Skip to content

ci: support running e2e tests with preview bundle #789

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/ci/code-mirror.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ trigger:
include:
- dev
- release/* # azure-functions-java-worker github repo restricts creation of release/* branches, so using a pattern is safe here.

- wangbill/ci-preview-bundle
resources:
repositories:
- repository: eng
Expand Down
21 changes: 12 additions & 9 deletions eng/ci/official-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,23 @@ extends:
os: windows

stages:
- stage: Build
- stage: ValidateAndPrint

jobs:
- template: /eng/ci/templates/official/jobs/build-artifacts.yml@self
- job: ValidateVariables
steps:
- script: |
echo "Validating the isPreviewBundle variable..."
if [ "${{ variables.isPreviewBundle }}" == "true" ] || [ "${{ variables.isPreviewBundle }}" == "false" ]; then
echo "isPreviewBundle is valid: ${{ variables.isPreviewBundle }}"
else
echo "ERROR: isPreviewBundle must be either 'true' or 'false'. Current value: ${{ variables.isPreviewBundle }}"
exit 1

- stage: TestWindows
dependsOn: Build

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
parameters:
isPreviewBundle: ${{ variables.isPreviewBundle }}
188 changes: 97 additions & 91 deletions eng/ci/templates/official/jobs/run-e2e-tests-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
isTagTemp: true
isTag: $[variables.isTagTemp]
ApplicationInsightAgentVersion: 3.5.4

isPreviewBundle: $[variables.isPreviewBundle]
strategy:
maxParallel: 1
matrix:
Expand All @@ -38,93 +38,99 @@ jobs:
JAVA_VERSION_SPEC: '21'

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'
displayName: 'Setup Java for Linux'
- pwsh: |
java -version
displayName: 'Check default java version'
- pwsh: |
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'
inputs:
version: 6.0.x
- pwsh: | # Download JDK for later installation
Invoke-WebRequest $(JDK_DOWNLOAD_LINK) -OutFile "$(JAVA_VERSION).tar.gz"
$current = get-location | select -ExpandProperty Path
Write-Host "##vso[task.setvariable variable=downloadPath;]$current"
displayName: 'Download jdk for 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
displayName: 'Setup Java for Linux'
- pwsh: |
.\setup-tests-pipeline.ps1
displayName: 'Setup test environment -- Install the Core Tools'
- bash: |
chmod +x ./Azure.Functions.Cli/func
chmod +x ./Azure.Functions.Cli/gozip
export PATH=$PATH:./Azure.Functions.Cli
func --version
displayName: 'Setup Core Tools - Linux'
- pwsh: |
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'
- task: DotNetCoreCLI@2
retryCountOnTaskFailure: 3
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)
AzureWebJobsSqlConnectionString: $(AzureWebJobsSqlConnectionString)
AzureWebJobsServiceBus: $(AzureWebJobsServiceBus)
AzureWebJobsEventHubReceiver: $(AzureWebJobsEventHubReceiver)
AzureWebJobsEventHubSender_2: $(AzureWebJobsEventHubSender_2)
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
# - 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'
# displayName: 'Setup Java for Linux'
# - pwsh: |
# java -version
# displayName: 'Check default java version'
# - pwsh: |
# 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'
# inputs:
# version: 6.0.x
# - pwsh: | # Download JDK for later installation
# Invoke-WebRequest $(JDK_DOWNLOAD_LINK) -OutFile "$(JAVA_VERSION).tar.gz"
# $current = get-location | select -ExpandProperty Path
# Write-Host "##vso[task.setvariable variable=downloadPath;]$current"
# displayName: 'Download jdk for 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
# displayName: 'Setup Java for Linux'
# - pwsh: |
# .\setup-tests-pipeline.ps1
# displayName: 'Setup test environment -- Install the Core Tools'
# - bash: |
# chmod +x ./Azure.Functions.Cli/func
# chmod +x ./Azure.Functions.Cli/gozip
# export PATH=$PATH:./Azure.Functions.Cli
# func --version
# displayName: 'Setup Core Tools - Linux'
# - pwsh: |
# chmod +x ./tools/scripts/ci/override-extensionbundle.ps1
# ./tools/scripts/ci/override-extensionbundle.ps1 `
# -hostJsonPath "./endtoendtests/Azure.Functions.Java.Tests.E2E/host.json" `
# -isPreviewBundle ([System.Convert]::ToBoolean("$(isPreviewBundle)"))
# displayName: 'Override host.json extensionBundle'
# - pwsh: |
# 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'
# - task: DotNetCoreCLI@2
# retryCountOnTaskFailure: 3
# 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)
# AzureWebJobsSqlConnectionString: $(AzureWebJobsSqlConnectionString)
# AzureWebJobsServiceBus: $(AzureWebJobsServiceBus)
# AzureWebJobsEventHubReceiver: $(AzureWebJobsEventHubReceiver)
# AzureWebJobsEventHubSender_2: $(AzureWebJobsEventHubSender_2)
# 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
Loading