Commit 4123861
Fixed: remove generateSecretKeys dependency from test to improve build caching
The `test` task depends on `generateSecretKeys`, which writes new random
values to `framework/security/config/security.properties` on every
build. Since this file is part of the main resource source set
(`config/` dirs are included via
`getDirectoryInActiveComponentsIfExists('config')`), changing it causes
cascading Gradle build cache misses for:
- `:compileTestGroovy` — classpath includes main resources
- `:checkstyleMain` — classpath includes `sourceSets.main.output`
- `:checkstyleTest` — same reason
- `:test` — classpath + test classes differ
This commit:
1. Removes `dependsOn 'generateSecretKeys'` from the `test` task —
the main `security.properties` is no longer mutated during `build`
2. Adds a test-specific `security.properties` in
`framework/security/src/test/resources/` with fixed keys — this shadows
the main config on the test classpath so unit tests that require JWT
keys (e.g. `ModelFormTest`) continue to work
The `generateSecretKeys` task is unchanged and remains available for
manual use (`./gradlew generateSecretKeys`) and as a dependency of
`loadAll`.
(cherry picked from commit 73d0d37)
(cherry picked from commit 4b59bc7)1 parent 539dfa8 commit 4123861
2 files changed
Lines changed: 53 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
312 | | - | |
313 | 312 | | |
314 | 313 | | |
315 | 314 | | |
316 | 315 | | |
317 | | - | |
318 | 316 | | |
319 | 317 | | |
320 | 318 | | |
| |||
Lines changed: 53 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
0 commit comments