Skip to content

Conversation

@boneskull
Copy link
Owner

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

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
Copilot AI review requested due to automatic review settings December 18, 2025 02:17
@github-actions github-actions bot added the bug Something isn't working label Dec 18, 2025
Copy link
Contributor

Copilot AI left a 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 format benchmarks-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]>
@boneskull boneskull merged commit 89f3170 into main Dec 18, 2025
10 checks passed
@boneskull boneskull deleted the fix/output-filenames branch December 18, 2025 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

default json output filename should be uniquely named

2 participants