8000 test: add e2e smoke test and manual test matrix by angelorc · Pull Request #54 · angelorc/vmsan · GitHub
[go: up one dir, main page]

Skip to content

test: add e2e smoke test and manual test matrix - #54

Merged
angelorc merged 6 commits into
mainfrom
test/e2e-smoke
Mar 9, 2026
Merged

angelorc merged 6 commits into
mainfrom
test/e2e-smoke

Conversation

@angelorc
@angelorc angelorc commented Mar 9, 2026 •
Copy link
Copy Markdown
Owner

Summary

  • Add tests/e2e/smoke.sh — automated bash smoke test with 7 scenarios covering the core vmsan workflow
  • Add tests/e2e/MANUAL-TESTS.md — manual test matrix for scenarios that cannot be fully automated
  • Add changeset for patch release

Smoke test scenarios

# Scenario What it verifies
I1 Full lifecycle create → exec → stop → remove
I2 File transfer upload a file, verify contents via exec
I3 Network deny-all outbound traffic blocked under deny-all policy
I4 Concurrent creates two parallel creates get distinct VM IDs
I5 Force remove remove a running VM with --force
I6 Version check vmsan --version returns valid version
I7 JSON output vmsan list --json produces valid JSON

Requirements

  • KVM-capable host with vmsan installed
  • Root privileges (sudo bash tests/e2e/smoke.sh)
  • jq available on PATH

Test plan

  • Run sudo bash tests/e2e/smoke.sh on a KVM host
  • Verify 7/7 scenarios pass
  • Verify cleanup trap removes all VMs on exit

Summary by CodeRabbit

  • Tests

    • Added an automated e2e smoke test suite with 7 checks covering VM lifecycle, file transfer, network policy enforcement, concurrent creation, forced removal, version output, and JSON/list validation.
  • Documentation

    • Added a manual e2e test matrix with 5 scenarios: base image boot, custom network policy, bandwidth throttling, timeout auto-stop, and multiple runtime verification.
  • Chores

    • Added a patch-version changeset note for vmsan.

@vercel
vercel Bot commented Mar 9, 2026 •
Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
vmsan Ignored Ignored Preview Mar 9, 2026 0:12am

Request Review

@coderabbitai
coderabbitai Bot commented Mar 9, 2026 •
Copy link
Copy Markdown

Warning

Rate limit exceeded

@angelorc has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 2 minutes and 30 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a3c16d6a-d83e-4b7c-9ea6-a80b85bbf51c

📥 Commits

Reviewing files that changed from the base of the PR and between 27f8e1b and 586ed95.

📒 Files selected for processing (2)
  • tests/e2e/MANUAL-TESTS.md
  • tests/e2e/smoke.sh
📝 Walkthrough

Walkthrough

Adds end-to-end testing for vmsan: a new smoke test script with seven test cases, a manual test matrix for KVM hosts, and a changeset entry documenting the addition.

Changes

Cohort / File(s) Summary
Changeset
.changeset/e2e-smoke-tests.md
Adds a patch changeset documenting the e2e smoke tests.
E2E smoke script
tests/e2e/smoke.sh
New standalone shell smoke test implementing seven test cases (lifecycle, file transfer, network policy, concurrent creation, force removal, version output, JSON validation), helpers for VM ID extraction, pass/fail reporting, cleanup, and parallel creation.
Manual test matrix
tests/e2e/MANUAL-TESTS.md
New manual test guidance for KVM-capable hosts with vmsan: five scenarios describing expected behaviors for image boot, policy, bandwidth, timeout, and multiple runtimes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐇 I hopped in quick to run each test,

created VMs and gave my best.
Seven checks beneath the moonlit log,
I guard the builds like carrot-prog.
Hooray — the smoke cleared from the bog! 🎉

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'test: add e2e smoke test and manual test matrix' directly and accurately summarizes the main changes: introduction of automated e2e smoke tests and a manual test matrix document.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch test/e2e-smoke

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.

