Add CLI arguments for session simulation replay#234
Open
Abasz wants to merge 2 commits into0.9.8-In-Developmentfrom
Open
Add CLI arguments for session simulation replay#234Abasz wants to merge 2 commits into0.9.8-In-Developmentfrom
Abasz wants to merge 2 commits into0.9.8-In-Developmentfrom
Conversation
Replace the commented-out simulation block in server.js with CLI arguments that enable replay of recorded rowing sessions without code changes. New flags: --simulate Enable session replay (default: off) --simulateFile Path to CSV recording (default: Concept2) --simulateDelay Startup delay in ms (default: 30000) --simulateOnce Run replay once instead of looping --simulateFast Replay at max speed instead of realtime Parsing logic extracted to SimulationArgs.js with full test coverage. Adds npm run simulate convenience script.
Fall back to the default 30000ms delay when a non-numeric, empty, or negative value is passed via --simulateDelay. Add edge case tests for invalid delay, empty string, negative values, and unknown flags.
84d0ef3 to
663ee80
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
This replaces the commented-out simulation block in server.js with proper CLI arguments, enabling replay of recorded rowing sessions without modifying source code.
What changed
--simulateis passednpm run simulateconvenience script to package.jsonSimulationArgs.test.jsDefaults preserve current behavior
All defaults match the original commented-out block exactly:
Without
--simulate, the server behaves identically to before — this is a zero-impact change for production.Available flags
--simulate--simulateFile <path>--simulateDelay <ms>--simulateOnce--simulateFastBenefits over the old approach
npm run simulatemakes it easy for new contributors to findExample usage