Skip to content

Commit

Permalink
chore: Updated benchmark filename input to include Node version
Browse files Browse the repository at this point in the history
Signed-off-by: mrickard <[email protected]>
  • Loading branch information
mrickard committed Jul 16, 2024
1 parent b474624 commit 08442b6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/benchmark-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
- name: Install Dependencies
run: npm install
- name: Run Benchmark Tests
run: node ./bin/run-bench.js --branch=${{ github.base_ref || 'main' }}
run: node ./bin/run-bench.js --filename=${{ github.base_ref || 'main' }}_${{ matrix.node-version }}
- name: Verify Benchmark Output
run: ls benchmark_results

4 changes: 2 additions & 2 deletions bin/run-bench.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ class Printer {
/* eslint-enable no-console */
}
const resultPath = 'benchmark_results'
const branch = opts.branch ? `${opts.branch}` : 'benchmark'
const filePrefix = opts.filename ? `${opts.filename}` : 'benchmark'
try {
await fs.stat(resultPath)
} catch (e) {
await fs.mkdir(resultPath)
}
const content = JSON.stringify(this._tests, null, 2)
const fileName = `${resultPath}/${branch}_${new Date().getTime()}.json`
const fileName = `${resultPath}/${filePrefix}_${new Date().getTime()}.json`
await fs.writeFile(fileName, content)
console.log(`Done! Test output written to ${fileName}`)
}
Expand Down

0 comments on commit 08442b6

Please sign in to comment.