Skip to content

[bug-hunter] ReportFailedTests ignores invalid SERVERLESS/DRY_RUN values #17857

@github-actions

Description

@github-actions

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

  1. 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
  1. 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.

  • expires on Mar 24, 2026, 11:42 AM UTC

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions