Skip to content

Commit 6c691c4

Browse files
committed
chore: align nightly-gauntlet.yaml with ci.yaml, only run mac/windows tests on main
Signed-off-by: Danny Kopping <danny@coder.com>
1 parent 6cd78b7 commit 6c691c4

File tree

2 files changed

+39
-69
lines changed

2 files changed

+39
-69
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ jobs:
461461
test-count: ${{ github.ref == 'refs/heads/main' && '1' || '' }}
462462

463463
- name: Test with PostgreSQL Database (macOS)
464-
if: runner.os == 'macOS'
464+
if: runner.os == 'macOS' && github.ref == 'refs/heads/main'
465465
uses: ./.github/actions/test-go-pg
466466
with:
467467
postgres-version: "13"
@@ -477,7 +477,7 @@ jobs:
477477
embedded-pg-cache: ${{ steps.embedded-pg-cache.outputs.embedded-pg-cache }}
478478

479479
- name: Test with PostgreSQL Database (Windows)
480-
if: runner.os == 'Windows'
480+
if: runner.os == 'Windows' && github.ref == 'refs/heads/main'
481481
uses: ./.github/actions/test-go-pg
482482
with:
483483
postgres-version: "13"

.github/workflows/nightly-gauntlet.yaml

Lines changed: 37 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# The nightly-gauntlet runs tests that are either too flaky or too slow to block
2-
# every PR.
1+
# The nightly-gauntlet runs the full test suite on macOS and Windows.
2+
# This complements ci.yaml which only runs a subset of packages on these platforms.
33
name: nightly-gauntlet
44
on:
55
schedule:
6-
# Every day at 4AM
6+
# Every day at 4AM UTC on weekdays
77
- cron: "0 4 * * 1-5"
88
workflow_dispatch:
99

@@ -21,6 +21,7 @@ jobs:
2121
# even if some of the preceding steps are slow.
2222
timeout-minutes: 25
2323
strategy:
24+
fail-fast: false
2425
matrix:
2526
os:
2627
- macos-latest
@@ -80,75 +81,44 @@ jobs:
8081
key-prefix: embedded-pg-${{ runner.os }}-${{ runner.arch }}
8182
cache-path: ${{ steps.embedded-pg-cache.outputs.cached-dirs }}
8283

83-
- name: Test with PostgreSQL Database
84-
env:
85-
POSTGRES_VERSION: "13"
86-
TS_DEBUG_DISCO: "true"
87-
LC_CTYPE: "en_US.UTF-8"
88-
LC_ALL: "en_US.UTF-8"
84+
- name: Setup RAM disk for Embedded Postgres (Windows)
85+
if: runner.os == 'Windows'
8986
shell: bash
90-
run: |
91-
set -o errexit
92-
set -o pipefail
93-
94-
if [ "${{ runner.os }}" == "Windows" ]; then
95-
# Create a temp dir on the R: ramdisk drive for Windows. The default
96-
# C: drive is extremely slow: https://github.com/actions/runner-images/issues/8755
97-
mkdir -p "R:/temp/embedded-pg"
98-
go run scripts/embedded-pg/main.go -path "R:/temp/embedded-pg" -cache "${EMBEDDED_PG_CACHE_DIR}"
99-
elif [ "${{ runner.os }}" == "macOS" ]; then
100-
# Postgres runs faster on a ramdisk on macOS too
101-
mkdir -p /tmp/tmpfs
102-
sudo mount_tmpfs -o noowners -s 8g /tmp/tmpfs
103-
go run scripts/embedded-pg/main.go -path /tmp/tmpfs/embedded-pg -cache "${EMBEDDED_PG_CACHE_DIR}"
104-
elif [ "${{ runner.os }}" == "Linux" ]; then
105-
make test-postgres-docker
106-
fi
87+
run: mkdir -p "R:/temp/embedded-pg"
10788

