Skip to content

test: cover val substring in emit names#4340

Open
joeydufourd wants to merge 2 commits into
nf-core:devfrom
joeydufourd:fix-val-emit-lint
Open

test: cover val substring in emit names#4340
joeydufourd wants to merge 2 commits into
nf-core:devfrom
joeydufourd:fix-val-emit-lint

Conversation

@joeydufourd

Copy link
Copy Markdown

Refs #3483.

This adds a regression test to ensure output parsing treats val only as a Nextflow output keyword and does not match it inside emit names such as peak_values.

The current parser already handles this case correctly; this test helps prevent regressions.

Tested with:

python -m pytest tests/modules/lint/test_main_nf.py -k "no_partial_keyword_match_in_emit_name"

PR checklist

  • This comment contains a description of changes (with reason)

  • CHANGELOG.md is updated

    • Not updated because this is a test-only regression coverage change with no user-facing behavior change.
  • If you've fixed a bug or added code that should be tested, add tests!

  • Documentation in docs is updated

    • Not updated because this change only adds regression test coverage.

@github-actions

Copy link
Copy Markdown
Contributor

This PR is against the main branch ❌

  • Do not close this PR
  • Click Edit and change the base to dev
  • This CI test will remain failed until you push a new commit

Hi @joeydufourd,

It looks like this pull-request is has been made against the joeydufourd/tools main branch.
The main branch on nf-core repositories should always contain code from the latest release.
Because of this, PRs to main are only allowed if they come from the joeydufourd/tools dev branch.

You do not need to close this PR, you can change the target branch to dev by clicking the "Edit" button at the top of this page.
Note that even after this, the test will continue to show as failing until you push a new commit.

Thanks again for your contribution!

@joeydufourd
joeydufourd changed the base branch from main to dev June 22, 2026 09:37

output:
path("*.txt"), emit: results
val(evaluate_result), emit: evaluation

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this line should already cover you test case, no?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Good point, but I don’t think that line fully covers this case because it has a real val(...) output as well:

val(evaluate_result), emit: evaluation

So even if the parser accidentally matched val inside evaluation, the parsed output type would still look correct. The regression I’m trying to cover is a non-val output where only the emit name contains val, e.g. path(...), emit: peak_values, which would expose a false positive if the parser matches keywords inside emit names!

@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.45%. Comparing base (c36e2a5) to head (d4a0b08).

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mashehu
mashehu force-pushed the fix-val-emit-lint branch from c32463a to d4a0b08 Compare June 22, 2026 11:29
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