@coderabbitai coderabbitai Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@tests/e2e/MANUAL-TESTS.md`:
- Line 8: Update the table row that uses `--allowed-domain "*.github.com"` so
the Expectation matches the flag and capitalizes “GitHub”: either add the apex
domain to the flag (e.g., include `--allowed-domain "github.com,*.github.com"`)
or change the Expected column to “Only GitHub subdomains reachable.” Ensure the
word “GitHub” is capitalized in the Expected cell.

In `@tests/e2e/smoke.sh`:
- Around line 99-103: The test treats any non-zero exit from vmsan exec "$VM_ID"
ping ... as a pass, which can mask exec failures or missing ping; update
tests/e2e/smoke.sh to first verify vmsan exec works by running a simple harmless
command (e.g., vmsan exec "$VM_ID" true or echo) and failing the test if that
fails, then run the ping and consider it a pass only if exec succeeded and the
ping command fails with an expected network-blocking indication (check ping's
specific non-zero exit code or stderr text such as "Network is unreachable" /
"connect: Network is unreachable"); reference the existing vmsan exec
invocation, VM_ID, and the I3 fail/pass labels when making these changes.
- Around line 29-33: The extract_vm_id function currently uses a brittle grep
pattern that fails on spaced/pretty JSON; replace its implementation to use jq
to robustly parse the first vmId from possibly-multi-line JSON output (e.g.,
echo "$output" | jq -r '.[0].vmId // .vmId' or a jq filter that returns the
first non-null "vmId"), ensure it still returns an empty string when none found
so VM_IDS handling/cleanup works, and update any call sites relying on
extract_vm_id to keep behavior consistent.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4c3ed79c-a7e3-4d42-ac4d-8809d495cd01

📥 Commits

Reviewing files that changed from the base of the PR and between 77854cf and b62b09a.

📒 Files selected for processing (3)
  • .changeset/e2e-smoke-tests.md
  • tests/e2e/MANUAL-TESTS.md
  • tests/e2e/smoke.sh

Comment thread tests/e2e/MANUAL-TESTS.md Resolved
Comment thread tests/e2e/smoke.sh Resolved
Comment thread tests/e2e/smoke.sh Resolved
@coderabbitai coderabbitai Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
tests/e2e/smoke.sh (1)

48-48: Array element removal leaves empty strings instead of removing the element.

The pattern VM_IDS=("${VM_IDS[@]/$VM_ID/}") performs substring replacement, not element removal. If VM_ID="vm-123", this replaces the substring with empty, leaving "" in the array. The cleanup loop then calls vmsan remove --force "", which fails (benignly due to || true).

This pattern appears at lines 48, 83, 107, 150, and 163.

Consider either accepting the current behavior (cleanup handles it gracefully) or using proper element filtering:

♻️ Proposed helper for correct element removal
+# Remove a VM ID from the tracking array
+remove_vm_id() {
+  local val="$1"
+  local new_arr=()
+  for item in "${VM_IDS[@]+"${VM_IDS[@]}"}"; do
+    [[ -n "$item" && "$item" != "$val" ]] && new_arr+=("$item")
+  done
+  VM_IDS=("${new_arr[@]+"${new_arr[@]}"}")
+}
+
 # Then replace all occurrences like:
-VM_IDS=("${VM_IDS[@]/$VM_ID/}")
+remove_vm_id "$VM_ID"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/e2e/smoke.sh` at line 48, The current use of substring replacement
VM_IDS=("${VM_IDS[@]/$VM_ID/}") leaves empty strings in the VM_IDS array when an
element equals VM_ID; replace that with explicit filtering: iterate the current
VM_IDS array, append only entries not equal to VM_ID into a new array, then
assign VM_IDS to that filtered array so elements are actually removed (apply
this fix to the places using VM_IDS/VM_ID removal and referenced by the cleanup
loop that runs vmsan remove --force "" so it no longer passes empty strings).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@tests/e2e/smoke.sh`:
- Line 48: The current use of substring replacement
VM_IDS=("${VM_IDS[@]/$VM_ID/}") leaves empty strings in the VM_IDS array when an
element equals VM_ID; replace that with explicit filtering: iterate the current
VM_IDS array, append only entries not equal to VM_ID into a new array, then
assign VM_IDS to that filtered array so elements are actually removed (apply
this fix to the places using VM_IDS/VM_ID removal and referenced by the cleanup
loop that runs vmsan remove --force "" so it no longer passes empty strings).

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 921aa2df-60a1-4659-894b-88a4a0c82824

📥 Commits

Reviewing files that changed from the base of the PR and between b62b09a and 27f8e1b.

📒 Files selected for processing (1)
  • tests/e2e/smoke.sh

angelorc added 2 commits March 9, 2026 12:57
- Use jq instead of brittle grep pattern to parse vmId from JSON output
- Add exec pre-check in I3 deny-all test to distinguish network blocking
  from exec failures, and verify ping fails for expected network reasons
- Fix manual test matrix: include apex domain in allowed-domain flag,
  capitalize GitHub, and align expectation text with wildcard behavior
@angelorc
angelorc merged commit d518f9a into main Mar 9, 2026
2 checks passed
@github-actions github-actions Bot mentioned this pull request Mar 9, 2026
@coderabbitai coderabbitai Bot mentioned this pull request Mar 9, 2026
5 tasks done
@angelorc angelorc mentioned this pull request Mar 9, 2026
@angelorc
angelorc deleted the test/e2e-smoke branch March 14, 2026 10:42
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.

1 participant

0