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