-
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
add docs to commit new files before pytest #2316
Conversation
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.
Nice! we could also print a warning if we see uncommited modules or do you think that is not that easy to check?
Codecov Report
@@ Coverage Diff @@
## dev #2316 +/- ##
==========================================
- Coverage 73.05% 72.93% -0.13%
==========================================
Files 78 78
Lines 8732 8763 +31
==========================================
+ Hits 6379 6391 +12
- Misses 2353 2372 +19
|
We don't use git in this command, so we would need to import |
One can definitively check if there are uncommitted changes in the whole working tree with |
@@ -179,6 +180,11 @@ def _run_pytests(self): | |||
console = rich.console.Console() | |||
console.rule(self.component_name, style="black") | |||
|
|||
# Check uncommitted changed | |||
repo = Repo(self.dir) | |||
if repo.is_dirty(): |
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.
Can we set an option to ignore this? Sorry for being particular 🙂
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.
It is only a warning, do we need to ignore it? Maybe better to capture possible errors, so it doesn't fail, in case someone doesn't have a repo or something similar
The command
nf-core modules test
runs tests using pytest. We use the pytest argument--git-aware
.This argument is used to avoid copying the whole
.git
directory and files ignored by git.It will only include files listed by
git ls-files
.In order to test a new module or subworkflow, the new files have to be committed, otherwise they will be ignored. This was reported in #2235 and nf-core Slack.
This PR adds documentation to advise committing changes before running the command, as it is better to keep the argument
--git-aware
.It throws a warning if there are uncommitted changes:
PR checklist
CHANGELOG.md
is updateddocs
is updated