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
+48-8Lines changed: 48 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -622,29 +622,48 @@ The uploadArtefact flag is not currently supported for tests running with the **
622
622
***
623
623
624
624
### `globalPre`
625
-
> Currently, only **Linux OS** is supported
626
-
627
625
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
626
629
627
#### Functionality
630
628
- Runs before any test execution starts, ensuring the environment is properly configured.
631
629
- 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
630
- Useful for setup tasks, such as fetching credentials, initializing databases, or downloading required files.
633
631
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
+
634
636
```yaml title="hyperexecute.yaml"
635
637
globalPre:
636
638
mode: remote #local or remote
637
639
commands:
638
640
- "echo 'Setting up environment'"
639
641
- "apt-get update && apt-get install -y curl"
640
642
- "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
641
657
```
658
+
:::
642
659
643
660
#### Parameters
644
661
| Parameter | Type | Description |
645
662
|-----------|------|-------------|
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`.|
647
664
| 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 /> - If you want to made some modification in the payload at runtime by executing some set of commands. <br /> - 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`. |
648
667
649
668
#### Difference between `globalPre` and `pre` flags
650
669
| Scenario | globalPre | pre |
@@ -657,29 +676,49 @@ globalPre:
657
676
***
658
677
659
678
### `globalPost`
660
-
> Currently, only **Linux OS** is supported
661
-
662
679
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
680
664
681
#### Functionality
665
682
- Runs after all test execution is completed, ensuring final cleanup and reporting.
666
683
- Executes on a separate machine (VM) or the local machine, based on the mode selected.
667
684
- Useful for cleanup tasks, such as deleting test artifacts, summarizing reports, or deallocating cloud resources.
668
685
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
+
669
694
```yaml title="hyperexecute.yaml"
670
695
globalPost:
671
696
mode: remote #local or remote
672
697
commands:
673
698
- "echo 'Cleaning up test environment'"
674
699
- "rm -rf /tmp/test-results"
675
700
- "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
676
713
```
714
+
:::
677
715
678
716
#### Parameters
679
717
| Parameter | Type | Description |
680
718
|-----------|------|-------------|
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`. |
682
720
| 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`. |
683
722
684
723
#### Difference between `globalPost` and `post` flags
685
724
| Scenario | globalPost | post |
@@ -1316,9 +1355,10 @@ if your test loads jquery static library multiple times and for some reason it i
1316
1355
1317
1356
> **Note**: These cached resources are not yet shared across VMs. So, each VM has its own copy of cache.
1318
1357
1358
+
<!--
1319
1359
***
1320
1360
1321
-
### `afterAll`
1361
+
### `afterAll`
1322
1362
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.
1323
1363
```yaml
1324
1364
afterAll:
@@ -1329,7 +1369,7 @@ afterAll:
1329
1369
1330
1370
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 :
1331
1371
- 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. -->
Copy file name to clipboardExpand all lines: docs/hyperexecute-yaml-parameters.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -162,7 +162,7 @@ The **HyperExecute YAML** file serves as the foundational component for test exe
162
162
|[postDirectives](/support/docs/deep-dive-into-hyperexecute-yaml/#postdirectives)| Map |Similar to post with option to retry. |
163
163
|[alwaysRunPostSteps](/support/docs/deep-dive-into-hyperexecute-yaml/#alwaysrunpoststeps)| Boolean | Execute the Post Steps in every scenario case |
164
164
|[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. |-->
166
166
|[project](/support/docs/deep-dive-into-hyperexecute-yaml/#project)| String | Segregate data at a project/repo level |
167
167
|[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. |
168
168
|[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