Skip to content

Commit 917c90e

Browse files
feat: add inputs for retrying failed tests (#23)
Add retryCount input for setting number of retries to be made on failed test cases. Defaults to no retries made.
1 parent 2a5e3a9 commit 917c90e

2 files changed

Lines changed: 21 additions & 4 deletions

File tree

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# UiPath-Test
22

3-
GitHub Action for running all publishable test cases in UiPath projects. Detailed test results are provided in json format from this action. They can also be found by navigating to the Testing tab in UiPath Orchestrator. Built as a wrapper around the [UiPath CLI task for running tests from a UiPath project.](https://docs.uipath.com/automation-ops/automation-cloud/latest/user-guide/executing-tasks-cli#testing-a-package-or-running-a-test-set)
3+
GitHub Action for running all publishable test cases in UiPath projects. Detailed test results are provided in json format from this action. They can also be found by navigating to the Testing tab in UiPath Orchestrator. Built as a wrapper around the [UiPath CLI task for running tests from a UiPath project.](https://docs.uipath.com/cicd-integrations/standalone/2024.10/user-guide/testing-a-packagerunning-a-test-set)
44

55
The action triggers test cases to be run by robots through UiPath Orchestrator and writes the test result outputs to the [GitHub Actions job summary](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary). See the setup section below on requirements for running test cases.
66

@@ -10,13 +10,13 @@ This action requires the following things to be set up in UiPath Orchestrator:
1010

1111
- UiPath CLI installed on GitHub Actions Runner. This can be done by running the [setup-uipath action](https://github.com/Mikael-RnD/setup-uipath) before this action
1212
- Test robots connected to the target folder/tenant in UiPath Orchestrator
13-
- [An external application created in Orchestrator](https://docs.uipath.com/automation-cloud/automation-cloud/latest/admin-guide/managing-external-applications) with the access scopes specified in the [UiPath CLI documentation](https://docs.uipath.com/automation-ops/automation-cloud/latest/user-guide/executing-tasks-cli#api-access-application-scopes). With the credentials passed to this actions input from GitHub Secrets (or other safe credential stores)
13+
- [An external application created in Orchestrator](https://docs.uipath.com/automation-cloud/automation-cloud/latest/admin-guide/managing-external-applications) with the access scopes specified in the [UiPath CLI documentation](https://docs.uipath.com/cicd-integrations/standalone/2024.10/user-guide/executing-uipath-cli-tasks#api-access-application-scopes). With the credentials passed to this actions input from GitHub Secrets (or other safe credential stores)
1414

1515
## Example usage
1616

1717
### Minimum required inputs
1818

19-
Using the minimum required inputs to this action assumes that the action is intended to run tests for all projects in the repository, targeting a tenant/organization within UiPath Automation Cloud, with the credentials for an external application that has been configured with the default application scopes noted [here.](https://docs.uipath.com/automation-ops/automation-cloud/latest/user-guide/executing-tasks-cli#api-access-application-scopes)
19+
Using the minimum required inputs to this action assumes that the action is intended to run tests for all projects in the repository, targeting a tenant/organization within UiPath Automation Cloud, with the credentials for an external application that has been configured with the default application scopes noted [here.](https://docs.uipath.com/cicd-integrations/standalone/2024.10/user-guide/executing-uipath-cli-tasks#api-access-application-scopes)
2020

2121
```yml
2222
# Run all publishable unit tests from UiPath projects in this repository, targeting an organization and tenant in UiPath Automation Cloud
@@ -50,6 +50,7 @@ The example below illustrates how the action can be used for a repository of mul
5050
orchestratorApplicationSecret: ${{ secrets.ORCHESTRATOR_APP_SECRET }}
5151
orchestratorApplicationScope: "OR.Assets OR.BackgroundTasks OR.Execution OR.Folders OR.Jobs OR.Machines.Read OR.Monitoring OR.Robots.Read OR.Settings.Read OR.TestSets OR.TestSetExecutions OR.TestSetSchedules OR.Users.Read"
5252
orchestratorLogicalName: myorg
53+
retryCount: 1
5354

5455
```
5556

@@ -65,6 +66,7 @@ The example below illustrates how the action can be used for a repository of mul
6566
|**orchestratorApplicationId**|Application ID for the CLI to authenticate with UiPath Orchestrator|True||${{ secrets.ORCHESTRATOR_APP_ID }}|
6667
|**orchestratorApplicationSecret**|Application Secret for the CLI to authenticate with UiPath Orchestrator|True||${{ secrets.ORCHESTRATOR_APP_SECRET }}|
6768
|**orchestratorApplicationScope**|External application scope|False|"OR.Assets OR.BackgroundTasks OR.Execution OR.Folders OR.Jobs OR.Machines.Read OR.Monitoring OR.Robots.Read OR.Settings.Read OR.TestSets OR.TestSetExecutions OR.TestSetSchedules OR.Users.Read"||
69+
|**retryCount**|Number of retries for failed test cases (by default, no retry is set).|False||1|
6870

6971
## Outputs
7072

action.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ inputs:
2727
orchestratorLogicalName:
2828
description: 'Logical name for Orchestrator organization'
2929
required: true
30+
retryCount:
31+
description: 'Number of retries for failed test cases (by default, no retry is set).'
32+
required: false
3033
outputs:
3134
testExecutionLinks:
3235
description: 'Outputs a comma-separated list of Orchestrator links for viewing test results'
@@ -98,6 +101,17 @@ runs:
98101
folderId=$(echo "$responseBody" | jq -r '.value[0].Id')
99102
echo "folderId=$folderId" >> $GITHUB_OUTPUT
100103
104+
- id: set_retry_count
105+
name: Set retry count
106+
shell: bash
107+
run: |
108+
if [ -z "${{ inputs.retryCount }}" ]; then
109+
echo "No retry count provided. Defaulting to 0."
110+
else
111+
echo "retryCount=--retryCount ${{ inputs.retryCount }}" >> $GITHUB_OUTPUT
112+
echo "Retry count set to ${{ inputs.retryCount }}"
113+
fi
114+
101115
- id: run_tests
102116
name: Test
103117
shell: bash
@@ -144,7 +158,8 @@ runs:
144158
--organizationUnit "${{ inputs.orchestratorFolder }}" \
145159
--out uipath \
146160
--result_path "$testResultFilePath" \
147-
--language en-US
161+
--language en-US \
162+
${{ steps.set_retry_count.outputs.retryCount }}
148163
149164
if [ $? -ne 0 ]; then
150165
testsFailed=1

0 commit comments

Comments
 (0)