108-
# if macOS, install google-chrome for scaletests
109-
# As another concern, should we really have this kind of external dependency
110-
# requirement on standard CI?
111-
if [ "${{ matrix.os }}" == "macos-latest" ]; then
112-
brew install google-chrome
113-
fi
114-
115-
# macOS will output "The default interactive shell is now zsh"
116-
# intermittently in CI...
117-
if [ "${{ matrix.os }}" == "macos-latest" ]; then
118-
touch ~/.bash_profile && echo "export BASH_SILENCE_DEPRECATION_WARNING=1" >> ~/.bash_profile
119-
fi
120-
121-
if [ "${{ runner.os }}" == "Windows" ]; then
122-
# Our Windows runners have 16 cores.
123-
# On Windows Postgres chokes up when we have 16x16=256 tests
124-
# running in parallel, and dbtestutil.NewDB starts to take more than
125-
# 10s to complete sometimes causing test timeouts. With 16x8=128 tests
126-
# Postgres tends not to choke.
127-
NUM_PARALLEL_PACKAGES=8
128-
NUM_PARALLEL_TESTS=16
129-
elif [ "${{ runner.os }}" == "macOS" ]; then
130-
# Our macOS runners have 8 cores. We set NUM_PARALLEL_TESTS to 16
131-
# because the tests complete faster and Postgres doesn't choke. It seems
132-
# that macOS's tmpfs is faster than the one on Windows.
133-
NUM_PARALLEL_PACKAGES=8
134-
NUM_PARALLEL_TESTS=16
135-
elif [ "${{ runner.os }}" == "Linux" ]; then
136-
# Our Linux runners have 8 cores.
137-
NUM_PARALLEL_PACKAGES=8
138-
NUM_PARALLEL_TESTS=8
139-
fi
140-
141-
# run tests without cache
142-
TESTCOUNT="-count=1"
89+
- name: Setup RAM disk for Embedded Postgres (macOS)
90+
if: runner.os == 'macOS'
91+
shell: bash
92+
run: |
93+
mkdir -p /tmp/tmpfs
94+
sudo mount_tmpfs -o noowners -s 8g /tmp/tmpfs
14395
144-
DB=ci gotestsum \
145-
--format standard-quiet --packages "./..." \
146-
-- -timeout=20m -v -p "$NUM_PARALLEL_PACKAGES" -parallel="$NUM_PARALLEL_TESTS" "$TESTCOUNT"
96+
- name: Test with PostgreSQL Database (macOS)
97+
if: runner.os == 'macOS'
98+
uses: ./.github/actions/test-go-pg
99+
with:
100+
postgres-version: "13"
101+
# Our macOS runners have 8 cores.
102+
test-parallelism-packages: "8"
103+
test-parallelism-tests: "16"
104+
test-count: "1"
105+
embedded-pg-path: "/tmp/tmpfs/embedded-pg"
106+
embedded-pg-cache: ${{ steps.embedded-pg-cache.outputs.embedded-pg-cache }}
107+
108+
- name: Test with PostgreSQL Database (Windows)
109+
if: runner.os == 'Windows'
110+
uses: ./.github/actions/test-go-pg
111+
with:
112+
postgres-version: "13"
113+
# Our Windows runners have 16 cores.
114+
test-parallelism-packages: "8"
115+
test-parallelism-tests: "16"
116+
test-count: "1"
117+
embedded-pg-path: "R:/temp/embedded-pg"
118+
embedded-pg-cache: ${{ steps.embedded-pg-cache.outputs.embedded-pg-cache }}
147119

148120
- name: Upload Embedded Postgres Cache
149121
uses: ./.github/actions/embedded-pg-cache/upload
150-
# We only use the embedded Postgres cache on macOS and Windows runners.
151-
if: runner.OS == 'macOS' || runner.OS == 'Windows'
152122
with:
153123
cache-key: ${{ steps.download-embedded-pg-cache.outputs.cache-key }}
154124
cache-path: "${{ steps.embedded-pg-cache.outputs.embedded-pg-cache }}"
@@ -165,7 +135,7 @@ jobs:
165135
needs:
166136
- test-go-pg
167137
runs-on: ubuntu-latest
168-
if: failure() && github.ref == 'refs/heads/main'
138+
if: failure()
169139

170140
steps:
171141
- name: Send Slack notification

0 commit comments

Comments
 (0)