mirror of
https://github.com/coder/coder.git
synced 2025-07-12 00:14:10 +00:00
* chore: Rename ProjectHistory to ProjectVersion Version more accurately represents version storage. This forks from the WorkspaceHistory name, but I think it's easier to understand Workspace history. * Rename files * Standardize tests a bit more * Remove Server struct from coderdtest * Improve test coverage for workspace history * Fix linting errors * Fix coderd test leak * Fix coderd test leak * Improve workspace history logs * Standardize test structure for codersdk * Fix linting errors * Fix WebSocket compression * Update coderd/workspaces.go Co-authored-by: Bryan <bryan@coder.com> * Add test for listing project parameters * Cache npm dependencies with setup node * Remove windows npm cache key Co-authored-by: Bryan <bryan@coder.com>
47 lines
1.1 KiB
Go
47 lines
1.1 KiB
Go
package codersdk_test
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
"github.com/coder/coder/coderd/coderdtest"
|
|
"github.com/coder/coder/provisionerd/proto"
|
|
)
|
|
|
|
func TestProvisionerDaemons(t *testing.T) {
|
|
t.Parallel()
|
|
t.Run("Get", func(t *testing.T) {
|
|
t.Parallel()
|
|
client := coderdtest.New(t)
|
|
_, err := client.ProvisionerDaemons(context.Background())
|
|
require.NoError(t, err)
|
|
})
|
|
}
|
|
|
|
func TestProvisionerDaemonClient(t *testing.T) {
|
|
t.Parallel()
|
|
t.Run("Error", func(t *testing.T) {
|
|
t.Parallel()
|
|
client := coderdtest.New(t)
|
|
ctx, cancelFunc := context.WithCancel(context.Background())
|
|
daemon, err := client.ProvisionerDaemonClient(ctx)
|
|
require.NoError(t, err)
|
|
cancelFunc()
|
|
_, err = daemon.AcquireJob(context.Background(), &proto.Empty{})
|
|
require.Error(t, err)
|
|
})
|
|
|
|
t.Run("Connect", func(t *testing.T) {
|
|
t.Parallel()
|
|
client := coderdtest.New(t)
|
|
ctx, cancelFunc := context.WithCancel(context.Background())
|
|
defer cancelFunc()
|
|
daemon, err := client.ProvisionerDaemonClient(ctx)
|
|
require.NoError(t, err)
|
|
_, err = daemon.AcquireJob(ctx, &proto.Empty{})
|
|
require.NoError(t, err)
|
|
})
|
|
}
|