What You’ll Learn
- The power of branching VM states at decision points
- Parallel test execution across different scenarios
- How to save time compared to traditional testing workflows
Prerequisites
- Vers CLI installed and authenticated
- Basic familiarity with command-line tools
Project Overview
We’ll demonstrate parallel testing workflows using VM branching. Instead of repeating setup steps for each test scenario, we’ll:- Set up once: Create a VM and install dependencies
- Branch at decision points: Capture the state right before testing
- Test in parallel: Run different test scenarios simultaneously
Step 1: Project Setup
Initialize the Project
Configure the Environment
Edit the generatedvers.toml to allocate sufficient resources:
Step 2: Launch and Set Up the Environment
Start the VM
- Creates the root VM
- Sets an alias “root” for easy reference
Connect and Set Up Dependencies
Verify the Setup
Step 3: The Critical Branch Point
This is where Vers shines. Instead of repeating all this setup for each test scenario, we’ll branch the VM state.Create Your First Branch
Create Additional Branches
Step 4: Run Parallel Tests
View Your VMs
- Root VM: Running parent with the base state
- Scenario A/B/C VMs: Running children for different tests
Execute Tests Non-Interactively
Parallel Testing Workflow
For true parallelism, open multiple terminals: Terminal 1:Step 5: The Time Savings
Traditional Approach (Without Vers)
Vers Approach
Step 6: Cleanup
Delete Branches
Or Delete Everything
Advanced Patterns
Checkpoint and Branch
Create checkpoints at different stages of your workflow:Nested Branching
Create branches of branches for complex test trees:Key Takeaways
- Branch Instead of Rebuild: Use
vers branchto capture state at decision points - Parallel Execution: Run tests simultaneously across multiple terminals
- State Inheritance: Branches inherit the exact memory and filesystem state
- Time Efficiency: Setup once, test many scenarios
Next Steps
- Explore Core Concepts for deeper understanding
- Learn about VM Access for programmatic control
- Check the CLI Reference for all branching options