Skip to content

Commit 9c8ad62

Browse files
committed
ci: add justfile and nextest with test groups & mutex
1 parent 5ca3fb9 commit 9c8ad62

File tree

3 files changed

+59
-1
lines changed

3 files changed

+59
-1
lines changed

.config/nextest.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[[profile.default.overrides]]
2+
filter = 'package(graphman-server)'
3+
priority = -1
4+
threads-required = 'num-test-threads' # Global mutex
5+
6+
[[profile.default.overrides]]
7+
filter = 'package(test-store)'
8+
priority = -1
9+
threads-required = 'num-test-threads' # Global mutex
10+
11+
[[profile.default.overrides]]
12+
filter = 'package(graph-tests)'
13+
priority = -1
14+
threads-required = 'num-test-threads' # Global mutex

flake.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
corepack
5252
nodejs
5353
postgresql
54+
just
5455
]);
5556
};
5657

@@ -85,7 +86,7 @@
8586
shared_preload_libraries = "pg_stat_statements";
8687
log_statement = "all";
8788
default_text_search_config = "pg_catalog.english";
88-
max_connections = 200;
89+
max_connections = 500;
8990
};
9091
};
9192
in {

justfile

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Display available commands and their descriptions (default target)
2+
default:
3+
@just --list
4+
5+
# Format all Rust code (cargo fmt)
6+
fmt:
7+
cargo fmt --all
8+
9+
# Check Rust code format (cargo fmt --check)
10+
fmt-check:
11+
cargo fmt --all -- --check
12+
13+
# Check Rust code (cargo check)
14+
check *EXTRA_FLAGS:
15+
cargo check {{EXTRA_FLAGS}}
16+
17+
# Run all tests (unit and integration)
18+
test *EXTRA_FLAGS:
19+
#!/usr/bin/env bash
20+
set -e # Exit on error
21+
cargo nextest run {{EXTRA_FLAGS}} --workspace
22+
23+
# Run unit tests
24+
test-unit *EXTRA_FLAGS:
25+
#!/usr/bin/env bash
26+
set -e # Exit on error
27+
cargo nextest run {{EXTRA_FLAGS}} --workspace --exclude graph-tests
28+
29+
# Run integration tests
30+
test-integration *EXTRA_FLAGS:
31+
#!/usr/bin/env bash
32+
set -e # Exit on error
33+
cargo nextest run {{EXTRA_FLAGS}} --package graph-tests --test integration_tests
34+
35+
# Run runner tests
36+
test-runner *EXTRA_FLAGS:
37+
#!/usr/bin/env bash
38+
set -e # Exit on error
39+
cargo nextest run {{EXTRA_FLAGS}} --package graph-tests --test runner_tests
40+
41+
# Clean workspace (cargo clean)
42+
clean:
43+
cargo clean

0 commit comments

Comments
 (0)