|
| 1 | +# Starter pipeline |
| 2 | +# Start with a minimal pipeline that you can customize to build and deploy your code. |
| 3 | +# Add steps that build, run tests, deploy, and more: |
| 4 | + |
| 5 | +pr: none |
| 6 | +trigger: none |
| 7 | + |
| 8 | +jobs: |
| 9 | + - job: "End_to_end_integration_tests" |
| 10 | + variables: |
| 11 | + ApplicationInsightAgentVersion: 3.5.1 |
| 12 | + displayName: 'End to end integration tests' |
| 13 | + strategy: |
| 14 | + maxParallel: 1 |
| 15 | + matrix: |
| 16 | + open-jdk-8-linux: |
| 17 | + IMAGE_TYPE: 'ubuntu-latest' |
| 18 | + JDK_DOWNLOAD_LINK: 'https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u392-b08/OpenJDK8U-jdk_x64_linux_hotspot_8u392b08.tar.gz' |
| 19 | + JAVA_VERSION: 'OpenJDK8U-jdk_x64_linux_hotspot_8u392b08' |
| 20 | + JDK_PATH: 'jdk8u392-b08' |
| 21 | + JAVA_VERSION_SPEC: '8' |
| 22 | + open-jdk-8-windows: |
| 23 | + IMAGE_TYPE: 'windows-latest' |
| 24 | + JDK_DOWNLOAD_LINK: 'https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u392-b08/OpenJDK8U-jdk_x64_windows_hotspot_8u392b08.zip' |
| 25 | + JAVA_VERSION: 'OpenJDK8U-jdk_x64_windows_hotspot_8u392b08' |
| 26 | + JDK_PATH: 'jdk8u392-b08' |
| 27 | + microsoft-open-jdk-11-linux: |
| 28 | + IMAGE_TYPE: 'ubuntu-latest' |
| 29 | + JDK_DOWNLOAD_LINK: 'https://aka.ms/download-jdk/microsoft-jdk-11.0.21-linux-x64.tar.gz' |
| 30 | + JAVA_VERSION: 'microsoft-jdk-11.0.21-linux-x64' |
| 31 | + JDK_PATH: 'jdk-11.0.21+9' |
| 32 | + JAVA_VERSION_SPEC: '11' |
| 33 | + microsoft-open-jdk-11-windows: |
| 34 | + IMAGE_TYPE: 'windows-latest' |
| 35 | + JDK_DOWNLOAD_LINK: 'https://aka.ms/download-jdk/microsoft-jdk-11.0.21-windows-x64.zip' |
| 36 | + JAVA_VERSION: 'microsoft-jdk-11.0.21-windows-x64' |
| 37 | + JDK_PATH: 'jdk-11.0.21+9' |
| 38 | + microsoft-open-jdk-17-linux: |
| 39 | + IMAGE_TYPE: 'ubuntu-latest' |
| 40 | + JDK_DOWNLOAD_LINK: 'https://aka.ms/download-jdk/microsoft-jdk-17.0.9-linux-x64.tar.gz' |
| 41 | + JAVA_VERSION: 'microsoft-jdk-17.0.9-linux-x64' |
| 42 | + JDK_PATH: 'jdk-17.0.9+8' |
| 43 | + JAVA_VERSION_SPEC: '17' |
| 44 | + microsoft-open-jdk-17-windows: |
| 45 | + IMAGE_TYPE: 'windows-latest' |
| 46 | + JDK_DOWNLOAD_LINK: 'https://aka.ms/download-jdk/microsoft-jdk-17.0.9-windows-x64.zip' |
| 47 | + JAVA_VERSION: 'microsoft-jdk-17.0.9-windows-x64' |
| 48 | + JDK_PATH: 'jdk-17.0.9+8' |
| 49 | + microsoft-open-jdk-21-linux: |
| 50 | + IMAGE_TYPE: 'ubuntu-latest' |
| 51 | + JDK_DOWNLOAD_LINK: 'https://aka.ms/download-jdk/microsoft-jdk-21.0.1-linux-x64.tar.gz' |
| 52 | + JAVA_VERSION: 'microsoft-jdk-21.0.1-linux-x64' |
| 53 | + JDK_PATH: 'jdk-21.0.1+12' |
| 54 | + JAVA_VERSION_SPEC: '21' |
| 55 | + microsoft-open-jdk-21-windows: |
| 56 | + IMAGE_TYPE: 'windows-latest' |
| 57 | + JDK_DOWNLOAD_LINK: 'https://aka.ms/download-jdk/microsoft-jdk-21.0.1-windows-x64.zip' |
| 58 | + JAVA_VERSION: 'microsoft-jdk-21.0.1-windows-x64' |
| 59 | + JDK_PATH: 'jdk-21.0.1+12' |
| 60 | + |
| 61 | + pool: |
| 62 | + vmImage: $(IMAGE_TYPE) |
| 63 | + |
| 64 | + steps: |
| 65 | + - task: NuGetToolInstaller@1 |
| 66 | + inputs: |
| 67 | + checkLatest: true |
| 68 | + displayName: 'Install NuGet Tool' |
| 69 | + |
| 70 | + - pwsh: | |
| 71 | + Get-Command mvn |
| 72 | + displayName: 'Check Maven is installed' |
| 73 | +
|
| 74 | + - task: JavaToolInstaller@0 # This step is necessary as Linux image has Java 11 as default |
| 75 | + inputs: |
| 76 | + versionSpec: '8' |
| 77 | + jdkArchitectureOption: 'x64' |
| 78 | + jdkSourceOption: 'PreInstalled' |
| 79 | + condition: eq( variables['Agent.OS'], 'Linux' ) |
| 80 | + displayName: 'Setup Java for Linux' |
| 81 | + |
| 82 | + - pwsh: | |
| 83 | + java -version |
| 84 | + displayName: 'Check default java version' |
| 85 | +
|
| 86 | + - task: UseDotNet@2 |
| 87 | + displayName: 'Install .NET 6' |
| 88 | + inputs: |
| 89 | + version: 6.0.x |
| 90 | + |
| 91 | + - pwsh: | |
| 92 | + .\setup-tests-pipeline.ps1 -UseCoreToolsBuildFromIntegrationTests |
| 93 | + displayName: 'Setup test environment -- Install the Core Tools' |
| 94 | + - pwsh: | |
| 95 | + $currDir = Get-Location |
| 96 | + $Env:Path = $Env:Path+";$currDir\Azure.Functions.Cli" |
| 97 | + ls $currDir\Azure.Functions.Cli |
| 98 | + func --version |
| 99 | + condition: eq( variables['Agent.OS'], 'Windows_NT' ) |
| 100 | + displayName: 'Setup Core Tools - Windows' |
| 101 | + - bash: | |
| 102 | + chmod +x ./Azure.Functions.Cli/func |
| 103 | + chmod +x ./Azure.Functions.Cli/gozip |
| 104 | + ls ./Azure.Functions.Cli |
| 105 | + export PATH=$PATH:./Azure.Functions.Cli |
| 106 | + func --version |
| 107 | + condition: eq( variables['Agent.OS'], 'Linux' ) |
| 108 | + displayName: 'Setup Core Tools - Linux' |
| 109 | +
|
| 110 | + - pwsh: | |
| 111 | + java -version |
| 112 | + cd ./endtoendtests |
| 113 | + mvn clean package `-Dmaven`.javadoc`.skip=true `-Dmaven`.test`.skip `-Dorg`.slf4j`.simpleLogger`.log`.org`.apache`.maven`.cli`.transfer`.Slf4jMavenTransferListener=warn `-B |
| 114 | + Copy-Item "confluent_cloud_cacert.pem" "./target/azure-functions/azure-functions-java-endtoendtests" |
| 115 | + displayName: 'Package Java for E2E' |
| 116 | +
|
| 117 | + - pwsh: | # Download JDK for later installation |
| 118 | + Invoke-WebRequest $(JDK_DOWNLOAD_LINK) -OutFile "$(JAVA_VERSION).tar.gz" |
| 119 | + $current = get-location | select -ExpandProperty Path |
| 120 | + Write-Host "##vso[task.setvariable variable=downloadPath;]$current" |
| 121 | + displayName: 'Download jdk for Linux' |
| 122 | + condition: eq( variables['Agent.OS'], 'Linux' ) |
| 123 | + - task: JavaToolInstaller@0 # Install JDK downloaded from previous task |
| 124 | + inputs: |
| 125 | + versionSpec: $(JAVA_VERSION_SPEC) |
| 126 | + jdkArchitectureOption: 'x64' |
| 127 | + jdkSourceOption: LocalDirectory |
| 128 | + jdkFile: "$(downloadPath)/$(JAVA_VERSION).tar.gz" |
| 129 | + jdkDestinationDirectory: "$(downloadPath)/externals" |
| 130 | + cleanDestinationDirectory: true |
| 131 | + condition: eq( variables['Agent.OS'], 'Linux' ) |
| 132 | + displayName: 'Setup Java for Linux' |
| 133 | + - pwsh: | |
| 134 | + Invoke-WebRequest $(JDK_DOWNLOAD_LINK) -OutFile "$(JAVA_VERSION).zip" |
| 135 | + Expand-Archive -Force "$(JAVA_VERSION).zip" . |
| 136 | + cd $(JDK_PATH) |
| 137 | + $current = get-location | select -ExpandProperty Path |
| 138 | + cd .. |
| 139 | + Write-Host "##vso[task.setvariable variable=JavaHome;]$current" |
| 140 | + displayName: 'Download and setup Java for Windows' |
| 141 | + condition: eq( variables['Agent.OS'], 'Windows_NT' ) |
| 142 | +
|
| 143 | + - task: DotNetCoreCLI@2 |
| 144 | + inputs: |
| 145 | + command: 'test' |
| 146 | + projects: | |
| 147 | + endtoendtests/Azure.Functions.Java.Tests.E2E/Azure.Functions.Java.Tests.E2E/Azure.Functions.Java.Tests.E2E.csproj |
| 148 | + env: |
| 149 | + JAVA_HOME: $(JavaHome) |
| 150 | + AzureWebJobsStorage: $(AzureWebJobsStorage) |
| 151 | + AzureWebJobsCosmosDBConnectionString: $(AzureWebJobsCosmosDBConnectionString) |
| 152 | + AzureWebJobsMySqlConnectionString: $(AzureWebJobsMySqlConnectionString) |
| 153 | + AzureWebJobsSqlConnectionString: $(AzureWebJobsSqlConnectionString) |
| 154 | + AzureWebJobsServiceBus: $(AzureWebJobsServiceBus) |
| 155 | + AzureWebJobsEventHubSender_2: $(AzureWebJobsEventHubSender_2) |
| 156 | + AzureWebJobsEventHubReceiver: $(AzureWebJobsEventHubReceiver) |
| 157 | + AzureWebJobsEventHubSender: $(AzureWebJobsEventHubSender) |
| 158 | + AzureWebJobsEventHubPath: $(AzureWebJobsEventHubPath) |
| 159 | + SBTopicName: $(SBTopicName) |
| 160 | + SBTopicSubName: $(SBTopicSubName) |
| 161 | + CosmosDBDatabaseName: $(CosmosDBDatabaseName) |
| 162 | + SBQueueName: $(SBQueueName) |
| 163 | + BrokerList": $(BrokerList) |
| 164 | + ConfluentCloudUsername: $(ConfluentCloudUsername) |
| 165 | + ConfluentCloudPassword: $(ConfluentCloudPassword) |
| 166 | + AzureWebJobsEventGridOutputBindingTopicUriString: $(AzureWebJobsEventGridOutputBindingTopicUriString) |
| 167 | + AzureWebJobsEventGridOutputBindingTopicKeyString: $(AzureWebJobsEventGridOutputBindingTopicKeyString) |
| 168 | + ApplicationInsightAPIKey: $(ApplicationInsightAPIKey) |
| 169 | + ApplicationInsightAPPID: $(ApplicationInsightAPPID) |
| 170 | + ApplicationInsightAgentVersion: $(ApplicationInsightAgentVersion) |
| 171 | + displayName: 'Build & Run tests' |
| 172 | + continueOnError: false |
| 173 | + |
0 commit comments