Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MENT-157: build-and-test-orchard-core workflow shouldn't fail if there aren't any tests #118

Merged
merged 11 commits into from
Dec 10, 2022
Merged
2 changes: 2 additions & 0 deletions .github/actions/test-dotnet/Invoke-SolutionTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ $tests = dotnet sln list |
-not [string]::IsNullOrEmpty($result) -and $result.Contains("The following Tests are available")
}

Set-GitHubOutput "test-count" $tests.Length

Write-Output "Starting to execute tests from $($tests.Length) projects."

foreach ($test in $tests) {
Expand Down
7 changes: 4 additions & 3 deletions .github/actions/test-dotnet/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ runs:
"Lombiq_Tests_UI__OrchardCoreUITestExecutorConfiguration__MaxParallelTests=${{ inputs.ui-test-parallelism }}" >> $Env:GITHUB_ENV

- name: Run Tests
id: run-tests
shell: pwsh
working-directory: ${{ inputs.build-directory }}
run: |
Expand All @@ -81,13 +82,13 @@ runs:
# The same is true for the next step as well.
- name: Merge FailureDumps
shell: pwsh
if: success() || failure()
if: (success() || failure()) && steps.run-tests.outputs.test-count != 0
BenedekFarkas marked this conversation as resolved.
Show resolved Hide resolved
run: Merge-FailureDumps -Directory "${{ inputs.build-directory }}"

- name: Upload UI testing artifacts
uses: actions/[email protected]
# We don't need additional conditions, because of the "if-no-files-found" setting.
if: success() || failure()
if: (success() || failure()) && steps.run-tests.outputs.test-count != 0
with:
name: ui-test-failure-dump-${{ steps.setup.outputs.friendly-build-directory-name }}-${{ steps.setup.outputs.runner-suffix }}
path: ${{ inputs.build-directory }}/FailureDumps/
Expand All @@ -96,7 +97,7 @@ runs:
- name: Test Report
# v10
uses: phoenix-actions/test-reporting@93ce19fa5882ebe3969ebdb9ee1024b3d29e776f
if: success() || failure()
if: (success() || failure()) && steps.run-tests.outputs.test-count != 0
with:
name: Test Results (${{inputs.build-directory}}|${{ steps.setup.outputs.runner-suffix }}
path: '${{inputs.build-directory}}/**/*.trx'
Expand Down