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

🧪 DEV: Use -e install for tox runs #4375

Merged
merged 6 commits into from Oct 1, 2020

Conversation

chrisjsewell
Copy link
Member

Quick one: Improves startup time for test runs

@chrisjsewell chrisjsewell changed the title Use -e install for tox runs 🧪 DEV: Use -e install for tox runs Sep 16, 2020
@codecov
Copy link

codecov bot commented Sep 16, 2020

Codecov Report

Merging #4375 into develop will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #4375   +/-   ##
========================================
  Coverage    79.22%   79.22%           
========================================
  Files          475      475           
  Lines        34831    34831           
========================================
  Hits         27593    27593           
  Misses        7238     7238           
Flag Coverage Δ
#django 73.07% <ø> (ø)
#sqlalchemy 72.30% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


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 02248cf...8eb2c3f. Read the comment docs.

@ramirezfranciscof
Copy link
Member

So, taking advantage that this is a very succint modification, I thought I might use it to learn a bit more about the CI (I'm not familiar with the details of how it works). What do this 2 lines do exactly?

@chrisjsewell
Copy link
Member Author

So normally tox "installs" the repository into the virtual environment before using it e.g. pip install ., with this option instead it uses pip install -e .. This means that it does not have to copy all the files somewhere, which can be slow, particularly for a package the size of aiida-core.

In general, I would definitely give tox a go. The big selling point, at least for me, is that it makes it easier to develop across multiple repositories, by standardising the test process and handling the setup and maintenance of test environments.
For example already this month I have worked on 16 repos 😬

image

In most of these I have tox setup so that I simply open the local repo folder, type tox and it runs the test suite in a virtual environment, which it ensures is up-to-date with the necessary dependencies.

@chrisjsewell
Copy link
Member Author

Sneaking in an extra docker-compose file as well, just for use in local testing, if you want to use an isolated version of rabbitmq (it explains how to use it in the initial comments)

@chrisjsewell
Copy link
Member Author

chrisjsewell commented Sep 17, 2020

BTW, just messing around trying to get all the tests to pass locally on my macbook (using tox).
With #4379, initializing the rabbitmq docker, installing graphviz, and setting up the ssh key as in .github/workflows/setup.sh

ssh-keygen -q -t rsa -b 4096 -N "" -f ~/.ssh/id_rsa
ssh-keygen -y -f ~/.ssh/id_rsa >> ~/.ssh/authorized_keys
ssh-keyscan -H localhost >> ~/.ssh/known_hosts

and enabling remote login:

image

I'm down to a few outstanding errors:

FAILED tests/cmdline/commands/test_daemon.py::TestVerdiDaemon::test_daemon_restart - AssertionError: SystemExit(<ExitCode.CRITICAL: 1>) is not None : Traceback (most recent call last):
FAILED tests/cmdline/commands/test_daemon.py::TestVerdiDaemon::test_daemon_start - AssertionError: 'daemon-error-not-running' != 'ok'
FAILED tests/cmdline/commands/test_daemon.py::TestVerdiDaemon::test_daemon_start_number - AssertionError: 'daemon-error-not-running' != 'ok'
FAILED tests/cmdline/commands/test_daemon.py::TestVerdiDaemon::test_daemon_start_number_config - AssertionError: 'daemon-error-not-running' != 'ok'
FAILED tests/sphinxext/test_workchain.py::test_workchain_build - AssertionError: assert 2 == 0
FAILED tests/sphinxext/test_workchain.py::test_broken_workchain_build - assert 'The broken workchain says hi!' in '\nException occurred:\n  File "/Users/chrisjsewell/Documents/GitHub/aiida_core_develop/aiida/mana...

@ramirezfranciscof
Copy link
Member

So, just to check, are you still working on this or did you manage to fix the issues and are waiting for me to approve?

@chrisjsewell
Copy link
Member Author

@ramirezfranciscof I resolved the conflict, so you can go ahead an approve

Copy link
Member

@ramirezfranciscof ramirezfranciscof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @chrisjsewell !

pyproject.toml Outdated Show resolved Hide resolved
Co-authored-by: Sebastiaan Huber <mail@sphuber.net>
Copy link
Member

@ramirezfranciscof ramirezfranciscof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, it is not very lengthy but here is the summary of what I understand this PR does that I would include in the commit. I'm not an expert of the CI so maybe @chrisjsewell and @sphuber can take a look and comment what other details should be explained in the message.

"CI: use -e install for tox + add docker-compose for isolated rabbitmq

  • Using the pip install -e . option for tox runs Improves startup time for tests by preventing unnecessary copy of files.

  • The docker-compose yml file allows to set up an isolated rabbitmq instance for local CI testing."

@sphuber
Copy link
Contributor

sphuber commented Oct 1, 2020

Seems like a good description to me, just some minor formatting changes to respect 72 chars max:

CI: use `-e` install for tox + add docker-compose for isolated RabbitMQ

 * Using `pip install -e .` for tox runs improves startup time for tests
   by preventing unnecessary copy of files.
 * The docker-compose yml file allows to set up an isolated RabbitMQ
   instance for local CI testing.

Feel free to update the branch and squash merge with that message

@ramirezfranciscof ramirezfranciscof merged commit 29331b5 into aiidateam:develop Oct 1, 2020
chrisjsewell added a commit to chrisjsewell/aiida_core that referenced this pull request Oct 21, 2020
…MQ (aiidateam#4375)

* Using `pip install -e .` for tox runs improves startup time for tests
   by preventing unnecessary copy of files.

* The docker-compose yml file allows to set up an isolated RabbitMQ
   instance for local CI testing.
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.

None yet

3 participants