Skip to content

Move pytest validations to its own directory - #3639

Merged
nycrat merged 20 commits into
UBC-Thunderbots:masterfrom
nycrat:avah/move_pytests_to_own_directory
Mar 21, 2026
Merged

Move pytest validations to its own directory#3639
nycrat merged 20 commits into
UBC-Thunderbots:masterfrom
nycrat:avah/move_pytests_to_own_directory

Conversation

@nycrat

@nycrat nycrat commented Mar 8, 2026

Copy link
Copy Markdown
Member

(PART 1)

Description

  • Moves pytest validations from simulated_tests/ to simulated_tests/validation/
  • Moves cpp validation stuff from validation/ to cpp_validation/ (planned to be removed Remove C++ Simulated Test Fixtures  #2581)
  • Creates RobotAtPosition, RobotAtOrientation, RobotAtAngularVelocity, DelayValidation for future tests
  • Remove ball BallMovesFromRest and BallMovesForward in favour of using other existing validations

Testing Done

Resolved Issues

part of #2558

Length Justification and Key Files to Review

Review Checklist

It is the reviewers responsibility to also make sure every item here has been covered

  • Function & Class comments: All function definitions (usually in the .h file) should have a javadoc style comment at the start of them. For examples, see the functions defined in thunderbots/software/geom. Similarly, all classes should have an associated Javadoc comment explaining the purpose of the class.
  • Remove all commented out code
  • Remove extra print statements: for example, those just used for testing
  • Resolve all TODO's: All TODO (or similar) statements should either be completed or associated with a github issue

@nycrat
nycrat force-pushed the avah/move_pytests_to_own_directory branch from 8061515 to 070e2f8 Compare March 8, 2026 02:53
Comment thread src/software/ai/hl/stp/play/crease_defense/BUILD Outdated
Comment thread src/software/ai/hl/stp/play/halt_play/BUILD Outdated
@nycrat
nycrat force-pushed the avah/move_pytests_to_own_directory branch from a60328b to 1bae6e2 Compare March 11, 2026 20:55
Comment thread src/software/simulated_tests/validation/ball_kicked_in_direction.py Outdated

@sauravbanna sauravbanna left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great, some good refactors ! i suggested a few more to reduce repetitive validations

Comment thread src/software/simulated_tests/validation/ball_kicked_in_direction.py Outdated
Comment thread src/software/simulated_tests/validation/delay_validation.py Outdated
Comment thread src/software/simulated_tests/validation/delay_validation.py Outdated
Comment thread src/software/simulated_tests/validation/robot_at_position.py Outdated
Comment thread src/software/simulated_tests/validation/friendly_receives_ball_slow.py Outdated
@nycrat
nycrat force-pushed the avah/move_pytests_to_own_directory branch from 320e9b7 to ced6821 Compare March 14, 2026 19:46
@nycrat
nycrat force-pushed the avah/move_pytests_to_own_directory branch from 59e3fc7 to 4daf7af Compare March 15, 2026 02:45
@nycrat
nycrat force-pushed the avah/move_pytests_to_own_directory branch from 5b327bc to b976287 Compare March 16, 2026 02:30
Comment on lines -83 to 86
ball_moves_at_rest_validation = BallAlwaysMovesFromRest(
position=tbots_cpp.Point(0, 0), threshold=0.05
ball_moves_at_rest_validation = BallNeverEntersRegion(
regions=[tbots_cpp.Circle(tbots_cpp.Point(0, 0), 0.05)]
)

@nycrat nycrat Mar 16, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE: If you look at the old validation logic for BallMovesFromRest, it does the same thing of checking if ball is within a radius to an initial position. That specific validation is not used anywhere else, so it has been removed in this PR

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This validation has been modified to include a robot_id parameter so that it can be a parent class for FriendlyReceivesBallSlow since they have lots of overlapped code

@nycrat

nycrat commented Mar 16, 2026

Copy link
Copy Markdown
Member Author

@sauravbanna @Andrewyx @adrianchan787 I've reverted many changes in this PR so that only the changes relevant to moving the pytest validations are included which should make it much easier to review (pretty much just 1-5 line changes on each file). The one large change to refactor the FriendlyHasBallPossession and FriendlyReceivesBallSlow validations were made to reduce repeated code as Saurav requested.

Would appreciate a review on this one whenever you have time

@nycrat
nycrat requested a review from sauravbanna March 16, 2026 04:05
@nycrat
nycrat merged commit 191f436 into UBC-Thunderbots:master Mar 21, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants