-
Notifications
You must be signed in to change notification settings - Fork 192
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
Run tests with a realistic version of git #2043
Conversation
a890a63
to
ffdae0d
Compare
Codecov Report
@@ Coverage Diff @@
## dev #2043 +/- ##
==========================================
- Coverage 67.76% 67.61% -0.15%
==========================================
Files 43 43
Lines 5559 5558 -1
==========================================
- Hits 3767 3758 -9
- Misses 1792 1800 +8
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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 think this makes a lot of sense, but we could also just alert people who have an outdated version of git installed to please update. That might be the simpler solution.
The git customization adds 20+ seconds to the test setup - We might want to somehow set a sunset trigger for this to remove it once newer versions of git can be reasonably expected. This could be in an issue, or as a trigger in the setup that fails when the installed git version after the setup is newer than some version.
.github/workflows/pytest.yml
Outdated
sudo apt remove git git-man | ||
sudo add-apt-repository --remove ppa:git-core/ppa | ||
sudo apt install git |
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 am not knowledgable enough to judge this, but isn't there an apt update
missing before the installation? Or is it intentionally missing?
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.
apt update
is needed when you add a new source and need to update package information. When you remove a source, there is no new info to get :)
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 meant between the repository removal and the install. I figured running update after removing the repository might change what package install pulls.
That's a great catch, thank you! |
Thanks for the quick replies! @fabianegli I think few people are likely to add their own PPA to get the latest version and will just go with the latest version available in the official Ubuntu repository (2.17 for Ubuntu 18.04 and 2.25 for Ubuntu 20.04). Ubuntu 20.04 will be supported until 2025-04 and I think we should do just the same. Some people just don't have the option to update the system they are given access to. I think in general it makes sense to use the git package from the official Ubuntu repository rather than from the custom PPA, so I'd rather keep this even in the future. I think that, as much as possible, the test environment should look like what users will have. I mean the bugs we found were due to the new default branch feature but it could be something else with future versions of git. |
@Aratz I agree with you for basically everything. |
Related, but a separate issue: #2044 |
I think I've managed to fix it. I've creating a release on my own fork for validation purposes. The tests fail for unrelated reasons but the full matrix was scheduled at least: https://github.com/Aratz/nf-core-tools/actions/runs/3547118628/jobs/5956896579#step:7:81 |
It would be nice to have a way to query our past runs to see how often specific python versions had failing tests while others succeeded to get some data on wether dropping all in-between version tests for both ubuntu version is reasonable. Otherwise I would try to keep testing all Python versions on the newer Ubuntu release. |
.github/workflows/pytest.yml
Outdated
steps: | ||
- id: set-matrix | ||
run: | | ||
if [ ${{ github.event_name }} == "release" ]; then |
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.
If we run this only for PRs towards master
(which is basically a release) the logic might be bit simpler no?
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'm not sure I follow, do you mean the select-strategy
job should run only on PR that target master
? I think this becomes a problem in the pytest
job because of the needs: select-strategy
line, i.e. the way it is written it is expected select-strategy
is run in all cases.
I've tried to implement this using only "workflow logic" but couldn't really come up with a good solution, so that's why I had to incorporate these bash lines instead.
@fabianegli hmm, yes in that case the workflow description would be much simpler actually. Maybe testing every python version on ubuntu-22.04 and only python-3.8 on ubuntu-20.04 (that is, the version available on the official repository) is enough? |
@Aratz yes, I think this would suffice. We'd then have the tests for the "frozen system" Ubuntu 20.04 with it's original python and git version plus a more comprehensive approach regarding Python versions on "ubuntu-latest". And now I am thinking that it might be preferable to set the test up in a separate workflow named something like "pytest-frozen-ubuntu-20.04" and keep the current pytest workflow as is - trading some code duplication for easier communication of intent. |
The issue here is that renaming a branch in an empty repository will fail with earlier versions of git (e.g. 2.25), where the default branch is always master anyways.
a257e35
to
755b9f2
Compare
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 think this does what we want/need. Well done @Aratz
This PR fixes the following issues:
test_create
andtest_sync
. This PR also fixes these tests.Additionally, this is at least the second time we encounter bugs that are specific to the version of git being used so maybe we should consider testing with older and newer LTS Ubuntu versions (and their respective versions of git)?
PR checklist
CHANGELOG.md
is updated