Repository navigation
Fix the C++ swerve drive tests depending on the test before them - #226
Merged
Merged
Conversation
… before each test, instead of starting from where the last test left them
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.
The C++ swerve drive tests share one set of simulated TalonFXs, and each test started from whatever the previous test left: wheels turned, motors still running toward the last setpoint. Catch2 runs the tests in a random order, so tests that assume forward-facing, stopped wheels failed depending on the order, as in the master CI run (SetAzimuthAnglesTurnsEveryModuleEvenWithAVelocityDeadband), and earlier LockPoseSetsXPattern, LockPoseTurnsTheWheelsEvenWithAVelocityDeadband and DesiredModuleStatesAreTheOptimizedOnes. DesiredModuleStatesAreTheOptimizedOnes failed every time in declaration order.
The fixture now stops each shared motor, zeroes its simulated velocity, and zeroes its encoder before every test.
Locally, [SwerveDriveTest] passes in declaration order, with the two random seeds that failed before, and with a new random seed. The CI filter [SwerveDriveTest],[SwerveInputStreamTelemetryTest] passes 57/57 three times with every core kept busy.