chore: Remove interface from coderd and lift API surface (#1772)

Abstracting coderd into an interface added misdirection because
the interface was never intended to be fulfilled outside of a single
implementation.

This lifts the abstraction, and attaches all handlers to a root struct
named `*coderd.API`.
This commit is contained in:
Kyle Carberry
2022-05-25 22:14:08 -05:00
committed by GitHub
parent c78f947e09
commit 31b819e83f
27 changed files with 234 additions and 263 deletions

View File

@ -290,9 +290,9 @@ func TestPostWorkspaceBuild(t *testing.T) {
t.Run("AlreadyActive", func(t *testing.T) {
t.Parallel()
_, client, coderDaemon := coderdtest.NewWithServer(t, nil)
client, coderAPI := coderdtest.NewWithAPI(t, nil)
user := coderdtest.CreateFirstUser(t, client)
closeDaemon := coderdtest.NewProvisionerDaemon(t, coderDaemon)
closeDaemon := coderdtest.NewProvisionerDaemon(t, coderAPI)
version := coderdtest.CreateTemplateVersion(t, client, user.OrganizationID, nil)
template := coderdtest.CreateTemplate(t, client, user.OrganizationID, version.ID)
coderdtest.AwaitTemplateVersionJob(t, client, version.ID)
@ -328,9 +328,9 @@ func TestPostWorkspaceBuild(t *testing.T) {
t.Run("WithState", func(t *testing.T) {
t.Parallel()
_, client, coderDaemon := coderdtest.NewWithServer(t, nil)
client, coderAPI := coderdtest.NewWithAPI(t, nil)
user := coderdtest.CreateFirstUser(t, client)
closeDaemon := coderdtest.NewProvisionerDaemon(t, coderDaemon)
closeDaemon := coderdtest.NewProvisionerDaemon(t, coderAPI)
version := coderdtest.CreateTemplateVersion(t, client, user.OrganizationID, nil)
template := coderdtest.CreateTemplate(t, client, user.OrganizationID, version.ID)
coderdtest.AwaitTemplateVersionJob(t, client, version.ID)