Skip to content

[CI] Fail tests validation run if vscode extensions tests fail #9691

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

Merged
merged 5 commits into from
Jun 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -257,23 +257,6 @@ jobs:
--timeout ${{ inputs.testSessionTimeout }}
${{ inputs.extraTestArgs }}

# Save the result of the previous steps - success or failure
# in the form of a file result-success/result-failure -{name}.rst
- name: Store result - success
if: ${{ success() }}
run: touch result-success-${{ inputs.testShortName }}.rst
- name: Store result - failure
if: ${{ !success() }}
run: touch result-failed-${{ inputs.testShortName }}.rst

# Upload that result file to artifact named test-job-result-{name}
- name: Upload test result
if: always()
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
with:
name: test-job-result-${{ inputs.testShortName }}-${{ inputs.os }}
path: result-*.rst

- name: Dump docker info
if: ${{ always() && inputs.os == 'ubuntu-latest' }}
run: |
Expand Down
30 changes: 18 additions & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ jobs:
requiresTestSdk: true

endtoend_tests:
name: EndToEnd ${{ matrix.os }}
name: EndToEnd Linux
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming in the future we plan on adding the windows and osx matrix and then we'll revert this back?

uses: ./.github/workflows/run-tests.yml
needs: build_packages
with:
Expand Down Expand Up @@ -213,22 +213,25 @@ jobs:
with:
name: aspire-extension
path: extension/out/aspire-extension.vsix

results: # This job is used for branch protection. It ensures all the above tests passed
if: ${{ always() && github.repository_owner == 'dotnet' }}
runs-on: ubuntu-latest
name: Final Results
needs: [ integrations_test_lin, integrations_test_win, integrations_test_macos, templates_test_lin, templates_test_win, templates_test_macos, endtoend_tests, extension_tests_win ]
needs: [
endtoend_tests,
extension_tests_win,
integrations_test_lin,
integrations_test_macos,
integrations_test_win,
templates_test_lin,
templates_test_macos,
templates_test_win
]
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

# get all the test-job-result* artifacts into a single directory
- uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
with:
pattern: test-job-result-*
merge-multiple: true
path: test-job-result

- uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
with:
pattern: logs-*-ubuntu-latest
Expand Down Expand Up @@ -266,7 +269,10 @@ jobs:
${{ github.workspace }}/testresults
--combined

# return success if zero result-failed-* files are found
- name: Compute result
- name: Fail if any dependency failed
# 'skipped' can be when a transitive dependency fails and the dependent job gets 'skipped'.
# For example, one of setup_* jobs failing and the Integration test jobs getting 'skipped'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a list of all potential values for result? Wondering if it would be best to compare if result does not equal success

if: ${{ always() && (contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped')) }}
run: |
[ 0 -eq $(find test-job-result -name 'result-failed-*' | wc -l) ]
echo "One or more dependent jobs failed."
exit 1