Skip to content

Commit 4aa14aa

Browse files
committed
fix(e2e): stream reliability artifacts to workflow
Signed-off-by: Ho Lim <subhoya@gmail.com>
1 parent 790ab12 commit 4aa14aa

3 files changed

Lines changed: 12 additions & 13 deletions

File tree

.github/workflows/e2e-main-retry.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,15 @@ jobs:
101101
- name: Build advisory same-commit reliability report
102102
env:
103103
GITHUB_TOKEN: ${{ github.token }}
104-
RELIABILITY_REPORT_PATH: ${{ runner.temp }}/same-commit-reliability.json
105104
SOURCE_RUN_ID: ${{ github.event.workflow_run.id }}
106105
shell: bash
107106
run: |
108107
set -euo pipefail
109108
node --experimental-strip-types --no-warnings \
110109
tools/e2e/same-commit-reliability.mts \
111-
| tee "${RUNNER_TEMP}/same-commit-reliability.md"
110+
>"${RUNNER_TEMP}/same-commit-reliability.json" \
111+
2>"${RUNNER_TEMP}/same-commit-reliability.md"
112+
cat "${RUNNER_TEMP}/same-commit-reliability.md"
112113
cat "${RUNNER_TEMP}/same-commit-reliability.md" >>"${GITHUB_STEP_SUMMARY}"
113114
114115
- name: Upload advisory reliability evidence

test/e2e/support/same-commit-reliability.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,13 @@ describe("same-commit E2E reliability", () => {
188188
ref: "${{ github.workflow_sha }}",
189189
"persist-credentials": false,
190190
});
191+
const build = workflowStep(reporter, "Build advisory same-commit reliability report");
192+
expect(build.env).toEqual({
193+
GITHUB_TOKEN: "${{ github.token }}",
194+
SOURCE_RUN_ID: "${{ github.event.workflow_run.id }}",
195+
});
196+
expect(build.run).toContain('>"${RUNNER_TEMP}/same-commit-reliability.json"');
197+
expect(build.run).toContain('2>"${RUNNER_TEMP}/same-commit-reliability.md"');
191198
});
192199

193200
it("consumes dispatch, retry, and runner classifications without retaining payload text", async () => {

tools/e2e/same-commit-reliability.mts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
44
// SPDX-License-Identifier: Apache-2.0
55

6-
import fs from "node:fs";
76
import { pathToFileURL } from "node:url";
87

98
import {
@@ -766,16 +765,8 @@ async function main(): Promise<void> {
766765
candidateSha: currentSample?.candidateSha ?? null,
767766
groups,
768767
};
769-
fs.writeFileSync(
770-
requiredEnvironment("RELIABILITY_REPORT_PATH"),
771-
`${JSON.stringify(report, null, 2)}\n`,
772-
{
773-
encoding: "utf8",
774-
mode: 0o600,
775-
flag: "wx",
776-
},
777-
);
778-
console.log(formatReliabilityReport(groups));
768+
process.stdout.write(`${JSON.stringify(report, null, 2)}\n`);
769+
process.stderr.write(`${formatReliabilityReport(groups)}\n`);
779770
}
780771

781772
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {

0 commit comments

Comments
 (0)