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

Run tests with pytest on Github actions #246

Merged
merged 11 commits into from
Jul 31, 2023

Conversation

silviot
Copy link
Contributor

@silviot silviot commented Jul 20, 2023

This PR configures Github actions to run tests using pytest.

The old travis configuration has been removed.

Currently a custom dallinger branch is being installed during tests, since this work is done in the context of supporting one-hour-one-life-like games on GU.

The old travis config used tox, but this PR uses pytest. The reason for this is that I'm not very familiar with tox.

@silviot silviot changed the base branch from master to one-hour-one-life July 20, 2023 16:15
@silviot silviot requested a review from alecpm July 20, 2023 16:35
test/conftest.py Outdated
# import dlgr was not working in the context of a test. The following
# lines make sure it works.
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't love this, can't we pip install -e . the GridUniverse package to the dlgr.griduniverse package and the dlgr namespace registered?

game_config.yml Outdated
@@ -0,0 +1 @@
dlgr/griduniverse/game_config.yml
Copy link
Contributor

Choose a reason for hiding this comment

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

@silviot I think I fixed the issue that required this yesterday on the one-hour-one-life main branch.

Copy link
Contributor

@alecpm alecpm left a comment

Choose a reason for hiding this comment

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

Tox was mainly used for server config and process managements stuff on Travis that GitHub actions manages for us. Tox was just running pytest. Getting rid of it is great!

I think this looks great, hopefully we can switch to Dallinger master soon. I have a couple small notes.

  • I don't think you should need the game_config.yml symlink if you rebase to master
  • I think there's probably a way to avoid that sys.path manipulation by installing the dlgr.griduniverse package as editable during the setup. That's what we do in Dallinger for dallinger.demos I think.

@alecpm alecpm force-pushed the issues/236-transitions branch from 9c7a641 to 140718b Compare July 31, 2023 23:12
@alecpm alecpm force-pushed the issues/236-transitions branch from 698dbf6 to f5587cc Compare July 31, 2023 23:32
@alecpm alecpm merged commit 8e697b5 into one-hour-one-life Jul 31, 2023
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