Skip to content

Commit

Permalink
feat: add output indicating if tests were found (#11)
Browse files Browse the repository at this point in the history
Add output containsPublishaleTestCases to indicate if any tests were
triggered by the action
  • Loading branch information
mikael-andersson91 authored Sep 24, 2024
1 parent ab86c58 commit 31d25c3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,4 @@ The example below illustrates how the action can be used for a repository of mul
|:--|:--|
|**testExecutionLinks**|Comma-separated list of URLs to directly access the test execution(s) triggered by this action|
|**testResults**|Markdown formatted table listing the tests that have been run and whether they passed or failed. Each project tested gets its table with a link to the test execution(s) in Orchestrator as part of its header. If no test cases were found for a project, nor set as publishable, a warning message is added.|
|**containsPublishableTestCases**|Boolean value indicating whether any test cases set as publishable were found in the repository|
7 changes: 7 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ outputs:
testResults:
description: 'Markdown formatted table listing the tests that have been run and whether they passed or failed'
value: ${{ steps.run_tests.outputs.testResults }}
containsPublishableTestCases:
description: 'Boolean value indicating whether any test cases set as publishable were found in the repository'
value: ${{ steps.run_tests.outputs.containsPublishableTestCases }}

runs:
using: "composite"
Expand Down Expand Up @@ -169,6 +172,10 @@ runs:
# Create text file with note on tests not existing.
if($repositoryContainsTests -eq 0){
"No publishable UiPath test cases were found in this repository. Testing has been skipped. " | Out-File $testResultsFolder\"test.txt"
Write-Output "containsPublishableTestCases=false" >> $Env:GITHUB_OUTPUT
}
else {
Write-Output "containsPublishableTestCases=true" >> $Env:GITHUB_OUTPUT
}
echo $testResults >> $Env:GITHUB_STEP_SUMMARY
Expand Down

0 comments on commit 31d25c3

Please sign in to comment.