Skip to content

fix: fail CI when piped tests fail - #39

Merged
ralyodio merged 1 commit into
profullstack:masterfrom
KennerMiner:fix/ci-test-exit-status
Sep 9, 2026
Merged

fix: fail CI when piped tests fail#39
ralyodio merged 1 commit into
profullstack:masterfrom
KennerMiner:fix/ci-test-exit-status

Conversation

@KennerMiner

Copy link
Copy Markdown
Contributor

The CI Test step currently reports success when Node tests fail. Its unspecified Linux shell uses bash -e, so tee supplies the pipeline's successful status and the script reaches exit 0.

Set shell: bash on that step. GitHub Actions then invokes Bash with -eo pipefail, preserving a failing test runner's exit status while keeping output.txt and the existing missing-database check.

Verified on Linux in a disposable Docker container with Node 24.20.0 and on macOS with Node 24.10.0, using the exact Test step script extracted from the workflow and GitHub's documented shell invocations:

Real Node test fixture Before After
Passing test 0 0
Failing assertion 0 (incorrect) 1
Skipped test with no database 1 1
Test file syntax error 0 (incorrect) 1

All eight runs per environment retained test output in output.txt. The Linux container had no network, no credentials, read-only inputs and limited resources. git diff --check passes. This verifies shell behavior locally; the full application/database suite and hosted CI were not run locally for this one-line workflow change.

Minimal failing-test fixture used in the workflow's test/*.test.ts path:

import { test } from 'node:test';
import assert from 'node:assert/strict';
test('real failing assertion', () => assert.equal(1, 2));

Running the existing Test step script with bash -e step.sh returns 0 for that fixture. With bash --noprofile --norc -eo pipefail step.sh, it returns 1. The other controls use a passing Node test, a Node test skipped with reason no database, and a test file containing a syntax error.

Reference: https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#jobsjob_idstepsshell

Submitted for consideration under the bug-fix PR offer at https://ugig.net/gigs/8b2a21db-ce15-433f-a73d-68f2e3349e87 . If eligible, SOL is a suitable payout method; receiving details can be supplied privately. No payment is assumed until confirmed.

@ralyodio
ralyodio merged commit ef5c4ca into profullstack:master Sep 9, 2026
4 checks passed
@KennerMiner

Copy link
Copy Markdown
Contributor Author

Thanks for merging this fix. The upstream test and Docker checks both passed.

I'd like to claim the bug-fix bounty from your ugig offer. SOL on Solana mainnet is suitable; the dedicated receiving address is:

3UAwwsxFnRMR1yn1WrxmdDBBmDkoDGNapbAtGE4mPcfA

Please confirm the award amount and share the transaction signature when sent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants