Skip to content

Commit

Permalink
run connected store tests in separate job with fresh docker-compose (#…
Browse files Browse the repository at this point in the history
…3356)

* run connected store tests in separate job with fresh docker-compose
  • Loading branch information
esmadau authored Feb 8, 2024
1 parent c962930 commit 25dc7a6
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 9 deletions.
25 changes: 25 additions & 0 deletions build/common/run-e2e-connected-store-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
parameters:
externalStorageTests: true

steps:
- task: DownloadBuildArtifacts@0
inputs:
buildType: 'current'
downloadType: 'single'
downloadPath: '$(System.ArtifactsDirectory)'
artifactName: 'IntegrationTests'

- script: dotnet test "Microsoft.Health.Dicom.Web.Tests.E2E.dll" --filter "Category!=bvt-dp & Category!=dicomupdate" --logger trx --results-directory "$(Agent.TempDirectory)/TestResults" -e DicomServer__Features__EnableExternalStore="true"
displayName: 'dotnet test Microsoft.Health.Dicom.Web.Tests.E2E.dll with EnableExternalStore'
workingDirectory: '$(System.ArtifactsDirectory)/IntegrationTests/Microsoft.Health.Dicom.Web.Tests.E2E'
condition: eq(${{ parameters.externalStorageTests }}, true)

- task: PublishTestResults@2
displayName: 'Publish Connected Store Test Results'
condition: succeededOrFailed()
inputs:
testResultsFormat: 'VSTest'
testResultsFiles: '*.trx'
searchFolder: '$(Agent.TempDirectory)/TestResults'
testRunTitle: 'E2E Connected Store Tests'
buildConfiguration: '$(buildConfiguration)'
21 changes: 21 additions & 0 deletions build/common/run-e2e-features-enabled-connected-store-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
steps:
- task: DownloadBuildArtifacts@0
inputs:
buildType: 'current'
downloadType: 'single'
downloadPath: '$(System.ArtifactsDirectory)'
artifactName: 'IntegrationTests'

- script: dotnet test "Microsoft.Health.Dicom.Web.Tests.E2E.dll" --filter "Category=bvt-dp" --logger trx --results-directory "$(Agent.TempDirectory)/TestResults" -e DicomServer__Features__EnableExternalStore="true"
displayName: 'dotnet test Microsoft.Health.Dicom.Web.Tests.E2E.dll with EnableExternalStore'
workingDirectory: '$(System.ArtifactsDirectory)/IntegrationTests/Microsoft.Health.Dicom.Web.Tests.E2E'

- task: PublishTestResults@2
displayName: 'Publish Connected Store Test Results'
condition: succeededOrFailed()
inputs:
testResultsFormat: 'VSTest'
testResultsFiles: '*.trx'
searchFolder: '$(Agent.TempDirectory)/TestResults'
testRunTitle: 'Partitioned Connected Store E2E Tests'
buildConfiguration: '$(buildConfiguration)'
4 changes: 0 additions & 4 deletions build/common/run-e2e-features-enabled-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ steps:
displayName: 'dotnet test Microsoft.Health.Dicom.Web.Tests.E2E.dll'
workingDirectory: '$(System.ArtifactsDirectory)/IntegrationTests/Microsoft.Health.Dicom.Web.Tests.E2E'

- script: dotnet test "Microsoft.Health.Dicom.Web.Tests.E2E.dll" --filter "Category=bvt-dp" --logger trx --results-directory "$(Agent.TempDirectory)/TestResults" -e DicomServer__Features__EnableExternalStore="true"
displayName: 'dotnet test Microsoft.Health.Dicom.Web.Tests.E2E.dll with EnableExternalStore'
workingDirectory: '$(System.ArtifactsDirectory)/IntegrationTests/Microsoft.Health.Dicom.Web.Tests.E2E'

- task: PublishTestResults@2
displayName: 'Publish Test Results'
condition: succeededOrFailed()
Expand Down
5 changes: 0 additions & 5 deletions build/common/run-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ steps:
displayName: 'dotnet test Microsoft.Health.Dicom.Web.Tests.E2E.dll'
workingDirectory: '$(System.ArtifactsDirectory)/IntegrationTests/Microsoft.Health.Dicom.Web.Tests.E2E'

