mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
This removes split ownership for workspaces. They are now a resource of organizations and have a designated owner, which is a user. This enables simple administration for commands like: - `coder stop ben/dev` - `coder build logs colin/arch` or if we decide to allow administrators to access workspaces, they could even SSH using this syntax: `coder ssh colin/dev`.
30 lines
949 B
Go
30 lines
949 B
Go
package coderdtest_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"go.uber.org/goleak"
|
|
|
|
"github.com/coder/coder/coderd/coderdtest"
|
|
)
|
|
|
|
func TestMain(m *testing.M) {
|
|
goleak.VerifyTestMain(m)
|
|
}
|
|
|
|
func TestNew(t *testing.T) {
|
|
t.Parallel()
|
|
client := coderdtest.New(t, nil)
|
|
user := coderdtest.CreateFirstUser(t, client)
|
|
closer := coderdtest.NewProvisionerDaemon(t, client)
|
|
version := coderdtest.CreateTemplateVersion(t, client, user.OrganizationID, nil)
|
|
coderdtest.AwaitTemplateVersionJob(t, client, version.ID)
|
|
template := coderdtest.CreateTemplate(t, client, user.OrganizationID, version.ID)
|
|
workspace := coderdtest.CreateWorkspace(t, client, user.OrganizationID, template.ID)
|
|
coderdtest.AwaitWorkspaceBuildJob(t, client, workspace.LatestBuild.ID)
|
|
coderdtest.AwaitWorkspaceAgents(t, client, workspace.LatestBuild.ID)
|
|
_, _ = coderdtest.NewGoogleInstanceIdentity(t, "example", false)
|
|
_, _ = coderdtest.NewAWSInstanceIdentity(t, "an-instance")
|
|
closer.Close()
|
|
}
|