diff --git a/.pipeline/templates/test-matrix-template-alpine.yml b/.pipeline/templates/test-matrix-template-alpine.yml index af546ee6..735a6bf3 100644 --- a/.pipeline/templates/test-matrix-template-alpine.yml +++ b/.pipeline/templates/test-matrix-template-alpine.yml @@ -1,6 +1,7 @@ -# filepath: .pipeline/templates/test-matrix-template.yml +# filepath: .pipeline/templates/test-matrix-template-alpine.yml parameters: - matrix: {} + # Each entry: { name, container, entry } + targets: [] artifactName: 'Build_Linux' poolName: 'RUST-1ES-POOL-WUS3' poolImageOverride: 'imageOverride -equals RUST-1ES-UBUSLIM' @@ -9,7 +10,11 @@ jobs: - job: Test_Matrix displayName: Linux amd64 strategy: - matrix: ${{ parameters.matrix }} + matrix: + ${{ each target in parameters.targets }}: + ${{ target.name }}: + container: ${{ target.container }} + entry: ${{ target.entry }} pool: name: ${{ parameters.poolName }} demands: diff --git a/.pipeline/templates/test-matrix-template-alpine_arm64.yml b/.pipeline/templates/test-matrix-template-alpine_arm64.yml index 90e16476..f7fef7e0 100644 --- a/.pipeline/templates/test-matrix-template-alpine_arm64.yml +++ b/.pipeline/templates/test-matrix-template-alpine_arm64.yml @@ -32,6 +32,16 @@ parameters: default: 120 jobs: + # ------------------------------------------------------------------ + # SHARED MODE: one SQL host + one matrix test job (musl/Alpine). + # NOTE: the steps block below is structurally identical to the + # per-job mode block further down. They differ only in how + # container/entry/sentinel names are sourced: runtime matrix + # variables $(container)/$(entry)/$(sentinelName) here vs. + # compile-time expressions ${{ target.* }} in per-job mode. + # ADO template constraints prevent further factoring. Keep both + # paths in sync when editing steps. + # ------------------------------------------------------------------ - ${{ if eq(parameters.sqlInstanceMode, 'shared') }}: - template: sql-host-template.yml parameters: @@ -155,6 +165,10 @@ jobs: artifact: '$(sentinelName)-$(System.StageAttempt)' publishLocation: 'pipeline' + # ------------------------------------------------------------------ + # PER-JOB MODE: one SQL host + one test job per matrix entry (musl). + # NOTE: keep in sync with the shared-mode steps block above. + # ------------------------------------------------------------------ - ${{ if eq(parameters.sqlInstanceMode, 'per-job') }}: - ${{ each target in parameters.targets }}: - template: sql-host-template.yml diff --git a/.pipeline/templates/test-matrix-template-arm64.yml b/.pipeline/templates/test-matrix-template-arm64.yml index 80bfdc4a..ce6c5b46 100644 --- a/.pipeline/templates/test-matrix-template-arm64.yml +++ b/.pipeline/templates/test-matrix-template-arm64.yml @@ -46,6 +46,13 @@ parameters: jobs: # ------------------------------------------------------------------ # SHARED MODE: one SQL host + one matrix test job. + # NOTE: the steps block below is structurally identical to the + # per-job mode block further down. They differ only in how + # container/entry/sentinel names are sourced: runtime matrix + # variables $(container)/$(entry)/$(sentinelName) here vs. + # compile-time expressions ${{ target.* }} in per-job mode. + # ADO template constraints prevent further factoring. Keep both + # paths in sync when editing steps. # ------------------------------------------------------------------ - ${{ if eq(parameters.sqlInstanceMode, 'shared') }}: - template: sql-host-template.yml @@ -169,6 +176,7 @@ jobs: # ------------------------------------------------------------------ # PER-JOB MODE: one SQL host + one test job per matrix entry. + # NOTE: keep in sync with the shared-mode steps block above. # ------------------------------------------------------------------ - ${{ if eq(parameters.sqlInstanceMode, 'per-job') }}: - ${{ each target in parameters.targets }}: diff --git a/.pipeline/templates/test-matrix-template.yml b/.pipeline/templates/test-matrix-template.yml index 5d88bc19..6388a4d3 100644 --- a/.pipeline/templates/test-matrix-template.yml +++ b/.pipeline/templates/test-matrix-template.yml @@ -1,12 +1,17 @@ # filepath: .pipeline/templates/test-matrix-template.yml parameters: - matrix: {} + # Each entry: { name, container, entry } + targets: [] jobs: - job: Test_Matrix displayName: Linux amd64 strategy: - matrix: ${{ parameters.matrix }} + matrix: + ${{ each target in parameters.targets }}: + ${{ target.name }}: + container: ${{ target.container }} + entry: ${{ target.entry }} pool: name: RUST-1ES-POOL-WUS3 demands: diff --git a/.pipeline/templates/validation-stages.yml b/.pipeline/templates/validation-stages.yml index 727a7fe1..17de721c 100644 --- a/.pipeline/templates/validation-stages.yml +++ b/.pipeline/templates/validation-stages.yml @@ -498,17 +498,17 @@ stages: - template: test-matrix-template-alpine.yml parameters: artifactName: 'Build_Linux' - matrix: - Alpine3_18: + targets: &alpine_targets + - name: Alpine3_18 container: ghcr.io/microsoft/mssql-rs/import/alpine:3.18 entry: alpine.sh - Alpine3_19: + - name: Alpine3_19 container: ghcr.io/microsoft/mssql-rs/import/alpine:3.19 entry: alpine.sh - Alpine3_20: + - name: Alpine3_20 container: ghcr.io/microsoft/mssql-rs/import/alpine:3.20 entry: alpine.sh - Alpine3_21: + - name: Alpine3_21 container: ghcr.io/microsoft/mssql-rs/import/alpine:3.21 entry: alpine.sh @@ -525,19 +525,7 @@ stages: poolImageOverride: imageOverride -equals RUST-UBUNTU-ARM64 sqlInstanceMode: ${{ parameters.sqlInstanceMode }} sqlImageTag: ${{ parameters.sqlImageTag }} - targets: - - name: Alpine3_18 - container: ghcr.io/microsoft/mssql-rs/import/alpine:3.18 - entry: alpine.sh - - name: Alpine3_19 - container: ghcr.io/microsoft/mssql-rs/import/alpine:3.19 - entry: alpine.sh - - name: Alpine3_20 - container: ghcr.io/microsoft/mssql-rs/import/alpine:3.20 - entry: alpine.sh - - name: Alpine3_21 - container: ghcr.io/microsoft/mssql-rs/import/alpine:3.21 - entry: alpine.sh + targets: *alpine_targets - stage: Test_amd64 dependsOn: @@ -547,30 +535,29 @@ stages: jobs: - template: test-matrix-template.yml parameters: - matrix: - DebianBookworm: + targets: &deb_rhel_targets + - name: DebianBookworm container: ghcr.io/microsoft/mssql-rs/import/debian:bookworm entry: deb-bookworm.sh - AzLinux3: + - name: AzLinux3 container: mcr.microsoft.com/azurelinux/base/core:3.0 entry: azlinux3.sh - RHEL9: + - name: RHEL9 container: ghcr.io/microsoft/mssql-rs/import/redhat/ubi9:latest entry: rhel.sh - OracleLinux9: + - name: OracleLinux9 container: ghcr.io/microsoft/mssql-rs/import/oraclelinux:9 entry: rhel.sh - SLES15: + - name: SLES15 container: registry.suse.com/suse/sle15 entry: sles.sh - Ubuntu22: + - name: Ubuntu22 container: ghcr.io/microsoft/mssql-rs/import/ubuntu:22.04 entry: deb-bookworm.sh - Ubuntu24: + - name: Ubuntu24 container: ghcr.io/microsoft/mssql-rs/import/ubuntu:24.04 entry: deb-bookworm.sh - - stage: Test_arm64 dependsOn: - Build @@ -581,28 +568,7 @@ stages: parameters: sqlInstanceMode: ${{ parameters.sqlInstanceMode }} sqlImageTag: ${{ parameters.sqlImageTag }} - targets: - - name: DebianBookworm - container: ghcr.io/microsoft/mssql-rs/import/debian:bookworm - entry: deb-bookworm.sh - - name: AzLinux3 - container: mcr.microsoft.com/azurelinux/base/core:3.0 - entry: azlinux3.sh - - name: RHEL9 - container: ghcr.io/microsoft/mssql-rs/import/redhat/ubi9:latest - entry: rhel.sh - - name: OracleLinux9 - container: ghcr.io/microsoft/mssql-rs/import/oraclelinux:9 - entry: rhel.sh - - name: SLES15 - container: registry.suse.com/suse/sle15 - entry: sles.sh - - name: Ubuntu22 - container: ghcr.io/microsoft/mssql-rs/import/ubuntu:22.04 - entry: deb-bookworm.sh - - name: Ubuntu24 - container: ghcr.io/microsoft/mssql-rs/import/ubuntu:24.04 - entry: deb-bookworm.sh + targets: *deb_rhel_targets # Merge the mssql-tds Rust coverage from every OS that runs the tests # (Build_Windows, Build_Linux, Test_MacOS) and the mssql-py-core coverage from