Skip to content

Commit

Permalink
Smoke test isolation per package (#23310)
Browse files Browse the repository at this point in the history
  • Loading branch information
ckairen authored Aug 13, 2021
1 parent 9b91128 commit b41f087
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
3 changes: 3 additions & 0 deletions common/SmokeTests/SmokeTest/SmokeTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@

<!-- This is needed to resolve a build conflict and force the correct version -->
<PackageReference Include="System.Net.NameResolution" Version="4.3.0" />

<!-- This is needed for non-nightly smoke test runs -->
<PackageReference Include="Azure.Template" Version="1.0.2" />
</ItemGroup>

<!-- Sample: IoT Hub Connection String Translation -->
Expand Down
30 changes: 15 additions & 15 deletions eng/pipelines/templates/jobs/smoke.tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ parameters:
- name: Daily
type: boolean
default: true
- name: Artifacts
- name: Artifact
type: object
default: []
default: {}
- name: ArtifactName
type: string
default: ""
Expand All @@ -21,19 +21,18 @@ jobs:
displayName: Check Smoke Test Eligibility
steps:
# pipelines only supports template each when it generates the entire script block.
- ${{ each artifact in parameters.Artifacts }}:
- ${{ if and(ne(variables['Skip.Release'], 'true'), ne(artifact.skipPublishPackage, 'true')) }}:
- pwsh: |
$deps = (Select-Xml -Path ./common/SmokeTests/SmokeTest/SmokeTest.csproj `
-Xpath //ItemGroup/PackageReference/@Include).Node.Value
if ($deps.Contains("${{ artifact.name }}")) {
Write-Host "Smoke tests will run for ${{ artifact.name }}"
Write-Host "##vso[task.setvariable variable=RunSmokeTests]true"
} else {
Write-Host "Smoke tests will NOT run for ${{ artifact.name }}"
}
name: check_smoke_tests_${{ artifact.safeName }}
displayName: Check smoke test eligibility for ${{ artifact.name }}
- ${{ if and(ne(variables['Skip.Release'], 'true'), ne(parameters.Artifact.skipPublishPackage, 'true')) }}:
- pwsh: |
$deps = (Select-Xml -Path ./common/SmokeTests/SmokeTest/SmokeTest.csproj `
-Xpath //ItemGroup/PackageReference/@Include).Node.Value
if ($deps.Contains("${{ parameters.Artifact.name }}")) {
Write-Host "Smoke tests will run for ${{ parameters.Artifact.name }}"
Write-Host "##vso[task.setvariable variable=RunSmokeTests]true"
} else {
Write-Host "Smoke tests will NOT run for ${{ parameters.Artifact.name }}"
}
name: check_smoke_tests_${{ parameters.Artifact.safeName }}
displayName: Check smoke test eligibility for ${{ parameters.Artifact.name }}
- pwsh: |
Write-Host "Setting RunSmokeTests to ${env:RunSmokeTests}"
Write-Host "##vso[task.setvariable variable=RunSmokeTests;isOutput=true]${env:RunSmokeTests}"
Expand All @@ -42,6 +41,7 @@ jobs:
RunSmokeTests: $(RunSmokeTests)
- job: SmokeTest
displayName: Run Smoke Test
${{ if eq(parameters.Daily, false) }}:
dependsOn: smoke_test_eligibility
condition: and(succeeded(), eq(dependencies.smoke_test_eligibility.outputs['output_eligibility.RunSmokeTests'], true))
Expand Down
15 changes: 6 additions & 9 deletions eng/pipelines/templates/stages/archetype-net-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,15 +226,12 @@ stages:
PRLabels: "auto-merge"
CloseAfterOpenForTesting: '${{ parameters.TestPipeline }}'

- ${{if and(eq(variables['Build.Reason'], 'Manual'), eq(variables['System.TeamProject'], 'internal'))}}:
- stage: SmokeTest_Release_Packages
displayName: Smoke Test Release Packages
jobs:
- template: /eng/pipelines/templates/jobs/smoke.tests.yml
parameters:
Daily: false
Artifacts: ${{ parameters.Artifacts }}
ArtifactName: ${{ parameters.ArtifactName }}
- ${{if and(eq(variables['Build.Reason'], 'Manual'), eq(variables['System.TeamProject'], 'internal'))}}:
- template: /eng/pipelines/templates/jobs/smoke.tests.yml
parameters:
Daily: false
Artifact: ${{ artifact }}
ArtifactName: ${{ parameters.ArtifactName }}

- stage: Integration
dependsOn: Signing
Expand Down

0 comments on commit b41f087

Please sign in to comment.