|
| 1 | +# LISA Testing Guidelines for Pull Requests |
| 2 | + |
| 3 | +This document provides comprehensive guidelines for generating test suggestions for pull requests (PRs) in the LISA project. These guidelines ensure thorough validation while maintaining cost efficiency and testing relevance. |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +When reviewing or creating PRs, follow these three key areas of testing guidance: |
| 8 | + |
| 9 | +1. **Test Case Selection** - Identify the essential test methods |
| 10 | +2. **Feature Impact Analysis** - Determine affected LISA features |
| 11 | +3. **Image Selection** - Choose appropriate Azure marketplace images |
| 12 | + |
| 13 | +## Copilot Instructions for Code Reviews |
| 14 | + |
| 15 | +**MANDATORY REQUIREMENT:** Every code review must include a test suggestion using the Quick Reference Template provided below. This is required for all pull request reviews to ensure consistent test coverage guidance. |
| 16 | + |
| 17 | +When reviewing any pull request, you must: |
| 18 | + |
| 19 | +1. **Always generate and present the test suggestion block** as part of your review |
| 20 | +2. **Use the exact Quick Reference Template format** (found at the bottom of this document) for copy-paste convenience |
| 21 | +3. **Include all three required components:** |
| 22 | + - Essential integration/end-to-end test method names (using exact method names separated by `|`) |
| 23 | + - Directly impacted LISA feature class names (using exact class names as they appear in codebase) |
| 24 | + - Minimal set of Azure Marketplace images required for validation (using exact image strings from the provided list) |
| 25 | + |
| 26 | +This ensures every code review provides actionable, standardized test guidance that reviewers and contributors can immediately use for validation. |
| 27 | + |
| 28 | +## Test Case Selection Guidelines |
| 29 | + |
| 30 | +### Unit Tests |
| 31 | +- Unit tests are automatically included and should **not** be listed in test suggestions |
| 32 | +- Focus only on integration and end-to-end test recommendations |
| 33 | + |
| 34 | +### Key Test Cases |
| 35 | +- **Identify Essential Tests Only**: Select the minimal set of test cases that validate your specific changes |
| 36 | +- **Use Method Names**: Always specify the exact test method names, never include class names or file paths |
| 37 | + - ✅ Correct: `verify_reboot_in_platform` |
| 38 | + - ❌ Incorrect: `core.provisioning` or `TestProvisioning.verify_reboot_in_platform` |
| 39 | +- **Multiple Test Format**: When suggesting multiple tests, separate method names with a pipe (`|`) for easy copy-paste usage |
| 40 | + - Example: `verify_reboot_in_platform|verify_stop_start_in_platform|verify_resize_operation` |
| 41 | + |
| 42 | +### Test Selection Strategy |
| 43 | +- If your change targets specific functionality, choose tests that directly exercise that functionality |
| 44 | +- If your change is broad or foundational, select representative tests that cover the most likely impact areas |
| 45 | + |
| 46 | +## LISA Features Impact Analysis |
| 47 | + |
| 48 | +### What are LISA Features? |
| 49 | +LISA Features are platform-specific capability classes that represent testable functionality. They serve as requirements for test cases and help identify testing scope. |
| 50 | + |
| 51 | +### Common LISA Features |
| 52 | +Examples include (but are not limited to): |
| 53 | +- `Gpu` - Graphics processing capabilities |
| 54 | +- `Nvme` - NVMe storage functionality |
| 55 | +- `StartStop` - VM start/stop operations |
| 56 | +- `Resize` - VM resizing capabilities |
| 57 | +- `NetworkInterface` - Network interface management |
| 58 | +- `SerialConsole` - Serial console access |
| 59 | +- `Hibernate` - VM hibernation features |
| 60 | + |
| 61 | +### Feature Selection Guidelines |
| 62 | +- List only features **directly impacted** by your changes |
| 63 | +- Use the exact feature class names as they appear in the codebase |
| 64 | +- Consider both primary and secondary impacts of your changes |
| 65 | + |
| 66 | +## Azure Marketplace Image Selection |
| 67 | + |
| 68 | +### Selection Principles |
| 69 | +- **Minimize Cost**: Select only the essential images needed to validate your changes |
| 70 | +- **Maximize Coverage**: Ensure selected images cover the key scenarios affected by your PR |
| 71 | +- **Use Exact Strings**: Always provide the complete image string exactly as listed below for direct copy-paste usage |
| 72 | + |
| 73 | +### When to Select Images |
| 74 | +- **OS-Specific Changes**: Choose images representing the affected operating systems |
| 75 | +- **Architecture Changes**: Include both x64 and ARM64 variants if relevant |
| 76 | +- **Generation Changes**: Consider both Gen1 and Gen2 images if applicable |
| 77 | +- **Distribution Changes**: Select specific Linux distributions if your change is distribution-sensitive |
| 78 | + |
| 79 | +### Available Azure Marketplace Images |
| 80 | + |
| 81 | +Copy the exact string for the images you need: |
| 82 | + |
| 83 | +#### Ubuntu Images |
| 84 | +- `canonical 0001-com-ubuntu-server-jammy 22_04-lts latest` |
| 85 | +- `canonical 0001-com-ubuntu-server-jammy 22_04-lts-arm64 latest` |
| 86 | +- `canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest` |
| 87 | +- `canonical ubuntu-24_04-lts server latest` |
| 88 | +- `canonical ubuntu-24_04-lts server-arm64 latest` |
| 89 | +- `canonical ubuntu-24_04-lts server-gen1 latest` |
| 90 | + |
| 91 | +#### Debian Images |
| 92 | +- `debian debian-11 11 latest` |
| 93 | +- `debian debian-11 11-gen2 latest` |
| 94 | +- `debian debian-12 12 latest` |
| 95 | +- `debian debian-12 12-arm64 latest` |
| 96 | +- `debian debian-12 12-gen2 latest` |
| 97 | + |
| 98 | +#### Azure Linux Images |
| 99 | +- `microsoftcblmariner azure-linux-3 azure-linux-3 latest` |
| 100 | +- `microsoftcblmariner azure-linux-3 azure-linux-3-arm64 latest` |
| 101 | +- `microsoftcblmariner azure-linux-3 azure-linux-3-gen2 latest` |
| 102 | + |
| 103 | +#### Oracle Linux Images |
| 104 | +- `oracle oracle-linux ol810-arm64-lvm-gen2 latest` |
| 105 | +- `oracle oracle-linux ol810-lvm latest` |
| 106 | +- `oracle oracle-linux ol810-lvm-gen2 latest` |
| 107 | +- `oracle oracle-linux ol94-arm64-lvm-gen2 latest` |
| 108 | +- `oracle oracle-linux ol94-lvm latest` |
| 109 | +- `oracle oracle-linux ol94-lvm-gen2 latest` |
| 110 | + |
| 111 | +#### Red Hat Enterprise Linux Images |
| 112 | +- `redhat rhel 8_10 latest` |
| 113 | +- `redhat rhel 810-gen2 latest` |
| 114 | +- `redhat rhel 9_5 latest` |
| 115 | +- `redhat rhel 95_gen2 latest` |
| 116 | +- `redhat rhel-arm64 9_5-arm64 latest` |
| 117 | + |
| 118 | +#### SUSE Linux Enterprise Server Images |
| 119 | +- `suse sles-12-sp5 gen1 latest` |
| 120 | +- `suse sles-12-sp5 gen2 latest` |
| 121 | +- `suse sles-15-sp6 gen1 latest` |
| 122 | +- `suse sles-15-sp6 gen2 latest` |
| 123 | +- `suse sles-15-sp6-arm64 gen2 latest` |
| 124 | + |
| 125 | +## Best Practices Summary |
| 126 | + |
| 127 | +1. **Be Specific**: Use exact method names, feature classes, and image strings |
| 128 | +2. **Be Minimal**: Select only what's necessary to validate your changes |
| 129 | +3. **Be Practical**: Format suggestions for easy copy-paste usage |
| 130 | +4. **Be Comprehensive**: Consider all three areas (tests, features, images) for complete coverage |
| 131 | +5. **Be Cost-Conscious**: Remember that each image selection has cost implications |
| 132 | + |
| 133 | +## Quick Reference Template |
| 134 | + |
| 135 | +When providing test suggestions, use this format: |
| 136 | + |
| 137 | +``` |
| 138 | +**Key Test Cases:** |
| 139 | +verify_reboot_in_platform|verify_stop_start_in_platform|smoke_test |
| 140 | +
|
| 141 | +**Impacted LISA Features:** |
| 142 | +FeatureName1, FeatureName2, FeatureName3 |
| 143 | +
|
| 144 | +**Tested Azure Marketplace Images:** |
| 145 | +- exact image string 1 |
| 146 | +- exact image string 2 |
| 147 | +- exact image string 3 |
| 148 | +``` |
0 commit comments