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" ] }, { diff --git a/eng/pipelines/templates/jobs/archetype-sdk-cmake-generate.yml b/eng/pipelines/templates/jobs/archetype-sdk-cmake-generate.yml deleted file mode 100644 index 4452b018de..0000000000 --- a/eng/pipelines/templates/jobs/archetype-sdk-cmake-generate.yml +++ /dev/null @@ -1,131 +0,0 @@ -parameters: - - name: Artifacts - type: object - default: [] - - name: ArtifactsSource - type: object - default: [] - - name: ServiceDirectory - type: string - default: not-specified - - name: CMakeTestOptions - type: object - default: [] - - name: CMakeSourceTestOptions - type: object - 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 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 4edbe88902..0000000000 --- a/eng/pipelines/templates/jobs/archetype-sdk-tests.yml +++ /dev/null @@ -1,302 +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 - -# 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: -- 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 }} 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-jobs.yml b/eng/pipelines/templates/jobs/cmake-generate-jobs.yml new file mode 100644 index 0000000000..866610875d --- /dev/null +++ b/eng/pipelines/templates/jobs/cmake-generate-jobs.yml @@ -0,0 +1,46 @@ +parameters: + - name: Artifacts + type: object + default: [] + - name: ArtifactsSource + type: object + default: [] + - name: ServiceDirectory + type: string + default: not-specified + - name: CMakeTestOptions + type: object + default: [] + - name: CMakeSourceTestOptions + type: object + default: [] + +jobs: +- template: /eng/common/pipelines/templates/jobs/archetype-sdk-tests-generate.yml + parameters: + 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 + AdditionalParameters: + Artifacts: ${{ parameters.Artifacts }} + ServiceDirectory: ${{ parameters.ServiceDirectory }} + CMakeTestOptions: ${{ parameters.CMakeTestOptions }} + +- template: /eng/common/pipelines/templates/jobs/archetype-sdk-tests-generate.yml + parameters: + 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 + AdditionalParameters: + 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 new file mode 100644 index 0000000000..cbf285a181 --- /dev/null +++ b/eng/pipelines/templates/jobs/cmake-generate.tests.yml @@ -0,0 +1,86 @@ +parameters: + - name: Artifacts + type: object + default: [] + - name: ServiceDirectory + type: string + default: not-specified + - name: CMakeTestOptions + type: object + default: [] + - 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: '' + - name: UsePlatformContainer + type: boolean + default: false + - name: DependsOn + type: string + default: not-set + - name: CloudConfig + type: object + default: {} + - name: JobName + type: string + default: CMakeGenerate + +jobs: +- job: ${{ parameters.JobName }} + condition: >- + and( + succeededOrFailed(), + ne(variables['Skip.CMakeGenerate'], 'true'), + ne(${{ parameters.Matrix }}, '{}') + ) + dependsOn: ${{ parameters.DependsOn }} + 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) + + - 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/jobs/live.tests.yml b/eng/pipelines/templates/jobs/live.tests.yml new file mode 100644 index 0000000000..5d3ae87fae --- /dev/null +++ b/eng/pipelines/templates/jobs/live.tests.yml @@ -0,0 +1,199 @@ +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: '' +# Matrix generation: +# https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/scripts/job-matrix/README.md +- name: Matrix + type: string +- name: MaxParallel + type: number + default: 0 +- 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 }} ] + + 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 }} + ${{ 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 + # 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 }} diff --git a/eng/pipelines/templates/stages/archetype-sdk-client.yml b/eng/pipelines/templates/stages/archetype-sdk-client.yml index d980b0f90f..3c478076b8 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,11 +41,38 @@ parameters: - name: CMakeSourceTestOptions type: object default: [] +- name: Location + type: string + 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 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 }} @@ -77,18 +98,18 @@ 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 }} + Location: ${{ parameters.Location }} + 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 @@ -98,7 +119,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') }}: 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..7cc6edb924 --- /dev/null +++ b/eng/pipelines/templates/stages/archetype-sdk-tests.yml @@ -0,0 +1,59 @@ +parameters: +- 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: Location + type: string + default: '' +- name: CloudConfig + type: object + default: {} +- name: Clouds + type: string + default: Public +- 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: LiveTest_${{ 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}} 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..1bab65ae73 --- /dev/null +++ b/eng/pipelines/templates/stages/platform-matrix-cmakegenerate.json @@ -0,0 +1,23 @@ +{ + "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 new file mode 100644 index 0000000000..701d9d055f --- /dev/null +++ b/eng/pipelines/templates/stages/platform-matrix-cmakesourcegenerate.json @@ -0,0 +1,23 @@ +{ + "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" + } + } + } +} 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..07787623a9 --- /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-2004-general", + "OSVmImage": "MMSUbuntu20.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 diff --git a/sdk/attestation/ci.yml b/sdk/attestation/ci.yml index 6d811cab27..aa52b0e192 100644 --- a/sdk/attestation/ci.yml +++ b/sdk/attestation/ci.yml @@ -26,6 +26,7 @@ stages: - template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: ServiceDirectory: attestation + Clouds: Public Location: WestUS CtestRegex: azure-security-attestation.* LiveTestCtestRegex: azure-security-attestation.* 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 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/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; } diff --git a/sdk/storage/ci.yml b/sdk/storage/ci.yml index 4238300c08..017ab238a9 100644 --- a/sdk/storage/ci.yml +++ b/sdk/storage/ci.yml @@ -30,7 +30,8 @@ stages: LineCoverageTarget: 76 BranchCoverageTarget: 41 LiveTestCtestRegex: azure-storage - SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources-preview) + Clouds: Preview + SupportedClouds: Preview Artifacts: - Name: azure-storage-common Path: azure-storage-common