Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 44bd726

Browse files
committed
Fix CI flake
1 parent 22360d3 commit 44bd726

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

.github/workflows/coder.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ jobs:
210210
211211
- name: Test with PostgreSQL Database
212212
if: runner.os == 'Linux'
213-
run: DB=true gotestsum --junitfile="gotests.xml" --packages="./..." --
213+
run: DB=ci gotestsum --junitfile="gotests.xml" --packages="./..." --
214214
-covermode=atomic -coverprofile="gotests.coverage" -timeout=3m
215215
-coverpkg=./...,github.com/coder/coder/codersdk
216216
-count=1 -parallel=2 -race -failfast

cli/start_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ func TestStart(t *testing.T) {
3131
err := root.ExecuteContext(ctx)
3232
require.ErrorIs(t, err, context.Canceled)
3333
}()
34-
var accessURL string
34+
var token string
3535
require.Eventually(t, func() bool {
3636
var err error
37-
accessURL, err = cfg.URL().Read()
37+
token, err = cfg.Session().Read()
3838
return err == nil
3939
}, 15*time.Second, 25*time.Millisecond)
4040
// Verify that authentication was properly set in dev-mode.
41-
token, err := cfg.Session().Read()
41+
accessURL, err := cfg.URL().Read()
4242
require.NoError(t, err)
4343
parsed, err := url.Parse(accessURL)
4444
require.NoError(t, err)

database/postgres/postgres.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ var openPortMutex sync.Mutex
2121

2222
// Open creates a new PostgreSQL server using a Docker container.
2323
func Open() (string, func(), error) {
24-
if os.Getenv("CI") != "" {
24+
if os.Getenv("DB") == "ci" {
2525
// In CI, creating a Docker container for each test is slow.
2626
// This expects a PostgreSQL instance with the hardcoded credentials
2727
// available.

0 commit comments

Comments
 (0)