Skip to content

feat(plugin): make performance tests opt-in via --performance-tests - #231

Merged
ian-flores merged 7 commits into
mainfrom
feat-perf-opt-in
Apr 30, 2026
Merged

feat(plugin): make performance tests opt-in via --performance-tests#231
ian-flores merged 7 commits into
mainfrom
feat-perf-opt-in

Conversation

@ian-flores

@ian-flores ian-flores commented Apr 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Performance tests (@performance) are now excluded from the default vip verify run; opt in with the new --performance-tests flag.
  • Wired through both the local subprocess and K8s Job paths via a small _extra_keep_from_args() helper.
  • The flag is additive; it has no effect when --categories is also specified (noted in the help text).
  • Marker description updated in plugin.py and pyproject.toml; opt-in status noted on the website.
  • Eight new selftests cover marker assembly, the helper, and K8s categories= propagation.

Closes #211.

Test plan

  • uv run ruff check src/ src/vip_tests/ selftests/ examples/
  • uv run ruff format --check src/ src/vip_tests/ selftests/ examples/
  • uv run pytest selftests/ -v -k "performance or marker" (27 passed)
  • Sanity: vip verify --connect-url ... -- --collect-only shows 0 perf tests by default, >0 with --performance-tests

- Clarify --categories help to point users toward --performance-tests
- Reword --performance-tests help to describe additive behavior accurately
- Extract _extra_keep_from_args() helper to deduplicate local/K8s paths
- Add TestExtraKeepFromArgs selftests covering both opt-in paths
- Clarify --performance-tests help: note it has no effect when --categories
  is also specified, removing the silent-precedence UX sharp edge
- Add TestPerformanceOptIn K8s path integration tests (test_k8s_default_excludes_performance,
  test_k8s_flag_removes_exclusion) to prevent local/K8s marker-expr drift
Copilot AI review requested due to automatic review settings April 30, 2026 00:34

Copilot AI left a comment

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.

Pull request overview

This PR makes the performance test category opt-in so vip verify excludes performance tests by default, and users can include them explicitly via a new --performance-tests flag.

Changes:

  • Exclude performance tests from the default vip verify marker expression, with an override via --performance-tests.
  • Update marker metadata/documentation to indicate performance is excluded by default.
  • Add selftests covering the new CLI behavior (local + K8s command/category assembly).

Reviewed changes

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

Show a summary per file
File Description
website/src/pages/getting-started.astro Updates docs to note performance tests are opt-in via --performance-tests.
src/vip/plugin.py Updates the registered performance marker description to indicate opt-in/default exclusion.
src/vip/cli.py Adds performance to default opt-in exclusions and introduces --performance-tests to re-include it by default.
selftests/test_plugin.py Adds pytester integration tests around performance marker deselection/selection behavior.
selftests/test_cli_verify.py Adds unit tests verifying the CLI marker expression changes (local + K8s paths) and new flag behavior.
pyproject.toml Updates marker listing for performance to indicate opt-in/default exclusion.

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

Comment thread src/vip/cli.py Outdated
Comment on lines 48 to 49
# executed when the user opts in via ``--categories``. These tests check
# VIP's own configuration rather than the Posit deployment.

Copilot AI Apr 30, 2026

Copy link

Choose a reason for hiding this comment

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

The comment above _OPT_IN_CATEGORIES says opt-in categories are only executed when the user opts in via --categories, but this PR also introduces --performance-tests as an opt-in mechanism. Please update the comment so it stays accurate (e.g., mention both --categories and dedicated opt-in flags).

Suggested change
# executed when the user opts in via ``--categories``. These tests check
# VIP's own configuration rather than the Posit deployment.
# executed when the user explicitly opts in, either via ``--categories`` or
# a dedicated opt-in flag (for example ``--performance-tests``). These tests
# check VIP's own configuration rather than the Posit deployment.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Addressed in acc3bf6.

Comment thread selftests/test_plugin.py Outdated
Comment on lines +208 to +221
def test_performance_deselected_by_default(self, selftest_pytester):
"""Performance tests should be deselected when --performance-tests is not passed."""
selftest_pytester.makepyfile(
"""
import pytest

@pytest.mark.performance
def test_load_time():
assert True
"""
)
result = selftest_pytester.runpytest(
"--vip-config=vip.toml", "-v", "-m", "not config_hygiene and not performance"
)

Copilot AI Apr 30, 2026

Copy link

Choose a reason for hiding this comment

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

This test claims to validate behavior when --performance-tests is not passed, but it explicitly sets the marker expression via -m "not config_hygiene and not performance". Either adjust the test/docstring to reflect that it's testing marker-based deselection, or invoke the VIP CLI path that actually controls the default selection.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Addressed in acc3bf6.

Comment thread selftests/test_plugin.py Outdated
Comment on lines +225 to +239
def test_performance_runs_with_flag(self, selftest_pytester):
"""Performance tests should run when --performance-tests equivalent marker is included."""
selftest_pytester.makepyfile(
"""
import pytest

@pytest.mark.performance
def test_load_time():
assert True
"""
)
result = selftest_pytester.runpytest(
"--vip-config=vip.toml", "-v", "-m", "not config_hygiene"
)
result.assert_outcomes(passed=1)

Copilot AI Apr 30, 2026

Copy link

Choose a reason for hiding this comment

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

This test name/docstring implies it exercises the --performance-tests flag, but it doesn't pass that flag (it just omits not performance in the -m expression). Consider renaming/rewording it, or change the test to run through the CLI option that this PR adds.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Addressed in acc3bf6.

Update the _OPT_IN_CATEGORIES comment to mention --performance-tests as
an opt-in mechanism alongside --categories. Replace the two misleading
pytester tests (which manually set -m expressions instead of exercising
the CLI flag) with unit tests that validate marker-expression assembly
through _extra_keep_from_args and _default_marker_expr directly.
@ian-flores
ian-flores marked this pull request as ready for review April 30, 2026 02:05
# Conflicts:
#	selftests/test_cli_verify.py
@ian-flores
ian-flores merged commit 4a8ba2e into main Apr 30, 2026
20 checks passed
@ian-flores
ian-flores deleted the feat-perf-opt-in branch April 30, 2026 02:20
@github-actions

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-04-30 02:20 UTC

@github-actions github-actions Bot mentioned this pull request Apr 30, 2026
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.

feat: disable performance tests by default

2 participants