Skip to content

Test release config, split out restore & build #10257

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

Open
wants to merge 18 commits into
base: dev
Choose a base branch
from
Open
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
4 changes: 4 additions & 0 deletions eng/ci/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ extends:
image: 1es-windows-2022
os: windows

sdl:
suppression:
suppressionFile: $(Build.SourcesDirectory)/eng/sdl/.gdnsuppress

stages:
- stage: Test
jobs:
Expand Down
3 changes: 3 additions & 0 deletions eng/ci/official-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,13 @@ extends:
name: 1es-pool-azfunc
image: 1es-windows-2022
os: windows

sdl:
codeql:
# Move codeql for source languages to source analysis stage
runSourceLanguagesInSourceAnalysis: true
suppression:
suppressionFile: $(Build.SourcesDirectory)/eng/sdl/.gdnsuppress
spotBugs:
enabled: false # Explicitly disabling as our JavaWorker package causes this to light up and subsequently fail.

Expand Down
27 changes: 23 additions & 4 deletions eng/ci/templates/jobs/run-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ jobs:
- job: RunUnitTests
displayName: Run Unit Tests

variables:
- name: test_projects
value: |
**/ExtensionsMetadataGeneratorTests.csproj
**/WebJobs.Script.Tests.csproj

templateContext:
outputParentDirectory: $(Build.ArtifactStagingDirectory)
outputs:
Expand All @@ -15,15 +21,28 @@ jobs:
steps:
- template: /eng/ci/templates/install-dotnet.yml@self

- task: DotNetCoreCLI@2
displayName: Restore
inputs:
command: custom
custom: restore
arguments: -v m
projects: $(test_projects)

- task: DotNetCoreCLI@2
displayName: Build
inputs:
command: build
arguments: -v m -c release --no-restore
projects: $(test_projects)

- task: DotNetCoreCLI@2
displayName: Unit Tests
inputs:
command: test
testRunTitle: Unit Tests
arguments: -v n
projects: |
**\ExtensionsMetadataGeneratorTests.csproj
**\WebJobs.Script.Tests.csproj
arguments: -v m -c release --no-build
projects: $(test_projects)

- task: CopyFiles@2
displayName: Copy deps.json
Expand Down
81 changes: 46 additions & 35 deletions eng/ci/templates/official/jobs/run-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ jobs:
os: windows

variables:
IntegrationProject: test/WebJobs.Script.Tests.Integration/WebJobs.Script.Tests.Integration.csproj
IsReleaseBranch: $[contains(variables['Build.SourceBranch'], 'release/')]
test_projects: test/WebJobs.Script.Tests.Integration/WebJobs.Script.Tests.Integration.csproj
is_release: $[contains(variables['Build.SourceBranch'], 'release/')]
test_args: -c release --no-build

steps:
- template: /eng/ci/templates/install-dotnet.yml@self
Expand Down Expand Up @@ -45,12 +46,6 @@ jobs:
command: ci
workingDir: sample/CustomHandlerRetry

- task: DotNetCoreCLI@2
displayName: Build Integration.csproj
inputs:
command: build
projects: $(IntegrationProject)

- task: AzurePowerShell@5
displayName: Checkout secrets
inputs:
Expand All @@ -74,101 +69,117 @@ jobs:
Write-Host "##vso[task.setvariable variable=ConnectionStrings__CosmosDB]$env:CosmosDbSecretMap"
Write-Host "##vso[task.setvariable variable=AzureWebJobsEventHubSender]$env:AzureWebJobsEventHubSenderSecretMap"
Write-Host "##vso[task.setvariable variable=AzureWebJobsEventHubReceiver]$env:AzureWebJobsEventHubReceiverSecretMap"
Write-Host "##vso[task.setvariable variable=AzureWebJobsEventHubPath]testhub"
env:
AzureWebJobsStorageSecretMap: $(Storage)
AzureWebJobsSecondaryStorageSecretMap: $(SecondaryStorage)
CosmosDbSecretMap: $(CosmosDb)
AzureWebJobsEventHubSenderSecretMap: $(EventHub)
AzureWebJobsEventHubReceiverSecretMap: $(EventHub)

