Skip to content

Commit

Permalink
Make the same logging change for 2022 script
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielRyanSmith authored and gsnedders committed Feb 8, 2023
1 parent da0fc28 commit eba88da
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion interop-2022/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ const KNOWN_TEST_STATUSES = new Set([
// than if we used rational numbers.
function scoreRuns(runs, allTestsSet) {
const scores = [];
const unexpectedNonOKTests = new Set();
try {
for (const run of runs) {
// Sum of the integer 0-1000 scores for each test.
Expand All @@ -139,7 +140,7 @@ function scoreRuns(runs, allTestsSet) {
let subtestTotal = 1;
if ('subtests' in results) {
if (results['status'] != 'OK' && !KNOWN_TEST_STATUSES.has(testname)) {
throw new Error(`Unexpected non-OK status for test: ${testname}`);
unexpectedNonOKTests.add(testname);
}
subtestTotal = results['subtests'].length;
for (const subtest of results['subtests']) {
Expand Down Expand Up @@ -181,6 +182,13 @@ function scoreRuns(runs, allTestsSet) {
throw e;
}

// Log and tests with unexpected non-OK statuses.
if (unexpectedNonOKTests.size > 0) {
console.log('Unexpected non-OK status for tests:');
for (const testname of unexpectedNonOKTests.values()) {
console.log(testname);
}
}
return scores;
}

Expand Down

0 comments on commit eba88da

Please sign in to comment.