mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: Add "coder projects create" command (#246)
* Refactor parameter parsing to return nil values if none computed * Refactor parameter to allow for hiding redisplay * Refactor parameters to enable schema matching * Refactor provisionerd to dynamically update parameter schemas * Refactor job update for provisionerd * Handle multiple states correctly when provisioning a project * Add project import job resource table * Basic creation flow works! * Create project fully works!!! * Only show job status if completed * Add create workspace support * Replace Netflix/go-expect with ActiveState * Fix linting errors * Use forked chzyer/readline * Add create workspace CLI * Add CLI test * Move jobs to their own APIs * Remove go-expect * Fix requested changes * Skip workspacecreate test on windows
This commit is contained in:
+3
-8
@@ -8,8 +8,6 @@ import (
|
||||
"github.com/coder/coder/cli/clitest"
|
||||
"github.com/coder/coder/coderd/coderdtest"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/Netflix/go-expect"
|
||||
)
|
||||
|
||||
func TestLogin(t *testing.T) {
|
||||
@@ -24,12 +22,9 @@ func TestLogin(t *testing.T) {
|
||||
|
||||
t.Run("InitialUserTTY", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
console, err := expect.NewConsole(expect.WithStdout(clitest.StdoutLogs(t)))
|
||||
require.NoError(t, err)
|
||||
client := coderdtest.New(t)
|
||||
root, _ := clitest.New(t, "login", client.URL.String())
|
||||
root.SetIn(console.Tty())
|
||||
root.SetOut(console.Tty())
|
||||
console := clitest.NewConsole(t, root)
|
||||
go func() {
|
||||
err := root.Execute()
|
||||
require.NoError(t, err)
|
||||
@@ -45,12 +40,12 @@ func TestLogin(t *testing.T) {
|
||||
for i := 0; i < len(matches); i += 2 {
|
||||
match := matches[i]
|
||||
value := matches[i+1]
|
||||
_, err = console.ExpectString(match)
|
||||
_, err := console.ExpectString(match)
|
||||
require.NoError(t, err)
|
||||
_, err = console.SendLine(value)
|
||||
require.NoError(t, err)
|
||||
}
|
||||
_, err = console.ExpectString("Welcome to Coder")
|
||||
_, err := console.ExpectString("Welcome to Coder")
|
||||
require.NoError(t, err)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user