Skip to content

Commit

Permalink
Remove junit
Browse files Browse the repository at this point in the history
  • Loading branch information
masad-frost committed Jul 12, 2024
1 parent 058275c commit de7feb2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1,580 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@ jobs:
- name: Test
run: npm run start -- --client ${{ matrix.client }} --server ${{ matrix.server }} --parallel 2

- name: Report
run: npx xunit-viewer --results tests/results/ --console --clear=false --output tests/results/${{ matrix.client }}-${{ matrix.server }}
if: always()

- uses: actions/upload-artifact@v4
if: always()
with:
Expand Down
20 changes: 4 additions & 16 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { randomBytes } from 'crypto';
import { mkdir, readFile, writeFile } from 'node:fs/promises';
import { mkdir, writeFile } from 'node:fs/promises';
import { structuredPatch } from 'diff';
import chalk from 'chalk';
import stripAnsi from 'strip-ansi';
import yargs from 'yargs';
import { hideBin } from 'yargs/helpers';
import builder from 'junit-report-builder';
import {
type Test,
serializeExpectedOutputEntry,
Expand Down Expand Up @@ -141,9 +140,6 @@ async function runSuite(
const networks = await setupNetworks(parallel);

const suiteStart = new Date();
const suite = builder
.testSuite()
.name(`river-babel (${clientImpl}, ${serverImpl})`);

console.log('Starting Tests');
console.log('Client:', clientImpl, 'Server:', serverImpl);
Expand Down Expand Up @@ -171,7 +167,6 @@ async function runSuite(
!nameFilters.some((filter) => name.includes(filter))) ||
ignore.includes(test)
) {
suite.testCase().name(name).skipped();
return true;
}

Expand Down Expand Up @@ -324,8 +319,6 @@ async function runSuite(
constants.O_APPEND | constants.O_WRONLY | constants.O_CREAT,
);

const testCase = suite.testCase().name(name);

for (const [clientName, client] of Object.entries(containers)) {
const expectedOutput = client.expectedOutput
.map(serializeExpectedOutputEntry)
Expand Down Expand Up @@ -356,10 +349,8 @@ end diff for ${clientName}, logs will be written to ${stderrLogFilePath}

if (test.flaky) {
testsFlaked.add(name);
testCase.standardError(diffMsg);
} else {
testsFailed.add(name);
testCase.failure(diffMsg);
}
}

Expand All @@ -378,8 +369,6 @@ end logs for server
);
}

testCase.time((new Date().getTime() - suiteStart.getTime()) / 1000);

await logFileHandle.close();
networks.release(network);

Expand Down Expand Up @@ -409,16 +398,16 @@ end logs for server
taskrunner.add(tasks);
await taskrunner.runAll();

suite.time((new Date().getTime() - suiteStart.getTime()) / 1000);

// Sometimes task runner can take a bit to flush the output
// we log and wait for a second
console.log('');
await new Promise((resolve) => setTimeout(resolve, 1000));

// print summary
const summary = `${chalk.black.bgYellow(' SUMMARY ')}
passed ${numTests - (testsFailed.size + testsFlaked.size)}/${numTests}
total time: ${(new Date().getTime() - suiteStart.getTime()) / 1000} seconds
passed ${numTests - (testsFailed.size + testsFlaked.size)}/${numTests}
${chalk.magenta(`flaked:`)}
${Array.from(testsFlaked)
Expand All @@ -435,7 +424,6 @@ ${Array.from(testsFailed)
console.log(summary);

await mkdir('tests/results', { recursive: true });
builder.writeTo(`tests/results/${clientImpl}-${serverImpl}.xml`);

return testsFailed.size;
}
Expand Down
Loading

0 comments on commit de7feb2

Please sign in to comment.