You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
e2e-cache.yml repeated the same inline shell block many times to assert that a cache directory exists (and then ls it), plus several inverse checks (the gradle2/maven2/sbt2 cache-miss jobs) asserting a directory does not exist.
This PR deduplicates that logic into a single helper script.
Rebased onto main after #1124 merged, which consolidated e2e-cache-dependency-path.yml into e2e-cache.yml and added maven/sbt cache-dependency-path coverage. The extraction is now applied across all 25 checks in the consolidated workflow; the standalone dependency-path file no longer exists.
Changes
New __tests__/check-dir.sh (POSIX sh, marked executable):
present: fail with ::error::The <dir> directory does not exist unexpectedly + exit 1 when the directory is missing; otherwise ls it.
absent: fail with ::error::The <dir> directory exists unexpectedly + exit 1 when the directory exists.
e2e-cache.yml now calls the helper instead of inline if [ ! -d ... ] blocks, keeping the exact same directories and present/absent semantics. Steps that only did check-and-ls collapse to a single line.
Paths are passed already-expanded via $HOME (e.g. bash __tests__/check-dir.sh "$HOME/.gradle/caches") to avoid tilde-expansion pitfalls. The sbt jobs use a
What
e2e-cache.ymlrepeated the same inline shell block many times to assert that a cache directory exists (and thenlsit), plus several inverse checks (thegradle2/maven2/sbt2cache-miss jobs) asserting a directory does not exist.This PR deduplicates that logic into a single helper script.
Changes
__tests__/check-dir.sh(POSIX sh, marked executable):check-dir.sh <dir> [present|absent], default modepresent.present: fail with::error::The <dir> directory does not exist unexpectedly+exit 1when the directory is missing; otherwiselsit.absent: fail with::error::The <dir> directory exists unexpectedly+exit 1when the directory exists.e2e-cache.ymlnow calls the helper instead of inlineif [ ! -d ... ]blocks, keeping the exact same directories and present/absent semantics. Steps that only did check-and-lscollapse to a single line.$HOME(e.g.bash __tests__/check-dir.sh "$HOME/.gradle/caches") to avoid tilde-expansion pitfalls. The sbt jobs use a