1
0
Fork 0
mirror of https://github.com/imjasonh/krust synced 2026-07-18 23:16:03 +00:00

refactor: Centralize test flags and commands in Makefile

- Add TEST_FLAGS variable for single-threaded test execution
- Create verbose targets for CI usage
- Update pre-commit hooks to use make targets
- Update CI workflow to use make targets
- This ensures consistency between local and CI test execution

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Jason Hall 2025-06-08 12:02:29 -04:00
parent c5b7bc1236
commit e15bd1df8c
Failed to extract signature
3 changed files with 33 additions and 24 deletions

View file

@ -1,9 +1,16 @@
.PHONY: test test-unit test-e2e build run clean fmt lint
.PHONY: test test-unit test-e2e build run clean fmt lint check-fmt check test-verbose
# Test flags - run single-threaded to avoid env var races
TEST_FLAGS := -- --test-threads=1
# Build the project
build:
cargo build
# Build verbosely
build-verbose:
cargo build --verbose
# Run the project
run:
cargo run
@ -11,13 +18,21 @@ run:
# Run all tests
test: test-unit test-e2e
# Run all tests verbosely (for CI)
test-verbose:
cargo test --verbose $(TEST_FLAGS)
# Run unit tests only
test-unit:
cargo test --lib --bins
cargo test --lib --bins $(TEST_FLAGS)
# Run e2e tests only
test-e2e:
cargo test --test '*'
cargo test --test '*' $(TEST_FLAGS)
# Run e2e tests verbosely (for CI)
test-e2e-verbose:
cargo test --test '*' --verbose $(TEST_FLAGS)
# Clean build artifacts
clean:
@ -35,5 +50,9 @@ lint:
check-fmt:
cargo fmt -- --check
# Check code (for pre-commit)
check-code:
cargo check
# Run all checks (format, lint, test)
check: check-fmt lint test