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 12 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 @@ -31,6 +31,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 @@ -44,10 +44,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

stages:
- stage: Initialize
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,15 +2,34 @@ jobs:
- job: RunUnitTests
displayName: Run Unit Tests

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

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)
77 changes: 44 additions & 33 deletions eng/ci/templates/official/jobs/run-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ jobs:
displayName: Run Integration Tests

pool:
name: 1es-pool-azfunc
image: 1es-windows-2022
name: 1es-pool-azfunc-large
image: 1es-windows-2022
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 @@ -71,6 +72,7 @@ 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)
Expand All @@ -79,99 +81,108 @@ jobs:
AzureWebJobsEventHubReceiverSecretMap: $(EventHub)

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

- task: DotNetCoreCLI@2
displayName: Build
inputs:
command: build
projects: $(IntegrationProject)
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 @@ -180,26 +191,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: PowerShell@2
condition: always()
Expand Down
24 changes: 17 additions & 7 deletions eng/ci/templates/official/jobs/run-non-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ jobs:
displayName: Run Non-E2E Integration Tests

pool:
name: 1es-pool-azfunc
image: 1es-windows-2022
name: 1es-pool-azfunc-large
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 Down Expand Up @@ -50,18 +50,27 @@ jobs:
secretsFilter: '*'

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

- task: DotNetCoreCLI@2
displayName: Build
inputs:
command: build
projects: $(IntegrationProject)
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 @@ -72,6 +81,7 @@ jobs:
AzureWebJobsSecretStorageKeyVaultTenantId: $(AzureTenantId)
AzureWebJobsSecretStorageKeyVaultClientId: $(AzureClientId)
AzureWebJobsSecretStorageKeyVaultClientSecret: $(AzureClientSecret)
AzureWebJobsEventHubPath: testhub

- task: PowerShell@2
condition: always()
Expand Down
65 changes: 65 additions & 0 deletions eng/sdl/.gdnsuppress
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"hydrated": false,
"version": "1.0.0",
"suppressionSets": {
"default": {
"name": "default",
"createdDate": "2024-07-01 19:36:04Z",
"lastUpdatedDate": "2024-07-01 19:36:04Z"
}
},
"results": {
"f1e5ee29e845d190153e848d09bb89833962f9c6f66780d1e78538457442729e": {
"signature": "f1e5ee29e845d190153e848d09bb89833962f9c6f66780d1e78538457442729e",
"alternativeSignatures": [
"77837171ff1c48bab672e310c4c9a32ccb21e692ca895b2ca6e1bcde7a1abd9a"
],
"target": "out/bin/WebJobs.Script/release/workers/dotnet-isolated/bin/FunctionsNetHost.exe",
"memberOf": [
"default"
],
"tool": "binskim",
"ruleId": "BA2008",
"createdDate": "2024-07-01 19:36:04Z"
},
"073837647d84d1a96c3bf6e4030c6be939b84ea13fa989374285acb5c9a3239c": {
"signature": "073837647d84d1a96c3bf6e4030c6be939b84ea13fa989374285acb5c9a3239c",
"alternativeSignatures": [
"b5d61f7c79519a106dead18e5db7686344b80a9d0f16f6e22be8880ebc17a89a"
],
"target": "out/bin/WebJobs.Script.Grpc/release/workers/dotnet-isolated/bin/FunctionsNetHost.exe",
"memberOf": [
"default"
],
"tool": "binskim",
"ruleId": "BA2008",
"createdDate": "2024-07-01 19:36:04Z"
},
"c82e50a25e624db5140ff636d33bbbc6396bc41724f35e1e2e2a3a4c3be7b6d8": {
"signature": "c82e50a25e624db5140ff636d33bbbc6396bc41724f35e1e2e2a3a4c3be7b6d8",
"alternativeSignatures": [
"53a01cb91737f8b90c6e0cc3377dac6116da5c8243873a7c9cdec73856689114"
],
"target": "out/bin/WebJobs.Script.Tests.Integration/release/workers/dotnet-isolated/bin/FunctionsNetHost.exe",
"memberOf": [
"default"
],
"tool": "binskim",
"ruleId": "BA2008",
"createdDate": "2024-07-01 19:36:04Z"
},
"b368ec157fee48c5a06dcf06d7e810d9dfd7d57f0ba1aa28154e5819c6720640": {
"signature": "b368ec157fee48c5a06dcf06d7e810d9dfd7d57f0ba1aa28154e5819c6720640",
"alternativeSignatures": [
"f05bf31dfdfbf61385a64b1d1f6a0afb79da831809ac23dda0985922185bcd6a"
],
"target": "out/bin/WebJobs.Script.WebHost/release/workers/dotnet-isolated/bin/FunctionsNetHost.exe",
"memberOf": [
"default"
],
"tool": "binskim",
"ruleId": "BA2008",
"createdDate": "2024-07-01 19:36:04Z"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ namespace Microsoft.Azure.WebJobs.Script.Tests.Integration.WebHostEndToEnd
{
public class CSharpPrecompiledEndToEndTestFixture : EndToEndTestFixture
{
private const string TestPathTemplate = "..\\..\\{0}\\debug";
private const string TestPathTemplate = "..\\..\\{0}\\{1}";

private readonly IDisposable _dispose;

public CSharpPrecompiledEndToEndTestFixture(string testProjectName, IDictionary<string, string> envVars = null, string functionWorkerRuntime = "dotnet")
: base(string.Format(TestPathTemplate, testProjectName), testProjectName, functionWorkerRuntime)
: base(string.Format(TestPathTemplate, testProjectName, TestHelpers.BuildConfig), testProjectName, functionWorkerRuntime)
{
if (envVars != null)
{
Expand Down
Loading