Impact
mage ReportFailedTests silently accepts invalid boolean values for SERVERLESS and DRY_RUN, then proceeds with default false values. This hides CI misconfiguration and causes incorrect behavior instead of failing fast with a clear error.
Reproduction Steps
- Create and run this minimal repro script:
#!/usr/bin/env bash
set -euo pipefail
cd /home/runner/work/integrations/integrations
export PATH="$(go env GOPATH)/bin:$PATH"
if ! command -v mage >/dev/null 2>&1; then
go install github.com/magefile/mage@v1.15.0
fi
mkdir -p /tmp/gh-aw/agent/empty-test-results
SERVERLESS=invalid DRY_RUN=invalid mage -v ReportFailedTests /tmp/gh-aw/agent/empty-test-results
- Observe exit code and output.
Expected vs Actual
Expected: command fails with parse errors (for invalid boolean env values), e.g. failed to parse SERVERLESS value / failed to parse DRY_RUN value.
Actual: command succeeds (exit code 0) and continues:
Running target: ReportFailedTests
path: /tmp/gh-aw/agent/empty-test-results
Failing Test
A minimal reproducible script is shown above. It deterministically reproduces the bug by setting invalid boolean values.
Evidence
- Buggy error checks compare the same variable to itself, so the condition is always false:
magefile.go:167 -> if err != err {
magefile.go:199 -> if err != err {
- Correct pattern exists nearby in same function:
magefile.go:190 -> if err != nil {
- Local reproduction result:
- command:
SERVERLESS=invalid DRY_RUN=invalid mage -v ReportFailedTests /tmp/gh-aw/agent/empty-test-results
- observed exit code:
0
- output contains no parse error.
What is this? | From workflow: Bug Hunter
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
Impact
mage ReportFailedTestssilently accepts invalid boolean values forSERVERLESSandDRY_RUN, then proceeds with defaultfalsevalues. This hides CI misconfiguration and causes incorrect behavior instead of failing fast with a clear error.Reproduction Steps
Expected vs Actual
Expected: command fails with parse errors (for invalid boolean env values), e.g.
failed to parse SERVERLESS value/failed to parse DRY_RUN value.Actual: command succeeds (
exit code 0) and continues:Failing Test
A minimal reproducible script is shown above. It deterministically reproduces the bug by setting invalid boolean values.
Evidence
magefile.go:167->if err != err {magefile.go:199->if err != err {magefile.go:190->if err != nil {SERVERLESS=invalid DRY_RUN=invalid mage -v ReportFailedTests /tmp/gh-aw/agent/empty-test-results0What is this? | From workflow: Bug Hunter
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.