mirror of
https://github.com/morluto/rea.git
synced 2026-11-20 05:32:44 +00:00
fix(ci): require passing provider test files (#12424)
Co-authored-by: ShuaixinHuang <ShuaixinHuang@users.noreply.github.com> Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
This commit is contained in:
2 files changed
+15
No files matched your search
@@ -59,6 +59,8 @@ for (const [path, cases] of Object.entries(requirements[lane])) {
|
||||
});
|
||||
if (matches.length !== 1 || !Array.isArray(matches[0].assertionResults))
|
||||
throw new Error(`Expected exactly one provider test result for ${path}`);
|
||||
if (matches[0].status !== "passed")
|
||||
throw new Error(`Required provider test file did not pass: ${path}`);
|
||||
for (const name of cases) {
|
||||
const results = matches[0].assertionResults.filter(
|
||||
(test) => test?.fullName === name,
|
||||
|
||||
@@ -34,6 +34,7 @@ const commonLimits = [
|
||||
];
|
||||
const testFile = (path: string, names: string[]) => ({
|
||||
name: resolve(path),
|
||||
status: "passed",
|
||||
assertionResults: names.map((fullName) => ({ fullName, status: "passed" })),
|
||||
});
|
||||
const report = (lane: "packet" | "signal") => ({
|
||||
@@ -100,6 +101,7 @@ it.each(["packet", "signal"] as const)(
|
||||
const result = report(lane);
|
||||
result.testResults.push({
|
||||
name: resolve("tests/unrelated.test.ts"),
|
||||
status: "passed",
|
||||
assertionResults: [{ fullName: "host-specific", status: "pending" }],
|
||||
});
|
||||
expect(run(lane, result)).toContain("cases passed");
|
||||
@@ -137,6 +139,17 @@ it.each(["packet", "signal"] as const)(
|
||||
},
|
||||
);
|
||||
|
||||
it.each(["packet", "signal"] as const)(
|
||||
"rejects a failed %s file despite passing required assertions",
|
||||
(lane) => {
|
||||
const result = report(lane);
|
||||
result.testResults[0]!.status = "failed";
|
||||
expect(() => run(lane, result)).toThrow(
|
||||
"Required provider test file did not pass",
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
it.each([
|
||||
["parent", resolve(process.cwd(), "..", "rea-provider-report.json")],
|
||||
["sibling prefix", `${resolve(process.cwd())}-outside/report.json`],
|
||||
|
||||
Reference in new issue
Block a user