Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write test cases for game loop #105

Open
nashirj opened this issue Jan 20, 2022 · 5 comments · May be fixed by #231
Open

Write test cases for game loop #105

nashirj opened this issue Jan 20, 2022 · 5 comments · May be fixed by #231
Assignees
Labels
General Software Team Game loop, web app, GUI, etc

Comments

@nashirj
Copy link
Member

nashirj commented Jan 20, 2022

Should have test cases that allow verifying all functionality in game loop. These test cases can be extended to serve as test cases for the physical hardware once we have the hardware in place. Examples of things to validate:

  • Normal moves
  • Promotion
  • Captures
  • Moving to/from graveyard

This issue should be kept up to date and remain open until all existing functionality of the game loop has test cases. Then all future game loop stuff should include test cases to validate the new functionality.

@nashirj nashirj added the General Software Team Game loop, web app, GUI, etc label Jan 20, 2022
@nashirj
Copy link
Member Author

nashirj commented Jan 25, 2022

As part of this issue, should set up a "debug" mode of interaction.

This would run through a specified test game and send moves to board exclusively through CLI. This would let us validate

  1. all game loop side code
  2. hardware/arduino code
  3. computer vision since we will have perfect knowledge of board state and can test how CV works with real board moves

@nashirj nashirj self-assigned this Jan 25, 2022
@nashirj
Copy link
Member Author

nashirj commented Feb 10, 2022

When debug mode of interaction can be specified with an optional --debug flag; if debug, we'll loop through the main game loop and only accept debug style messages from the human user (properly formatted moves that will be sent directly to Arduino; this will allow us to send the HOME_AXIS command). otherwise, we'll use the same logic currently in place. functionally, everything else should stay the same.

We can also have a --test flag that reads a file and sends commands from the file to the board. Prereq: need the board set up properly before the test case runs. Can optionally have a --all flag that runs all tests.

It might end up being cleaner to create a new boardtest.py and boarddebug.py file, but I think there would be a lot of duplication.

@LSaber36
Copy link
Collaborator

Hardware tests:

  • Be able to test aligning any axis to either minimum or maximum positions
  • Be able to make specific moves
  • Turning on/off electromagnet

@LSaber36
Copy link
Collaborator

LSaber36 commented Feb 11, 2022

I was thinking about it, and I think that there needs to be a hardware option for both --debug and --test flags. Perhaps we could add another flag to decide between hardware and software options, maybe --hardware (since it would probably be software by default). This extra --hardware flag would simply control where the test cases, or cli input, would be sent (Either to the chess engine or to the arduino).

I think we should do it this way because the behavior for running cases for either scenario are different. The software version is based on cases that get processed by the engine and everything, whereas the hardware version is based on directly sending commands to the arduino, bypassing the chess engine.

@LSaber36 LSaber36 self-assigned this Feb 11, 2022
@chasesza chasesza assigned chasesza and unassigned chasesza Feb 16, 2022
@adenm-10 adenm-10 linked a pull request Apr 9, 2022 that will close this issue
@nashirj
Copy link
Member Author

nashirj commented Aug 16, 2022

The Arduino tests should validate that if the end stops are hit, the movement stops.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
General Software Team Game loop, web app, GUI, etc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants