ci(azure-pipelines): start postgres container for tests

This commit is contained in:
Sarah Vaupel 2025-02-10 15:04:47 +01:00
parent 258a240a77
commit 084b9258dd

View File

@ -123,30 +123,36 @@ stages:
ArtifactName: 'Build_${{service.name}}'
publishLocation: 'Container'
# - stage: Test
# dependsOn: Setup
# condition: eq(variables.skipTests, false)
# jobs:
# - ${{ each service in parameters.services }}:
# - job: Test_${{service.name}}
# displayName: Compile ${{service.name}}
# dependsOn: ${{service.dependsOn}}
# steps:
# - template: .azure-pipelines/templates/steps/make.yaml
# parameters:
# makeJob: lint
# makeService: ${{service.name}}
# - template: .azure-pipelines/templates/steps/make.yaml
# parameters:
# makeJob: test
# makeService: ${{service.name}}
# - job: TestReport_${{service.name}}
# displayName: Upload test reports for ${{service.name}}
# steps:
# - script: echo "Work in progress" # TODO
- stage: Test
dependsOn: Setup
condition: eq(variables.skipTests, false)
jobs:
- task: Bash@3
displayName: Start database container for testing
inputs:
targetType: inline
script: |
docker run -d devfra.azurecr.io/de.fraport.trusted/postgres:16.1-bookworm
- ${{ each service in parameters.services }}:
- job: Test_${{service.name}}
displayName: Run ${{service.name}} tests
dependsOn: ${{service.dependsOn}}
steps:
- template: .azure-pipelines/templates/steps/make.yaml
parameters:
makeJob: lint
makeService: ${{service.name}}
- template: .azure-pipelines/templates/steps/make.yaml
parameters:
makeJob: test
makeService: ${{service.name}}
- job: TestReport_${{service.name}}
displayName: Upload test reports for ${{service.name}}
steps:
- script: echo "Work in progress" # TODO
- stage: Release
dependsOn: Build # TODO include Test iff not skipped
dependsOn: Test
condition: or(eq(variables.forceRelease, true), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
jobs:
- template: .azure-pipelines/templates/jobs/release.yaml