- task: DotNetCoreCLI@2
displayName: Restore
inputs:
command: custom
custom: restore
arguments: -v m
projects: $(test_projects)

- task: DotNetCoreCLI@2
displayName: Build
inputs:
command: build
arguments: -v m -c release --no-restore
projects: $(test_projects)

- task: DotNetCoreCLI@2
displayName: C# end to end tests
inputs:
command: test
testRunTitle: C# end to end tests
arguments: '--filter "Group=CSharpEndToEndTests" --no-build'
projects: $(IntegrationProject)
arguments: '--filter "Group=CSharpEndToEndTests" $(test_args)'
projects: $(test_projects)

- task: DotNetCoreCLI@2
displayName: Node end to end tests
condition: succeededOrFailed()
inputs:
command: test
testRunTitle: Node end to end tests
arguments: '--filter "Group=NodeEndToEndTests" --no-build'
projects: $(IntegrationProject)
arguments: '--filter "Group=NodeEndToEndTests" $(test_args)'
projects: $(test_projects)

- task: DotNetCoreCLI@2
displayName: Direct load end to end tests
condition: succeededOrFailed()
inputs:
command: test
testRunTitle: Direct load end to end tests
arguments: '--filter "Group=DirectLoadEndToEndTests" --no-build'
projects: $(IntegrationProject)
arguments: '--filter "Group=DirectLoadEndToEndTests" $(test_args)'
projects: $(test_projects)

- task: DotNetCoreCLI@2
displayName: F# end to end tests
condition: succeededOrFailed()
inputs:
command: test
testRunTitle: F# end to end tests
arguments: '--filter "Group=FSharpEndToEndTests" --no-build'
projects: $(IntegrationProject)
arguments: '--filter "Group=FSharpEndToEndTests" $(test_args)'
projects: $(test_projects)

- task: DotNetCoreCLI@2
displayName: Language worker end to end tests
condition: succeededOrFailed()
inputs:
command: test
testRunTitle: Language worker end to end tests
arguments: '--filter "Group=LanguageWorkerSelectionEndToEndTests" --no-build'
projects: $(IntegrationProject)
arguments: '--filter "Group=LanguageWorkerSelectionEndToEndTests" $(test_args)'
projects: $(test_projects)

- task: DotNetCoreCLI@2
displayName: Node script host end to end tests
condition: succeededOrFailed()
inputs:
command: test
testRunTitle: Node script host end to end tests
arguments: '--filter "Group=NodeScriptHostTests" --no-build'
projects: $(IntegrationProject)
arguments: '--filter "Group=NodeScriptHostTests" $(test_args)'
projects: $(test_projects)

- task: DotNetCoreCLI@2
displayName: Raw assembly end to end tests
condition: succeededOrFailed()
inputs:
command: test
testRunTitle: Raw assembly end to end tests
arguments: '--filter "Group=RawAssemblyEndToEndTests" --no-build'
projects: $(IntegrationProject)
arguments: '--filter "Group=RawAssemblyEndToEndTests" $(test_args)'
projects: $(test_projects)

- task: DotNetCoreCLI@2
displayName: Samples end to end tests
condition: succeededOrFailed()
inputs:
command: test
testRunTitle: Samples end to end tests
arguments: '--filter "Group=SamplesEndToEndTests" --no-build'
projects: $(IntegrationProject)
arguments: '--filter "Group=SamplesEndToEndTests" $(test_args)'
projects: $(test_projects)

- task: DotNetCoreCLI@2
displayName: Drain mode end to end tests
condition: succeededOrFailed()
inputs:
command: test
testRunTitle: Drain mode end to end tests
arguments: '--filter "Group=DrainModeEndToEndTests" --no-build'
projects: $(IntegrationProject)
arguments: '--filter "Group=DrainModeEndToEndTests" $(test_args)'
projects: $(test_projects)

- task: DotNetCoreCLI@2
displayName: Standby mode end to end tests Windows
condition: succeededOrFailed()
inputs:
command: test
testRunTitle: Standby mode end to end tests Windows
arguments: '--filter "Group=StandbyModeEndToEndTests_Windows" --no-build'
projects: $(IntegrationProject)
arguments: '--filter "Group=StandbyModeEndToEndTests_Windows" $(test_args)'
projects: $(test_projects)

