-
Notifications
You must be signed in to change notification settings - Fork 30
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 CI github actions workflow #1034
base: develop
Are you sure you want to change the base?
Conversation
@benmwebb do you have any idea why ctest doesn't find the tests? |
.github/workflows/ci.yml
Outdated
- name: Install dependencies | ||
run: | | ||
sudo apt-get update -qq | ||
sudo apt-get install -qq libboost-all-dev swig libhdf5-serial-dev libeigen3-dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're missing a lot of IMP build deps here - if you look at the logs you'll see that many modules are not building. On my Ubuntu build images I also install python-numpy python3-biopython python3-numpy cmake libcgal-dev libcgal-qt5-dev libfftw3-dev libopencv-dev libgsl0-dev python2-dev python3-dev libann-dev libprotobuf-dev protobuf-compiler python-protobuf python3-protobuf libopenmpi-dev
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I adapted this from Travis. Why don't we need these dependencies over there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Travis just does a very basic build of some of the low-level modules, not all of IMP, just to see if things compile. And it doesn't run any of the tests.
.github/workflows/ci.yml
Outdated
cmake .. -DUSE_PYTHON2=${{ env.PY2 }} -DCMAKE_CXX_FLAGS="${{ env.CXXFLAGS }}" | ||
make -k -j 2 | ||
- name: Run tests | ||
run: ./setup_environment.sh ../test/nosetests --with-coverage --cover-branches -e 'probabilistic' ../test/test_*.py ../test/medium_test_*.py test/*/*.py > /dev/null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-e 'probabilistic'
says to ignore all tests that match probabilistic
, right? Why is this included?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There used to be a utility method in IMP.test
called probabilistic_test
. nose would run it as a test, but it's not a test and so would always fail; see #996. That workaround shouldn't be needed any more though since I renamed the method to probabilistic_check
.
The other workaround is to symlink the nosetests binary into the test directory and run it there, otherwise methods like get_input_file_name
don't work. But I think I fixed that as part of #996 too.
python-dev is for Python 2
Any change of directories within a step does not propagate to the next step.
Ubuntu 18.04 ships with Python 3.6, not 3.8.
When using system Python on Ubuntu, 'pip' will always install Python 2 packages. Use 'pip3' for Python 3.
Don't use Python 2's nosetests when building IMP for Python 3, and vice versa. IMP itself should also be more nose-aware these days, so we can drop some of our test workarounds.
Ubuntu puts CGAL in an odd location, and IMP's CMake can't find it. Help it out by setting CGAL_DIR.
Give nose the correct paths for the IMP.kernel Python tests. Ultimately we will want it to run all modules' tests, although we will need to handle disabled modules appropriately.
@benmwebb thanks for the changes. Is this now superseded by the |
No, that in |
I'll take a stab at it, but no promises. |
nose is no longer maintained, so try running tests with pytest instead.
If the underlying C++ code segfaults, protect the rest of the test run by running each test in a separate forked process. This should also reduce issues with tests that do things that can only be done once per process, e.g. parsing command line flags.
"pytest" only works with newer pytest (not that available for Python 2). Use the older "py.test" binary instead.
The test as currently written doesn't work when run with pytest because it doesn't understand the sys.argv that pytest feeds it. Use unittest instead.
Ubuntu calls the Python 3 version of pytest "pytest-3".
Codecov Report
@@ Coverage Diff @@
## develop #1034 +/- ##
==========================================
Coverage ? 60.64%
==========================================
Files ? 53
Lines ? 3801
Branches ? 416
==========================================
Hits ? 2305
Misses ? 1438
Partials ? 58 Continue to review full report at Codecov.
|
As discussed on slack, this PR sets up a github actions CI that builds all of IMP and runs the test suite with code coverage, uploading to codecov.