Skip to content

Elevate session management V2 tests to e2e#4069

Merged
yrobla merged 1 commit intomainfrom
issue-3867-v4
Mar 11, 2026
Merged

Elevate session management V2 tests to e2e#4069
yrobla merged 1 commit intomainfrom
issue-3867-v4

Conversation

@yrobla
Copy link
Copy Markdown
Contributor

@yrobla yrobla commented Mar 10, 2026

Summary

Replace the unit-level integration tests in pkg/vmcp/session with a comprehensive e2e test suite that validates Session Management V2 behaviour against a real Kubernetes cluster.

Fixes #3867

Type of change

  • Bug fix
  • New feature
  • Refactoring (no behavior change)
  • Dependency update
  • Documentation
  • Other (describe):

Test plan

  • Unit tests (task test)
  • E2E tests (task test-e2e)
  • Linting (task lint-fix)
  • Manual testing (describe below)

Changes

File Change

Does this introduce a user-facing change?

Special notes for reviewers

Large PR Justification

This is a refactor of testing sessions, that includes a comprehensive e2e test and removing redundant ones. Cannot be split.

@yrobla yrobla requested a review from Copilot March 10, 2026 11:30
@github-actions github-actions bot added the size/XL Extra large PR: 1000+ lines changed label Mar 10, 2026
Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Large PR Detected

This PR exceeds 1000 lines of changes and requires justification before it can be reviewed.

How to unblock this PR:

Add a section to your PR description with the following format:

## Large PR Justification

[Explain why this PR must be large, such as:]
- Generated code that cannot be split
- Large refactoring that must be atomic
- Multiple related changes that would break if separated
- Migration or data transformation

Alternative:

Consider splitting this PR into smaller, focused changes (< 1000 lines each) for easier review and reduced risk.

See our Contributing Guidelines for more details.


This review will be automatically dismissed once you add the justification section.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 077e6ef27f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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 refactors the Session Management V2 test suite by elevating tests from the package-level unit integration layer (pkg/vmcp/session/) to a full end-to-end test suite running against a real Kubernetes cluster. It consolidates the previously separate virtualmcp_hmac_secret_test.go e2e file and the sessionv2_integration_test.go unit-integration file into a single, comprehensive new e2e file.

Changes:

  • New file test/e2e/thv-operator/virtualmcp/virtualmcp_session_management_v2_test.go: Adds three Ginkgo Ordered contexts covering HMAC secret auto-management (creation, structure, env-var injection), verification that V2 is disabled by default, and session hijacking prevention with a real in-cluster JWT-issuing OIDC server.
  • Deleted test/e2e/thv-operator/virtualmcp/virtualmcp_hmac_secret_test.go: Tests superseded and consolidated into the new file.
  • Deleted pkg/vmcp/session/sessionv2_integration_test.go: Unit-level integration tests replaced by the new e2e suite.

Reviewed changes

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

File Description
test/e2e/thv-operator/virtualmcp/virtualmcp_session_management_v2_test.go New comprehensive e2e test file consolidating HMAC secret lifecycle, disabled-V2 negative checks, and session hijacking prevention against a real cluster
test/e2e/thv-operator/virtualmcp/virtualmcp_hmac_secret_test.go Deleted; contents superseded by the new consolidated e2e file
pkg/vmcp/session/sessionv2_integration_test.go Deleted; in-process integration tests replaced by the new e2e file (with partial coverage gaps)

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

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.54%. Comparing base (9031587) to head (c307578).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4069      +/-   ##
==========================================
+ Coverage   68.48%   68.54%   +0.05%     
==========================================
  Files         446      446              
  Lines       45573    45573              
==========================================
+ Hits        31211    31237      +26     
+ Misses      11948    11922      -26     
  Partials     2414     2414              

☔ View full report in Codecov by Sentry.
📢 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.

@github-actions github-actions bot added size/XL Extra large PR: 1000+ lines changed and removed size/XL Extra large PR: 1000+ lines changed labels Mar 10, 2026
@github-actions github-actions bot dismissed their stale review March 10, 2026 11:50

Large PR justification has been provided. Thank you!

@github-actions
Copy link
Copy Markdown
Contributor

✅ Large PR justification has been provided. The size review has been dismissed and this PR can now proceed with normal review.

@github-actions github-actions bot added size/XL Extra large PR: 1000+ lines changed and removed size/XL Extra large PR: 1000+ lines changed labels Mar 10, 2026
@yrobla yrobla requested a review from Copilot March 10, 2026 11:55
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

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.


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

@github-actions github-actions bot added size/XL Extra large PR: 1000+ lines changed and removed size/XL Extra large PR: 1000+ lines changed labels Mar 10, 2026
@yrobla yrobla requested a review from Copilot March 10, 2026 13:03
@github-actions github-actions bot added size/XL Extra large PR: 1000+ lines changed and removed size/XL Extra large PR: 1000+ lines changed labels Mar 10, 2026
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

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.


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

@yrobla yrobla force-pushed the issue-3867-v4 branch 2 times, most recently from 9f66b3f to 74945ce Compare March 10, 2026 14:08
@github-actions github-actions bot added size/XL Extra large PR: 1000+ lines changed and removed size/XL Extra large PR: 1000+ lines changed labels Mar 10, 2026
@yrobla yrobla requested a review from Copilot March 10, 2026 14:12
@github-actions github-actions bot added size/XL Extra large PR: 1000+ lines changed and removed size/XL Extra large PR: 1000+ lines changed labels Mar 10, 2026
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

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.


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

@github-actions github-actions bot added size/XL Extra large PR: 1000+ lines changed and removed size/XL Extra large PR: 1000+ lines changed labels Mar 10, 2026
@github-actions github-actions bot added size/XL Extra large PR: 1000+ lines changed and removed size/XL Extra large PR: 1000+ lines changed labels Mar 10, 2026
Replace the unit-level integration tests in pkg/vmcp/session with a
comprehensive e2e test suite that validates Session Management V2
behaviour against a real Kubernetes cluster.

Related-to: #3867
@github-actions github-actions bot added size/XL Extra large PR: 1000+ lines changed and removed size/XL Extra large PR: 1000+ lines changed labels Mar 10, 2026
@yrobla yrobla merged commit de0eb9c into main Mar 11, 2026
81 of 89 checks passed
@yrobla yrobla deleted the issue-3867-v4 branch March 11, 2026 08:46
yrobla added a commit that referenced this pull request Mar 11, 2026
Replace the unit-level integration tests in pkg/vmcp/session with a
comprehensive e2e test suite that validates Session Management V2
behaviour against a real Kubernetes cluster.

Related-to: #3867

Co-authored-by: taskbot <taskbot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XL Extra large PR: 1000+ lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[vMCP] Implement session token hash binding (blocks Phase 2 production rollout)

4 participants