Skip to content

Commit 567a0cc

Browse files
CI: run full test suite via 'testOnly *' instead of cached testQuick
Root cause of CI running zero tests: sbt 2.x's `test` delegates to `testQuick`, whose result is cached in a global store (~/.cache/sbt) that survives `clean`. On unchanged sources it reports 'No tests to run' and skips the entire effectful, DB-backed suite — reproduced locally (clean; test still skips). `testOnly *` runs every matching spec unconditionally on every invocation. Point fullTest/fullCoverageTest at it; revert the CI cache to the simpler cache:sbt (correctness no longer depends on the cache).
1 parent 34de3e1 commit 567a0cc

2 files changed

Lines changed: 6 additions & 12 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,7 @@ jobs:
1717
with:
1818
distribution: temurin
1919
java-version: '17'
20-
# Cache only dependency artifacts - NOT sbt's global state. sbt 2.x's `test` is incremental (testQuick) and its
21-
# "already succeeded" record survives `clean`; caching sbt state would make CI skip tests on unchanged sources
22-
# ("No tests to run"), so we deliberately don't restore it and let every CI run execute the full suite.
23-
- uses: actions/cache@v4
24-
with:
25-
path: |
26-
~/.ivy2/cache
27-
~/.cache/coursier
28-
key: sbt-deps-${{ hashFiles('**/*.sbt', 'project/**') }}
29-
restore-keys: sbt-deps-
20+
cache: sbt
3021
- uses: sbt/setup-sbt@v1
3122
- uses: extractions/setup-just@v4
3223
- name: Start Docker images used in IT tests

branchtalk.sbt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,5 +485,8 @@ val application = project
485485
// aliases
486486

487487
addCommandAlias("fmt", "scalafmt ; Test/scalafmt")
488-
addCommandAlias("fullTest", "test")
489-
addCommandAlias("fullCoverageTest", "coverage ; test ; coverageReport ; coverageAggregate")
488+
// `test` delegates to `testQuick`, and sbt 2.x caches its result in a global store (~/.cache/sbt) that survives
489+
// `clean`, so on unchanged sources it reports "No tests to run" and skips the whole (effectful, DB-backed) suite.
490+
// `testOnly *` runs every matching spec unconditionally on every invocation, so a full run really executes.
491+
addCommandAlias("fullTest", "testOnly * ")
492+
addCommandAlias("fullCoverageTest", "coverage ; testOnly * ; coverageReport ; coverageAggregate")

0 commit comments

Comments
 (0)