Skip to content

Commit

Permalink
DYN-6454 Update smoke test workflow (#14694)
Browse files Browse the repository at this point in the history
* DYN-6454 Update smoke test workflow

* DYN-6454 Update smoke test workflow
  • Loading branch information
avidit authored Dec 6, 2023
1 parent c599f9f commit 51ec92c
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_dynamo_all_net6.0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- name: Save Pull Request Number
env:
PR_NUMBER: ${{ github.event.number }}
run: $PR_NUMBER | Out-File -FilePath pr_number.txt
run: $env:PR_NUMBER | Out-File -FilePath pr_number.txt
- name: Upload Pull Request Artifact
uses: actions/upload-artifact@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_dynamo_all_net8.0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- name: Save Pull Request Number
env:
PR_NUMBER: ${{ github.event.number }}
run: $PR_NUMBER | Out-File -FilePath pr_number.txt
run: $env:PR_NUMBER | Out-File -FilePath pr_number.txt
- name: Upload Pull Request Artifact
uses: actions/upload-artifact@v3
with:
Expand Down
73 changes: 48 additions & 25 deletions .github/workflows/ui_smoke_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ on:
- completed

env:
TEST_EXECUTE_DOWNLOAD_URL: https://downloads.smartbear.com/TestExecute1552SLM.exe
ACTOR: ${{ github.actor }}
WORKFLOW_ID: ${{ github.event.workflow_run.workflow_id }}
RUN_ID: ${{ github.event.workflow_run.id }}
RUN_NAME: ${{ github.event.workflow_run.name }}
RUN_URL: ${{ github.event.workflow_run.html_url }}
TEST_EXECUTE_DOWNLOAD_URL: https://downloads.smartbear.com/TestExecute1559SLM.exe
WORKFLOW_RUN_WORKFLOW_ID: ${{ github.event.workflow_run.workflow_id }}
WORKFLOW_RUN_ID: ${{ github.event.workflow_run.id }}
WORKFLOW_RUN_NAME: ${{ github.event.workflow_run.name }}
WORKFLOW_RUN_HTML_URL: ${{ github.event.workflow_run.html_url }}

jobs:
ui_smoke_tests:
Expand All @@ -30,45 +29,69 @@ jobs:
token: ${{ secrets.DYNAMO_TESTS_TOKEN }}
ref: master
- name: Download TestExecute
run: Invoke-WebRequest -Uri "${{ env.TEST_EXECUTE_DOWNLOAD_URL }}" -OutFile ".\TE.exe"
run: Invoke-WebRequest -Uri $env:TEST_EXECUTE_DOWNLOAD_URL -OutFile ".\TE.exe"
- name: Install TestExecute
shell: cmd
run: .\TE.exe -SilentInstall
- name: Download Build Artifact
uses: dawidd6/action-download-artifact@v2
with:
name: DynamoSandbox
workflow: ${{ env.WORKFLOW_ID }}
run_id: ${{ env.RUN_ID }}
workflow: ${{ env.WORKFLOW_RUN_WORKFLOW_ID }}
run_id: ${{ env.WORKFLOW_RUN_ID }}
path: ${{ github.workspace }}\build
- name: Download Pull Request Artifact
uses: dawidd6/action-download-artifact@v2
with:
name: pr_number
workflow: ${{ env.WORKFLOW_ID }}
run_id: ${{ env.RUN_ID }}
workflow: ${{ env.WORKFLOW_RUN_WORKFLOW_ID }}
run_id: ${{ env.WORKFLOW_RUN_ID }}
path: ${{ github.workspace }}\pr
- name: Set Run Details
run: |
"PR_NUMBER=$(Get-Content -Path ${{ github.workspace }}\pr\pr_number.txt)" | Out-File -FilePath $env:GITHUB_ENV -Append
"CHECK_NAME=$("UI Smoke Tests", $($env:WORKFLOW_RUN_NAME -Split " ")[-1] -Join " - ")" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Run UI Smoke Tests
shell: cmd
run: .github\scripts\run_tests.bat ${{ secrets.TEST_EXECUTE_ACCESS_KEY }} Dynamo\Dynamo.pjs DynamoSandbox SmokeTests
- name: UI Smoke Tests Report
uses: dorny/test-reporter@v1.7.0
- name: Publish Test Report
id: test_report
if: always()
uses: dorny/test-reporter@v1.7.0
with:
name: UI Smoke Test Report
name: ${{ env.CHECK_NAME }}
path: reports/report.xml
reporter: java-junit
- name: Read Pull Request Number
id: read_pr_number
- name: Add Test Summary
if: always()
run: |
"pr_number=$(Get-Content ${{ github.workspace }}\pr\pr_number.txt)" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
- name: Summary
env:
PR_NUMBER: ${{ steps.read_pr_number.outputs.pr_number }}
PR_URL: ${{ format('{0}/{1}/pull', github.server_url, github.repository) }}
if (Test-Path -Path summary.md) {
Get-Content -Path summary.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append
}
- name: Add Run Summary
if: always()
run: |
$run_summary=@"
### Run Summary
Workflow Run: [$env:WORKFLOW_RUN_NAME]($env:WORKFLOW_RUN_HTML_URL)
Check: [$env:CHECK_NAME](${{ steps.test_report.outputs.url_html }})
$(if ($env:PR_NUMBER) {
"Pull Request: [#$env:PR_NUMBER](${{ format('{0}/{1}/pull/{2}', github.server_url, github.repository, env.PR_NUMBER) }})"
})
"@
$run_summary | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append
- name: Add Pull Request Comment
if: always()
env:
GH_TOKEN: ${{ github.token }}
run: |
Get-Content summary.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append
"Actor: @$env:ACTOR" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append
"Workflow Run: [$env:RUN_NAME]($env:RUN_URL)" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append
"Pull Request: [$env:PR_NUMBER]($env:PR_URL/$env:PR_NUMBER)" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append
$pr_comment=@"
## UI Smoke Tests
Test: **${{ steps.test_report.outputs.conclusion }}**. ${{ steps.test_report.outputs.passed }} passed, ${{ steps.test_report.outputs.failed }} failed.
[TestComplete Test Result]($(Get-Content -Path ${{ github.workspace }}\reports\result.txt))
Workflow Run: [${{ github.workflow }}](${{ format('{0}/{1}/actions/runs/{2}', github.server_url, github.repository, github.run_id) }})
Check: [$env:CHECK_NAME](${{ steps.test_report.outputs.url_html }})
"@
if ($env:PR_NUMBER) {
gh pr comment $env:PR_NUMBER --body $pr_comment --repo ${{ github.repository }}
}

0 comments on commit 51ec92c

Please sign in to comment.