mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
82dfd6c72f
* feat: Add stage to build logs This adds a stage property to logs, and refactors the job logs cliui. It also adds tests to the cliui for build logs! * feat: Add stage to build logs This adds a stage property to logs, and refactors the job logs cliui. It also adds tests to the cliui for build logs! * feat: Add config-ssh and tests for resiliency * Rename "Echo" test to "ImmediateExit" * Fix Terraform resource agent association * Fix logs post-cancel * Fix select on Windows * Remove terraform init logs * Move timer into it's own loop * Fix race condition in provisioner jobs * Fix requested changes
34 lines
673 B
Go
34 lines
673 B
Go
package cli_test
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
"github.com/coder/coder/cli/clitest"
|
|
"github.com/coder/coder/pty/ptytest"
|
|
)
|
|
|
|
func TestProjectInit(t *testing.T) {
|
|
t.Parallel()
|
|
t.Run("Extract", func(t *testing.T) {
|
|
t.Parallel()
|
|
tempDir := t.TempDir()
|
|
cmd, _ := clitest.New(t, "projects", "init", tempDir)
|
|
doneChan := make(chan struct{})
|
|
pty := ptytest.New(t)
|
|
cmd.SetIn(pty.Input())
|
|
cmd.SetOut(pty.Output())
|
|
go func() {
|
|
defer close(doneChan)
|
|
err := cmd.Execute()
|
|
require.NoError(t, err)
|
|
}()
|
|
<-doneChan
|
|
files, err := os.ReadDir(tempDir)
|
|
require.NoError(t, err)
|
|
require.Greater(t, len(files), 0)
|
|
})
|
|
}
|