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

Add automated tests pipeline #18

Merged
merged 3 commits into from
Feb 29, 2024
Merged

Add automated tests pipeline #18

merged 3 commits into from
Feb 29, 2024

Conversation

corentinlger
Copy link
Collaborator

Description

Add a GitHub Actions workflow configuration file (CI.yml) to the repository to set up continuous integration. This workflow is triggered whenever there is a Push or a Pull Request on the main branch (I also added a trigger on the automated_tests branch to test the current PR I'm writing).

It gets the code in the Push / PR, creates a python environment and installs all the dependencies of the project (as someone would do if they wanted to download and use the repo). Then I added a line to check the format of the code with black (we might choose another one), and one to test the code by running pytest.

The pipeline runs on a matrix of OS ([ubuntu-20.04, windows-2019, macos-11]) and on two python versions at the moment (["3.10", "3.11"]). We can also easily modify that later if needed.

Related Issue (if applicable)

How to Test

Either do a Push or a PR on the current branch (automated_tests).

Screenshots (if applicable)

@corentinlger corentinlger added the enhancement New feature or request label Feb 29, 2024
@corentinlger
Copy link
Collaborator Author

First tests failed because I was trying to use black even if it wasn't installed. I added it to the requirements.txt to fix this problem.

@Marsolo1 also noticed that the installation pipeline was really long on a mac OS (it is actually the dependencies installation that takes a lot of time, not the testing with pytest) . I didn't remove it from the OS list because you both use a mac, but to reduce the testing time, I only kept one version of python (3.10) and removed tests on windows machines.

@corentinlger
Copy link
Collaborator Author

corentinlger commented Feb 29, 2024

Actually it seems that grpc is extremely long to install on mac machines provided by Github for testing (but not for linux ones).

Additionally, as indicated on this page we get 2,000 Github Actions minutes per months to do those kind of tests for free. Considering that macOS minutes are multiplied by 10 to calculate GitHub Actions minutes and are particularly slow in our case, it might be a good idea to only launch tests on Linux for the time being.

@corentinlger corentinlger merged commit 3ba3ffd into main Feb 29, 2024
4 checks passed
@corentinlger corentinlger deleted the automated_tests branch March 7, 2024 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant