Skip to content

Commit d693079

Browse files
chore: ensure the generated asset directory is present
1 parent b6fee30 commit d693079

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

.github/workflows/accuracy-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ jobs:
4444
uses: actions/upload-artifact@v4
4545
with:
4646
name: accuracy-test-summary
47-
path: .accuracy/tests-summary.html
47+
path: .accuracy/test-summary.html
4848
- name: Comment summary on PR
4949
if: github.event_name == 'pull_request' && github.event.label.name == 'accuracy-tests'
5050
uses: marocchino/sticky-pull-request-comment@d2ad0de260ae8b0235ce059e63f2949ba9e05943 # v2
5151
with:
52-
path: .accuracy/tests-summary.html
52+
path: .accuracy/test-summary.html

scripts/accuracy/generate-test-summary.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { readFile, writeFile } from "fs/promises";
1+
import path from "path";
2+
import { readFile, writeFile, mkdir } from "fs/promises";
23
import { getAccuracyResultStorage } from "../../tests/accuracy/sdk/accuracy-result-storage/get-accuracy-result-storage.js";
34
import {
45
AccuracyResult,
@@ -247,6 +248,8 @@ async function generateTestSummary() {
247248
const testSummary = getTestSummary(comparableAccuracyResult);
248249
const htmlReport = await generateHtmlReport(comparableAccuracyResult, testSummary, baselineInfo);
249250

251+
// Ensure that our writable path actually exist.
252+
await mkdir(path.dirname(HTML_TESTS_SUMMARY_FILE), { recursive: true });
250253
await writeFile(HTML_TESTS_SUMMARY_FILE, htmlReport, "utf8");
251254

252255
console.log(`✅ HTML report generated: ${HTML_TESTS_SUMMARY_FILE}`);

scripts/accuracy/run-accuracy-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ JEST_EXIT_CODE=$?
3333
# "in-progress". When all the tests are done and jest exits with an exit code of
3434
# 0, we can safely mark accuracy run as finished otherwise failed.
3535

36-
# This "outside-the-tests-status-update" is arising out of the fact that each
36+
# This "outside-the-test-status-update" is arising out of the fact that each
3737
# test suite stores their own accuracy run data in the storage and this setup
3838
# might lead to data inconsistency when the tests fail. To overcome that each
3939
# accuracy result entry has a status which by default is "in-progress" and is

tests/accuracy/sdk/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ export const ACCURACY_RESULTS_DIR = path.join(GENERATED_ASSETS_DIR, "results");
1919

2020
export const LATEST_ACCURACY_RUN_NAME = "latest-run";
2121

22-
export const HTML_TESTS_SUMMARY_FILE = path.join(GENERATED_ASSETS_DIR, "tests-summary.html");
22+
export const HTML_TESTS_SUMMARY_FILE = path.join(GENERATED_ASSETS_DIR, "test-summary.html");
2323

2424
export const HTML_TESTS_SUMMARY_TEMPLATE = path.join(RESOURCES_DIR, "test-summary-template.html");

0 commit comments

Comments
 (0)