- script: dotnet test "Microsoft.Health.Dicom.Web.Tests.E2E.dll" --filter "Category!=bvt-dp & Category!=dicomupdate" --logger trx --results-directory "$(Agent.TempDirectory)/TestResults" -e DicomServer__Features__EnableExternalStore="true"
displayName: 'dotnet test Microsoft.Health.Dicom.Web.Tests.E2E.dll with EnableExternalStore'
workingDirectory: '$(System.ArtifactsDirectory)/IntegrationTests/Microsoft.Health.Dicom.Web.Tests.E2E'
condition: eq(${{ parameters.externalStorageTests }}, true)

- task: PublishTestResults@2
displayName: 'Publish Test Results'
condition: succeededOrFailed()
Expand Down
32 changes: 32 additions & 0 deletions build/pr/run-e2e-features-enabled-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,35 @@ jobs:
displayName: 'Stop docker-compose'
workingDirectory: 'docker'
condition: always()

- job: SetupAndRunConnectedStore
displayName: 'Feature-Specific E2E Connected Store Tests'
pool:
vmImage: 'ubuntu-latest'
steps:
- task: UseDotNet@2
displayName: 'Use .Net Core sdk'
inputs:
useGlobalJson: true

- script: ContinuousIntegrationBuild=true docker-compose -p healthcare -f docker-compose.yml -f docker-compose.features.yml up --build -d
displayName: 'Run docker-compose'
workingDirectory: 'docker'

- bash: for i in {1..12}; do curl -fsS "$(testEnvironmentUrl)health/check" > /dev/null && exit 0 || sleep 5; done; exit 1
displayName: 'Wait for DICOM Server'

- bash: for i in {1..12}; do curl -fsS "$(testFunctionsUrl)" > /dev/null && exit 0 || sleep 5; done; exit 1
displayName: 'Wait for DICOM Functions'

- template: ../common/run-e2e-features-enabled-connected-store-tests.yml

- script: docker-compose -p healthcare -f docker-compose.yml -f docker-compose.features.yml logs -t
displayName: 'docker-compose logs'
workingDirectory: 'docker'
condition: always()

- script: docker-compose -p healthcare -f docker-compose.yml -f docker-compose.features.yml rm -s -f
displayName: 'Stop docker-compose'
workingDirectory: 'docker'
condition: always()
32 changes: 32 additions & 0 deletions build/pr/run-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,35 @@ jobs:
displayName: 'Stop docker-compose'
workingDirectory: 'docker'
condition: always()

- job: SetupAndRunConnectedStore
displayName: 'E2E Connected Store Tests'
pool:
vmImage: 'ubuntu-latest'
steps:
- task: UseDotNet@2
displayName: 'Use .Net Core sdk'
inputs:
useGlobalJson: true

- script: ContinuousIntegrationBuild=true docker-compose -p healthcare -f docker-compose.yml -f docker-compose.ports.azurite.yml up --build -d
displayName: 'Run docker-compose'
workingDirectory: 'docker'

- bash: for i in {1..12}; do curl -fsS "$(testEnvironmentUrl)health/check" > /dev/null && exit 0 || sleep 5; done; exit 1
displayName: 'Wait for DICOM Server'

- bash: for i in {1..12}; do curl -fsS "$(testFunctionsUrl)" > /dev/null && exit 0 || sleep 5; done; exit 1
displayName: 'Wait for DICOM Functions'

- template: ../common/run-e2e-connected-store-tests.yml

- script: docker-compose -p healthcare -f docker-compose.yml logs -t
displayName: 'docker-compose logs'
workingDirectory: 'docker'
condition: always()

- script: docker-compose -p healthcare -f docker-compose.yml rm -s -f
displayName: 'Stop docker-compose'
workingDirectory: 'docker'
condition: always()

0 comments on commit 25dc7a6

Please sign in to comment.