Skip to content

Commit

Permalink
ci: disable snapshot tests in benchmarks (#5008)
Browse files Browse the repository at this point in the history
  • Loading branch information
agostbiro authored Mar 20, 2024
1 parent 7164c5d commit ba129d3
Show file tree
Hide file tree
Showing 3 changed files with 12,883 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/edr-benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ jobs:

- name: Run benchmark
run: pnpm run -s benchmark

- name: Validate regressions
run: pnpm run -s verify
# - name: Validate regressions
# run: pnpm run -s verify

- name: Generate report for github-action-benchmark
run: pnpm run -s report | tee report.json
Expand Down
9 changes: 7 additions & 2 deletions crates/tools/js/benchmark/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ async function verify(benchmarkResultPath) {

if (!_.isEqual(snapshotFailures, benchFailures)) {
success = false;
const shouldFail = snapshotFailures.difference(benchFailures);
const shouldNotFail = benchFailures.difference(snapshotFailures);
const shouldFail = setDifference(snapshotFailures, benchFailures);
const shouldNotFail = setDifference(benchFailures, snapshotFailures);

// We're logging to stderr so that it doesn't pollute stdout where we write the result
console.error(`Snapshot failure for ${scenarioName}`);
Expand Down Expand Up @@ -125,6 +125,11 @@ async function verify(benchmarkResultPath) {
return success;
}

// From https://stackoverflow.com/a/66512466
function setDifference(a, b) {
return new Set(Array.from(a).filter((item) => !b.has(item)));
}

async function benchmarkAllScenarios(outPath) {
const result = {};
let totalTime = 0;
Expand Down
12,874 changes: 12,873 additions & 1 deletion crates/tools/scenarios/snapshot.json

Large diffs are not rendered by default.

0 comments on commit ba129d3

Please sign in to comment.