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

Implement tox #2661

Conversation

KasukabeDefenceForce
Copy link
Contributor

📝 Description

Type: 🚀 feature
The PR aims at implementing tox for automated testing across various Python versions and environments.

📌 Resources

Examples, notebooks, and links to useful references.

🚦 Testing

How did you test these changes?

  • Testing pipeline
  • Other method (describe)
  • My changes can't be tested (explain why)

☑️ Checklist

  • I requested two reviewers for this pull request
  • I updated the documentation according to my changes
  • I built the documentation by applying the build_docs label

Note: If you are not allowed to perform any of these actions, ping (@) a contributor.

@KasukabeDefenceForce
Copy link
Contributor Author

KasukabeDefenceForce commented Jun 19, 2024

For running tests on all the mentioned environments use the command:
tox
For running tests on specific environment use the command:
tox -e {env}-test

For example:
tox -e py38-test

@andrewfullard
Copy link
Contributor

You said in Slack that the main benefit is testing against multiple Python versions. With our static environment, I am not sure that applies to TARDIS. What other benefits does tox provide?

@KasukabeDefenceForce
Copy link
Contributor Author

You said in Slack that the main benefit is testing against multiple Python versions. With our static environment, I am not sure that applies to TARDIS. What other benefits does tox provide?

Some other benefits:

  1. We can simplify the test command. For example, instead of running pytest tardis --tardis-refdata=/Users/abhinav/workspace/code/tardis-main/tardis-refdata --tardis-regression-data=/Users/abhinav/workspace/code/tardis-main/tardis-regression-data we can just run tox.
  2. Tox creates separate virtual environments for each test, preventing dependency conflicts and ensuring consistent test conditions. For example, if a user has installed some extra dependencies locally, it wont affect the test environment.

Resources:
https://blog.ionelmc.ro/2015/04/14/tox-tricks-and-patterns/
https://codilime.com/blog/python-tox/
https://christophergs.com/python/2020/04/12/python-tox-why-use-it-and-tutorial/

@andrewfullard
Copy link
Contributor

Can tox implement single-command testing for all of the not (continuum or rpacket_tracking), continuum, and rpacket_tracking test cases?

@wkerzendorf
Copy link
Member

is this done? @atharva-2001 told me that we don't want to use it.

@KasukabeDefenceForce
Copy link
Contributor Author

Can tox implement single-command testing for all of the not (continuum or rpacket_tracking), continuum, and rpacket_tracking test cases?

Yes we can.

@KasukabeDefenceForce
Copy link
Contributor Author

is this done? @atharva-2001 told me that we don't want to use it.

Yep, its not worth it in our case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants