Skip to content

fix(output): small fixup for output and docs#217

Merged
bdeitte merged 2 commits intomainfrom
small-fixups
Apr 22, 2026
Merged

fix(output): small fixup for output and docs#217
bdeitte merged 2 commits intomainfrom
small-fixups

Conversation

@bdeitte
Copy link
Copy Markdown
Member

@bdeitte bdeitte commented Apr 22, 2026

As I went through the latest (so many good things in here), I noticed two things:

  1. The tests are faster with the parallelization, but there's a new prefix ([gw1] and similar) that doesn't make the output as clean
  2. I never documented the "--filter" flag

bdeitte added 2 commits April 22, 2026 12:55
Strip report.node in pytest_runtest_logreport with tryfirst=True so pytest's
built-in TerminalReporter falls back to its non-xdist verbose format.
Copilot AI review requested due to automatic review settings April 22, 2026 18:31
Copy link
Copy Markdown
Collaborator

@statik statik left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the usability of VIP’s pytest output under xdist parallel runs and updates the Getting Started docs to include the --filter/-f flag.

Changes:

  • Suppress pytest-xdist’s verbose [gw<N>] worker prefix in terminal output by stripping the report.node attribute early in reporting.
  • Add documentation examples for vip verify --filter/-f and adjust the “extra pytest flags” example accordingly.
  • Add a selftest asserting the [gw<N>] prefix does not appear in verbose output under xdist.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
website/src/pages/getting-started.astro Documents --filter/-f usage and updates example commands.
src/vip/plugin.py Adds tryfirst hook ordering and strips report.node to suppress xdist worker prefixes.
selftests/test_plugin.py Adds regression test ensuring [gw<N>] prefixes are not present in stdout under xdist + -v.
Comments suppressed due to low confidence (1)

src/vip/plugin.py:702

  • report.node is stripped before the xdist worker guard (hasattr(_active_config, "workerinput")). This means workers would also have the attribute deleted if it ever exists there, which contradicts the docstring’s “skip processing on workers” intent and could interfere with other plugins that might set report.node on workers. Consider moving the report.node stripping below the worker guard and restricting it to the controller path (and optionally wrapping the deletion in a small try/except AttributeError for robustness).
    # Strip the xdist worker attribute so pytest's built-in TerminalReporter
    # does not prefix each verbose line with ``[gw<N>]``.  Runs before the
    # terminal reporter thanks to ``tryfirst=True``.
    if hasattr(report, "node"):
        del report.node

    if _active_config is None:
        return

    # On xdist workers, skip all processing — the controller handles it.
    # _active_config is a pytest.Config; xdist sets workerinput on worker configs.
    if hasattr(_active_config, "workerinput"):
        return

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@bdeitte bdeitte merged commit 15ff959 into main Apr 22, 2026
24 checks passed
@bdeitte bdeitte deleted the small-fixups branch April 22, 2026 18:38
@github-actions
Copy link
Copy Markdown

PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-04-22 18:38 UTC

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