# Disabled to unblock in 202401. Will fix shortly.
# - task: DotNetCoreCLI@2
Expand All @@ -177,26 +188,26 @@ jobs:
# inputs:
# command: test
# testRunTitle: Standby mode end to end tests Linux
# arguments: '--filter "Group=StandbyModeEndToEndTests_Linux" --no-build'
# projects: $(IntegrationProject)
# arguments: '--filter "Group=StandbyModeEndToEndTests_Linux" $(test_args)'
# projects: $(test_projects)

- task: DotNetCoreCLI@2
displayName: Linux container end to end tests Windows
condition: succeededOrFailed()
inputs:
command: test
testRunTitle: Linux container end to end tests Windows
arguments: '--filter "Group=ContainerInstanceTests" --no-build'
projects: $(IntegrationProject)
arguments: '--filter "Group=ContainerInstanceTests" $(test_args)'
projects: $(test_projects)

- task: DotNetCoreCLI@2
displayName: Release verification tests
condition: ${{ eq(variables.IsReleaseBranch, true) }}
condition: ${{ eq(variables.is_release, true) }}
inputs:
command: test
testRunTitle: Release verification tests
arguments: '--filter "Group=ReleaseTests" --no-build'
projects: $(IntegrationProject)
arguments: '--filter "Group=ReleaseTests" $(test_args)'
projects: $(test_projects)

- task: AzurePowerShell@5
condition: always()
Expand Down
30 changes: 20 additions & 10 deletions eng/ci/templates/official/jobs/run-non-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ jobs:

pool:
name: 1es-pool-azfunc
image: 1es-windows-2022
image: 1es-windows-2022
os: windows

variables:
IntegrationProject: test/WebJobs.Script.Tests.Integration/WebJobs.Script.Tests.Integration.csproj
test_projects: test/WebJobs.Script.Tests.Integration/WebJobs.Script.Tests.Integration.csproj

steps:
- template: /eng/ci/templates/install-dotnet.yml@self
Expand All @@ -33,12 +33,6 @@ jobs:
targetType: inline
script: 'Install-Module -Name Az.Storage -RequiredVersion 1.11.0 -Scope CurrentUser -Force -AllowClobber'

- task: DotNetCoreCLI@2
displayName: Build Integration.csproj
inputs:
command: build
projects: $(IntegrationProject)

- task: AzurePowerShell@5
displayName: Checkout secrets
inputs:
Expand Down Expand Up @@ -72,13 +66,28 @@ jobs:
az login --service-principal -u $(ARM_CLIENT_ID) --tenant $(ARM_TENANT_ID) --allow-no-subscriptions --federated-token $(ARM_ID_TOKEN)
displayName: 'Login to Azure'

- task: DotNetCoreCLI@2
displayName: Restore
inputs:
command: custom
custom: restore
arguments: -v m
projects: $(test_projects)

- task: DotNetCoreCLI@2
displayName: Build
inputs:
command: build
arguments: -v m -c release --no-restore
projects: $(test_projects)

- task: DotNetCoreCLI@2
displayName: Non-E2E integration tests
inputs:
command: test
testRunTitle: Non-E2E integration tests
arguments: '--filter "Category!=E2E"'
projects: $(IntegrationProject)
arguments: '--filter "Category!=E2E" -c release --no-build'
projects: $(test_projects)
env:
AzureWebJobsStorage: $(Storage)
AzureWebJobsSecondaryStorage: $(SecondaryStorage)
Expand All @@ -89,6 +98,7 @@ jobs:
AzureWebJobsSecretStorageKeyVaultTenantId: $(AzureTenantId)
AzureWebJobsSecretStorageKeyVaultClientId: $(AzureClientId)
AzureWebJobsSecretStorageKeyVaultClientSecret: $(AzureClientSecret)
AzureWebJobsEventHubPath: testhub

- task: AzurePowerShell@5
condition: always()
Expand Down
Loading