Skip to content

fix: show failed logs in generated unit tests#3771

Merged
johanneskoester merged 2 commits into
snakemake:mainfrom
fgvieira:unit_tests_print_failed_logs
Oct 3, 2025
Merged

fix: show failed logs in generated unit tests#3771
johanneskoester merged 2 commits into
snakemake:mainfrom
fgvieira:unit_tests_print_failed_logs

Conversation

@fgvieira

@fgvieira fgvieira commented Oct 3, 2025

Copy link
Copy Markdown
Contributor

QC

  • The PR contains a test case for the changes or the changes are already covered by an existing test case.
  • The documentation (docs/) is updated to reflect the changes or this is not necessary (e.g. if the change does neither modify the language nor the behavior or functionalities of Snakemake).

Summary by CodeRabbit

  • Tests
    • Enabled automatic display of failed logs in Snakemake rule tests by adding the --show-failed-logs flag to the test invocation.
    • Improves visibility into failure causes during test runs without altering existing test behavior or configuration.
    • No changes to test logic; only command-line execution updated for clearer diagnostics.

@coderabbitai

coderabbitai Bot commented Oct 3, 2025

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

The ruletest template for Snakemake unit tests now includes the "--show-failed-logs" flag in the subprocess invocation arguments, inserted between "-f" and "-j1". No other logic, control flow, or public interfaces were modified.

Changes

Cohort / File(s) Summary of Changes
Test template flag update
src/snakemake/unit_tests/templates/ruletest.py.jinja2
Inserted the --show-failed-logs flag into the Snakemake command arguments between -f and -j1; no other changes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The PR description still includes the placeholder prompt and lacks any details about the actual changes beyond the QC checklist, leaving reviewers without context on what was implemented or why. Please replace the placeholder comment with a brief summary of the change, for example describing the addition of the --show-failed-logs flag to the ruletest template and its purpose, so reviewers have proper context.
✅ Passed checks (2 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Title Check ✅ Passed The title clearly and concisely summarizes the primary change by indicating that failed logs will now be shown in generated unit tests, matching the addition of the "--show-failed-logs" flag to the test template without extraneous details.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@johanneskoester johanneskoester changed the title fix: show failed logs fix: show failed logs in generated unit tests Oct 3, 2025
@johanneskoester johanneskoester enabled auto-merge (squash) October 3, 2025 15:59
@johanneskoester johanneskoester merged commit 61f4e9b into snakemake:main Oct 3, 2025
58 checks passed
johanneskoester pushed a commit that referenced this pull request Oct 3, 2025
🤖 I have created a release *beep* *boop*
---


##
[9.11.9](v9.11.8...v9.11.9)
(2025-10-03)


### Bug Fixes

* Raise WorkflowError on empty file path in _IOFile.check
([#3769](#3769))
([4249ff7](4249ff7))
* remove id field in notebook cells created by nbformat, thereby
increasing compatibility with different jupyter versions
([#3767](#3767))
([46cf3ed](46cf3ed))
* show failed logs in generated unit tests
([#3771](#3771))
([61f4e9b](61f4e9b))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
@fgvieira fgvieira deleted the unit_tests_print_failed_logs branch October 3, 2025 17:06
kjohnsen pushed a commit to kjohnsen/snakemake that referenced this pull request Dec 15, 2025
<!--Add a description of your PR here-->

### QC
<!-- Make sure that you can tick the boxes below. -->

* [x] The PR contains a test case for the changes or the changes are
already covered by an existing test case.
* [x] The documentation (`docs/`) is updated to reflect the changes or
this is not necessary (e.g. if the change does neither modify the
language nor the behavior or functionalities of Snakemake).


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Tests**
* Enabled automatic display of failed logs in Snakemake rule tests by
adding the --show-failed-logs flag to the test invocation.
* Improves visibility into failure causes during test runs without
altering existing test behavior or configuration.
* No changes to test logic; only command-line execution updated for
clearer diagnostics.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: Johannes Köster <johannes.koester@tu-dortmund.de>
kjohnsen pushed a commit to kjohnsen/snakemake that referenced this pull request Dec 15, 2025
🤖 I have created a release *beep* *boop*
---


##
[9.11.9](snakemake/snakemake@v9.11.8...v9.11.9)
(2025-10-03)


### Bug Fixes

* Raise WorkflowError on empty file path in _IOFile.check
([snakemake#3769](snakemake#3769))
([4249ff7](snakemake@4249ff7))
* remove id field in notebook cells created by nbformat, thereby
increasing compatibility with different jupyter versions
([snakemake#3767](snakemake#3767))
([46cf3ed](snakemake@46cf3ed))
* show failed logs in generated unit tests
([snakemake#3771](snakemake#3771))
([61f4e9b](snakemake@61f4e9b))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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.

2 participants