Skip to content

Commit b0ba57d

Browse files
authored
Merge pull request #1420 from surishubham/main
Merge pull request #1418 from amanchopra1905/stage
2 parents 5e931d0 + d962147 commit b0ba57d

File tree

2 files changed

+49
-9
lines changed

2 files changed

+49
-9
lines changed

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

Lines changed: 48 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -622,29 +622,48 @@ The uploadArtefact flag is not currently supported for tests running with the **
622622
***
623623

624624
### `globalPre`
625-
> Currently, only **Linux OS** is supported
626-
627625
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.
628626

629627
#### Functionality
630628
- Runs before any test execution starts, ensuring the environment is properly configured.
631629
- 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.
632630
- Useful for setup tasks, such as fetching credentials, initializing databases, or downloading required files.
633631

632+
#### Limitations
633+
- This feature is supported in YAML version 0.1 and 0.2 only.
634+
- `remote` mode is not supported for **XCUI** and **Espresso** framework jobs. Default mode for these frameworks is `local`.
635+
634636
```yaml title="hyperexecute.yaml"
635637
globalPre:
636638
mode: remote #local or remote
637639
commands:
638640
- "echo 'Setting up environment'"
639641
- "apt-get update && apt-get install -y curl"
640642
- "curl -X POST https://api.example.com/init"
643+
runson: win
644+
cache: true
645+
```
646+
647+
:::info
648+
You can also use `beforeAll` as an alias for the `globalPre` command:
649+
650+
```yaml
651+
beforeAll:
652+
commands:
653+
- "apt-get update && apt-get install -y curl"
654+
mode: remote
655+
runson: win
656+
cache: true
641657
```
658+
:::
642659

643660
#### Parameters
644661
| Parameter | Type | Description |
645662
|-----------|------|-------------|
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). |
663+
| mode | string | Defines where the pre-step commands will be executed. <br /> Options: [local or remote](/support/docs/deep-dive-into-hyperexecute-yaml/#mode). Default `mode` is `remote`.|
647664
| commands | list | List of shell commands to execute before test execution begins. |
665+
| runson | string | It specifies the operating system on which all the task would run in case of `remote mode`. By default, it is set to `linux`. |
666+
| cache | boolean | It is used to cache the payload after all commands have executed. It is useful in cases like: <br /> &nbsp;&nbsp;&nbsp; - If you want to made some modification in the payload at runtime by executing some set of commands. <br /> &nbsp;&nbsp;&nbsp; - If the payload is fetched from git source. By caching the payload, git rate limiting can be avoided as the payload will only be fetched once per job with `cache: true`. |
648667

649668
#### Difference between `globalPre` and `pre` flags
650669
| Scenario | globalPre | pre |
@@ -657,29 +676,49 @@ globalPre:
657676
***
658677

659678
### `globalPost`
660-
> Currently, only **Linux OS** is supported
661-
662679
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.
663680

664681
#### Functionality
665682
- Runs after all test execution is completed, ensuring final cleanup and reporting.
666683
- Executes on a separate machine (VM) or the local machine, based on the mode selected.
667684
- Useful for cleanup tasks, such as deleting test artifacts, summarizing reports, or deallocating cloud resources.
668685

686+
#### Limitations
687+
- This feature is supported in YAML version 0.1 and 0.2 only.
688+
- `remote` mode is not supported for **XCUI** and **Espresso** framework jobs. Default mode for these frameworks is `local`.
689+
690+
#### Limitations
691+
- This feature is supported in 0.1 and 0.2 yaml only.
692+
- Remote mode is not supported for XCUI and espresso framework jobs. Default mode for these frameworks is local.
693+
669694
```yaml title="hyperexecute.yaml"
670695
globalPost:
671696
mode: remote #local or remote
672697
commands:
673698
- "echo 'Cleaning up test environment'"
674699
- "rm -rf /tmp/test-results"
675700
- "curl -X POST https://api.example.com/cleanup"
701+
runson: linux
702+
```
703+
704+
:::info
705+
You can also use `afterAll` as an alias for the `globalPost` command:
706+
707+
```yaml
708+
afterAll:
709+
commands:
710+
- "curl -X POST https://api.example.com/cleanup"
711+
mode: local
712+
runson: linux
676713
```
714+
:::
677715

678716
#### Parameters
679717
| Parameter | Type | Description |
680718
|-----------|------|-------------|
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). |
719+
| mode | string | Defines where the post-step commands will be executed. <br /> Options: [local or remote](/support/docs/deep-dive-into-hyperexecute-yaml/#mode). Default `mode` is `remote`. |
682720
| commands | list | List of shell commands to execute after test execution completes. |
721+
| runson | string | It specifies the operating system on which all the task would run in case of `remote mode`. By default, it is set to `linux`. |
683722

684723
#### Difference between `globalPost` and `post` flags
685724
| Scenario | globalPost | post |
@@ -1316,9 +1355,10 @@ if your test loads jquery static library multiple times and for some reason it i
13161355

13171356
> **Note**: These cached resources are not yet shared across VMs. So, each VM has its own copy of cache.
13181357

1358+
<!--
13191359
***
13201360

1321-
### `afterAll`
1361+
### `afterAll`
13221362
It is used to run commands after the job has finished. Currently only local directive is allowed, means that all the commands would be run on the same host on which HyperExecute CLI was run. Running commands in `afterAll` on HyperExecute VMs(remote commands) is not yet supported. Users will have access to all the artifacts when these commands would be run.
13231363
```yaml
13241364
afterAll:
@@ -1329,7 +1369,7 @@ afterAll:
13291369

13301370
For instance you want to further process the artifacts and create a custom PDF. You can use `afterAll` for this purpose wherein custom commands can be invoked. Other use cases can be in case you :
13311371
- Want to run some commands after the job is finished.
1332-
- Want to run these commands from the same host from which hyperexecute-cli is run.
1372+
- Want to run these commands from the same host from which hyperexecute-cli is run. -->
13331373

13341374
<!-- ***
13351375
## `beforeAll`

docs/hyperexecute-yaml-parameters.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ The **HyperExecute YAML** file serves as the foundational component for test exe
162162
| [postDirectives](/support/docs/deep-dive-into-hyperexecute-yaml/#postdirectives) | Map |Similar to post with option to retry. |
163163
| [alwaysRunPostSteps](/support/docs/deep-dive-into-hyperexecute-yaml/#alwaysrunpoststeps) | Boolean | Execute the Post Steps in every scenario case |
164164
| [cacheTestURL](/support/docs/deep-dive-into-hyperexecute-yaml/#cachetesturl) | Boolean |It enables users to cache static test files. |
165-
| [afterAll](/support/docs/deep-dive-into-hyperexecute-yaml/#afterall) | Map |It is used to run commands after the job has finished. |
165+
<!-- | [afterAll](/support/docs/deep-dive-into-hyperexecute-yaml/#afterall) | Map |It is used to run commands after the job has finished. | -->
166166
| [project](/support/docs/deep-dive-into-hyperexecute-yaml/#project) | String | Segregate data at a project/repo level |
167167
| [slackChannel](/support/docs/deep-dive-into-hyperexecute-yaml/#slackchannel) | String | Allows you to receive notifications of your Job updates directly in your preferred Slack channel. |
168168
| [afterEachScenario](/support/docs/deep-dive-into-hyperexecute-yaml/#aftereachscenario) | List of Strings | Allows you to trigger your define tasks after each test scenario. |

0 commit comments

Comments
 (0)