-
Notifications
You must be signed in to change notification settings - Fork 11
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
Running tests locally? #82
Comments
I ran into the first error as well: |
Thanks @gassmoeller and @MatthewFlamm for your feedback, this PR #96 makes possible to run independently the tests, and in #99 details on how to install the requirements to run the tests is added. |
Actually I also ran into this when I used Python3.12 in Ubuntu (I am a macOS user and this issue does not show up in Python3.12, and the CI used to run with Python3.8 in Ubuntu). Thanks for spotting this, and the fix has been merged also in #102, by changing from: |
Thanks for the fix! |
I wanted to ask if it is expected to be able to run the tests locally? I tried to reproduce the test pipeline defined in
.github/workflows/CI.yml
locally to see if I can reproduce the tests, however I failed with two independent approaches:Log of output and error when running
pytest --cov=pyopmspe11 --cov-report term-missing tests/ > log 2>&1
: log.txt.I think the crucial lines of the log are:
This then also breaks all other tests because the python environment changes the working directory in the first test and doesnt change it back if the first test crashes (independent issue: it would be good to find a way to make the tests independent of each other, so you get a realistic picture of which tests fail, not just 'this test and maybe some of the others that fail because of the first one failing').
Since the message suggest I may have a problem with the installation of my opm package I tried to reproduce the CI workflow more closely and created a docker container with Ubuntu Jammy (the one used in the github action), then following verbatim all the steps in
.github/workflows/CI.yml
. I had to install some additional packages like pip and git, which is expected, because the github image already has some packages preinstalled. But I was also finally unsuccessful. The full log when I runpytest --cov=pyopmspe11 --cov-report term-missing tests/
: log2.txt.I think the crucial lines here are:
This looks as if the test is trying to do the following in data.py:
float(row[0])
withrow[0] = "np.float64(0.049999999999999996)"
. I am not sure how this happens if the main workflow for the repository works correctly (e.g. here https://github.com/OPM/pyopmspe11/actions/runs/11122281215/job/30903209334).It would be nice to be able to run the tests locally to make sure the installation works correctly. Is this a problem with my installation or is there something else that prevents the tests from working correctly in local installations?
Related to openjournals/joss-reviews#7357
The text was updated successfully, but these errors were encountered: