Skip to content

Commit 77f927e

Browse files
committed
Remove low-signal tests, add pg tests for windows/mac
Signed-off-by: Danny Kopping <danny@coder.com>
1 parent 705018d commit 77f927e

File tree

1 file changed

+66
-39
lines changed

1 file changed

+66
-39
lines changed

.github/workflows/nightly-gauntlet.yaml

Lines changed: 66 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,27 @@ permissions:
1111
contents: read
1212

1313
jobs:
14-
go-race:
15-
# While GitHub's toaster runners are likelier to flake, we want consistency
16-
# between this environment and the regular test environment for DataDog
17-
# statistics and to only show real workflow threats.
18-
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
19-
# This runner costs 0.016 USD per minute,
20-
# so 0.016 * 240 = 3.84 USD per run.
21-
timeout-minutes: 240
14+
test-go-pg:
15+
runs-on: ${{ matrix.os == 'macos-latest' && github.repository_owner == 'coder' && 'depot-macos-latest' || matrix.os == 'windows-2022' && github.repository_owner == 'coder' && 'windows-latest-16-cores' || matrix.os }}
16+
17+
18+
# TODO: re-enable main check!
19+
20+
21+
22+
23+
24+
# if: github.ref == 'refs/heads/main'
25+
# This timeout must be greater than the timeout set by `go test` in
26+
# `make test-postgres` to ensure we receive a trace of running
27+
# goroutines. Setting this to the timeout +5m should work quite well
28+
# even if some of the preceding steps are slow.
29+
timeout-minutes: 25
30+
strategy:
31+
matrix:
32+
os:
33+
- macos-latest
34+
- windows-2022
2235
steps:
2336
- name: Harden Runner
2437
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
@@ -27,56 +40,70 @@ jobs:
2740

2841
- name: Checkout
2942
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
43+
with:
44+
fetch-depth: 1
3045

3146
- name: Setup Go
3247
uses: ./.github/actions/setup-go
3348

3449
- name: Setup Terraform
3550
uses: ./.github/actions/setup-tf
3651

37-
- name: Run Tests
38-
run: |
39-
# -race is likeliest to catch flaky tests
40-
# due to correctness detection and its performance
41-
# impact.
42-
gotestsum --junitfile="gotests.xml" -- -timeout=240m -count=3 -race ./...
52+
# Sets up the ImDisk toolkit for Windows and creates a RAM disk on drive R:.
53+
- name: Setup ImDisk
54+
if: runner.os == 'Windows'
55+
uses: ./.github/actions/setup-imdisk
4356

44-
- name: Upload test results to DataDog
45-
uses: ./.github/actions/upload-datadog
46-
if: always()
47-
with:
48-
api-key: ${{ secrets.DATADOG_API_KEY }}
57+
- name: Test with PostgreSQL Database
58+
env:
59+
POSTGRES_VERSION: "13"
60+
TS_DEBUG_DISCO: "true"
61+
LC_CTYPE: "en_US.UTF-8"
62+
LC_ALL: "en_US.UTF-8"
63+
shell: bash
64+
run: |
65+
# if macOS, install google-chrome for scaletests
66+
# As another concern, should we really have this kind of external dependency
67+
# requirement on standard CI?
68+
if [ "${{ matrix.os }}" == "macos-latest" ]; then
69+
brew install google-chrome
70+
fi
4971
50-
go-timing:
51-
# We run these tests with p=1 so we don't need a lot of compute.
52-
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04' || 'ubuntu-latest' }}
53-
timeout-minutes: 10
54-
steps:
55-
- name: Harden Runner
56-
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
57-
with:
58-
egress-policy: audit
72+
# By default Go will use the number of logical CPUs, which
73+
# is a fine default.
74+
PARALLEL_FLAG=""
5975
60-
- name: Checkout
61-
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
76+
# macOS will output "The default interactive shell is now zsh"
77+
# intermittently in CI...
78+
if [ "${{ matrix.os }}" == "macos-latest" ]; then
79+
touch ~/.bash_profile && echo "export BASH_SILENCE_DEPRECATION_WARNING=1" >> ~/.bash_profile
80+
fi
6281
63-
- name: Setup Go
64-
uses: ./.github/actions/setup-go
82+
if [ "${{ runner.os }}" == "Windows" ]; then
83+
# Create a temp dir on the R: ramdisk drive for Windows. The default
84+
# C: drive is extremely slow: https://github.com/actions/runner-images/issues/8755
85+
mkdir -p "R:/temp/embedded-pg"
86+
go run scripts/embedded-pg/main.go -path "R:/temp/embedded-pg"
87+
# Reduce test parallelism, mirroring what we do for race tests.
88+
# We'd been encountering issues with timing related flakes, and
89+
# this seems to help.
90+
else
91+
go run scripts/embedded-pg/main.go
92+
fi
6593
66-
- name: Run Tests
67-
run: |
68-
gotestsum --junitfile="gotests.xml" -- --tags="timing" -p=1 -run='_Timing/' ./...
94+
DB=ci gotestsum --format standard-quiet -- -v -short -count=1 -parallel 4 -p 4 ./...
6995
70-
- name: Upload test results to DataDog
96+
- name: Upload test stats to Datadog
97+
timeout-minutes: 1
98+
continue-on-error: true
7199
uses: ./.github/actions/upload-datadog
72-
if: always()
100+
if: success() || failure()
73101
with:
74102
api-key: ${{ secrets.DATADOG_API_KEY }}
75103

76104
notify-slack-on-failure:
77105
needs:
78-
- go-race
79-
- go-timing
106+
- test-go-pg
80107
runs-on: ubuntu-latest
81108
if: failure() && github.ref == 'refs/heads/main'
82109

0 commit comments

Comments
 (0)