HyperExecute TestNG Use Cases
This guide outlines common Java + TestNG scenarios for running tests on HyperExecute
Q: How can I ensure my tests operate with the appropriate Java version on HyperExecute?
By default, HyperExecute VMs are provisioned with Java 8. If your project requires another version (e.g., 11, 15, 18, 22), you can use the runtime feature and specify the compatible version in the hyperexecute.yaml.
YAML Example for Java 11
hyperexecute.yaml
runtime:
language: java
version: "11"
Q: What is test discovery in HyperExecute, and how does it help?
Test discovery is the process of pre-identifying the tests (classes, scenarios, or feature files) to be executed.
Why Use Test Discovery?
- Selective Execution → Run only the tests you need.
- Flexibility → Filter by file paths, tags, or custom logic.
- Pre-Execution Preview → Know exactly which tests will run.
Discovery Methods
| Type | Description | Use Case |
|---|---|---|
raw | Runs a shell command to list tests. | Simple, filename/class-based filtering. |
automatic | Uses HyperExecute backend tools (snooper) for discovery. | Tag or scenario-based filtering. |
Examples
Automatic Discovery (Tag-based)
hyperexecute.yaml
testDiscovery:
type: automatic
mode: static
args:
featureFilePaths: web/src/test/resources/features
frameWork: java
specificTags: ["@AccountCombineSet"]
Raw Command Discovery
hyperexecute.yaml
testDiscovery:
type: raw
mode: local
command: grep 'public class' src/test/java/hyperexecute/*.java | awk '{print $3}'
Discovery Modes
- local → Runs discovery on your machine (useful for small/simple projects).
- remote → Runs discovery on HyperExecute VM (recommended for large projects).