From 387e2eb696f7252bc70e0369f00da4750d1335f8 Mon Sep 17 00:00:00 2001 From: Kirstyn Amperiadis <102087132+kamperiadis@users.noreply.github.com> Date: Tue, 11 Jun 2024 16:19:09 -0500 Subject: [PATCH] [1ES] Add end to end integration tests pipeline (#767) * Add 1ES pipeline for end to end tests * Stagger nightly build runs --- eng/ci/integration-tests.yml | 42 +++++++++++++++++++ eng/ci/official-build.yml | 3 +- .../official/jobs/run-e2e-tests-linux.yml | 17 ++++++-- .../official/jobs/run-e2e-tests-windows.yml | 18 ++++++-- 4 files changed, 72 insertions(+), 8 deletions(-) create mode 100644 eng/ci/integration-tests.yml diff --git a/eng/ci/integration-tests.yml b/eng/ci/integration-tests.yml new file mode 100644 index 0000000..f294665 --- /dev/null +++ b/eng/ci/integration-tests.yml @@ -0,0 +1,42 @@ +trigger: none # ensure this is not ran as a CI build + +pr: + branches: + include: + - dev + - release/* + +resources: + repositories: + - repository: 1es + type: git + name: 1ESPipelineTemplates/1ESPipelineTemplates + ref: refs/tags/release + - repository: eng + type: git + name: engineering + ref: refs/tags/release + +variables: + - template: ci/variables/build.yml@eng + - template: /ci/variables/cfs.yml@eng + +extends: + template: v1/1ES.Unofficial.PipelineTemplate.yml@1es + parameters: + pool: + name: 1es-pool-azfunc + image: 1es-windows-2022 + os: windows + + stages: + - stage: TestWindows + jobs: + - template: /eng/ci/templates/official/jobs/run-e2e-tests-windows.yml@self + + - stage: TestLinux + dependsOn: + - TestWindows + + jobs: + - template: /eng/ci/templates/official/jobs/run-e2e-tests-linux.yml@self \ No newline at end of file diff --git a/eng/ci/official-build.yml b/eng/ci/official-build.yml index 5730600..12e6f64 100644 --- a/eng/ci/official-build.yml +++ b/eng/ci/official-build.yml @@ -1,5 +1,5 @@ schedules: -- cron: "0 0 * * *" +- cron: "0 20 * * *" displayName: Nightly Build branches: include: @@ -53,7 +53,6 @@ extends: - stage: TestLinux dependsOn: - - Build - TestWindows jobs: diff --git a/eng/ci/templates/official/jobs/run-e2e-tests-linux.yml b/eng/ci/templates/official/jobs/run-e2e-tests-linux.yml index d98df66..0d078d6 100644 --- a/eng/ci/templates/official/jobs/run-e2e-tests-linux.yml +++ b/eng/ci/templates/official/jobs/run-e2e-tests-linux.yml @@ -8,8 +8,10 @@ jobs: os: linux variables: - buildNumber: $[ stageDependencies.Build.Build.outputs['output.buildNumber'] ] - ApplicationInsightAgentVersion: 3.5.1 + ${{ if contains(variables['Build.SourceBranch'], '/tags/' ) }}: + isTagTemp: true + isTag: $[variables.isTagTemp] + ApplicationInsightAgentVersion: 3.5.2 strategy: maxParallel: 1 @@ -53,7 +55,16 @@ jobs: java -version displayName: 'Check default java version' - pwsh: | - .\package-pipeline.ps1 -buildNumber $(buildNumber) + if ("$(isTag)"){ + $buildNumber="$(Build.SourceBranchName)" + Write-Host "Found git tag." + } + else { + $buildNumber="$(Build.BuildNumber)-v4" + Write-Host "git tag not found. Setting package suffix to '$buildNumber'" + } + Write-Host "##vso[task.setvariable variable=buildNumber;isOutput=true;]$buildNumber" + .\package-pipeline.ps1 -buildNumber $buildNumber displayName: 'Executing build script' - task: UseDotNet@2 displayName: 'Install .NET 6' diff --git a/eng/ci/templates/official/jobs/run-e2e-tests-windows.yml b/eng/ci/templates/official/jobs/run-e2e-tests-windows.yml index 2d7edff..cb9e9d3 100644 --- a/eng/ci/templates/official/jobs/run-e2e-tests-windows.yml +++ b/eng/ci/templates/official/jobs/run-e2e-tests-windows.yml @@ -8,8 +8,10 @@ jobs: os: windows variables: - buildNumber: $[ stageDependencies.Build.Build.outputs['output.buildNumber'] ] - ApplicationInsightAgentVersion: 3.5.1 + ${{ if contains(variables['Build.SourceBranch'], '/tags/' ) }}: + isTagTemp: true + isTag: $[variables.isTagTemp] + ApplicationInsightAgentVersion: 3.5.2 strategy: maxParallel: 1 @@ -43,7 +45,16 @@ jobs: java -version displayName: 'Check default java version' - pwsh: | - .\package-pipeline.ps1 -buildNumber $(buildNumber) + if ("$(isTag)"){ + $buildNumber="$(Build.SourceBranchName)" + Write-Host "Found git tag." + } + else { + $buildNumber="$(Build.BuildNumber)-v4" + Write-Host "git tag not found. Setting package suffix to '$buildNumber'" + } + Write-Host "##vso[task.setvariable variable=buildNumber;isOutput=true;]$buildNumber" + .\package-pipeline.ps1 -buildNumber $buildNumber displayName: 'Executing build script' - task: UseDotNet@2 displayName: 'Install .NET 6' @@ -61,6 +72,7 @@ jobs: - pwsh: | .\setup-tests-pipeline.ps1 displayName: 'Setup test environment -- Install the Core Tools' + - pwsh: | $currDir = Get-Location $Env:Path = $Env:Path+";$currDir/Azure.Functions.Cli"