@@ -22,67 +22,33 @@ check-all:
2222build * 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
4342test-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
6046test-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
7750test-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)
8854clean :
0 commit comments