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 CI github actions workflow #1034

Open
wants to merge 42 commits into
base: develop
Choose a base branch
from
Open

Add CI github actions workflow #1034

wants to merge 42 commits into from

Conversation

sethaxen
Copy link
Contributor

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.

@sethaxen
Copy link
Contributor Author

@benmwebb do you have any idea why ctest doesn't find the tests?

- name: Install dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -qq libboost-all-dev swig libhdf5-serial-dev libeigen3-dev
Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Member

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 Show resolved Hide resolved
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
Copy link
Contributor Author

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?

Copy link
Member

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.

sethaxen and others added 15 commits October 21, 2020 15:15
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.
@sethaxen
Copy link
Contributor Author

sethaxen commented Jan 5, 2021

@benmwebb thanks for the changes. Is this now superseded by the ci.yml workflow in the default branch?

@benmwebb
Copy link
Member

benmwebb commented Jan 5, 2021

Is this now superseded by the ci.yml workflow in the default branch?

No, that in develop is just a stopgap - it does what the old Travis build used to do (just compilation, no tests). (Travis builds stopped working for all our repos because we ran out of credits, so I switched them all to GitHub Actions.) I'd like to run a basic set of tests too, as you're doing here. Something in the nose environment doesn't look quite right yet though (probably because it's trying to run everything in one process, and the tests weren't written with that in mind). I'm gradually replacing nose with pytest in our repos, so I'll probably do that here too rather than mess with nose for too long (unless you want to look at it instead).

@sethaxen
Copy link
Contributor Author

sethaxen commented Jan 5, 2021

Something in the nose environment doesn't look quite right yet though (probably because it's trying to run everything in one process, and the tests weren't written with that in mind). I'm gradually replacing nose with pytest in our repos, so I'll probably do that here too rather than mess with nose for too long (unless you want to look at it instead).

I'll take a stab at it, but no promises.

sethaxen and others added 17 commits January 4, 2021 22:45
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-io
Copy link

codecov-io commented Jan 14, 2021

Codecov Report

❗ No coverage uploaded for pull request base (develop@e5c226f). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e5c226f...8ffe8da. Read the comment docs.

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.

3 participants