chore(ci): make test workflow faster with test --stale
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Moritz 2026-06-02 23:35:39 +02:00
parent 1ef6ea502e
commit d51dcb1ac3
2 changed files with 24 additions and 6 deletions

View file

@ -29,7 +29,12 @@ seed-database:
start-database: start-database:
docker compose up -d docker compose up -d
ci-dev: lint audit test-fast # Full check suite: lint + audit + the fast tests (slow/ui excluded). No Dialyzer.
ci-dev: install-dependencies lint audit test-fast
# Fast pre-commit check: lint + sobelow + only the affected tests (mix test --stale)
# with reduced property runs. Run the full `ci-dev` before pushing.
check: install-dependencies lint sobelow test-stale
# Build the Dialyzer PLT. Idempotent — no-op once the PLT is up to date. # Build the Dialyzer PLT. Idempotent — no-op once the PLT is up to date.
# First build takes 515 min; subsequent runs are seconds. PLT files live in # First build takes 515 min; subsequent runs are seconds. PLT files live in
@ -58,19 +63,28 @@ lint:
@bash -c 'for file in priv/gettext/de/LC_MESSAGES/*.po; do awk "/^msgid \"\"$/{header=1; next} /^msgid /{header=0} /^msgstr \"\"$/ && !header{print FILENAME\":\"NR\": \" \$0; exit 1}" "$file" || exit 1; done' @bash -c 'for file in priv/gettext/de/LC_MESSAGES/*.po; do awk "/^msgid \"\"$/{header=1; next} /^msgid /{header=0} /^msgstr \"\"$/ && !header{print FILENAME\":\"NR\": \" \$0; exit 1}" "$file" || exit 1; done'
mix gettext.extract --check-up-to-date mix gettext.extract --check-up-to-date
audit: # Static security scan (Sobelow).
sobelow:
mix sobelow --config mix sobelow --config
# Full security audit: Sobelow + dependency advisory scans.
audit: sobelow
mix deps.audit --ignore-file .deps_audit_ignore mix deps.audit --ignore-file .deps_audit_ignore
mix hex.audit mix hex.audit
# Run all tests # Run all tests. No install-dependencies prerequisite so single-file runs stay
test *args: install-dependencies # fast; run `just install-dependencies` once on a fresh checkout.
test *args:
mix test {{args}} mix test {{args}}
# Run only fast tests (excludes slow/performance and UI tests) # Fast tests only (excludes slow/performance and UI tests).
test-fast *args: install-dependencies test-fast *args:
mix test --exclude slow --exclude ui {{args}} mix test --exclude slow --exclude ui {{args}}
# Affected fast tests only (mix test --stale) with reduced property runs.
test-stale *args:
PROPERTY_RUNS=25 mix test --stale --exclude slow --exclude ui {{args}}
# Run only UI tests # Run only UI tests
ui *args: install-dependencies ui *args: install-dependencies
mix test --only ui {{args}} mix test --only ui {{args}}

View file

@ -62,3 +62,7 @@ config :mv, :join_rate_limit, scale_ms: 60_000, limit: 2
# Ash: silence "after_transaction hooks in surrounding transaction" warning when using # Ash: silence "after_transaction hooks in surrounding transaction" warning when using
# Ecto sandbox (tests run in a transaction; create_member after_transaction is expected). # Ecto sandbox (tests run in a transaction; create_member after_transaction is expected).
config :ash, warn_on_transaction_hooks?: false config :ash, warn_on_transaction_hooks?: false
# StreamData property tests: generated cases per property, overridable via PROPERTY_RUNS
# (the `just check` recipe sets it low for speed; default 100 otherwise).
config :stream_data, max_runs: String.to_integer(System.get_env("PROPERTY_RUNS") || "100")