Skip to content

Commit dace628

Browse files
committed
ci: Do not use nextest
Nextest's process-per-test model is not well suited for how our tests work since it requires that database connectiosn are set up for every test in a test suite, rather than just once per suite.
1 parent e4b51a5 commit dace628

File tree

2 files changed

+11
-63
lines changed

2 files changed

+11
-63
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,6 @@ jobs:
5959
- name: Setup just
6060
uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3
6161

62-
- name: Install cargo-nextest
63-
uses: baptiste0928/cargo-install@e38323ef017552d7f7af73a3f4db467f278310ed # v3
64-
with:
65-
crate: cargo-nextest
66-
version: ^0.9
67-
6862
- name: Run unit tests
6963
run: just test-unit --verbose
7064

@@ -106,12 +100,6 @@ jobs:
106100
- name: Setup just
107101
uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3
108102

109-
- name: Install cargo-nextest
110-
uses: baptiste0928/cargo-install@e38323ef017552d7f7af73a3f4db467f278310ed # v3
111-
with:
112-
crate: cargo-nextest
113-
version: ^0.9
114-
115103
- name: Install pnpm
116104
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4
117105

@@ -165,12 +153,6 @@ jobs:
165153
- name: Setup just
166154
uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3
167155

168-
- name: Install cargo-nextest
169-
uses: baptiste0928/cargo-install@e38323ef017552d7f7af73a3f4db467f278310ed # v3
170-
with:
171-
crate: cargo-nextest
172-
version: ^0.9
173-
174156
- name: Install Foundry
175157
uses: foundry-rs/foundry-toolchain@82dee4ba654bd2146511f85f0d013af94670c4de # v1
176158
with:

justfile

Lines changed: 11 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -22,67 +22,33 @@ check-all:
2222
build *EXTRA_FLAGS:
2323
cargo build --bin graph-node {{EXTRA_FLAGS}}
2424

25-
# Run all tests (unit and integration)
26-
test *EXTRA_FLAGS:
25+
_cargo-test *ARGS:
2726
#!/usr/bin/env bash
2827
set -e # Exit on error
2928

3029
# Ensure that the `THEGRAPH_STORE_POSTGRES_DIESEL_URL` environment variable is set.
31-
if [ -z "$THEGRAPH_STORE_POSTGRES_DIESEL_URL" ]; then
32-
echo "Error: THEGRAPH_STORE_POSTGRES_DIESEL_URL is not set"
30+
if [ -z "$THEGRAPH_STORE_POSTGRES_DIESEL_URL" -a -z "$GRAPH_NODE_TEST_CONFIG" ]; then
31+
echo "error: Neither THEGRAPH_STORE_POSTGRES_DIESEL_URL nor GRAPH_NODE_TEST_CONFIG is set"
3332
exit 1
3433
fi
3534

36-
if command -v "cargo-nextest" &> /dev/null; then
37-
cargo nextest run {{EXTRA_FLAGS}} --workspace
38-
else
39-
cargo test {{EXTRA_FLAGS}} --workspace -- --nocapture
40-
fi
35+
cargo test {{ARGS}}
36+
37+
# Run all tests (unit and integration)
38+
test *EXTRA_FLAGS:
39+
@just _cargo-test {{EXTRA_FLAGS}} --workspace -- --nocapture
4140

4241
# Run unit tests
4342
test-unit *EXTRA_FLAGS:
44-
#!/usr/bin/env bash
45-
set -e # Exit on error
46-
47-
# Ensure that the `THEGRAPH_STORE_POSTGRES_DIESEL_URL` environment variable is set.
48-
if [ -z "$THEGRAPH_STORE_POSTGRES_DIESEL_URL" ]; then
49-
echo "Error: THEGRAPH_STORE_POSTGRES_DIESEL_URL is not set"
50-
exit 1
51-
fi
52-
53-
if command -v "cargo-nextest" &> /dev/null; then
54-
cargo nextest run {{EXTRA_FLAGS}} --workspace --exclude graph-tests
55-
else
56-
cargo test {{EXTRA_FLAGS}} --workspace --exclude graph-tests -- --nocapture
57-
fi
43+
@just _cargo-test {{EXTRA_FLAGS}} --workspace --exclude graph-tests -- --nocapture
5844

5945
# Run runner tests
6046
test-runner *EXTRA_FLAGS:
61-
#!/usr/bin/env bash
62-
set -e # Exit on error
63-
64-
# Ensure that the `THEGRAPH_STORE_POSTGRES_DIESEL_URL` environment variable is set.
65-
if [ -z "$THEGRAPH_STORE_POSTGRES_DIESEL_URL" ]; then
66-
echo "Error: THEGRAPH_STORE_POSTGRES_DIESEL_URL is not set"
67-
exit 1
68-
fi
69-
70-
if command -v "cargo-nextest" &> /dev/null; then
71-
cargo nextest run {{EXTRA_FLAGS}} --package graph-tests --test runner_tests
72-
else
73-
cargo test {{EXTRA_FLAGS}} --package graph-tests --test runner_tests -- --nocapture
74-
fi
47+
@just _cargo-test {{EXTRA_FLAGS}} --package graph-tests --test runner_tests -- --nocapture
7548

7649
# Run integration tests
7750
test-integration *EXTRA_FLAGS:
78-
#!/usr/bin/env bash
79-
set -e # Exit on error
80-
81-
if command -v "cargo-nextest" &> /dev/null; then
82-
cargo nextest run {{EXTRA_FLAGS}} --package graph-tests --test integration_tests
83-
else
84-
cargo test {{EXTRA_FLAGS}} --package graph-tests --test integration_tests -- --nocapture
85-
fi
51+
@just _cargo-test {{EXTRA_FLAGS}} --package graph-tests --test integration_tests -- --nocapture
8652

8753
# Clean workspace (cargo clean)
8854
clean:

0 commit comments

Comments
 (0)