chore(test): fold the container scripts to clear the quality findings
quality clean.prefix-groups: env-nix.sh and env-virtual.sh move to scripts/test/container/env/nix.sh and env/virtual.sh; their only callers, scripts/test/test-env-nix.sh and test-env-virtual.sh, are updated. clean.clones: the shared git safe.directory block of e2e.sh and env-nix.sh is one script, scripts/test/container/safe-directory.sh, called at the same spot. clean.comment: parameter lines use the form # Param: NAME ($n) - text. coding.shell-lint SC1091: quality runs shellcheck without -x, so the source directives are shellcheck source=/dev/null like the sibling scripts; the sourcing logic is unchanged. | 🌿 Branch | 📊 Diff stat | 🎯 Fix | 💥 Break | 💸 Tokens | ⏱️ Velocity | 🛡️ Security | 🏆 Score | Gate | | --- | --- | --- | --- | --- | --- | --- | --- | --- | | chore/test-scripts-no-inline | 7 files +17/-17 | 92 % | 3 % | – | – | 100 % | 89 | ✅ 90/5, tokens and velocity <= 100, security 100 % | Evidence: quality check --staged 0 findings, shellcheck --norc clean on all 7 scripts, MEDUSA 100 %, critical 0. The container jobs of PR CI are the proof. Hub review 42b3a76554491026. Refs https://github.com/kevinveenbirkenbach/package-manager/pull/20 Created-with: https://s.veen.world/skills Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9a9ac39ad4
commit
4cb00eec18
7 files changed
+17
-17
No files matched your search
+42
@@ -0,0 +1,42 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Param: IMAGE ($1) - the image name shown in the missing-nix error.
|
||||
# Param: PKGMGR_DISTRO ($2) - the distro shown in the missing-nix error.
|
||||
IMAGE="$1"
|
||||
PKGMGR_DISTRO="$2"
|
||||
|
||||
bash scripts/test/container/safe-directory.sh
|
||||
|
||||
echo ">>> preflight: nix must exist in image"
|
||||
if ! command -v nix >/dev/null 2>&1; then
|
||||
echo "NO_NIX"
|
||||
echo "ERROR: nix not found in image ${IMAGE} (PKGMGR_DISTRO=${PKGMGR_DISTRO})"
|
||||
echo "HINT: Ensure Nix is installed during image build for this distro."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo ">>> nix version"
|
||||
nix --version
|
||||
|
||||
if [[ -f /opt/src/pkgmgr/scripts/nix/lib/retry_403.sh ]]; then
|
||||
# shellcheck source=/dev/null
|
||||
source /opt/src/pkgmgr/scripts/nix/lib/retry_403.sh
|
||||
elif [[ -f ./scripts/nix/lib/retry_403.sh ]]; then
|
||||
# shellcheck source=/dev/null
|
||||
source ./scripts/nix/lib/retry_403.sh
|
||||
else
|
||||
echo "ERROR: retry helper not found: scripts/nix/lib/retry_403.sh"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo ">>> nix flake show"
|
||||
run_with_github_403_retry nix flake show . --no-write-lock-file >/dev/null
|
||||
|
||||
echo ">>> nix build .#default"
|
||||
run_with_github_403_retry nix build .#default --no-link --no-write-lock-file
|
||||
|
||||
echo ">>> nix run .#pkgmgr -- --help"
|
||||
run_with_github_403_retry nix run .#pkgmgr -- --help --no-write-lock-file
|
||||
|
||||
echo ">>> OK: Nix flake-only test succeeded."
|
||||
Reference in new issue
Block a user