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

Delay engine and book downloads until needed for a test #1035

Conversation

MarkZH
Copy link
Collaborator

@MarkZH MarkZH commented Oct 12, 2024

Type of pull request:

  • Bug fix
  • Feature
  • Other

Description:

This PR delays downloading the chess engines used for testing until the test that uses them actually runs. This way, the test script can start faster and run the downloads in parallel. Plus, any tooling that reads the test file (VS Code plugins that track test completion) does not have to wait for engine/book downloads.

Another change is to skip a test when an engine or book download fails instead of failing it. The Sjeng website seems to have been down for several weeks now. GitHub actions still works because it's retained a cached copy.

Finally, a logger instance local to test_bot.py is used instead of importing the one from lichess_bot.py.

Related Issues:

N/A

Checklist:

  • I have read and followed the contribution guidelines.
  • I have added necessary documentation (if applicable).
  • The changes pass all existing tests.

Screenshots/logs (if applicable):

N/A

Also,

- Since the Sjeng site seems unreliable recently, skip the test if the
download fails.
- Use a local logger instead of the one from lichess_bot.
@AttackingOrDefending
Copy link
Member

I think we should give tests around 15 more seconds to finish to account for the extra time taken to download the engines.

In case the tests are run in a different order.
Since stockfish is used as the opponent in all engine tests, make sure
it exists in case the tests are run in a different order.
@AttackingOrDefending AttackingOrDefending merged commit 4909a8e into lichess-bot-devs:master Oct 14, 2024
21 checks passed
@MarkZH MarkZH deleted the delay-engine-book-downloads branch October 14, 2024 07:31
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.

2 participants