Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
88d53d5
working through initial setup of actions and package installation. ju…
scbedd May 15, 2025
99b550c
Add oav-runner to eng/tools/package.json
mikeharder May 15, 2025
c1230fb
[eng/tools/tsconfig.json] Add oav-runner, formatting
mikeharder May 15, 2025
dd67632
much further along in the journey. have it factored closer to what i …
scbedd May 20, 2025
74d2d13
tests properly running
scbedd May 20, 2025
5e4ce29
further updates around calling properly. I really need to clean up th…
scbedd May 23, 2025
1e819ae
adding nice error reporting. working on summary files
scbedd May 23, 2025
c81d71c
make necessary changes to package-lock and other files
scbedd May 23, 2025
5e26c3e
more updates + updating workflow invocation
scbedd May 23, 2025
ce6255b
strictly miming lint-diff to try to figure out why my bin isn't build…
scbedd May 23, 2025
247d942
update specs to call properly
scbedd May 23, 2025
5fa8eaf
update to package-lock.json
scbedd May 23, 2025
0a811b5
fix error-reporting
scbedd May 23, 2025
895ca4b
further refinements
scbedd May 23, 2025
1f92197
fix npm build error
scbedd May 23, 2025
aff13eb
properly setting the exit code when there are actually errors
scbedd May 23, 2025
493f335
update the success summary!
scbedd May 23, 2025
c56eeb9
should be able to run either specs or examples properly now
scbedd May 24, 2025
3609afa
cleanup commit
scbedd May 24, 2025
52bed60
formatting the project properly now
scbedd May 24, 2025
d471af6
rename our specs etc
scbedd May 27, 2025
6b55122
add a test case for an example scenario that absolutely exists
scbedd May 27, 2025
ff4acba
populate more tests
scbedd May 27, 2025
1196a2d
pretty
scbedd May 27, 2025
a4bf7bb
skin out the associatedswaggers and find related to example changes
scbedd May 28, 2025
e840c18
going to need to get rid of all the .filter() or .foreach() as they d…
scbedd May 28, 2025
2029387
cleanup and finishing up the tests. update the summary to output the …
scbedd May 29, 2025
0c5a642
Apply suggestions from code review
scbedd May 29, 2025
31de60f
PR feedback. removing prettierrc. renaming test job. renaming checks
scbedd May 29, 2025
9314de6
refactor the refs usage
scbedd May 29, 2025
912d5bf
Apply suggestions from code review
scbedd May 30, 2025
f37ba49
update getRefs and getExamples to use a common property function
scbedd May 30, 2025
7ce114a
finish rename standardization of the PR. update cli to allow optional…
scbedd May 30, 2025
519423f
honor the new os.cwd usage
scbedd May 30, 2025
92a59db
Apply suggestions from code review
scbedd May 30, 2025
55f9283
commit my package lock. need to do a merge from main now
scbedd May 30, 2025
0ce1c41
git merge main. now need to fix swagger.js
scbedd May 30, 2025
d59f135
merge main
scbedd May 30, 2025
8d08617
remove usage of consolelogger. update from main. update package lock.…
scbedd May 30, 2025
3239dd1
remove the vitest fie
scbedd May 30, 2025
bc8ec0a
Merge branch 'main' into add-model/semantic-gitvalidation
mikeharder May 30, 2025
3422037
switch to local files instead of forcing a huge copy
scbedd Jun 2, 2025
48ec587
remove debug output
scbedd Jun 2, 2025
c33a994
Merge branch 'main' into add-model/semantic-gitvalidation
mikeharder Jun 2, 2025
0fbb537
remove unused var
mikeharder Jun 2, 2025
637ba58
prettier
mikeharder Jun 2, 2025
431c768
Add helper path.includesFolder()
mikeharder Jun 2, 2025
52cacc3
this should be it for crossplat I hope
scbedd Jun 3, 2025
e222d8e
add error reporting tests
scbedd Jun 3, 2025
45ff0b7
remove debug log lines
scbedd Jun 3, 2025
c781fe3
[error-reporting.test] Convert to async, remove empty catch
mikeharder Jun 3, 2025
ee14479
prettier
mikeharder Jun 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
prettier
  • Loading branch information
mikeharder committed Jun 3, 2025
commit ee14479b66ea40b3266052e23abaae9d0561b703
38 changes: 19 additions & 19 deletions .github/shared/test/error-reporting.test.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// @ts-check

import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
import { setSummary, annotateFileError } from '../src/error-reporting.js';
import fs from 'fs/promises';
import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
import { setSummary, annotateFileError } from "../src/error-reporting.js";
import fs from "fs/promises";

describe('ErrorReporting', () => {
describe("ErrorReporting", () => {
let logSpy;

beforeEach(() => {
logSpy = vi.spyOn(console, 'log').mockImplementation(() => {});
logSpy = vi.spyOn(console, "log").mockImplementation(() => {});
// ensure that on test runs GITHUB_STEP_SUMMARY is not set in my current env by default
// this gives us a clean slate for each test
delete process.env.GITHUB_STEP_SUMMARY;
Expand All @@ -18,36 +18,36 @@
logSpy.mockRestore();
});

it('should warn when GITHUB_STEP_SUMMARY is unset', () => {
setSummary('hello');
it("should warn when GITHUB_STEP_SUMMARY is unset", () => {
setSummary("hello");
expect(logSpy).toHaveBeenCalledWith(
'GITHUB_STEP_SUMMARY is not set. Skipping summary update.'
"GITHUB_STEP_SUMMARY is not set. Skipping summary update.",
);
});

it('should write to the summary file when GITHUB_STEP_SUMMARY is set', async () => {
it("should write to the summary file when GITHUB_STEP_SUMMARY is set", async () => {
process.env.GITHUB_STEP_SUMMARY = `${__dirname}/tmp-summary.md`;

await fs.rm(process.env.GITHUB_STEP_SUMMARY, {force: true});
await fs.rm(process.env.GITHUB_STEP_SUMMARY, { force: true });

setSummary('# Title');
setSummary("# Title");

expect(logSpy).not.toHaveBeenCalledWith(
'GITHUB_STEP_SUMMARY is not set. Skipping summary update.'
"GITHUB_STEP_SUMMARY is not set. Skipping summary update.",
);

const content = await fs.readFile(process.env.GITHUB_STEP_SUMMARY, 'utf-8');
const content = await fs.readFile(process.env.GITHUB_STEP_SUMMARY, "utf-8");

// cleanup after the test so nothing is left behi
await fs.rm(process.env.GITHUB_STEP_SUMMARY, {force: true});
await fs.rm(process.env.GITHUB_STEP_SUMMARY, { force: true });

expect(content).toBe('# Title');
expect(content).toBe("# Title");
});

it('should emit a GitHub-style error annotation', () => {
annotateFileError('src/foo.js', 'Something broke', 42, 7);
it("should emit a GitHub-style error annotation", () => {
annotateFileError("src/foo.js", "Something broke", 42, 7);
expect(logSpy).toHaveBeenCalledWith(
'::error file=src/foo.js,line=42,col=7::Something broke'
"::error file=src/foo.js,line=42,col=7::Something broke",
);
});
});
});
Loading