Skip to content

Commit 8496ff8

Browse files
committed
Merge pull request #1407 from amanchopra1905/stage
updated the globalPre and globalPosf
1 parent b636bd4 commit 8496ff8

File tree

1 file changed

+26
-18
lines changed

1 file changed

+26
-18
lines changed

docs/deep-dive-into-hyperexecute-yaml.md

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,16 @@ matrix:
7272
***
7373

7474
### `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
7676

7777
```yaml
7878
pre:
7979
- npm install
8080
- mvn install
8181
```
8282

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+
8385
***
8486
## AutoSplit Mode Parameters
8587

@@ -482,14 +484,16 @@ maxRetries: 2
482484
***
483485

484486
### `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.
486488

487489
```yaml
488490
post:
489491
- echo <some-dir>/output/output.log
490492
- curl https://www.example.com
491493
```
492494

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+
493497
***
494498

495499
### `report`
@@ -620,11 +624,11 @@ The uploadArtefact flag is not currently supported for tests running with the **
620624
### `globalPre`
621625
> Currently, only **Linux OS** is supported
622626

623-
The `globalPre` flag allows you to define a pre-execution step that runs once before any task starts. This flag ensures that all necessary setup tasks, such as installing dependencies, configuring environments, or initializing resources, are completed before test execution begins.
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.
624628

625629
#### Functionality
626630
- Runs before any test execution starts, ensuring the environment is properly configured.
627-
- Executed on a separate machine (VM) or the local machine, based on the [test discovery mode](/support/docs/deep-dive-into-hyperexecute-yaml/#mode) selected.
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.
628632
- Useful for setup tasks, such as fetching credentials, initializing databases, or downloading required files.
629633

630634
```yaml title="hyperexecute.yaml"
@@ -639,9 +643,17 @@ globalPre:
639643
#### Parameters
640644
| Parameter | Type | Description |
641645
|-----------|------|-------------|
642-
| mode | string | Defines where the pre-step commands will be executed. Options: local or remote. |
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). |
643647
| commands | list | List of shell commands to execute before test execution begins. |
644648

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 |
655+
|Example Usage | `apt-get update`, `docker pull` | `export ENV=staging` |
656+
645657
***
646658

647659
### `globalPost`
@@ -651,7 +663,7 @@ The `globalPost` flag defines a post-execution step that runs once after all tas
651663

652664
#### Functionality
653665
- Runs after all test execution is completed, ensuring final cleanup and reporting.
654-
- Executed on a separate machine (VM) or the local machine, based on the mode selected.
666+
- Executes on a separate machine (VM) or the local machine, based on the mode selected.
655667
- Useful for cleanup tasks, such as deleting test artifacts, summarizing reports, or deallocating cloud resources.
656668

657669
```yaml title="hyperexecute.yaml"
@@ -666,20 +678,16 @@ globalPost:
666678
#### Parameters
667679
| Parameter | Type | Description |
668680
|-----------|------|-------------|
669-
| mode | string | Defines where the post-step commands will be executed. Options: local or remote. |
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). |
670682
| commands | list | List of shell commands to execute after test execution completes. |
671683

672-
#### Difference between `globalPre`/`globalPost` and `pre`/`post` flags
673-
| Scenario | globalPre | globalPost | pre | post |
674-
|----------|-----------|------------|-----|------|
675-
|Execution Scope | Runs once before all tasks | Runs once after all tasks | Runs before each individual task | Runs after each individual task |
676-
|Execution Frequency | Executes once per entire test execution | Executes once after all tasks complete | Executes once per task | Executes once per task |
677-
|Execution Location | Separate VM or local machine | Separate VM or local machine | Inside the task environment | Inside the task environment |
678-
|Purpose | Global setup (e.g., install dependencies, initialize environment) | Global cleanup (e.g., remove logs, finalize reports) | Task-specific setup (e.g., prepare test data) | Task-specific cleanup (e.g., delete temporary files) |
679-
|Isolation | Runs in a dedicated VM (if remote) | Runs in a dedicated VM (if remote) | Runs in the same task environment | Runs in the same task environment |
680-
|Configuration Placement | Defined globally in the YAML configuration | Defined globally in the YAML configuration | Defined within the task block | Defined within the task block|
681-
|Typical Commands | Install dependencies, start services | Cleanup logs, send reports | Load test-specific configs, set environment variables | Delete temp files, reset configurations
682-
|Example Usage | `apt-get update`, `docker pull` | `rm -rf /logs`, `curl -X POST …` | `export ENV=staging` | `rm -rf temp/*` |
684+
#### Difference between `globalPost` and `post` flags
685+
| Scenario | globalPost | post |
686+
|----------|------------|------|
687+
|Purpose | Global cleanup (e.g., remove logs, finalize reports) | Task-specific cleanup (e.g., delete temporary files) |
688+
|Execution Frequency | Executes once after all tasks complete | Executes once per task |
689+
|Execution Location | Separate VM or local machine | Inside the task environment |
690+
|Example Usage | `rm -rf /logs`, `curl -X POST …` | `rm -rf temp/*` |
683691

684692
***
685693

0 commit comments

Comments
 (0)