You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/deep-dive-into-hyperexecute-yaml.md
+76-2Lines changed: 76 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,14 +72,16 @@ matrix:
72
72
***
73
73
74
74
### `pre`
75
-
All actions you need to perform before test execution, such as installing dependencies. You’ll ideally want to use this parameter to "pre" run simple commands like `npm install`, `yarn install`, `mvn install` etc
75
+
All actions you need to perform before each test execution, such as installing dependencies. You’ll ideally want to use this parameter to "pre" run simple commands like `npm install`, `yarn install`, `mvn install` etc
76
76
77
77
```yaml
78
78
pre:
79
79
- npm install
80
80
- mvn install
81
81
```
82
82
83
+
>📘 Refer to [globalPre](/support/docs/deep-dive-into-hyperexecute-yaml/#globalpre) command to perform a common global setup for all your tasks, such as installing dependencies or configuring environments.
84
+
83
85
***
84
86
## AutoSplit Mode Parameters
85
87
@@ -482,14 +484,16 @@ maxRetries: 2
482
484
***
483
485
484
486
### `post`
485
-
This parameter is used for executing actions after all your tests are executed, such as printing an output file or uploading a report via a curl API request. It's ideal for performing post-run tasks.
487
+
This parameter is used for executing actions after every test execution, such as printing an output file or uploading a report via a curl API request. It's ideal for performing post-run tasks.
486
488
487
489
```yaml
488
490
post:
489
491
- echo <some-dir>/output/output.log
490
492
- curl https://www.example.com
491
493
```
492
494
495
+
>📘 Refer to [globalPost](/support/docs/deep-dive-into-hyperexecute-yaml/#globalpost) command to perform a common global setup for all your tasks, such as clean up tasks and or killing the environments.
496
+
493
497
***
494
498
495
499
### `report`
@@ -617,6 +621,76 @@ The uploadArtefact flag is not currently supported for tests running with the **
617
621
618
622
***
619
623
624
+
### `globalPre`
625
+
> Currently, only **Linux OS** is supported
626
+
627
+
The `globalPre` flag allows you to define a pre-execution step that runs once before any of your tasks starts. This flag ensures that all necessary setup tasks, such as installing dependencies, configuring environments, or initializing resources, are completed before test execution begins.
628
+
629
+
#### Functionality
630
+
- Runs before any test execution starts, ensuring the environment is properly configured.
631
+
- Executes on a separate machine (VM) or the local machine, based on the [test discovery mode](/support/docs/deep-dive-into-hyperexecute-yaml/#mode) selected.
632
+
- Useful for setup tasks, such as fetching credentials, initializing databases, or downloading required files.
633
+
634
+
```yaml title="hyperexecute.yaml"
635
+
globalPre:
636
+
mode: remote #local or remote
637
+
commands:
638
+
- "echo 'Setting up environment'"
639
+
- "apt-get update && apt-get install -y curl"
640
+
- "curl -X POST https://api.example.com/init"
641
+
```
642
+
643
+
#### Parameters
644
+
| Parameter | Type | Description |
645
+
|-----------|------|-------------|
646
+
| mode | string | Defines where the pre-step commands will be executed. <br /> Options: [local or remote](/support/docs/deep-dive-into-hyperexecute-yaml/#mode). |
647
+
| commands | list | List of shell commands to execute before test execution begins. |
648
+
649
+
#### Difference between `globalPre` and `pre` flags
650
+
| Scenario | globalPre | pre |
651
+
|----------|-----------|-----|
652
+
|Purpose | Global setup (e.g., install dependencies, initialize environment) | Task-specific setup (e.g., prepare test data) |
653
+
|Execution Frequency | Executes once per entire test execution | Executes once per task |
654
+
|Execution Location | Separate VM or local machine | Inside the task environment |
The `globalPost` flag defines a post-execution step that runs once after all tasks have completed. This step ensures that cleanup tasks, such as removing temporary files, logging results, or notifying external systems, are performed after test execution.
663
+
664
+
#### Functionality
665
+
- Runs after all test execution is completed, ensuring final cleanup and reporting.
666
+
- Executes on a separate machine (VM) or the local machine, based on the mode selected.
667
+
- Useful for cleanup tasks, such as deleting test artifacts, summarizing reports, or deallocating cloud resources.
668
+
669
+
```yaml title="hyperexecute.yaml"
670
+
globalPost:
671
+
mode: remote #local or remote
672
+
commands:
673
+
- "echo 'Cleaning up test environment'"
674
+
- "rm -rf /tmp/test-results"
675
+
- "curl -X POST https://api.example.com/cleanup"
676
+
```
677
+
678
+
#### Parameters
679
+
| Parameter | Type | Description |
680
+
|-----------|------|-------------|
681
+
| mode | string | Defines where the post-step commands will be executed. <br /> Options: [local or remote](/support/docs/deep-dive-into-hyperexecute-yaml/#mode). |
682
+
| commands | list | List of shell commands to execute after test execution completes. |
683
+
684
+
#### Difference between `globalPost` and `post` flags
Copy file name to clipboardExpand all lines: docs/hyperexecute-yaml-parameters.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -131,6 +131,8 @@ The **HyperExecute YAML** file serves as the foundational component for test exe
131
131
132
132
| Key | Type | Description|
133
133
|-----|------|------------|
134
+
|[globalPre](/support/docs/deep-dive-into-hyperexecute-yaml/#globalpre)| Map | This flag runs once before all tasks start, used for global setup such as installing dependencies or configuring environments. |
135
+
|[globalPost](/support/docs/deep-dive-into-hyperexecute-yaml/#globalpost)| Map | This flag runs once after all tasks finish, used for global cleanup such as removing logs or finalizing reports. |
134
136
|[failFast](/support/docs/deep-dive-into-hyperexecute-yaml/#failfast)| Map | Flag to fail a job faster if there are `x` consecutive failures. |
135
137
|[differentialUpload](/support/docs/deep-dive-into-hyperexecute-yaml/#differentialupload)| Map | Minimize the time of upload of code. |
136
138
|[background](/support/docs/deep-dive-into-hyperexecute-yaml/#background)| Map |It is used to trigger long-running Application Servers tasks like running WebApps or databases |
0 commit comments