trigger: - master - releases/* pool: QuickTest strategy: matrix: default: NAME: default version2: NAME: version2 views: NAME: views resources: containers: - container: db endpoint: CentronACR image: centron.azurecr.io/centron_db/$(NAME):0213def19b183ffb83ce9649468ad914384c0bcb env: MSSQL_SA_PASSWORD: SA!password ports: - 1433:1433 options: --name db - container: smtp endpoint: CentronACR image: centron.azurecr.io/mailcatcher:latest ports: - 1025:1025 - 1080:1080 options: --name centron-smtp-1 - container: webservice endpoint: CentronACR image: centron.azurecr.io/centron_webservice:latest env: HARDWARE_ID: LinuxV1.ZDhiZjhiZjgtMjIwNS00MWQ1LThiMGEtMjM2ZjZhMzc2MGMz WEBSERVICE_CONFIG: ' http://localhost:1234/CentronService false Server=db,1433; Database=Centron; User Id=SA; Password=SA!password true false false false RadiusServer 30 120 0 ThisIsASecretKey ' command: sh -c "sleep 75;echo $WEBSERVICE_CONFIG > /app/WebServiceConfig.xml;/app/Centron.Host.Console" ports: - "1234:1234" options: --name webservice services: db: db centron-smtp-1: smtp webservice: webservice steps: - checkout: self fetchDepth: 0 - script: 'dotnet build "./src/nexus/CentronNexus.Host/CentronNexus.Host.csproj"' displayName: Build Nexus - script: > dotnet run --project "./src/nexus/CentronNexus.Host/CentronNexus.Host.csproj" > nexus_logs_$(NAME).txt 2>&1 & echo "##vso[task.setvariable variable=NexusPID;]$!" displayName: Run Nexus - script: 'dotnet build "./tests/PlaywrightTests/PlaywrightTests.csproj"' displayName: 'Build playwright tests' - script: './tests/PlaywrightTests/bin/Debug/net8.0/playwright.ps1 install' displayName: 'Install playwright tests' - script: > dotnet test "./tests/PlaywrightTests/PlaywrightTests.csproj" --filter TestCategory=$(NAME) --logger "trx;LogFileName=TestResults.trx" --results-directory "artifacts/tests/playwright/" displayName: 'Run playwright tests' - publish: ./tests/PlaywrightTests/bin/Debug/net8.0/playwright-traces/ artifact: traces_$(NAME)_$(System.JobAttempt) displayName: 'Publish playwright test traces' condition: always() - task: PublishTestResults@2 displayName: 'Publish playwright test results' condition: always() inputs: testResultsFormat: VSTest testResultsFiles: 'artifacts/tests/playwright/TestResults.trx' testRunTitle: 'Playwright Tests' buildConfiguration: 'Release' failTaskOnFailedTests: true - script: 'kill $(NexusPID) || true' displayName: Cleanup Nexus process condition: always() continueOnError: true - publish: nexus_logs_$(NAME).txt artifact: nexus_$(NAME)_$(System.JobAttempt) displayName: Publish Nexus logs condition: always() continueOnError: true - script: docker container logs webservice > webservice_logs_$(NAME).txt || true displayName: Get webservice logs condition: always() - publish: webservice_logs_$(NAME).txt artifact: webservice_$(NAME)_$(System.JobAttempt) displayName: Publish webservice logs condition: always() continueOnError: true - script: docker image prune -f --filter "dangling=true" displayName: Cleanup dangling images condition: always() continueOnError: true