-
Notifications
You must be signed in to change notification settings - Fork 0
fix(reporters): use timestamped filenames for JSON/CSV output #200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Default output filenames for JSON and CSV reporters are now uniquely named with timestamps (e.g., benchmarks-2025-12-17-10-30-45.json) instead of the static 'results.json' / 'results.csv'. This prevents accidental overwrites when running multiple benchmark runs to the same output directory. Closes #196
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR changes the default output filenames for JSON and CSV reporters from static names (results.json, results.csv) to timestamped filenames (e.g., benchmarks-2025-12-17-10-30-45.json). This prevents accidental overwrites when running multiple benchmark runs to the same output directory and addresses issue #196.
Key changes:
- Added
generateTimestampedFilename()function that creates filenames with timestamp formatbenchmarks-YYYY-MM-DD-HH-MM-SS.{extension} - Updated JSON and CSV reporter setup to use timestamped filenames as defaults instead of static names
- Added
findFileByPattern()test utility to locate timestamped output files in integration tests
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| src/core/output-path-resolver.ts | Adds generateTimestampedFilename() function to create timestamped filenames with format benchmarks-YYYY-MM-DD-HH-MM-SS.{extension} |
| src/cli/commands/run.ts | Updates CSV and JSON reporter initialization to use generateTimestampedFilename() instead of static results.csv and results.json |
| test/util.ts | Adds findFileByPattern() helper function to locate timestamped output files in test directories |
| test/unit/output-path-resolver.test.ts | Adds comprehensive unit tests for generateTimestampedFilename() including format validation, extension handling, and zero-padding verification |
| test/integration/reporters.test.ts | Updates tests to use findFileByPattern() for locating timestamped output files; updates conflict test to use explicit --output-file |
| test/integration/verbose-mode.test.ts | Updates verbose mode tests to find and verify timestamped JSON and CSV output files |
| test/integration/quiet-mode.test.ts | Updates quiet mode tests to locate and verify timestamped output files |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Use UTC time methods for consistent timestamped filenames - Make regex patterns more specific to match exact timestamp format - Replace 1100ms delay test with Date mocking for faster execution 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Default output filenames for JSON and CSV reporters are now uniquely named
with timestamps (e.g., benchmarks-2025-12-17-10-30-45.json) instead of the
static 'results.json' / 'results.csv'. This prevents accidental overwrites
when running multiple benchmark runs to the same output directory.
Closes #196