Software icon indicating copy to clipboard operation
Software copied to clipboard

Pytest validation

Open suchirss opened this issue 1 year ago • 10 comments

Please fill out the following before requesting review on this PR

Description

This PR addresses issue #2809. kickoff_play_test.py has been written to test the following rules for kickoff:

  1. During friendly kickoff, a maximum of one friendly robot is within the center circle and the remaining friendly robots are within the friendly half.
  2. After friendly kickoff is initiated, the ball leaves its starting point by a distance of at least 0.05m within 15 seconds.
  3. During enemy kickoff, all friendly robots are in the friendly half and none are in the center circle.

kickoff_play_test.py uses NumberOfRobotsAlwaysStaysInRegion() in the always validation sequence set and BallEventuallyExitsRegion() in the eventually validation sequence set to verify the above rules.

robot_enters_regions.py was modified so that NumberOfRobotsAlwaysStaysInRegion() is able to accept multiple regions as parameters.

or_validation.py was created to implement OR logic when running a group of tests - this is used in kickoff_play_test.py to check that either 0 or 1 robots are in centerCircle.

This test discovered that our AI currently violates kickoff rule #3 outlined above - a friendly robot enters the enemy half during enemyKickoff. As such, issue #3119 was created.

Testing Done

./tbots.py test //software/ai/hl/stp/play:kickoff_play_test -t was used to visualize the kickoff_play_test on Thunderscope. All three tests can be seen in this GIF: 3DEnemyKickoffPlay_fail

Resolved Issues

resolves #2809

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

suchirss avatar Jan 27 '24 22:01 suchirss

Ok in the previous PR the the CI Simulated Gameplay Tests were failing because of kickoff_play_test.py. I fixed that issue but now it's failing because of ball_placement_test.py.

I was asking about this on Thursday and I think Nima mentioned that this is a problem that others are having as well, and that sometimes it just gets resolved by running it a few times? If I run ball placement test individually on CLion, it'll pass for me, but if I execute bazel test //... , then ball_placement_test will fail.

How should I proceed?

suchirss avatar May 12 '24 09:05 suchirss

It's affecting multiple people, I'll try to take a look today

itsarune avatar May 12 '24 19:05 itsarune

This PR is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Sep 14 '24 21:09 github-actions[bot]

This PR was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Sep 20 '24 02:09 github-actions[bot]

This PR is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Nov 05 '24 02:11 github-actions[bot]

This PR is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Dec 06 '24 03:12 github-actions[bot]

This PR is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Jan 06 '25 03:01 github-actions[bot]

Note: pushed PR right now to allow others to debug. Not yet ready for review to merge PR.

suchirss avatar Feb 17 '25 20:02 suchirss