Skip to content

Makefile verify target - set -e + echo $? makes test failures pass #1689

Description

@sdghsdkjlas27-dotcom

DESCRIPTION:
Makefile's test and entry targets capture exit code by writing $$? to a file. With .SHELLFLAGS := -e -o pipefail -c, set -e causes the recipe to ABORT immediately on a failing command - echo "$$?" never runs. The verify target reads back the file and asserts it's 0, but a failing test will leave the previous file (or no file) value. Test failures are silently masked.

REPRODUCTION:

  1. Add exit 1 to test command in a docker container.
  2. Verify passes anyway because set -e halts before echo.

IMPACT:
Test failures silently masked. CI green on broken code. CRITICAL bug.

RELATED FILES:
Makefile
entry.sh (related)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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