Skip to content

fix: a failing test fails the Test and Integration tests steps - #158

Merged
CaffeinatedCoder merged 1 commit into
mainfrom
fix/ci-pipefail
Nov 16, 2026
Merged

CaffeinatedCoder merged 1 commit into
mainfrom
fix/ci-pipefail

Conversation

@CaffeinatedCoder

@CaffeinatedCoder CaffeinatedCoder commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

Closes #150

Problem

The steps Test and Integration tests of .github/workflows/dotnet.yml pipe dotnet test into tee. A step that names no shell runs as bash -e {0}, without pipefail, so the status of the pipe is tee's, and the check that follows asks only whether one test passed. A run with failing tests was green: as the check a pull request needs, and as the lanes release.yml calls before it packs. #150 showed it with the step's script on a workstation; it had not been seen in CI.

Change

One block in dotnet.yml, and nothing else:

defaults:
  run:
    shell: bash

shell: bash is bash --noprofile --norc -eo pipefail {0}. The two scripts are as they were, the check that at least one test ran included.

Why the workflow's default and not set -o pipefail in the two scripts

What else it changes. Every run: step of the file gets the shell, so each was read for a pipe:

Step Pipe What changes
Build, Image digest (twice), Pack, Smoke test, Compile probes, Run every spike project, Run every spike script, Every lane succeeded none nothing
Spike E, the impact table cat "$table" | tee -a …, echo | tee -a … the step would fail if cat failed, on a file the glob has just matched

--noprofile --norc change nothing for a script: bash reads those files as a login or an interactive shell only.

Two things a reviewer may want to know:

  • A step now ends at the first project that fails. In the red run below, Test stopped after the kernel's tests and never ran the PostgreSQL package's. That is -e with a pipe that reports its status, and it is the smallest change; running every project and failing at the end would be a rewrite of the loop.
  • For the lane of test: a second provider against the public contract, on SQL Server 2022 and SQLite, and the SQL Server lane #157, once both are merged: its set -o pipefail then says what is already true. Its Image digest reads the version through docker exec … | tr: a docker exec that fails ends the step at that line instead of at the comparison below it. Red either way; v="$(false | tr -d x)" goes on under bash -e and exits 1 under the new shell.

Tests

Seen in CI, each of the two steps red with one failing test and green without it. The failing tests were a unit test in CodoMetis.EFCore.SchemaKit.Tests (the first project of the loop) and a test of the category Integration in CodoMetis.EFCore.SchemaKit.PostgreSQL.Tests (the second), so the two steps between them show both places in the loop.

.NET, as a pull request runs it Test Integration tests (PostgreSQL 16 and 18)
The fix and the two failing tests (6ca1eee) failure failure: Failed: 1, Passed: 654, exit code 1 failure on both: Failed: 1, Passed: 72, exit code 1
main's workflow and the same two tests (fc0879c, #159) success success, with Failed: 1, Passed: 654 in its log success on both, with Failed: 1, Passed: 72 in its log
This pull request (dec05db) success success: 654 and 166 passed success on both: 4 and 72 passed

The second row is the defect. The logs name the shell: /usr/bin/bash -e {0} in the second row, /usr/bin/bash --noprofile --norc -e -o pipefail {0} in the other two. In the first row the gate CI failed with the lanes.

As release.yml calls it. The default is the called workflow's own, so whether it holds under workflow_call had to be seen too, and release.yml is not mine to run. The two throwaway commits also held a workflow that does what its ci job does: defaults: run: shell: bash at the top, as release.yml has, and one job with uses: ./.github/workflows/dotnet.yml.

dotnet.yml, called The called steps' shell
The fix and the two failing tests failure: Test and both Integration tests bash --noprofile --norc -e -o pipefail {0}
main's workflow and the same two tests success, with the same failed tests in the logs bash -e {0}

So a caller's default does not reach the workflow it calls, which is how a tag was checked by lanes that could not fail although release.yml sets the default; and the called workflow's own default does hold.

The two failing tests and the throwaway workflow are gone from this branch (it was force-pushed from 6ca1eee to dec05db; the diff is the block above and its comment). #159 is closed unmerged and its branch is deleted.

Not done here: release.yml itself was not run. The guard that would fail when a piped run: script loses pipefail is owed and tracked as #160: it belongs in Conventions/WorkflowGateConventionTests.cs, which arrives with #154 and is not on main.

🤖 Generated with Claude Code

@CaffeinatedCoder CaffeinatedCoder added this to the 11.0.0 milestone Nov 16, 2026
@CaffeinatedCoder CaffeinatedCoder added bug Something isn't working severity/high Wrong results, crash or failed writes in a realistic scenario area/release Versioning, changelogs, release wiring labels Nov 16, 2026
Both steps pipe dotnet test into tee. A step that names no shell runs as
bash -e {0}, without pipefail, so the pipe's status was tee's, and the check
that follows asks only whether one test passed: a run with failing tests was
green, as a pull request's check and as the lanes release.yml calls.

The workflow now sets shell: bash for every run step, which is
bash --noprofile --norc -eo pipefail {0}. release.yml sets the same for its
own steps, and a caller's default does not reach the workflow it calls.

Closes #150

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@CaffeinatedCoder
CaffeinatedCoder marked this pull request as ready for review November 16, 2026 14:24
@CaffeinatedCoder
CaffeinatedCoder merged commit 1e0476b into main Nov 16, 2026
10 checks passed
@CaffeinatedCoder
CaffeinatedCoder deleted the fix/ci-pipefail branch November 16, 2026 15:01
CaffeinatedCoder added a commit that referenced this pull request Nov 16, 2026
… since #158

The step set pipefail for itself while #150 was open. The file's default
shell has it now, for every script, and says why it is not set per script.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
CaffeinatedCoder added a commit that referenced this pull request Nov 16, 2026
… since #158

The step set pipefail for itself while #150 was open. The file's default
shell has it now, for every script, and says why it is not set per script.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/release Versioning, changelogs, release wiring bug Something isn't working severity/high Wrong results, crash or failed writes in a realistic scenario

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: a failing test does not fail the Test and Integration lanes, since dotnet test is piped to tee without pipefail

1 participant