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>
34 lines
826 B
Bash
Executable File
34 lines
826 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
if [ -f /etc/os-release ]; then
|
|
# shellcheck source=/dev/null
|
|
. /etc/os-release
|
|
fi
|
|
|
|
echo "Running tests inside distro: ${ID:-unknown}"
|
|
|
|
if [ -f "/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh" ]; then
|
|
# shellcheck source=/dev/null
|
|
. "/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh"
|
|
fi
|
|
|
|
if [ -f "$HOME/.nix-profile/etc/profile.d/nix.sh" ]; then
|
|
# shellcheck source=/dev/null
|
|
. "$HOME/.nix-profile/etc/profile.d/nix.sh"
|
|
fi
|
|
|
|
PATH="/nix/var/nix/profiles/default/bin:$HOME/.nix-profile/bin:$PATH"
|
|
|
|
command -v nix >/dev/null || {
|
|
echo "ERROR: nix not found."
|
|
exit 1
|
|
}
|
|
|
|
bash scripts/test/container/safe-directory.sh
|
|
|
|
nix develop .#default --no-write-lock-file -c \
|
|
python3 -m unittest discover \
|
|
-s /opt/src/pkgmgr/tests/e2e \
|
|
-p "$TEST_PATTERN"
|