From 01d223920c2d1a5d59e1f9075753bd2ac668ceea Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Wed, 13 Apr 2022 09:12:49 -0700 Subject: [PATCH 01/32] Represent existing matrix in json --- .../stages/platform-matrix-live.json | 133 ++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 eng/pipelines/templates/stages/platform-matrix-live.json diff --git a/eng/pipelines/templates/stages/platform-matrix-live.json b/eng/pipelines/templates/stages/platform-matrix-live.json new file mode 100644 index 0000000000..f9f60c6ff3 --- /dev/null +++ b/eng/pipelines/templates/stages/platform-matrix-live.json @@ -0,0 +1,133 @@ +{ + "displayNames": { + "_": "" + }, + "include": [ + { + "StaticConfigs": { + "MacOS_x64_with_unit_test": { + "Pool": "Azure Pipelines", + "OSVmImage": "macOS-10.15", + "VCPKG_DEFAULT_TRIPLET": "x64-osx", + "CmakeArgs": " -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_PERFORMANCE_TESTS=ON -DBUILD_SAMPLES=ON", + "AZURE_CORE_ENABLE_JSON_TESTS": 1, + "BuildArgs": "-j 4" + } + } + }, + { + "StaticConfigs": { + "_": { + "VCPKG_DEFAULT_TRIPLET": "x64-linux", + "BuildArgs": "-j 4", + "Pool": "azsdk-pool-mms-ubuntu-1804-general", + "OSVmImage": "MMSUbuntu18.04" + } + }, + "BuildConfig": { + "Linux_x64_gcc5_with_unit_test": { + "CmakeEnvArg": "CC=/usr/bin/gcc-5 CXX=/usr/bin/g++-5 cmake", + "CmakeArgs": " -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON" + }, + "Linux_x64_with_unit_test": { + "CmakeArgs": " -DBUILD_TESTING=ON -DBUILD_PERFORMANCE_TESTS=ON -DRUN_LONG_UNIT_TESTS=ON -DCMAKE_BUILD_TYPE=Debug -DBUILD_CODE_COVERAGE=ON", + "AptDependencies": "gcovr lcov", + "CODE_COVERAGE": "enabled", + "CODE_COVERAGE_COLLECT_ONLY": 1, + "AZURE_CORE_ENABLE_JSON_TESTS": 1 + } + } + }, + { + "StaticConfigs": { + "_": { + "BuildArgs": "-j 4", + "Pool": "azsdk-pool-mms-ubuntu-1804-general", + "OSVmImage": "MMSUbuntu18.04", + "VCPKG_DEFAULT_TRIPLET": "x64-linux" + } + }, + "BuildConfiguration": { + "Ubuntu20_x64_with_unit_test": { + "CmakeArgs": " -DBUILD_TESTING=ON -DBUILD_PERFORMANCE_TESTS=ON -DRUN_LONG_UNIT_TESTS=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_SAMPLES=ON", + "AZURE_CORE_ENABLE_JSON_TESTS": 1 + }, + "Ubuntu20_samples": { + "CmakeArgs": " -DBUILD_TESTING=ON -DBUILD_SAMPLES=ON -DCMAKE_BUILD_TYPE=Release ", + "RunSamples": 1 + }, + "Ubuntu20_x64_no_rtti": { + "CmakeArgs": " -DBUILD_RTTI=OFF -DCMAKE_BUILD_TYPE=Release " + } + } + }, + { + "StaticConfigs": { + "_": { + "Pool": "azsdk-pool-mms-win-2019-general", + "OSVmImage": "MMS2019", + "CMAKE_GENERATOR": "Visual Studio 16 2019" + } + }, + "BuildConfig": { + "Win_x86_with_unit_test_winHttp": { + "VcpkgInstall": "openssl", + "CMAKE_GENERATOR_PLATFORM": "Win32", + "CmakeArgs": " -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_PERFORMANCE_TESTS=ON ", + "VCPKG_DEFAULT_TRIPLET": "x86-windows-static", + "WindowsCtestConfig": "-C Release", + "BuildArgs": "-v --parallel 8 --config Release" + }, + "Win_x86_no_rtti_whit_unit_test": { + "VcpkgInstall": "libxml2 openssl", + "CMAKE_GENERATOR_PLATFORM": "Win32", + "CmakeArgs": " -DBUILD_RTTI=OFF -DBUILD_TESTING=ON -DBUILD_SAMPLES=ON", + "VCPKG_DEFAULT_TRIPLET": "x86-windows-static", + "WindowsCtestConfig": "-C Release", + "BuildArgs": "-v --parallel 8 --config Release" + }, + "Win_x86_with_unit_test_libcurl": { + "CMAKE_GENERATOR_PLATFORM": "Win32", + "VCPKG_DEFAULT_TRIPLET": "x86-windows-static", + "CmakeArgs": " -DBUILD_TRANSPORT_CURL=ON -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_PERFORMANCE_TESTS=ON ", + "BuildArgs": "-v --parallel 8" + }, + "Win_x64_with_unit_test_winHttp": { + "VcpkgInstall": "openssl", + "CMAKE_GENERATOR_PLATFORM": "x64", + "CmakeArgs": " -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_PERFORMANCE_TESTS=ON ", + "BuildArgs": "-v --parallel 8 --config Release", + "AZURE_CORE_ENABLE_JSON_TESTS": 1, + "VCPKG_DEFAULT_TRIPLET": "x64-windows-static", + "WindowsCtestConfig": "-C Release" + }, + "Win_x64_with_unit_samples_winHttp": { + "VcpkgInstall": "openssl", + "VCPKG_DEFAULT_TRIPLET": "x64-windows-static", + "CMAKE_GENERATOR_PLATFORM": "x64", + "CmakeArgs": " -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_PERFORMANCE_TESTS=ON -DBUILD_SAMPLES=ON ", + "BuildArgs": "-v --parallel 8 --config Release", + "AZURE_CORE_ENABLE_JSON_TESTS": 1, + "RunSamples": 1, + "WindowsCtestConfig": "-C Release" + }, + "Win_x64_with_unit_test_libcurl": { + "VCPKG_DEFAULT_TRIPLET": "x64-windows-static", + "CMAKE_GENERATOR_PLATFORM": "x64", + "CmakeArgs": " -DBUILD_TRANSPORT_CURL=ON -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_PERFORMANCE_TESTS=ON ", + "BuildArgs": "-v --parallel 8 --config Release", + "WindowsCtestConfig": "-C Release" + }, + "Win_x64_with_unit_samples_libcurl": { + "VcpkgInstall": "curl[winssl] openssl", + "VCPKG_DEFAULT_TRIPLET": "x64-windows-static", + "CMAKE_GENERATOR_PLATFORM": "x64", + "CmakeArgs": " -DBUILD_TRANSPORT_CURL=ON -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_PERFORMANCE_TESTS=ON -DBUILD_SAMPLES=ON ", + "BuildArgs": "-v --parallel 8 --config Release", + "RunSamples": 1, + "WindowsCtestConfig": "-C Release" + } + } + } + ] +} \ No newline at end of file From d3bcf27dac1254a65a9541ecf3ae19a676f78630 Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Wed, 13 Apr 2022 09:20:44 -0700 Subject: [PATCH 02/32] Use new matrix --- .../templates/jobs/archetype-sdk-tests.yml | 289 +----------------- eng/pipelines/templates/jobs/live.tests.yml | 179 +++++++++++ 2 files changed, 195 insertions(+), 273 deletions(-) create mode 100644 eng/pipelines/templates/jobs/live.tests.yml diff --git a/eng/pipelines/templates/jobs/archetype-sdk-tests.yml b/eng/pipelines/templates/jobs/archetype-sdk-tests.yml index 4edbe88902..5334ad598c 100644 --- a/eng/pipelines/templates/jobs/archetype-sdk-tests.yml +++ b/eng/pipelines/templates/jobs/archetype-sdk-tests.yml @@ -27,276 +27,19 @@ parameters: # https://github.com/Azure/azure-sdk-for-cpp/issues/2944 jobs: -- job: ValidateLive - condition: and(succeededOrFailed(), ne(variables['Skip.LiveTest'], 'true')) - timeoutInMinutes: ${{ parameters.TimeoutInMinutes }} - strategy: - matrix: - Linux_x64_gcc5_with_unit_test: - Pool: azsdk-pool-mms-ubuntu-1804-general - OSVmImage: MMSUbuntu18.04 - VCPKG_DEFAULT_TRIPLET: 'x64-linux' - # Can't set CC and CXX to env because it would affect VCPKG building which requires g++ > 7 - # So, this conf will set the CXX for cmake inline. - CmakeEnvArg: 'CC=/usr/bin/gcc-5 CXX=/usr/bin/g++-5 cmake' - BuildArgs: '-j 4' - CmakeArgs: ' -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON' - Linux_x64_with_unit_test: - Pool: azsdk-pool-mms-ubuntu-1804-general - OSVmImage: MMSUbuntu18.04 - VCPKG_DEFAULT_TRIPLET: 'x64-linux' - CmakeArgs: ' -DBUILD_TESTING=ON -DBUILD_PERFORMANCE_TESTS=ON -DRUN_LONG_UNIT_TESTS=ON -DCMAKE_BUILD_TYPE=Debug -DBUILD_CODE_COVERAGE=ON' - AptDependencies: 'gcovr lcov' - CODE_COVERAGE: '${{ parameters.Coverage }}' - # Avoid re-running tests again for code coverage since the tests were previously ran - CODE_COVERAGE_COLLECT_ONLY: 1 - AZURE_CORE_ENABLE_JSON_TESTS: 1 - BuildArgs: '-j 4' - Ubuntu20_x64_with_unit_test: - Pool: azsdk-pool-mms-ubuntu-1804-general - OSVmImage: MMSUbuntu18.04 - VCPKG_DEFAULT_TRIPLET: 'x64-linux' - CmakeArgs: ' -DBUILD_TESTING=ON -DBUILD_PERFORMANCE_TESTS=ON -DRUN_LONG_UNIT_TESTS=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_SAMPLES=ON' - AZURE_CORE_ENABLE_JSON_TESTS: 1 - BuildArgs: '-j 4' - Ubuntu20_samples: - Pool: azsdk-pool-mms-ubuntu-1804-general - OSVmImage: MMSUbuntu18.04 - VCPKG_DEFAULT_TRIPLET: 'x64-linux' - # Builds samples and run them against the deployed resources. Samples requires Azure Account, so only works on live tests. - CmakeArgs: ' -DBUILD_TESTING=ON -DBUILD_SAMPLES=ON -DCMAKE_BUILD_TYPE=Release ' - BuildArgs: '-j 4' - RunSamples: 1 - Ubuntu20_x64_no_rtti: - Pool: azsdk-pool-mms-ubuntu-1804-general - OSVmImage: MMSUbuntu18.04 - VCPKG_DEFAULT_TRIPLET: 'x64-linux' - CmakeArgs: ' -DBUILD_RTTI=OFF -DCMAKE_BUILD_TYPE=Release ' - BuildArgs: '-j 4' - # Not asking for any transport adapter will default to OS -> windows:winHttp or !windows:libcurl - Win_x86_with_unit_test_winHttp: - Pool: azsdk-pool-mms-win-2019-general - OSVmImage: MMS2019 - VCPKG_DEFAULT_TRIPLET: 'x86-windows-static' - VcpkgInstall: 'openssl' - CMAKE_GENERATOR: 'Visual Studio 16 2019' - CMAKE_GENERATOR_PLATFORM: Win32 - CmakeArgs: ' -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_PERFORMANCE_TESTS=ON ' - BuildArgs: '-v --parallel 8 --config Release' - WindowsCtestConfig: "-C Release" - Win_x86_no_rtti_whit_unit_test: - Pool: azsdk-pool-mms-win-2019-general - OSVmImage: MMS2019 - VcpkgInstall: 'libxml2 openssl' - VCPKG_DEFAULT_TRIPLET: 'x86-windows-static' - CMAKE_GENERATOR: 'Visual Studio 16 2019' - CMAKE_GENERATOR_PLATFORM: Win32 - CmakeArgs: ' -DBUILD_RTTI=OFF -DBUILD_TESTING=ON -DBUILD_SAMPLES=ON' - BuildArgs: '-v --parallel 8 --config Release' - WindowsCtestConfig: "-C Release" - Win_x64_with_unit_test_winHttp: - Pool: azsdk-pool-mms-win-2019-general - VcpkgInstall: 'openssl' - OSVmImage: MMS2019 - VCPKG_DEFAULT_TRIPLET: 'x64-windows-static' - CMAKE_GENERATOR: 'Visual Studio 16 2019' - CMAKE_GENERATOR_PLATFORM: x64 - CmakeArgs: ' -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_PERFORMANCE_TESTS=ON ' - BuildArgs: '-v --parallel 8 --config Release ' - AZURE_CORE_ENABLE_JSON_TESTS: 1 - WindowsCtestConfig: "-C Release" - Win_x64_with_unit_samples_winHttp: - Pool: azsdk-pool-mms-win-2019-general - VcpkgInstall: 'openssl' - OSVmImage: MMS2019 - VCPKG_DEFAULT_TRIPLET: 'x64-windows-static' - CMAKE_GENERATOR: 'Visual Studio 16 2019' - CMAKE_GENERATOR_PLATFORM: x64 - CmakeArgs: ' -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_PERFORMANCE_TESTS=ON -DBUILD_SAMPLES=ON ' - BuildArgs: '-v --parallel 8 --config Release ' - AZURE_CORE_ENABLE_JSON_TESTS: 1 - RunSamples: 1 - WindowsCtestConfig: "-C Release" - # specify libcurl to be used on Windows - Win_x86_with_unit_test_libcurl: - Pool: azsdk-pool-mms-win-2019-general - OSVmImage: MMS2019 - VCPKG_DEFAULT_TRIPLET: 'x86-windows-static' - CMAKE_GENERATOR: 'Visual Studio 16 2019' - CMAKE_GENERATOR_PLATFORM: Win32 - CmakeArgs: ' -DBUILD_TRANSPORT_CURL=ON -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_PERFORMANCE_TESTS=ON ' - BuildArgs: '-v --parallel 8' - #AZURE_CORE_ENABLE_JSON_TESTS: 1 # Testing Json lib on Win+WinHttp only, No need to repeat here as it is independent to the http transport adapter. - Win_x64_with_unit_test_libcurl: - Pool: azsdk-pool-mms-win-2019-general - OSVmImage: MMS2019 - VCPKG_DEFAULT_TRIPLET: 'x64-windows-static' - CMAKE_GENERATOR: 'Visual Studio 16 2019' - CMAKE_GENERATOR_PLATFORM: x64 - CmakeArgs: ' -DBUILD_TRANSPORT_CURL=ON -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_PERFORMANCE_TESTS=ON ' - BuildArgs: '-v --parallel 8 --config Release ' - WindowsCtestConfig: "-C Release" - #AZURE_CORE_ENABLE_JSON_TESTS: 1 # Testing Json lib on Win+WinHttp only, No need to repeat here as it is independent to the http transport adapter. - Win_x64_with_unit_samples_libcurl: - Pool: azsdk-pool-mms-win-2019-general - OSVmImage: MMS2019 - VcpkgInstall: 'curl[winssl] openssl' - VCPKG_DEFAULT_TRIPLET: 'x64-windows-static' - CMAKE_GENERATOR: 'Visual Studio 16 2019' - CMAKE_GENERATOR_PLATFORM: x64 - CmakeArgs: ' -DBUILD_TRANSPORT_CURL=ON -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_PERFORMANCE_TESTS=ON -DBUILD_SAMPLES=ON ' - BuildArgs: '-v --parallel 8 --config Release ' - RunSamples: 1 - WindowsCtestConfig: "-C Release" - MacOS_x64_with_unit_test: - Pool: Azure Pipelines - OSVmImage: 'macOS-10.15' - VCPKG_DEFAULT_TRIPLET: 'x64-osx' - CmakeArgs: ' -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_PERFORMANCE_TESTS=ON -DBUILD_SAMPLES=ON' - AZURE_CORE_ENABLE_JSON_TESTS: 1 - BuildArgs: '-j 4' - pool: - name: $(Pool) - vmImage: $(OSVmImage) - variables: - CMOCKA_XML_FILE: "%g-test-results.xml" - CMOCKA_MESSAGE_OUTPUT: "xml" - AZURE_ENABLE_STATIC_ANALYSIS: 1 - BuildArgs: "" - WindowsCtestConfig: "" - CmakeEnvArg: "" - CmakeArgs: "" - AZURE_TEST_MODE: "LIVE" - AZURE_LOG_LEVEL: "verbose" - # Surface the ServiceDirectory parameter as an environment variable so tests can take advantage of it. - AZURE_SERVICE_DIRECTORY: ${{ parameters.ServiceDirectory }} - - steps: - - checkout: self - submodules: recursive - - - template: /eng/common/pipelines/templates/steps/verify-agent-os.yml - parameters: - AgentImage: $(OSVmImage) - - - template: /eng/common/pipelines/templates/steps/bypass-local-dns.yml - - # Add g++5 repo to ubuntu - - bash: sudo sh -c "echo 'deb http://ftp.debian.org/debian/ stretch main' >> /etc/apt/sources.list" - displayName: Add g++ 5 - condition: >- - and( - succeeded(), - contains(variables['OSVmImage'], 'Ubuntu'), - contains(variables['CmakeEnvArg'], 'CC=/usr/bin/gcc-5 CXX=/usr/bin/g++-5 cmake') - ) - - # Install g++5 - - bash: sudo apt-get update & sudo apt-get install g++-5 - displayName: Install g++ 5 - condition: >- - and( - succeeded(), - contains(variables['OSVmImage'], 'Ubuntu'), - contains(variables['CmakeEnvArg'], 'CC=/usr/bin/gcc-5 CXX=/usr/bin/g++-5 cmake') - ) - - # Install apt dependencies (if appropriate) - - bash: sudo apt install -y $(AptDependencies) - condition: and(succeededOrFailed(), ne(variables['AptDependencies'], '')) - displayName: Install dependencies from apt - - - template: /eng/pipelines/templates/steps/vcpkg.yml - - - script: | - dotnet tool install -g dotnet-reportgenerator-globaltool - dotnet tool install dotnet-reportgenerator-globaltool --tool-path tools - displayName: Install coverage tools - # CODE_COVERAGE variable is '' (do-not-generate) in all matrix but linux-gcc - # It is 'enabled' by default on linux-gcc but it can be opt-out by each pipeline (disabled) - condition: and(succeededOrFailed(), ne(variables['CODE_COVERAGE'], 'disabled'), ne(variables['CODE_COVERAGE'], '')) - - - template: /eng/pipelines/templates/steps/cmake-build.yml - parameters: - ServiceDirectory: ${{ parameters.ServiceDirectory }} - GenerateArgs: $(CmakeArgs) - BuildArgs: "$(BuildArgs)" - Env: "$(CmakeEnvArg)" - - - template: /eng/common/TestResources/deploy-test-resources.yml - parameters: - ServiceDirectory: ${{ parameters.ServiceDirectory }} - Location: ${{ parameters.Location }} - SubscriptionConfiguration: ${{ parameters.SubscriptionConfiguration }} - - # For non multi-config generator use the same build configuration to run tests - # We don't need to set it to invoke ctest - # Visual Studio generator used in CI is a multi-config generator. - # As such, it requires the configuration argument for building and invoking ctest - - script: ctest $(WindowsCtestConfig) -V --tests-regex ${{ parameters.CtestRegex }} --no-compress-output -T Test - workingDirectory: build - displayName: ctest - # Runs only if test-resources are happly deployed. - # unit-tests runs for those configs where samples are not ran. - # This enables to run tests and samples at the same time as different matrix configuration. - # Then unit-tests runs, samples should not run. - condition: and( - succeeded(), - ne(variables['RunSamples'], '1')) - - - task: PublishTestResults@2 - inputs: - testResultsFormat: cTest - testResultsFiles: Testing/*/Test.xml - testRunTitle: $(Agent.JobName) - searchFolder: build - mergeTestResults: true - publishRunAttachments: true - displayName: Publish test results - # this step only makes sense when ctest has run - condition: and(succeededOrFailed(), ne(variables['RunSamples'], '1')) - - # Running Samples step. - # Will run samples described on a file name [service]-samples.txt within the build directory. - # For example keyvault-samples.txt. - # The file is written by CMake during configuration when building samples. - - bash: | - IFS=$'\n' - if [[ -f "./${{ parameters.ServiceDirectory }}-samples.txt" ]]; then - for sample in `cat ./${{ parameters.ServiceDirectory }}-samples.txt` - do - echo "**********Running sample: ${sample}" - bash -c "$sample" - status=$? - if [[ $status -eq 0 ]]; then - echo "*********Sample completed*********" - else - echo "*Sample returned a failed code: $status" - exit 1 - fi - done - fi - workingDirectory: build - displayName: "Run Samples for : ${{ parameters.ServiceDirectory }}" - condition: and(succeeded(), eq(variables['RunSamples'], '1')) - - # Make coverage targets (specified in coverage_targets.txt) and assemble - # coverage report - - bash: | - make `cat ${{ parameters.ServiceDirectory }}-targets-coverage.txt` - ../tools/reportgenerator "-reports:${{ parameters.CoverageReportPath }}" "-targetdir:." "-reporttypes:Cobertura" - workingDirectory: build - displayName: Generate Code Coverage Data - condition: and(succeeded(), ne(variables['CODE_COVERAGE'], 'disabled'), ne(variables['CODE_COVERAGE'], '')) - - - task: PublishCodeCoverageResults@1 - inputs: - codeCoverageTool: Cobertura - summaryFileLocation: '$(Build.SourcesDirectory)/**/Cobertura.xml' - displayName: Publish Code Coverage to DevOps - condition: and(succeededOrFailed(), ne(variables['CODE_COVERAGE'], 'disabled'), ne(variables['CODE_COVERAGE'], '')) - - - template: /eng/common/TestResources/remove-test-resources.yml - parameters: - ServiceDirectory: ${{ parameters.ServiceDirectory }} - SubscriptionConfiguration: ${{ parameters.SubscriptionConfiguration }} +- template: /eng/common/pipelines/templates/jobs/archetype-sdk-tests-generate.yml + parameters: + MatrixConfigs: + - Name: base + Path: eng/pipelines/templates/stages/platform-matrix-live.json + Selection: all + GenerateVMJobs: true + JobTemplatePath: /eng/pipelines/templates/jobs/live.tests.yml + AdditionalParameters: + Location: ${{ parameters.Location}} + SubscriptionConfiguration: ${{ parameters.SubscriptionConfiguration}} + ServiceDirectory: ${{ parameters.ServiceDirectory}} + CtestRegex: ${{ parameters.CtestRegex}} + Coverage: ${{ parameters.Coverage}} + CoverageReportPath: ${{ parameters.CoverageReportPath}} + TimeoutInMinutes: ${{ parameters.TimeoutInMinutes}} diff --git a/eng/pipelines/templates/jobs/live.tests.yml b/eng/pipelines/templates/jobs/live.tests.yml new file mode 100644 index 0000000000..a9db4ce9d4 --- /dev/null +++ b/eng/pipelines/templates/jobs/live.tests.yml @@ -0,0 +1,179 @@ +parameters: +- name: Location + type: string + default: '' +- name: SubscriptionConfiguration + type: string + default: $(sub-config-azure-cloud-test-resources) +- name: ServiceDirectory + type: string + default: not-specified +- name: CtestRegex + type: string + default: .* +- name: Coverage + type: string + default: 'enabled' +- name: CoverageReportPath + type: string + default: sdk/*/*/*cov_xml.xml +- name: TimeoutInMinutes + type: number + default: 60 +- name: DependsOn + type: string + default: '' +- name: Matrix + type: string + +jobs: +- job: ValidateLive + dependsOn: ${{ parameters.DependsOn }} + condition: ne(${{ parameters.Matrix }}, '{}') + + strategy: + maxParallel: ${{ parameters.MaxParallel }} + matrix: $[ ${{ parameters.Matrix }} ] + + variables: + CMOCKA_XML_FILE: "%g-test-results.xml" + CMOCKA_MESSAGE_OUTPUT: "xml" + AZURE_ENABLE_STATIC_ANALYSIS: 1 + BuildArgs: "" + WindowsCtestConfig: "" + CmakeEnvArg: "" + CmakeArgs: "" + AZURE_TEST_MODE: "LIVE" + AZURE_LOG_LEVEL: "verbose" + # Surface the ServiceDirectory parameter as an environment variable so tests can take advantage of it. + AZURE_SERVICE_DIRECTORY: ${{ parameters.ServiceDirectory }} + + steps: + - checkout: self + submodules: recursive + + - template: /eng/common/pipelines/templates/steps/verify-agent-os.yml + parameters: + AgentImage: $(OSVmImage) + + - template: /eng/common/pipelines/templates/steps/bypass-local-dns.yml + + # Add g++5 repo to ubuntu + - bash: sudo sh -c "echo 'deb http://ftp.debian.org/debian/ stretch main' >> /etc/apt/sources.list" + displayName: Add g++ 5 + condition: >- + and( + succeeded(), + contains(variables['OSVmImage'], 'Ubuntu'), + contains(variables['CmakeEnvArg'], 'CC=/usr/bin/gcc-5 CXX=/usr/bin/g++-5 cmake') + ) + + # Install g++5 + - bash: sudo apt-get update & sudo apt-get install g++-5 + displayName: Install g++ 5 + condition: >- + and( + succeeded(), + contains(variables['OSVmImage'], 'Ubuntu'), + contains(variables['CmakeEnvArg'], 'CC=/usr/bin/gcc-5 CXX=/usr/bin/g++-5 cmake') + ) + + # Install apt dependencies (if appropriate) + - bash: sudo apt install -y $(AptDependencies) + condition: and(succeededOrFailed(), ne(variables['AptDependencies'], '')) + displayName: Install dependencies from apt + + - template: /eng/pipelines/templates/steps/vcpkg.yml + + - script: | + dotnet tool install -g dotnet-reportgenerator-globaltool + dotnet tool install dotnet-reportgenerator-globaltool --tool-path tools + displayName: Install coverage tools + # CODE_COVERAGE variable is '' (do-not-generate) in all matrix but linux-gcc + # It is 'enabled' by default on linux-gcc but it can be opt-out by each pipeline (disabled) + condition: and(succeededOrFailed(), ne(variables['CODE_COVERAGE'], 'disabled'), ne(variables['CODE_COVERAGE'], '')) + + - template: /eng/pipelines/templates/steps/cmake-build.yml + parameters: + ServiceDirectory: ${{ parameters.ServiceDirectory }} + GenerateArgs: $(CmakeArgs) + BuildArgs: "$(BuildArgs)" + Env: "$(CmakeEnvArg)" + + - template: /eng/common/TestResources/deploy-test-resources.yml + parameters: + ServiceDirectory: ${{ parameters.ServiceDirectory }} + Location: ${{ parameters.Location }} + SubscriptionConfiguration: ${{ parameters.SubscriptionConfiguration }} + + # For non multi-config generator use the same build configuration to run tests + # We don't need to set it to invoke ctest + # Visual Studio generator used in CI is a multi-config generator. + # As such, it requires the configuration argument for building and invoking ctest + - script: ctest $(WindowsCtestConfig) -V --tests-regex ${{ parameters.CtestRegex }} --no-compress-output -T Test + workingDirectory: build + displayName: ctest + # Runs only if test-resources are happly deployed. + # unit-tests runs for those configs where samples are not ran. + # This enables to run tests and samples at the same time as different matrix configuration. + # Then unit-tests runs, samples should not run. + condition: and( + succeeded(), + ne(variables['RunSamples'], '1')) + + - task: PublishTestResults@2 + inputs: + testResultsFormat: cTest + testResultsFiles: Testing/*/Test.xml + testRunTitle: $(Agent.JobName) + searchFolder: build + mergeTestResults: true + publishRunAttachments: true + displayName: Publish test results + # this step only makes sense when ctest has run + condition: and(succeededOrFailed(), ne(variables['RunSamples'], '1')) + + # Running Samples step. + # Will run samples described on a file name [service]-samples.txt within the build directory. + # For example keyvault-samples.txt. + # The file is written by CMake during configuration when building samples. + - bash: | + IFS=$'\n' + if [[ -f "./${{ parameters.ServiceDirectory }}-samples.txt" ]]; then + for sample in `cat ./${{ parameters.ServiceDirectory }}-samples.txt` + do + echo "**********Running sample: ${sample}" + bash -c "$sample" + status=$? + if [[ $status -eq 0 ]]; then + echo "*********Sample completed*********" + else + echo "*Sample returned a failed code: $status" + exit 1 + fi + done + fi + workingDirectory: build + displayName: "Run Samples for : ${{ parameters.ServiceDirectory }}" + condition: and(succeeded(), eq(variables['RunSamples'], '1')) + + # Make coverage targets (specified in coverage_targets.txt) and assemble + # coverage report + - bash: | + make `cat ${{ parameters.ServiceDirectory }}-targets-coverage.txt` + ../tools/reportgenerator "-reports:${{ parameters.CoverageReportPath }}" "-targetdir:." "-reporttypes:Cobertura" + workingDirectory: build + displayName: Generate Code Coverage Data + condition: and(succeeded(), ne(variables['CODE_COVERAGE'], 'disabled'), ne(variables['CODE_COVERAGE'], '')) + + - task: PublishCodeCoverageResults@1 + inputs: + codeCoverageTool: Cobertura + summaryFileLocation: '$(Build.SourcesDirectory)/**/Cobertura.xml' + displayName: Publish Code Coverage to DevOps + condition: and(succeededOrFailed(), ne(variables['CODE_COVERAGE'], 'disabled'), ne(variables['CODE_COVERAGE'], '')) + + - template: /eng/common/TestResources/remove-test-resources.yml + parameters: + ServiceDirectory: ${{ parameters.ServiceDirectory }} + SubscriptionConfiguration: ${{ parameters.SubscriptionConfiguration }} From 58e14cd02b3dde996210075d92258dcd0274d3de Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Wed, 13 Apr 2022 09:51:45 -0700 Subject: [PATCH 03/32] Clean up comment --- eng/pipelines/templates/jobs/archetype-sdk-tests.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/eng/pipelines/templates/jobs/archetype-sdk-tests.yml b/eng/pipelines/templates/jobs/archetype-sdk-tests.yml index 5334ad598c..45f95c3ccf 100644 --- a/eng/pipelines/templates/jobs/archetype-sdk-tests.yml +++ b/eng/pipelines/templates/jobs/archetype-sdk-tests.yml @@ -21,11 +21,6 @@ parameters: type: number default: 60 -# This job uses the legacy matrix format (matrix property of the job, one -# build/test scenario per job). A new format (multiple build/test scenarios per -# job) may be possible here: -# https://github.com/Azure/azure-sdk-for-cpp/issues/2944 - jobs: - template: /eng/common/pipelines/templates/jobs/archetype-sdk-tests-generate.yml parameters: From 1ca4a71e7d0337bcaf0ee1684aa7d85f02925453 Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Wed, 13 Apr 2022 09:52:04 -0700 Subject: [PATCH 04/32] Move to stage --- .../templates/jobs/archetype-sdk-tests.yml | 40 --------------- .../templates/stages/archetype-sdk-tests.yml | 51 +++++++++++++++++++ 2 files changed, 51 insertions(+), 40 deletions(-) delete mode 100644 eng/pipelines/templates/jobs/archetype-sdk-tests.yml create mode 100644 eng/pipelines/templates/stages/archetype-sdk-tests.yml diff --git a/eng/pipelines/templates/jobs/archetype-sdk-tests.yml b/eng/pipelines/templates/jobs/archetype-sdk-tests.yml deleted file mode 100644 index 45f95c3ccf..0000000000 --- a/eng/pipelines/templates/jobs/archetype-sdk-tests.yml +++ /dev/null @@ -1,40 +0,0 @@ -parameters: -- name: Location - type: string - default: '' -- name: SubscriptionConfiguration - type: string - default: $(sub-config-azure-cloud-test-resources) -- name: ServiceDirectory - type: string - default: not-specified -- name: CtestRegex - type: string - default: .* -- name: Coverage - type: string - default: 'enabled' -- name: CoverageReportPath - type: string - default: sdk/*/*/*cov_xml.xml -- name: TimeoutInMinutes - type: number - default: 60 - -jobs: -- template: /eng/common/pipelines/templates/jobs/archetype-sdk-tests-generate.yml - parameters: - MatrixConfigs: - - Name: base - Path: eng/pipelines/templates/stages/platform-matrix-live.json - Selection: all - GenerateVMJobs: true - JobTemplatePath: /eng/pipelines/templates/jobs/live.tests.yml - AdditionalParameters: - Location: ${{ parameters.Location}} - SubscriptionConfiguration: ${{ parameters.SubscriptionConfiguration}} - ServiceDirectory: ${{ parameters.ServiceDirectory}} - CtestRegex: ${{ parameters.CtestRegex}} - Coverage: ${{ parameters.Coverage}} - CoverageReportPath: ${{ parameters.CoverageReportPath}} - TimeoutInMinutes: ${{ parameters.TimeoutInMinutes}} diff --git a/eng/pipelines/templates/stages/archetype-sdk-tests.yml b/eng/pipelines/templates/stages/archetype-sdk-tests.yml new file mode 100644 index 0000000000..721811f161 --- /dev/null +++ b/eng/pipelines/templates/stages/archetype-sdk-tests.yml @@ -0,0 +1,51 @@ +parameters: +- name: Location + type: string + default: '' +- name: ServiceDirectory + type: string + default: not-specified +- name: CtestRegex + type: string + default: .* +- name: Coverage + type: string + default: 'enabled' +- name: CoverageReportPath + type: string + default: sdk/*/*/*cov_xml.xml +- name: TimeoutInMinutes + type: number + default: 60 +- name: CloudConfig + type: object + default: + Cloud: Public + +stages: +- ${{ each cloud in parameters.CloudConfig }}: + - ${{ if or(contains(parameters.Clouds, cloud.key), and(contains(variables['Build.DefinitionName'], 'tests-weekly'), contains(parameters.SupportedClouds, cloud.key))) }}: + - ${{ if not(contains(parameters.UnsupportedClouds, cloud.key)) }}: + - stage: ${{ cloud.key }} + dependsOn: [] + jobs: + - template: /eng/common/pipelines/templates/jobs/archetype-sdk-tests-generate.yml + parameters: + MatrixConfigs: + - Name: base + Path: eng/pipelines/templates/stages/platform-matrix-live.json + Selection: all + GenerateVMJobs: true + JobTemplatePath: /eng/pipelines/templates/jobs/live.tests.yml + CloudConfig: + SubscriptionConfiguration: ${{ cloud.value.SubscriptionConfiguration }} + SubscriptionConfigurations: ${{ cloud.value.SubscriptionConfigurations }} + Location: ${{ coalesce(parameters.Location, cloud.value.Location) }} + Cloud: ${{ cloud.key }} + AdditionalParameters: + Location: ${{ parameters.Location}} + ServiceDirectory: ${{ parameters.ServiceDirectory}} + CtestRegex: ${{ parameters.CtestRegex}} + Coverage: ${{ parameters.Coverage}} + CoverageReportPath: ${{ parameters.CoverageReportPath}} + TimeoutInMinutes: ${{ parameters.TimeoutInMinutes}} From 2e1093b9e9d21e1cdf53976223b87c8c0589e582 Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Wed, 13 Apr 2022 10:22:15 -0700 Subject: [PATCH 05/32] Cloud configuration --- eng/pipelines/templates/jobs/live.tests.yml | 4 +- .../templates/stages/archetype-sdk-client.yml | 53 ++++++++++++------- .../templates/stages/archetype-sdk-tests.yml | 14 ++--- sdk/attestation/ci.yml | 6 ++- sdk/keyvault/ci.yml | 1 - sdk/storage/ci.yml | 4 +- 6 files changed, 53 insertions(+), 29 deletions(-) diff --git a/eng/pipelines/templates/jobs/live.tests.yml b/eng/pipelines/templates/jobs/live.tests.yml index a9db4ce9d4..54512458fa 100644 --- a/eng/pipelines/templates/jobs/live.tests.yml +++ b/eng/pipelines/templates/jobs/live.tests.yml @@ -103,8 +103,8 @@ jobs: - template: /eng/common/TestResources/deploy-test-resources.yml parameters: ServiceDirectory: ${{ parameters.ServiceDirectory }} - Location: ${{ parameters.Location }} - SubscriptionConfiguration: ${{ parameters.SubscriptionConfiguration }} + Location: ${{ parameters.CloudConfig.Location }} + SubscriptionConfiguration: ${{ parameters.CloudConfig.SubscriptionConfiguration }} # For non multi-config generator use the same build configuration to run tests # We don't need to set it to invoke ctest diff --git a/eng/pipelines/templates/stages/archetype-sdk-client.yml b/eng/pipelines/templates/stages/archetype-sdk-client.yml index d980b0f90f..63789cec05 100644 --- a/eng/pipelines/templates/stages/archetype-sdk-client.yml +++ b/eng/pipelines/templates/stages/archetype-sdk-client.yml @@ -20,12 +20,6 @@ parameters: - name: ArtifactsSource type: object default: [] -- name: Location - type: string - default: '' -- name: SubscriptionConfiguration - type: string - default: $(sub-config-azure-cloud-test-resources) - name: CoverageReportPath type: string default: 'sdk/*/*/*cov_xml.xml' @@ -47,6 +41,30 @@ parameters: - name: CMakeSourceTestOptions type: object default: [] +- name: CloudConfig + type: object + default: + Public: + SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) + Preview: + SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources-preview) + Canary: + SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) + Location: 'eastus2euap' + UsGov: + SubscriptionConfiguration: $(sub-config-gov-test-resources) + China: + SubscriptionConfiguration: $(sub-config-cn-test-resources) +- name: Clouds + type: string + default: Public +- name: SupportedClouds + type: string + default: Public +- name: UnsupportedClouds + type: string + default: '' + stages: - stage: CMakeGeneration @@ -77,18 +95,17 @@ stages: TestEnv: ${{ parameters.TestEnv }} - ${{ if and(eq(variables['System.TeamProject'], 'internal'), ne(parameters.LiveTestCtestRegex, '')) }}: - - stage: LiveTest - dependsOn: [] - jobs: - - template: /eng/pipelines/templates/jobs/archetype-sdk-tests.yml - # Code coverage is enabled by default for live tests - parameters: - TimeoutInMinutes: ${{ parameters.LiveTestTimeoutInMinutes }} - ServiceDirectory: ${{ parameters.ServiceDirectory }} - CtestRegex: ${{ parameters.LiveTestCtestRegex }} - Location: ${{ parameters.Location }} - SubscriptionConfiguration: ${{ parameters.SubscriptionConfiguration }} - CoverageReportPath: ${{ parameters.CoverageReportPath }} + - template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml + # Code coverage is enabled by default for live tests + parameters: + TimeoutInMinutes: ${{ parameters.LiveTestTimeoutInMinutes }} + ServiceDirectory: ${{ parameters.ServiceDirectory }} + CtestRegex: ${{ parameters.LiveTestCtestRegex }} + CoverageReportPath: ${{ parameters.CoverageReportPath }} + CloudConfig: ${{ parameters.CloudConfig }} + Clouds: ${{ parameters.Clouds }} + SupportedClouds: ${{ parameters.SupportedClouds }} + UnsupportedClouds: ${{ parameters.UnsupportedClouds }} - ${{ if and(eq(variables['System.TeamProject'], 'internal'), not(endsWith(variables['Build.DefinitionName'], ' - tests'))) }}: - template: archetype-cpp-release.yml diff --git a/eng/pipelines/templates/stages/archetype-sdk-tests.yml b/eng/pipelines/templates/stages/archetype-sdk-tests.yml index 721811f161..493a6bca03 100644 --- a/eng/pipelines/templates/stages/archetype-sdk-tests.yml +++ b/eng/pipelines/templates/stages/archetype-sdk-tests.yml @@ -1,7 +1,4 @@ parameters: -- name: Location - type: string - default: '' - name: ServiceDirectory type: string default: not-specified @@ -19,14 +16,19 @@ parameters: default: 60 - name: CloudConfig type: object - default: - Cloud: Public + default: {} +- name: SupportedClouds + type: string + default: 'Public' +- name: UnsupportedClouds + type: string + default: '' stages: - ${{ each cloud in parameters.CloudConfig }}: - ${{ if or(contains(parameters.Clouds, cloud.key), and(contains(variables['Build.DefinitionName'], 'tests-weekly'), contains(parameters.SupportedClouds, cloud.key))) }}: - ${{ if not(contains(parameters.UnsupportedClouds, cloud.key)) }}: - - stage: ${{ cloud.key }} + - stage: LiveTest_${{ cloud.key }} dependsOn: [] jobs: - template: /eng/common/pipelines/templates/jobs/archetype-sdk-tests-generate.yml diff --git a/sdk/attestation/ci.yml b/sdk/attestation/ci.yml index 6d811cab27..a8d3b7f6f7 100644 --- a/sdk/attestation/ci.yml +++ b/sdk/attestation/ci.yml @@ -26,7 +26,11 @@ stages: - template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: ServiceDirectory: attestation - Location: WestUS + Cloud: Public + CloudConfig: + Public: + SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) + Location: WestUS CtestRegex: azure-security-attestation.* LiveTestCtestRegex: azure-security-attestation.* LineCoverageTarget: 90 diff --git a/sdk/keyvault/ci.yml b/sdk/keyvault/ci.yml index 83598a1e68..d01910bc0c 100644 --- a/sdk/keyvault/ci.yml +++ b/sdk/keyvault/ci.yml @@ -29,7 +29,6 @@ stages: CtestRegex: "azure-security-keyvault.*" LiveTestCtestRegex: "azure-security-keyvault.*" LiveTestTimeoutInMinutes: 120 - SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) LineCoverageTarget: 81 BranchCoverageTarget: 42 Artifacts: diff --git a/sdk/storage/ci.yml b/sdk/storage/ci.yml index 4238300c08..4349ebf97b 100644 --- a/sdk/storage/ci.yml +++ b/sdk/storage/ci.yml @@ -30,7 +30,9 @@ stages: LineCoverageTarget: 76 BranchCoverageTarget: 41 LiveTestCtestRegex: azure-storage - SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources-preview) + Clouds: Preview + SupportedClouds: Preview + UnsupportedClouds: Public,Canary,UsGov,China Artifacts: - Name: azure-storage-common Path: azure-storage-common From 50bd747b9ac4f5c12432852f0f4a1d5d019288f6 Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Wed, 13 Apr 2022 10:23:45 -0700 Subject: [PATCH 06/32] Expect the Cloud --- eng/pipelines/templates/stages/archetype-sdk-tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eng/pipelines/templates/stages/archetype-sdk-tests.yml b/eng/pipelines/templates/stages/archetype-sdk-tests.yml index 493a6bca03..afd4c32603 100644 --- a/eng/pipelines/templates/stages/archetype-sdk-tests.yml +++ b/eng/pipelines/templates/stages/archetype-sdk-tests.yml @@ -17,6 +17,9 @@ parameters: - name: CloudConfig type: object default: {} +- name: Clouds + type: string + default: Public - name: SupportedClouds type: string default: 'Public' From e5750eb4e7a57117774cba69ce2e03a00499298b Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Wed, 13 Apr 2022 10:27:09 -0700 Subject: [PATCH 07/32] Expect parameters --- eng/pipelines/templates/jobs/live.tests.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/eng/pipelines/templates/jobs/live.tests.yml b/eng/pipelines/templates/jobs/live.tests.yml index 54512458fa..d2d6ef707e 100644 --- a/eng/pipelines/templates/jobs/live.tests.yml +++ b/eng/pipelines/templates/jobs/live.tests.yml @@ -25,12 +25,26 @@ parameters: default: '' - name: Matrix type: string +- name: CloudConfig + type: object + default: {} +- name: UsePlatformContainer + type: boolean + default: false jobs: - job: ValidateLive dependsOn: ${{ parameters.DependsOn }} condition: ne(${{ parameters.Matrix }}, '{}') + pool: + name: $(Pool) + vmImage: $(OSVmImage) + + ${{ if eq(parameters.UsePlatformContainer, 'true') }}: + # Add a default so the job doesn't fail when the matrix is empty + container: $[ variables['Container'] ] + strategy: maxParallel: ${{ parameters.MaxParallel }} matrix: $[ ${{ parameters.Matrix }} ] From bfafa8d87819e1809a6da5be7138973f1e090b6c Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Wed, 13 Apr 2022 10:28:16 -0700 Subject: [PATCH 08/32] MaxParallel --- eng/pipelines/templates/jobs/live.tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eng/pipelines/templates/jobs/live.tests.yml b/eng/pipelines/templates/jobs/live.tests.yml index d2d6ef707e..2e04505457 100644 --- a/eng/pipelines/templates/jobs/live.tests.yml +++ b/eng/pipelines/templates/jobs/live.tests.yml @@ -25,6 +25,9 @@ parameters: default: '' - name: Matrix type: string +- name: MaxParallel + type: number + default: 0 - name: CloudConfig type: object default: {} From d46e7538a0d29dbc175853e21860a964d90fa8f8 Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Wed, 13 Apr 2022 10:31:02 -0700 Subject: [PATCH 09/32] Try wildcard --- eng/pipelines/templates/stages/archetype-sdk-client.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/templates/stages/archetype-sdk-client.yml b/eng/pipelines/templates/stages/archetype-sdk-client.yml index 63789cec05..4f93ef747c 100644 --- a/eng/pipelines/templates/stages/archetype-sdk-client.yml +++ b/eng/pipelines/templates/stages/archetype-sdk-client.yml @@ -115,7 +115,7 @@ stages: - Build # Only depend on `LiveTest` if there are live tests to execute - ${{ if and(eq(variables['System.TeamProject'], 'internal'), ne(parameters.LiveTestCtestRegex, '')) }}: - - LiveTest + - LiveTest* Artifacts: ${{ parameters.Artifacts }} ArtifactName: packages ${{ if eq(parameters.ServiceDirectory, 'template') }}: From 965c92ef87d6dc8bcb5209b46fefc2e339b34a99 Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Wed, 13 Apr 2022 10:32:53 -0700 Subject: [PATCH 10/32] DependsOn --- eng/pipelines/templates/stages/archetype-sdk-client.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/eng/pipelines/templates/stages/archetype-sdk-client.yml b/eng/pipelines/templates/stages/archetype-sdk-client.yml index 4f93ef747c..a0d861daf5 100644 --- a/eng/pipelines/templates/stages/archetype-sdk-client.yml +++ b/eng/pipelines/templates/stages/archetype-sdk-client.yml @@ -115,7 +115,11 @@ stages: - Build # Only depend on `LiveTest` if there are live tests to execute - ${{ if and(eq(variables['System.TeamProject'], 'internal'), ne(parameters.LiveTestCtestRegex, '')) }}: - - LiveTest* + # Pulled from stages/archetype-sdk-tests.yml to generate 'LiveTest_' + - ${{ each cloud in parameters.CloudConfig }}: + - ${{ if or(contains(parameters.Clouds, cloud.key), and(contains(variables['Build.DefinitionName'], 'tests-weekly'), contains(parameters.SupportedClouds, cloud.key))) }}: + - ${{ if not(contains(parameters.UnsupportedClouds, cloud.key)) }}: + - LiveTest_${{ cloud.key }} Artifacts: ${{ parameters.Artifacts }} ArtifactName: packages ${{ if eq(parameters.ServiceDirectory, 'template') }}: From bbb631a510cdf3919bbf535abcf6548e909cc033 Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Wed, 13 Apr 2022 11:07:40 -0700 Subject: [PATCH 11/32] Quote CtestRegex --- eng/pipelines/templates/jobs/live.tests.yml | 2 +- sdk/core/ci.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/pipelines/templates/jobs/live.tests.yml b/eng/pipelines/templates/jobs/live.tests.yml index 2e04505457..9cc45d3520 100644 --- a/eng/pipelines/templates/jobs/live.tests.yml +++ b/eng/pipelines/templates/jobs/live.tests.yml @@ -127,7 +127,7 @@ jobs: # We don't need to set it to invoke ctest # Visual Studio generator used in CI is a multi-config generator. # As such, it requires the configuration argument for building and invoking ctest - - script: ctest $(WindowsCtestConfig) -V --tests-regex ${{ parameters.CtestRegex }} --no-compress-output -T Test + - script: ctest $(WindowsCtestConfig) -V --tests-regex "${{ parameters.CtestRegex }}" --no-compress-output -T Test workingDirectory: build displayName: ctest # Runs only if test-resources are happly deployed. diff --git a/sdk/core/ci.yml b/sdk/core/ci.yml index bdcdadfa1f..4abf132ccc 100644 --- a/sdk/core/ci.yml +++ b/sdk/core/ci.yml @@ -38,7 +38,7 @@ stages: # In the case of changes to core we want to re-run all CI tests for all # libraries to check for potential regressions everywhere. CtestRegex: .* - LiveTestCtestRegex: '"azure-core.|json-test"' + LiveTestCtestRegex: azure-core.|json-test LiveTestTimeoutInMinutes: 90 # default is 60 min. We need a little longer on worst case for Win+jsonTests LineCoverageTarget: 93 BranchCoverageTarget: 55 From 30a5cb3e623eb654fb8909928b9d8748a74c8a8a Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Wed, 13 Apr 2022 11:27:43 -0700 Subject: [PATCH 12/32] s --- sdk/attestation/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/attestation/ci.yml b/sdk/attestation/ci.yml index a8d3b7f6f7..64a7a2a86d 100644 --- a/sdk/attestation/ci.yml +++ b/sdk/attestation/ci.yml @@ -26,7 +26,7 @@ stages: - template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: ServiceDirectory: attestation - Cloud: Public + Clouds: Public CloudConfig: Public: SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) From 43412f6c2785a95bdadf81b92103f917d6d2a639 Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Thu, 14 Apr 2022 06:57:11 -0700 Subject: [PATCH 13/32] Use template for cmake generate tests --- .../jobs/archetype-sdk-cmake-generate.yml | 137 +++--------------- .../templates/jobs/cmake-generate.tests.yml | 71 +++++++++ .../stages/platform-matrix-cmakegenerate.json | 32 ++++ .../platform-matrix-cmakesourcegenerate.json | 28 ++++ 4 files changed, 155 insertions(+), 113 deletions(-) create mode 100644 eng/pipelines/templates/jobs/cmake-generate.tests.yml create mode 100644 eng/pipelines/templates/stages/platform-matrix-cmakegenerate.json create mode 100644 eng/pipelines/templates/stages/platform-matrix-cmakesourcegenerate.json diff --git a/eng/pipelines/templates/jobs/archetype-sdk-cmake-generate.yml b/eng/pipelines/templates/jobs/archetype-sdk-cmake-generate.yml index 4452b018de..2dfd0d4c93 100644 --- a/eng/pipelines/templates/jobs/archetype-sdk-cmake-generate.yml +++ b/eng/pipelines/templates/jobs/archetype-sdk-cmake-generate.yml @@ -16,116 +16,27 @@ parameters: default: [] jobs: -- job: CMakeGenerate - condition: and(succeededOrFailed(), ne(variables['Skip.CMakeGenerate'], 'true')) - strategy: - matrix: - Linux: - Pool: azsdk-pool-mms-ubuntu-1804-general - OSVmImage: MMSUbuntu18.04 - CmakeEnvArg: '' - AptDependencies: 'libcurl4-openssl-dev' - VCPKG_DEFAULT_TRIPLET: 'x64-linux' - Windows: - Pool: azsdk-pool-mms-win-2019-general - OSVmImage: MMS2019 - CmakeEnvArg: '' - VCPKG_DEFAULT_TRIPLET: 'x64-windows' - Mac: - Pool: Azure Pipelines - OSVmImage: macOS-10.15 - CmakeEnvArg: '' - VCPKG_DEFAULT_TRIPLET: 'x64-osx' - pool: - name: $(Pool) - vmImage: $(OSVmImage) - variables: - CMOCKA_XML_FILE: "%g-test-results.xml" - - steps: - - checkout: self - submodules: recursive - - - template: /eng/common/pipelines/templates/steps/verify-agent-os.yml - parameters: - AgentImage: $(OSVmImage) - - - template: /eng/common/pipelines/templates/steps/bypass-local-dns.yml - - - pwsh: sudo apt update && sudo apt install -y $(AptDependencies) - condition: and(succeeded(), ne(variables['AptDependencies'], '')) - displayName: Install dependencies from apt - - - template: /eng/pipelines/templates/steps/vcpkg.yml - - - script: cmake --version - displayName: cmake --version - - - ${{ each artifact in parameters.Artifacts }}: - - script: echo 'CMake generate tests for ${{ artifact.Name }}' - displayName: ${{ artifact.Name }} - - ${{ each cmakeOption in parameters.CMakeTestOptions }}: - - template: /eng/pipelines/templates/steps/cmake-generate.yml - parameters: - CmakeGeneratePath: sdk/${{ parameters.ServiceDirectory }}/${{ artifact.Path }} - GenerateArgs: ${{ cmakeOption.Value }} - Env: "$(CmakeEnvArg)" - -- job: CMakeSourceGenerate - condition: and(succeededOrFailed(), ne(variables['Skip.CMakeGenerate'], 'true')) - strategy: - matrix: - Windows: - Pool: azsdk-pool-mms-win-2019-general - OSVmImage: MMS2019 - CmakeEnvArg: '' - Linux: - Pool: azsdk-pool-mms-ubuntu-1804-general - OSVmImage: MMSUbuntu18.04 - CmakeEnvArg: '' - AptDependencies: 'libcurl4-openssl-dev' - Mac: - Pool: Azure Pipelines - OSVmImage: macOS-10.15 - CmakeEnvArg: 'OPENSSL_ROOT_DIR=/usr/local/opt/openssl@3 OPENSSL_INCLUDE_DIR=/usr/local/opt/openssl@3/include ' - BrewDependencies: 'openssl' - - pool: - name: $(Pool) - vmImage: $(OSVmImage) - variables: - CMOCKA_XML_FILE: "%g-test-results.xml" - - steps: - - checkout: self - submodules: recursive - - - template: /eng/common/pipelines/templates/steps/verify-agent-os.yml - parameters: - AgentImage: $(OSVmImage) - - - template: /eng/common/pipelines/templates/steps/bypass-local-dns.yml - - - pwsh: sudo apt update && sudo apt install -y $(AptDependencies) - condition: and(succeeded(), ne(variables['AptDependencies'], '')) - displayName: Install dependencies from apt - - - pwsh: | - brew install $(BrewDependencies) - condition: and(succeeded(), ne(variables['BrewDependencies'], '')) - displayName: Install dependencies from brew - - - template: /eng/pipelines/templates/steps/vcpkg.yml - - - script: cmake --version - displayName: cmake --version - - - ${{ each artifact in parameters.ArtifactsSource }}: - - script: echo 'CMake generate tests for ${{ artifact.Name }}' - displayName: ${{ artifact.Name }} - - ${{ each cmakeOption in parameters.CMakeSourceTestOptions }}: - - template: /eng/pipelines/templates/steps/cmake-generate.yml - parameters: - CmakeGeneratePath: sdk/${{ parameters.ServiceDirectory }}/${{ artifact.Path }} - GenerateArgs: ${{ cmakeOption.Value }} - Env: "$(CmakeEnvArg)" \ No newline at end of file +- template: /eng/common/pipelines/templates/jobs/archetype-sdk-tests-generate.yml + parameters: + MatrixConfigs: + - Name: base + Path: eng/pipelines/templates/stages/platform-matrix-cmakegenerate.json + GenerateVMJobs: true + JobTemplatePath: /eng/pipelines/templates/job/cmake-generate.tests.yml + AdditionalParameters: + Artifacts: ${{ parameters.Artifacts }} + ServiceDirectory: ${{ parameters.ServiceDirectory }} + CMakeTestOptions: ${{ parameters.CMakeTestOptions }} + CMakeSourceTestOptions: ${{ parameters.CMakeSourceTestOptions }} + +- template: /eng/common/pipelines/templates/jobs/archetype-sdk-tests-generate.yml + parameters: + MatrixConfigs: + - Name: base + Path: eng/pipelines/templates/stages/platform-matrix-cmakegenerate.json + GenerateVMJobs: true + JobTemplatePath: /eng/pipelines/templates/job/cmake-source-generate.tests.yml + AdditionalParameters: + Artifacts: ${{ parameters.ArtifactsSource }} + ServiceDirectory: ${{ parameters.ServiceDirectory }} + CMakeTestOptions: ${{ parameters.CMakeSourceTestOptions }} diff --git a/eng/pipelines/templates/jobs/cmake-generate.tests.yml b/eng/pipelines/templates/jobs/cmake-generate.tests.yml new file mode 100644 index 0000000000..ad404abed1 --- /dev/null +++ b/eng/pipelines/templates/jobs/cmake-generate.tests.yml @@ -0,0 +1,71 @@ +parameters: + - name: Artifacts + type: object + default: [] + - name: ServiceDirectory + type: string + default: not-specified + - name: CMakeTestOptions + type: object + default: [] + - name: MaxParallel + type: number + default: 0 + - name: Matrix + type: string + default: '' + - name: UsePlatformContainer + type: boolean + default: false + +jobs: +- job: CMakeGenerate + condition: and(succeededOrFailed(), ne(variables['Skip.CMakeGenerate'], 'true')) + strategy: + maxParallel: ${{ parameters.MaxParallel }} + matrix: $[ ${{ parameters.Matrix }} ] + + pool: + name: $(Pool) + vmImage: $(OSVmImage) + + ${{ if eq(parameters.UsePlatformContainer, 'true') }}: + # Add a default so the job doesn't fail when the matrix is empty + container: $[ variables['Container'] ] + + variables: + CMOCKA_XML_FILE: "%g-test-results.xml" + + steps: + - checkout: self + submodules: recursive + + - template: /eng/common/pipelines/templates/steps/verify-agent-os.yml + parameters: + AgentImage: $(OSVmImage) + + - template: /eng/common/pipelines/templates/steps/bypass-local-dns.yml + + - pwsh: sudo apt update && sudo apt install -y $(AptDependencies) + condition: and(succeeded(), ne(variables['AptDependencies'], '')) + displayName: Install dependencies from apt + + - pwsh: | + brew install $(BrewDependencies) + condition: and(succeeded(), ne(variables['BrewDependencies'], '')) + displayName: Install dependencies from brew + + - template: /eng/pipelines/templates/steps/vcpkg.yml + + - script: cmake --version + displayName: cmake --version + + - ${{ each artifact in parameters.Artifacts }}: + - script: echo 'CMake generate tests for ${{ artifact.Name }}' + displayName: ${{ artifact.Name }} + - ${{ each cmakeOption in parameters.CMakeTestOptions }}: + - template: /eng/pipelines/templates/steps/cmake-generate.yml + parameters: + CmakeGeneratePath: sdk/${{ parameters.ServiceDirectory }}/${{ artifact.Path }} + GenerateArgs: ${{ cmakeOption.Value }} + Env: "$(CmakeEnvArg)" diff --git a/eng/pipelines/templates/stages/platform-matrix-cmakegenerate.json b/eng/pipelines/templates/stages/platform-matrix-cmakegenerate.json new file mode 100644 index 0000000000..4125708c8e --- /dev/null +++ b/eng/pipelines/templates/stages/platform-matrix-cmakegenerate.json @@ -0,0 +1,32 @@ +{ + "displayNames": { + "_": "" + }, + "include": [ + { + "StaticConfigs": { + "_": { + "CmakeEnvArg": "" + } + }, + "OSConfig": { + "Linux": { + "Pool": "azsdk-pool-mms-ubuntu-1804-general", + "OSVmImage": "MMSUbuntu18.04", + "AptDependencies": "libcurl4-openssl-dev", + "VCPKG_DEFAULT_TRIPLET": "x64-linux" + }, + "Windows": { + "Pool": "azsdk-pool-mms-win-2019-general", + "OSVmImage": "MMS2019", + "VCPKG_DEFAULT_TRIPLET": "x64-windows" + }, + "Mac": { + "Pool": "Azure Pipelines", + "OSVmImage": "macOS-10.15", + "VCPKG_DEFAULT_TRIPLET": "x64-osx" + } + } + } + ] +} diff --git a/eng/pipelines/templates/stages/platform-matrix-cmakesourcegenerate.json b/eng/pipelines/templates/stages/platform-matrix-cmakesourcegenerate.json new file mode 100644 index 0000000000..ba1d1095e0 --- /dev/null +++ b/eng/pipelines/templates/stages/platform-matrix-cmakesourcegenerate.json @@ -0,0 +1,28 @@ +{ + "displayNames": { + "_": "" + }, + "include": [ + { + "OSConfig": { + "Windows": { + "Pool": "azsdk-pool-mms-win-2019-general", + "OSVmImage": "MMS2019", + "CmakeEnvArg": "" + }, + "Linux": { + "Pool": "azsdk-pool-mms-ubuntu-1804-general", + "OSVmImage": "MMSUbuntu18.04", + "CmakeEnvArg": "", + "AptDependencies": "libcurl4-openssl-dev" + }, + "Mac": { + "Pool": "Azure Pipelines", + "OSVmImage": "macOS-10.15", + "CmakeEnvArg": "OPENSSL_ROOT_DIR=/usr/local/opt/openssl@3 OPENSSL_INCLUDE_DIR=/usr/local/opt/openssl@3/include ", + "BrewDependencies": "openssl" + } + } + } + ] +} From 9d8ef792d28a7cb208a4f9c396a3d6db792a423c Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Thu, 14 Apr 2022 07:02:43 -0700 Subject: [PATCH 14/32] Spelling --- .../templates/jobs/archetype-sdk-cmake-generate.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/pipelines/templates/jobs/archetype-sdk-cmake-generate.yml b/eng/pipelines/templates/jobs/archetype-sdk-cmake-generate.yml index 2dfd0d4c93..abb688ae3e 100644 --- a/eng/pipelines/templates/jobs/archetype-sdk-cmake-generate.yml +++ b/eng/pipelines/templates/jobs/archetype-sdk-cmake-generate.yml @@ -22,7 +22,7 @@ jobs: - Name: base Path: eng/pipelines/templates/stages/platform-matrix-cmakegenerate.json GenerateVMJobs: true - JobTemplatePath: /eng/pipelines/templates/job/cmake-generate.tests.yml + JobTemplatePath: /eng/pipelines/templates/jobs/cmake-generate.tests.yml AdditionalParameters: Artifacts: ${{ parameters.Artifacts }} ServiceDirectory: ${{ parameters.ServiceDirectory }} @@ -33,9 +33,9 @@ jobs: parameters: MatrixConfigs: - Name: base - Path: eng/pipelines/templates/stages/platform-matrix-cmakegenerate.json + Path: eng/pipelines/templates/stages/platform-matrix-cmakesourcegenerate.json GenerateVMJobs: true - JobTemplatePath: /eng/pipelines/templates/job/cmake-source-generate.tests.yml + JobTemplatePath: /eng/pipelines/templates/jobs/cmake-source-generate.tests.yml AdditionalParameters: Artifacts: ${{ parameters.ArtifactsSource }} ServiceDirectory: ${{ parameters.ServiceDirectory }} From 86f6259f2fe81d74e0fe077ddc3c60b8370193a5 Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Thu, 14 Apr 2022 07:07:43 -0700 Subject: [PATCH 15/32] Template name mappings --- eng/pipelines/templates/jobs/archetype-sdk-cmake-generate.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eng/pipelines/templates/jobs/archetype-sdk-cmake-generate.yml b/eng/pipelines/templates/jobs/archetype-sdk-cmake-generate.yml index abb688ae3e..e7f2da83da 100644 --- a/eng/pipelines/templates/jobs/archetype-sdk-cmake-generate.yml +++ b/eng/pipelines/templates/jobs/archetype-sdk-cmake-generate.yml @@ -23,11 +23,11 @@ jobs: Path: eng/pipelines/templates/stages/platform-matrix-cmakegenerate.json GenerateVMJobs: true JobTemplatePath: /eng/pipelines/templates/jobs/cmake-generate.tests.yml + GenerateJobName: generate_matrix_cmake AdditionalParameters: Artifacts: ${{ parameters.Artifacts }} ServiceDirectory: ${{ parameters.ServiceDirectory }} CMakeTestOptions: ${{ parameters.CMakeTestOptions }} - CMakeSourceTestOptions: ${{ parameters.CMakeSourceTestOptions }} - template: /eng/common/pipelines/templates/jobs/archetype-sdk-tests-generate.yml parameters: @@ -36,6 +36,7 @@ jobs: Path: eng/pipelines/templates/stages/platform-matrix-cmakesourcegenerate.json GenerateVMJobs: true JobTemplatePath: /eng/pipelines/templates/jobs/cmake-source-generate.tests.yml + GenerateJobName: generate_matrix_cmake_source AdditionalParameters: Artifacts: ${{ parameters.ArtifactsSource }} ServiceDirectory: ${{ parameters.ServiceDirectory }} From 69fb39c046cb23b9797c9c90b44bd4e744a1a153 Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Thu, 14 Apr 2022 07:10:48 -0700 Subject: [PATCH 16/32] Formatting, parameters --- .../templates/jobs/cmake-generate.tests.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/eng/pipelines/templates/jobs/cmake-generate.tests.yml b/eng/pipelines/templates/jobs/cmake-generate.tests.yml index ad404abed1..4e137d18fb 100644 --- a/eng/pipelines/templates/jobs/cmake-generate.tests.yml +++ b/eng/pipelines/templates/jobs/cmake-generate.tests.yml @@ -17,10 +17,22 @@ parameters: - name: UsePlatformContainer type: boolean default: false + - name: DependsOn + type: string + default: not-set + - name: CloudConfig + type: object + default: {} jobs: - job: CMakeGenerate - condition: and(succeededOrFailed(), ne(variables['Skip.CMakeGenerate'], 'true')) + condition: >- + and( + succeededOrFailed(), + ne(variables['Skip.CMakeGenerate'], 'true'), + ne(${{ parameters.Matrix }}, '{}') + ) + dependsOn: ${{ parameters.DependsOn }} strategy: maxParallel: ${{ parameters.MaxParallel }} matrix: $[ ${{ parameters.Matrix }} ] From db0e177a3a7e2eb2aff08148a05267fc1d554a9e Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Thu, 14 Apr 2022 07:13:55 -0700 Subject: [PATCH 17/32] Filename --- eng/pipelines/templates/jobs/archetype-sdk-cmake-generate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/templates/jobs/archetype-sdk-cmake-generate.yml b/eng/pipelines/templates/jobs/archetype-sdk-cmake-generate.yml index e7f2da83da..b9b9f70032 100644 --- a/eng/pipelines/templates/jobs/archetype-sdk-cmake-generate.yml +++ b/eng/pipelines/templates/jobs/archetype-sdk-cmake-generate.yml @@ -35,7 +35,7 @@ jobs: - Name: base Path: eng/pipelines/templates/stages/platform-matrix-cmakesourcegenerate.json GenerateVMJobs: true - JobTemplatePath: /eng/pipelines/templates/jobs/cmake-source-generate.tests.yml + JobTemplatePath: /eng/pipelines/templates/jobs/cmake-generate.tests.yml GenerateJobName: generate_matrix_cmake_source AdditionalParameters: Artifacts: ${{ parameters.ArtifactsSource }} From b79fe4789faa3b52a40c2887fa075e357d59a4ca Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Thu, 14 Apr 2022 07:18:53 -0700 Subject: [PATCH 18/32] Job name --- .../templates/jobs/archetype-sdk-cmake-generate.yml | 1 + eng/pipelines/templates/jobs/cmake-generate.tests.yml | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/eng/pipelines/templates/jobs/archetype-sdk-cmake-generate.yml b/eng/pipelines/templates/jobs/archetype-sdk-cmake-generate.yml index b9b9f70032..a785e513aa 100644 --- a/eng/pipelines/templates/jobs/archetype-sdk-cmake-generate.yml +++ b/eng/pipelines/templates/jobs/archetype-sdk-cmake-generate.yml @@ -41,3 +41,4 @@ jobs: Artifacts: ${{ parameters.ArtifactsSource }} ServiceDirectory: ${{ parameters.ServiceDirectory }} CMakeTestOptions: ${{ parameters.CMakeSourceTestOptions }} + JobName: CMakeSourceGenerate diff --git a/eng/pipelines/templates/jobs/cmake-generate.tests.yml b/eng/pipelines/templates/jobs/cmake-generate.tests.yml index 4e137d18fb..535b2b1e61 100644 --- a/eng/pipelines/templates/jobs/cmake-generate.tests.yml +++ b/eng/pipelines/templates/jobs/cmake-generate.tests.yml @@ -23,9 +23,12 @@ parameters: - name: CloudConfig type: object default: {} + - name: JobName + type: string + default: CMakeGenerate jobs: -- job: CMakeGenerate +- job: ${{ parameters.JobName }} condition: >- and( succeededOrFailed(), From 62063797ec7ca506e0500ab7cdf0a398e9643b46 Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Thu, 14 Apr 2022 07:21:21 -0700 Subject: [PATCH 19/32] Selection --- eng/pipelines/templates/jobs/archetype-sdk-cmake-generate.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eng/pipelines/templates/jobs/archetype-sdk-cmake-generate.yml b/eng/pipelines/templates/jobs/archetype-sdk-cmake-generate.yml index a785e513aa..866610875d 100644 --- a/eng/pipelines/templates/jobs/archetype-sdk-cmake-generate.yml +++ b/eng/pipelines/templates/jobs/archetype-sdk-cmake-generate.yml @@ -21,6 +21,7 @@ jobs: MatrixConfigs: - Name: base Path: eng/pipelines/templates/stages/platform-matrix-cmakegenerate.json + Selection: all GenerateVMJobs: true JobTemplatePath: /eng/pipelines/templates/jobs/cmake-generate.tests.yml GenerateJobName: generate_matrix_cmake @@ -34,6 +35,7 @@ jobs: MatrixConfigs: - Name: base Path: eng/pipelines/templates/stages/platform-matrix-cmakesourcegenerate.json + Selection: all GenerateVMJobs: true JobTemplatePath: /eng/pipelines/templates/jobs/cmake-generate.tests.yml GenerateJobName: generate_matrix_cmake_source From 837c70d9df8a010645befb6e507c21aeec7ebe2f Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Thu, 14 Apr 2022 07:30:20 -0700 Subject: [PATCH 20/32] Remove duplicate bypass-local-dns.yml --- eng/pipelines/templates/jobs/cmake-generate.tests.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/eng/pipelines/templates/jobs/cmake-generate.tests.yml b/eng/pipelines/templates/jobs/cmake-generate.tests.yml index 535b2b1e61..4db29cb1a1 100644 --- a/eng/pipelines/templates/jobs/cmake-generate.tests.yml +++ b/eng/pipelines/templates/jobs/cmake-generate.tests.yml @@ -59,8 +59,6 @@ jobs: parameters: AgentImage: $(OSVmImage) - - template: /eng/common/pipelines/templates/steps/bypass-local-dns.yml - - pwsh: sudo apt update && sudo apt install -y $(AptDependencies) condition: and(succeeded(), ne(variables['AptDependencies'], '')) displayName: Install dependencies from apt From bba5937de826bb294452499864dbd0c36b27de1a Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Thu, 14 Apr 2022 07:38:57 -0700 Subject: [PATCH 21/32] Enable Location override --- eng/pipelines/templates/jobs/live.tests.yml | 3 ++- eng/pipelines/templates/stages/archetype-sdk-tests.yml | 3 +++ sdk/attestation/ci.yml | 5 +---- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/eng/pipelines/templates/jobs/live.tests.yml b/eng/pipelines/templates/jobs/live.tests.yml index 9cc45d3520..8d66e2be00 100644 --- a/eng/pipelines/templates/jobs/live.tests.yml +++ b/eng/pipelines/templates/jobs/live.tests.yml @@ -120,7 +120,8 @@ jobs: - template: /eng/common/TestResources/deploy-test-resources.yml parameters: ServiceDirectory: ${{ parameters.ServiceDirectory }} - Location: ${{ parameters.CloudConfig.Location }} + ${{ if or(parameters.Location, parameters.CloudConfig.Location) }}: + Location: ${{ coalesce(parameters.Location, parameters.CloudConfig.Location) }} SubscriptionConfiguration: ${{ parameters.CloudConfig.SubscriptionConfiguration }} # For non multi-config generator use the same build configuration to run tests diff --git a/eng/pipelines/templates/stages/archetype-sdk-tests.yml b/eng/pipelines/templates/stages/archetype-sdk-tests.yml index afd4c32603..7cc6edb924 100644 --- a/eng/pipelines/templates/stages/archetype-sdk-tests.yml +++ b/eng/pipelines/templates/stages/archetype-sdk-tests.yml @@ -14,6 +14,9 @@ parameters: - name: TimeoutInMinutes type: number default: 60 +- name: Location + type: string + default: '' - name: CloudConfig type: object default: {} diff --git a/sdk/attestation/ci.yml b/sdk/attestation/ci.yml index 64a7a2a86d..aa52b0e192 100644 --- a/sdk/attestation/ci.yml +++ b/sdk/attestation/ci.yml @@ -27,10 +27,7 @@ stages: parameters: ServiceDirectory: attestation Clouds: Public - CloudConfig: - Public: - SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) - Location: WestUS + Location: WestUS CtestRegex: azure-security-attestation.* LiveTestCtestRegex: azure-security-attestation.* LineCoverageTarget: 90 From a7dfbec6a5ae638607ca4a78f263c72352b20c6a Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Thu, 14 Apr 2022 07:45:19 -0700 Subject: [PATCH 22/32] Add Location --- eng/pipelines/templates/stages/archetype-sdk-client.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/eng/pipelines/templates/stages/archetype-sdk-client.yml b/eng/pipelines/templates/stages/archetype-sdk-client.yml index a0d861daf5..b2ec726a43 100644 --- a/eng/pipelines/templates/stages/archetype-sdk-client.yml +++ b/eng/pipelines/templates/stages/archetype-sdk-client.yml @@ -41,6 +41,9 @@ parameters: - name: CMakeSourceTestOptions type: object default: [] +- name: Location + type: string + value: '' - name: CloudConfig type: object default: @@ -102,6 +105,7 @@ stages: ServiceDirectory: ${{ parameters.ServiceDirectory }} CtestRegex: ${{ parameters.LiveTestCtestRegex }} CoverageReportPath: ${{ parameters.CoverageReportPath }} + Location: ${{ parameters.Location }} CloudConfig: ${{ parameters.CloudConfig }} Clouds: ${{ parameters.Clouds }} SupportedClouds: ${{ parameters.SupportedClouds }} From 1b483cccca711377fed57cb1e02c9d83be4f2f2d Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Thu, 14 Apr 2022 07:46:00 -0700 Subject: [PATCH 23/32] Spelling --- eng/pipelines/templates/stages/archetype-sdk-client.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/templates/stages/archetype-sdk-client.yml b/eng/pipelines/templates/stages/archetype-sdk-client.yml index b2ec726a43..f0fb211d01 100644 --- a/eng/pipelines/templates/stages/archetype-sdk-client.yml +++ b/eng/pipelines/templates/stages/archetype-sdk-client.yml @@ -43,7 +43,7 @@ parameters: default: [] - name: Location type: string - value: '' + default: '' - name: CloudConfig type: object default: From b5fc6b19ac6c0e4a3f82147ab0b7b0aa75f94731 Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Thu, 14 Apr 2022 08:10:17 -0700 Subject: [PATCH 24/32] Add spelling words --- .vscode/cspell.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.vscode/cspell.json b/.vscode/cspell.json index 9074868966..9c6a632f34 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -146,7 +146,9 @@ "issecret", "PSScriptRoot", "BUILDID", - "cppvcpkgcache" + "cppvcpkgcache", + "cmakegenerate", + "cmakesourcegenerate" ] }, { From a677627edbdbbb9c4fedfedd155c94bd4b9e06ef Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Thu, 14 Apr 2022 12:03:26 -0700 Subject: [PATCH 25/32] Use Ubuntu 20 where the name specifies Ubuntu 20 --- eng/pipelines/templates/stages/platform-matrix-live.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/pipelines/templates/stages/platform-matrix-live.json b/eng/pipelines/templates/stages/platform-matrix-live.json index f9f60c6ff3..07787623a9 100644 --- a/eng/pipelines/templates/stages/platform-matrix-live.json +++ b/eng/pipelines/templates/stages/platform-matrix-live.json @@ -42,8 +42,8 @@ "StaticConfigs": { "_": { "BuildArgs": "-j 4", - "Pool": "azsdk-pool-mms-ubuntu-1804-general", - "OSVmImage": "MMSUbuntu18.04", + "Pool": "azsdk-pool-mms-ubuntu-2004-general", + "OSVmImage": "MMSUbuntu20.04", "VCPKG_DEFAULT_TRIPLET": "x64-linux" } }, From a113f2964a9022b03f409c912289bddd6a72524a Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Mon, 18 Apr 2022 11:52:32 -0700 Subject: [PATCH 26/32] Apply suggestions from code review Co-authored-by: Ben Broderick Phillips --- .../templates/stages/platform-matrix-cmakegenerate.json | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/eng/pipelines/templates/stages/platform-matrix-cmakegenerate.json b/eng/pipelines/templates/stages/platform-matrix-cmakegenerate.json index 4125708c8e..c89b01fe22 100644 --- a/eng/pipelines/templates/stages/platform-matrix-cmakegenerate.json +++ b/eng/pipelines/templates/stages/platform-matrix-cmakegenerate.json @@ -4,11 +4,7 @@ }, "include": [ { - "StaticConfigs": { - "_": { - "CmakeEnvArg": "" - } - }, + "CmakeEnvArg": "", "OSConfig": { "Linux": { "Pool": "azsdk-pool-mms-ubuntu-1804-general", From 2f217ebd1e63aa1cb29f2ea8091bca54b2d020aa Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Mon, 18 Apr 2022 11:53:13 -0700 Subject: [PATCH 27/32] PR feedback --- .../templates/stages/platform-matrix-cmakegenerate.json | 4 ++-- .../templates/stages/platform-matrix-cmakesourcegenerate.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/pipelines/templates/stages/platform-matrix-cmakegenerate.json b/eng/pipelines/templates/stages/platform-matrix-cmakegenerate.json index c89b01fe22..28efe99c57 100644 --- a/eng/pipelines/templates/stages/platform-matrix-cmakegenerate.json +++ b/eng/pipelines/templates/stages/platform-matrix-cmakegenerate.json @@ -2,9 +2,9 @@ "displayNames": { "_": "" }, - "include": [ + "matrix": [ { - "CmakeEnvArg": "", + "CmakeEnvArg": "", "OSConfig": { "Linux": { "Pool": "azsdk-pool-mms-ubuntu-1804-general", diff --git a/eng/pipelines/templates/stages/platform-matrix-cmakesourcegenerate.json b/eng/pipelines/templates/stages/platform-matrix-cmakesourcegenerate.json index ba1d1095e0..8fb375d0be 100644 --- a/eng/pipelines/templates/stages/platform-matrix-cmakesourcegenerate.json +++ b/eng/pipelines/templates/stages/platform-matrix-cmakesourcegenerate.json @@ -2,7 +2,7 @@ "displayNames": { "_": "" }, - "include": [ + "matrix": [ { "OSConfig": { "Windows": { From 2dda1ba6d0fce624ad90db2a26c02c1c47e15534 Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Mon, 18 Apr 2022 13:27:57 -0700 Subject: [PATCH 28/32] Rename from archetype- --- ...archetype-sdk-cmake-generate.yml => cmake-generate-jobs.yml} | 0 eng/pipelines/templates/stages/archetype-sdk-client.yml | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename eng/pipelines/templates/jobs/{archetype-sdk-cmake-generate.yml => cmake-generate-jobs.yml} (100%) diff --git a/eng/pipelines/templates/jobs/archetype-sdk-cmake-generate.yml b/eng/pipelines/templates/jobs/cmake-generate-jobs.yml similarity index 100% rename from eng/pipelines/templates/jobs/archetype-sdk-cmake-generate.yml rename to eng/pipelines/templates/jobs/cmake-generate-jobs.yml diff --git a/eng/pipelines/templates/stages/archetype-sdk-client.yml b/eng/pipelines/templates/stages/archetype-sdk-client.yml index f0fb211d01..3c478076b8 100644 --- a/eng/pipelines/templates/stages/archetype-sdk-client.yml +++ b/eng/pipelines/templates/stages/archetype-sdk-client.yml @@ -72,7 +72,7 @@ parameters: stages: - stage: CMakeGeneration jobs: - - template: /eng/pipelines/templates/jobs/archetype-sdk-cmake-generate.yml + - template: /eng/pipelines/templates/jobs/cmake-generate-jobs.yml parameters: ServiceDirectory: ${{ parameters.ServiceDirectory }} Artifacts: ${{ parameters.Artifacts }} From d89d1fb346d8ec777843540532107530a8a5f664 Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Mon, 18 Apr 2022 13:29:49 -0700 Subject: [PATCH 29/32] Remove Unsupported Clouds --- sdk/storage/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/sdk/storage/ci.yml b/sdk/storage/ci.yml index 4349ebf97b..017ab238a9 100644 --- a/sdk/storage/ci.yml +++ b/sdk/storage/ci.yml @@ -32,7 +32,6 @@ stages: LiveTestCtestRegex: azure-storage Clouds: Preview SupportedClouds: Preview - UnsupportedClouds: Public,Canary,UsGov,China Artifacts: - Name: azure-storage-common Path: azure-storage-common From 6fe9338aff6fa0b59df5d9f808bbde7150f1e976 Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Thu, 21 Apr 2022 12:02:27 -0700 Subject: [PATCH 30/32] Express matrix properly --- .../stages/platform-matrix-cmakegenerate.json | 43 ++++++++----------- .../platform-matrix-cmakesourcegenerate.json | 43 ++++++++----------- 2 files changed, 38 insertions(+), 48 deletions(-) diff --git a/eng/pipelines/templates/stages/platform-matrix-cmakegenerate.json b/eng/pipelines/templates/stages/platform-matrix-cmakegenerate.json index 28efe99c57..1bab65ae73 100644 --- a/eng/pipelines/templates/stages/platform-matrix-cmakegenerate.json +++ b/eng/pipelines/templates/stages/platform-matrix-cmakegenerate.json @@ -1,28 +1,23 @@ { - "displayNames": { - "_": "" - }, - "matrix": [ - { - "CmakeEnvArg": "", - "OSConfig": { - "Linux": { - "Pool": "azsdk-pool-mms-ubuntu-1804-general", - "OSVmImage": "MMSUbuntu18.04", - "AptDependencies": "libcurl4-openssl-dev", - "VCPKG_DEFAULT_TRIPLET": "x64-linux" - }, - "Windows": { - "Pool": "azsdk-pool-mms-win-2019-general", - "OSVmImage": "MMS2019", - "VCPKG_DEFAULT_TRIPLET": "x64-windows" - }, - "Mac": { - "Pool": "Azure Pipelines", - "OSVmImage": "macOS-10.15", - "VCPKG_DEFAULT_TRIPLET": "x64-osx" - } + "matrix": { + "CmakeEnvArg": "", + "OSConfig": { + "Linux": { + "Pool": "azsdk-pool-mms-ubuntu-1804-general", + "OSVmImage": "MMSUbuntu18.04", + "AptDependencies": "libcurl4-openssl-dev", + "VCPKG_DEFAULT_TRIPLET": "x64-linux" + }, + "Windows": { + "Pool": "azsdk-pool-mms-win-2019-general", + "OSVmImage": "MMS2019", + "VCPKG_DEFAULT_TRIPLET": "x64-windows" + }, + "Mac": { + "Pool": "Azure Pipelines", + "OSVmImage": "macOS-10.15", + "VCPKG_DEFAULT_TRIPLET": "x64-osx" } } - ] + } } diff --git a/eng/pipelines/templates/stages/platform-matrix-cmakesourcegenerate.json b/eng/pipelines/templates/stages/platform-matrix-cmakesourcegenerate.json index 8fb375d0be..701d9d055f 100644 --- a/eng/pipelines/templates/stages/platform-matrix-cmakesourcegenerate.json +++ b/eng/pipelines/templates/stages/platform-matrix-cmakesourcegenerate.json @@ -1,28 +1,23 @@ { - "displayNames": { - "_": "" - }, - "matrix": [ - { - "OSConfig": { - "Windows": { - "Pool": "azsdk-pool-mms-win-2019-general", - "OSVmImage": "MMS2019", - "CmakeEnvArg": "" - }, - "Linux": { - "Pool": "azsdk-pool-mms-ubuntu-1804-general", - "OSVmImage": "MMSUbuntu18.04", - "CmakeEnvArg": "", - "AptDependencies": "libcurl4-openssl-dev" - }, - "Mac": { - "Pool": "Azure Pipelines", - "OSVmImage": "macOS-10.15", - "CmakeEnvArg": "OPENSSL_ROOT_DIR=/usr/local/opt/openssl@3 OPENSSL_INCLUDE_DIR=/usr/local/opt/openssl@3/include ", - "BrewDependencies": "openssl" - } + "matrix": { + "OSConfig": { + "Windows": { + "Pool": "azsdk-pool-mms-win-2019-general", + "OSVmImage": "MMS2019", + "CmakeEnvArg": "" + }, + "Linux": { + "Pool": "azsdk-pool-mms-ubuntu-1804-general", + "OSVmImage": "MMSUbuntu18.04", + "CmakeEnvArg": "", + "AptDependencies": "libcurl4-openssl-dev" + }, + "Mac": { + "Pool": "Azure Pipelines", + "OSVmImage": "macOS-10.15", + "CmakeEnvArg": "OPENSSL_ROOT_DIR=/usr/local/opt/openssl@3 OPENSSL_INCLUDE_DIR=/usr/local/opt/openssl@3/include ", + "BrewDependencies": "openssl" } } - ] + } } From b210736862f686e4536c926fa8aa4a9a4a9a96b5 Mon Sep 17 00:00:00 2001 From: Victor Vazquez Date: Mon, 25 Apr 2022 19:13:05 +0000 Subject: [PATCH 31/32] fix storage sample --- .../test/ut/share_file_client_test.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/sdk/storage/azure-storage-files-shares/test/ut/share_file_client_test.cpp b/sdk/storage/azure-storage-files-shares/test/ut/share_file_client_test.cpp index fed1ae16f0..11d45b2214 100644 --- a/sdk/storage/azure-storage-files-shares/test/ut/share_file_client_test.cpp +++ b/sdk/storage/azure-storage-files-shares/test/ut/share_file_client_test.cpp @@ -538,32 +538,31 @@ namespace Azure { namespace Storage { namespace Test { std::vector expectedData = m_fileContent; int64_t fileSize = m_fileContent.size(); int64_t actualDownloadSize = std::min(p.DownloadSize, fileSize); - auto offset = p.Offset; auto length = p.Length; auto chunkSize = p.ChunkSize; auto concurrency = p.Concurrency; auto initialChunkSize = p.InitialChunkSize; - if (offset.HasValue() && length.HasValue()) + if (p.Offset.HasValue() && length.HasValue()) { - actualDownloadSize = std::min(length.Value(), fileSize - offset.Value()); + actualDownloadSize = std::min(length.Value(), fileSize - p.Offset.Value()); if (actualDownloadSize >= 0) { expectedData.assign( - m_fileContent.begin() + static_cast(offset.Value()), - m_fileContent.begin() + static_cast(offset.Value() + actualDownloadSize)); + m_fileContent.begin() + static_cast(p.Offset.Value()), + m_fileContent.begin() + static_cast(p.Offset.Value() + actualDownloadSize)); } else { expectedData.clear(); } } - else if (offset.HasValue()) + else if (p.Offset.HasValue()) { - actualDownloadSize = fileSize - offset.Value(); + actualDownloadSize = fileSize - p.Offset.Value(); if (actualDownloadSize >= 0) { expectedData.assign( - m_fileContent.begin() + static_cast(offset.Value()), m_fileContent.end()); + m_fileContent.begin() + static_cast(p.Offset.Value()), m_fileContent.end()); } else { @@ -573,10 +572,10 @@ namespace Azure { namespace Storage { namespace Test { downloadBuffer.resize(static_cast(p.DownloadSize), '\x00'); Files::Shares::DownloadFileToOptions options; options.TransferOptions.Concurrency = concurrency; - if (offset.HasValue()) + if (p.Offset.HasValue()) { options.Range = Core::Http::HttpRange(); - options.Range.Value().Offset = offset.Value(); + options.Range.Value().Offset = p.Offset.Value(); options.Range.Value().Length = length; } From 9ec75ef3ff309ec2d02bd45d0209c9f735123e58 Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Tue, 26 Apr 2022 07:03:19 -0700 Subject: [PATCH 32/32] Matrix documentation --- eng/pipelines/templates/jobs/ci.tests.yml | 2 ++ eng/pipelines/templates/jobs/cmake-generate.tests.yml | 2 ++ eng/pipelines/templates/jobs/live.tests.yml | 2 ++ 3 files changed, 6 insertions(+) diff --git a/eng/pipelines/templates/jobs/ci.tests.yml b/eng/pipelines/templates/jobs/ci.tests.yml index a9d25fda90..9f27a6f855 100644 --- a/eng/pipelines/templates/jobs/ci.tests.yml +++ b/eng/pipelines/templates/jobs/ci.tests.yml @@ -20,6 +20,8 @@ parameters: - name: CoverageEnabled type: boolean default: true + # Matrix generation: + # https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/scripts/job-matrix/README.md - name: Matrix type: string - name: LineCoverageTarget diff --git a/eng/pipelines/templates/jobs/cmake-generate.tests.yml b/eng/pipelines/templates/jobs/cmake-generate.tests.yml index 4db29cb1a1..cbf285a181 100644 --- a/eng/pipelines/templates/jobs/cmake-generate.tests.yml +++ b/eng/pipelines/templates/jobs/cmake-generate.tests.yml @@ -11,6 +11,8 @@ parameters: - name: MaxParallel type: number default: 0 + # Matrix generation: + # https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/scripts/job-matrix/README.md - name: Matrix type: string default: '' diff --git a/eng/pipelines/templates/jobs/live.tests.yml b/eng/pipelines/templates/jobs/live.tests.yml index 8d66e2be00..5d3ae87fae 100644 --- a/eng/pipelines/templates/jobs/live.tests.yml +++ b/eng/pipelines/templates/jobs/live.tests.yml @@ -23,6 +23,8 @@ parameters: - name: DependsOn type: string default: '' +# Matrix generation: +# https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/scripts/job-matrix/README.md - name: Matrix type: string - name: MaxParallel