From 3b79f5db857781c39d1dbaa6ca5bcb9d2003a605 Mon Sep 17 00:00:00 2001 From: Jacob Viau Date: Fri, 28 Jun 2024 12:32:00 -0700 Subject: [PATCH 01/13] Test release config, split out restore & build --- eng/ci/templates/jobs/run-unit-tests.yml | 27 +++++-- .../official/jobs/run-integration-tests.yml | 72 +++++++++++-------- .../official/jobs/run-non-e2e-tests.yml | 19 +++-- 3 files changed, 78 insertions(+), 40 deletions(-) diff --git a/eng/ci/templates/jobs/run-unit-tests.yml b/eng/ci/templates/jobs/run-unit-tests.yml index 26dc1458e4..01e9ab5611 100644 --- a/eng/ci/templates/jobs/run-unit-tests.yml +++ b/eng/ci/templates/jobs/run-unit-tests.yml @@ -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) diff --git a/eng/ci/templates/official/jobs/run-integration-tests.yml b/eng/ci/templates/official/jobs/run-integration-tests.yml index 6fda50be0f..338ce2907f 100644 --- a/eng/ci/templates/official/jobs/run-integration-tests.yml +++ b/eng/ci/templates/official/jobs/run-integration-tests.yml @@ -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 @@ -79,18 +80,27 @@ 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 @@ -98,8 +108,8 @@ jobs: 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 @@ -107,8 +117,8 @@ jobs: 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 @@ -116,8 +126,8 @@ jobs: 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 @@ -125,8 +135,8 @@ jobs: 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 @@ -134,8 +144,8 @@ jobs: 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 @@ -143,8 +153,8 @@ jobs: 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 @@ -152,8 +162,8 @@ jobs: 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 @@ -161,8 +171,8 @@ jobs: 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 @@ -170,8 +180,8 @@ jobs: 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 @@ -180,8 +190,8 @@ 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 @@ -189,17 +199,17 @@ jobs: 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() diff --git a/eng/ci/templates/official/jobs/run-non-e2e-tests.yml b/eng/ci/templates/official/jobs/run-non-e2e-tests.yml index 17c7056625..34a396a15b 100644 --- a/eng/ci/templates/official/jobs/run-non-e2e-tests.yml +++ b/eng/ci/templates/official/jobs/run-non-e2e-tests.yml @@ -8,7 +8,7 @@ jobs: 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 @@ -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) From 16fd3f869d971b046475142259caeb7f8e0785c1 Mon Sep 17 00:00:00 2001 From: Jacob Viau Date: Fri, 28 Jun 2024 13:10:06 -0700 Subject: [PATCH 02/13] Fix indentation --- eng/ci/templates/jobs/run-unit-tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/eng/ci/templates/jobs/run-unit-tests.yml b/eng/ci/templates/jobs/run-unit-tests.yml index 01e9ab5611..c237f1180d 100644 --- a/eng/ci/templates/jobs/run-unit-tests.yml +++ b/eng/ci/templates/jobs/run-unit-tests.yml @@ -3,10 +3,10 @@ jobs: displayName: Run Unit Tests variables: - - name: test_projects - value: | - **\ExtensionsMetadataGeneratorTests.csproj - **\WebJobs.Script.Tests.csproj + - name: test_projects + value: | + **\ExtensionsMetadataGeneratorTests.csproj + **\WebJobs.Script.Tests.csproj steps: - template: /eng/ci/templates/install-dotnet.yml@self From 1ef2fdf879c619eb65c708f1f561725536ef74db Mon Sep 17 00:00:00 2001 From: Jacob Viau Date: Fri, 28 Jun 2024 14:40:59 -0700 Subject: [PATCH 03/13] Run integration tests on large sku --- eng/ci/templates/official/jobs/run-integration-tests.yml | 4 ++-- eng/ci/templates/official/jobs/run-non-e2e-tests.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/eng/ci/templates/official/jobs/run-integration-tests.yml b/eng/ci/templates/official/jobs/run-integration-tests.yml index 338ce2907f..24cb3dad86 100644 --- a/eng/ci/templates/official/jobs/run-integration-tests.yml +++ b/eng/ci/templates/official/jobs/run-integration-tests.yml @@ -3,8 +3,8 @@ 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: diff --git a/eng/ci/templates/official/jobs/run-non-e2e-tests.yml b/eng/ci/templates/official/jobs/run-non-e2e-tests.yml index 34a396a15b..58839996a6 100644 --- a/eng/ci/templates/official/jobs/run-non-e2e-tests.yml +++ b/eng/ci/templates/official/jobs/run-non-e2e-tests.yml @@ -3,8 +3,8 @@ 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: From 87d8e1d42cc879a600f5a96e8645c0ec154d896d Mon Sep 17 00:00:00 2001 From: Jacob Viau Date: Fri, 28 Jun 2024 14:57:12 -0700 Subject: [PATCH 04/13] Add binlogs --- eng/ci/templates/jobs/run-unit-tests.yml | 16 ++++++++++++++-- .../official/jobs/run-integration-tests.yml | 15 +++++++++++++-- .../official/jobs/run-non-e2e-tests.yml | 15 +++++++++++++-- 3 files changed, 40 insertions(+), 6 deletions(-) diff --git a/eng/ci/templates/jobs/run-unit-tests.yml b/eng/ci/templates/jobs/run-unit-tests.yml index c237f1180d..b3b5c68702 100644 --- a/eng/ci/templates/jobs/run-unit-tests.yml +++ b/eng/ci/templates/jobs/run-unit-tests.yml @@ -7,6 +7,18 @@ jobs: value: | **\ExtensionsMetadataGeneratorTests.csproj **\WebJobs.Script.Tests.csproj + - name: log_dir + value: $(Build.ArtifactStagingDirectory)/log + + templateContext: + outputParentDirectory: $(Build.ArtifactStagingDirectory) + outputs: + - output: pipelineArtifact + displayName: Publish logs + path: $(log_dir) + artifact: Unit_Test_Log + sbomEnabled: false + condition: always() steps: - template: /eng/ci/templates/install-dotnet.yml@self @@ -16,14 +28,14 @@ jobs: inputs: command: custom custom: restore - arguments: -v m + arguments: -v m -bl:$(log_dir)/restore.binlog projects: $(test_projects) - task: DotNetCoreCLI@2 displayName: Build inputs: command: build - arguments: -v m -c release --no-restore + arguments: -v m -c release --no-restore -bl:$(log_dir)/build.binlog projects: $(test_projects) - task: DotNetCoreCLI@2 diff --git a/eng/ci/templates/official/jobs/run-integration-tests.yml b/eng/ci/templates/official/jobs/run-integration-tests.yml index 24cb3dad86..9412718eea 100644 --- a/eng/ci/templates/official/jobs/run-integration-tests.yml +++ b/eng/ci/templates/official/jobs/run-integration-tests.yml @@ -11,6 +11,17 @@ jobs: 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 + log_dir: $(Build.ArtifactStagingDirectory)/log + + templateContext: + outputParentDirectory: $(Build.ArtifactStagingDirectory) + outputs: + - output: pipelineArtifact + displayName: Publish logs + path: $(log_dir) + artifact: Integration_Test_Log + sbomEnabled: false + condition: always() steps: - template: /eng/ci/templates/install-dotnet.yml@self @@ -84,14 +95,14 @@ jobs: inputs: command: custom custom: restore - arguments: -v m + arguments: -v m -bl:$(log_dir)/restore.binlog projects: $(test_projects) - task: DotNetCoreCLI@2 displayName: Build inputs: command: build - arguments: -v m -c release --no-restore + arguments: -v m -c release --no-restore -bl:$(log_dir)/build.binlog projects: $(test_projects) - task: DotNetCoreCLI@2 diff --git a/eng/ci/templates/official/jobs/run-non-e2e-tests.yml b/eng/ci/templates/official/jobs/run-non-e2e-tests.yml index 58839996a6..c503764683 100644 --- a/eng/ci/templates/official/jobs/run-non-e2e-tests.yml +++ b/eng/ci/templates/official/jobs/run-non-e2e-tests.yml @@ -9,6 +9,17 @@ jobs: variables: test_projects: test/WebJobs.Script.Tests.Integration/WebJobs.Script.Tests.Integration.csproj + log_dir: $(Build.ArtifactStagingDirectory)/log + + templateContext: + outputParentDirectory: $(Build.ArtifactStagingDirectory) + outputs: + - output: pipelineArtifact + displayName: Publish logs + path: $(log_dir) + artifact: Non_E2E_Test_Log + sbomEnabled: false + condition: always() steps: - template: /eng/ci/templates/install-dotnet.yml@self @@ -54,14 +65,14 @@ jobs: inputs: command: custom custom: restore - arguments: -v m + arguments: -v m -bl:$(log_dir)/restore.binlog projects: $(test_projects) - task: DotNetCoreCLI@2 displayName: Build inputs: command: build - arguments: -v m -c release --no-restore + arguments: -v m -c release --no-restore -bl:$(log_dir)/build.binlog projects: $(test_projects) - task: DotNetCoreCLI@2 From ab1a56e56269f196be5812a53b74bef27cef84ef Mon Sep 17 00:00:00 2001 From: Jacob Viau Date: Fri, 28 Jun 2024 15:10:28 -0700 Subject: [PATCH 05/13] Fix precompiled search path for release config --- .../WebHostEndToEnd/CSharpPrecompiledTestFixture.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/WebJobs.Script.Tests.Integration/WebHostEndToEnd/CSharpPrecompiledTestFixture.cs b/test/WebJobs.Script.Tests.Integration/WebHostEndToEnd/CSharpPrecompiledTestFixture.cs index 8965f7e3be..6fb8dafca4 100644 --- a/test/WebJobs.Script.Tests.Integration/WebHostEndToEnd/CSharpPrecompiledTestFixture.cs +++ b/test/WebJobs.Script.Tests.Integration/WebHostEndToEnd/CSharpPrecompiledTestFixture.cs @@ -6,7 +6,12 @@ namespace Microsoft.Azure.WebJobs.Script.Tests.Integration.WebHostEndToEnd { public class CSharpPrecompiledEndToEndTestFixture : EndToEndTestFixture { +#if DEBUG private const string TestPathTemplate = "..\\..\\{0}\\debug"; +#elif RELEASE + private const string TestPathTemplate = "..\\..\\{0}\\release"; +#endif + private readonly IDisposable _dispose; public CSharpPrecompiledEndToEndTestFixture(string testProjectName, IDictionary envVars = null, string functionWorkerRuntime = "dotnet") From be8d538670acf90adc4ce628eaf9bf4601de1231 Mon Sep 17 00:00:00 2001 From: Jacob Viau Date: Fri, 28 Jun 2024 15:48:27 -0700 Subject: [PATCH 06/13] Update test config paths --- .../WebHostEndToEnd/CSharpPrecompiledTestFixture.cs | 8 ++------ .../WebHostEndToEnd/HostProcessLauncher.cs | 2 +- test/WebJobs.Script.Tests.Shared/TestHelpers.cs | 6 ++++++ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/test/WebJobs.Script.Tests.Integration/WebHostEndToEnd/CSharpPrecompiledTestFixture.cs b/test/WebJobs.Script.Tests.Integration/WebHostEndToEnd/CSharpPrecompiledTestFixture.cs index 6fb8dafca4..1ff08ee350 100644 --- a/test/WebJobs.Script.Tests.Integration/WebHostEndToEnd/CSharpPrecompiledTestFixture.cs +++ b/test/WebJobs.Script.Tests.Integration/WebHostEndToEnd/CSharpPrecompiledTestFixture.cs @@ -6,16 +6,12 @@ namespace Microsoft.Azure.WebJobs.Script.Tests.Integration.WebHostEndToEnd { public class CSharpPrecompiledEndToEndTestFixture : EndToEndTestFixture { -#if DEBUG - private const string TestPathTemplate = "..\\..\\{0}\\debug"; -#elif RELEASE - private const string TestPathTemplate = "..\\..\\{0}\\release"; -#endif + private const string TestPathTemplate = "..\\..\\{0}\\{{1}}"; private readonly IDisposable _dispose; public CSharpPrecompiledEndToEndTestFixture(string testProjectName, IDictionary envVars = null, string functionWorkerRuntime = "dotnet") - : base(string.Format(TestPathTemplate, testProjectName), testProjectName, functionWorkerRuntime) + : base(string.Format(TestPathTemplate, testProjectName, TestHelpers.BuildConfig), testProjectName, functionWorkerRuntime) { if (envVars != null) { diff --git a/test/WebJobs.Script.Tests.Integration/WebHostEndToEnd/HostProcessLauncher.cs b/test/WebJobs.Script.Tests.Integration/WebHostEndToEnd/HostProcessLauncher.cs index eac97adc50..9d59c2c345 100644 --- a/test/WebJobs.Script.Tests.Integration/WebHostEndToEnd/HostProcessLauncher.cs +++ b/test/WebJobs.Script.Tests.Integration/WebHostEndToEnd/HostProcessLauncher.cs @@ -40,7 +40,7 @@ public HostProcessLauncher( bool usePublishPath = false) { string template = usePublishPath ? PublishPathTemplate : BuildPathTemplate; - _testPath = Path.GetFullPath(string.Format(template, testProjectName, "debug")); + _testPath = Path.GetFullPath(string.Format(template, testProjectName, TestHelpers.BuildConfig)); _envVars = envVars ?? new Dictionary(); } diff --git a/test/WebJobs.Script.Tests.Shared/TestHelpers.cs b/test/WebJobs.Script.Tests.Shared/TestHelpers.cs index d23814761f..28af969274 100644 --- a/test/WebJobs.Script.Tests.Shared/TestHelpers.cs +++ b/test/WebJobs.Script.Tests.Shared/TestHelpers.cs @@ -32,6 +32,12 @@ namespace Microsoft.Azure.WebJobs.Script.Tests { public static partial class TestHelpers { +#if DEBUG + public const string BuildConfig = "debug"; +#else + public const string BuildConfig = "release"; +#endif + private const string Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; private static readonly Random Random = new Random(); From 645a495c978f7051671ea3a939dff68cb1b3e7c1 Mon Sep 17 00:00:00 2001 From: Jacob Viau Date: Fri, 28 Jun 2024 16:35:58 -0700 Subject: [PATCH 07/13] Fix path format --- .../WebHostEndToEnd/CSharpPrecompiledTestFixture.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/WebJobs.Script.Tests.Integration/WebHostEndToEnd/CSharpPrecompiledTestFixture.cs b/test/WebJobs.Script.Tests.Integration/WebHostEndToEnd/CSharpPrecompiledTestFixture.cs index 1ff08ee350..cc1324c9e7 100644 --- a/test/WebJobs.Script.Tests.Integration/WebHostEndToEnd/CSharpPrecompiledTestFixture.cs +++ b/test/WebJobs.Script.Tests.Integration/WebHostEndToEnd/CSharpPrecompiledTestFixture.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.WebJobs.Script.Tests.Integration.WebHostEndToEnd { public class CSharpPrecompiledEndToEndTestFixture : EndToEndTestFixture { - private const string TestPathTemplate = "..\\..\\{0}\\{{1}}"; + private const string TestPathTemplate = "..\\..\\{0}\\{1}"; private readonly IDisposable _dispose; From 263008932b6c245d2b845c8765c8b2fa936c6e93 Mon Sep 17 00:00:00 2001 From: Jacob Viau Date: Mon, 1 Jul 2024 12:09:56 -0700 Subject: [PATCH 08/13] fix missing AzureWebJobsEventHubPath --- eng/ci/templates/official/jobs/run-integration-tests.yml | 1 + eng/ci/templates/official/jobs/run-non-e2e-tests.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/eng/ci/templates/official/jobs/run-integration-tests.yml b/eng/ci/templates/official/jobs/run-integration-tests.yml index 9412718eea..f89e2f35f0 100644 --- a/eng/ci/templates/official/jobs/run-integration-tests.yml +++ b/eng/ci/templates/official/jobs/run-integration-tests.yml @@ -83,6 +83,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) diff --git a/eng/ci/templates/official/jobs/run-non-e2e-tests.yml b/eng/ci/templates/official/jobs/run-non-e2e-tests.yml index c503764683..bd36100908 100644 --- a/eng/ci/templates/official/jobs/run-non-e2e-tests.yml +++ b/eng/ci/templates/official/jobs/run-non-e2e-tests.yml @@ -92,6 +92,7 @@ jobs: AzureWebJobsSecretStorageKeyVaultTenantId: $(AzureTenantId) AzureWebJobsSecretStorageKeyVaultClientId: $(AzureClientId) AzureWebJobsSecretStorageKeyVaultClientSecret: $(AzureClientSecret) + AzureWebJobsEventHubPath: testhub - task: PowerShell@2 condition: always() From 9ffef1034647743472049ddf6a3e3439adc26c37 Mon Sep 17 00:00:00 2001 From: Jacob Viau Date: Mon, 1 Jul 2024 13:00:43 -0700 Subject: [PATCH 09/13] Add guardian suppression --- eng/ci/integration-tests.yml | 4 +++ eng/ci/official-build.yml | 3 ++ eng/sdl/.gdnsuppress | 65 ++++++++++++++++++++++++++++++++++++ 3 files changed, 72 insertions(+) create mode 100644 eng/sdl/.gdnsuppress diff --git a/eng/ci/integration-tests.yml b/eng/ci/integration-tests.yml index baeed4d535..2bc3249b9f 100644 --- a/eng/ci/integration-tests.yml +++ b/eng/ci/integration-tests.yml @@ -31,6 +31,10 @@ extends: image: 1es-windows-2022 os: windows + sdl: + suppression: + suppressionFile: /eng/sdl/.gdnsuppress + stages: - stage: Test jobs: diff --git a/eng/ci/official-build.yml b/eng/ci/official-build.yml index 6bb03fbe13..4b7d569e9d 100644 --- a/eng/ci/official-build.yml +++ b/eng/ci/official-build.yml @@ -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: /eng/sdl/.gdnsuppress stages: - stage: Initialize diff --git a/eng/sdl/.gdnsuppress b/eng/sdl/.gdnsuppress new file mode 100644 index 0000000000..6b6e57ec06 --- /dev/null +++ b/eng/sdl/.gdnsuppress @@ -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" + } + } +} \ No newline at end of file From bd047fb46fe29c9a340204feb7f4ea02843b2761 Mon Sep 17 00:00:00 2001 From: Jacob Viau Date: Mon, 1 Jul 2024 15:21:08 -0700 Subject: [PATCH 10/13] Fix .gdnsuppress path --- eng/ci/integration-tests.yml | 2 +- eng/ci/official-build.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/ci/integration-tests.yml b/eng/ci/integration-tests.yml index 2bc3249b9f..a454077a40 100644 --- a/eng/ci/integration-tests.yml +++ b/eng/ci/integration-tests.yml @@ -33,7 +33,7 @@ extends: sdl: suppression: - suppressionFile: /eng/sdl/.gdnsuppress + suppressionFile: $(Build.SourcesDirectory)/eng/sdl/.gdnsuppress stages: - stage: Test diff --git a/eng/ci/official-build.yml b/eng/ci/official-build.yml index 4b7d569e9d..dabf94706b 100644 --- a/eng/ci/official-build.yml +++ b/eng/ci/official-build.yml @@ -50,7 +50,7 @@ extends: # Move codeql for source languages to source analysis stage runSourceLanguagesInSourceAnalysis: true suppression: - suppressionFile: /eng/sdl/.gdnsuppress + suppressionFile: $(Build.SourcesDirectory)/eng/sdl/.gdnsuppress stages: - stage: Initialize From 1eb5e854d5999caf1f8b456e055d289542765aae Mon Sep 17 00:00:00 2001 From: Jacob Viau Date: Mon, 1 Jul 2024 16:17:42 -0700 Subject: [PATCH 11/13] fix flaky unit test --- test/WebJobs.Script.Tests/FunctionsSyncServiceTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/WebJobs.Script.Tests/FunctionsSyncServiceTests.cs b/test/WebJobs.Script.Tests/FunctionsSyncServiceTests.cs index c7f48230a7..949008d39a 100644 --- a/test/WebJobs.Script.Tests/FunctionsSyncServiceTests.cs +++ b/test/WebJobs.Script.Tests/FunctionsSyncServiceTests.cs @@ -81,8 +81,8 @@ public async Task StartAsync_PrimaryHost_Running_SyncsTriggers_AfterTimeout() [Fact] public async Task StartAsync_TokenCancelledBeforeTimeout_DoesNotSyncTriggers() { - var cts = new CancellationTokenSource(); - cts.CancelAfter(_testDueTime / 2); + using CancellationTokenSource cts = new(); + cts.Cancel(); await _syncService.StartAsync(cts.Token); await Task.Delay(2 * _testDueTime); From a55703b1b83a670443bce5b06ccbaf9e5503d8ba Mon Sep 17 00:00:00 2001 From: Jacob Viau Date: Mon, 1 Jul 2024 16:20:52 -0700 Subject: [PATCH 12/13] Remove test binlog --- eng/ci/templates/jobs/run-unit-tests.yml | 16 ++-------------- .../official/jobs/run-integration-tests.yml | 15 ++------------- .../official/jobs/run-non-e2e-tests.yml | 15 ++------------- 3 files changed, 6 insertions(+), 40 deletions(-) diff --git a/eng/ci/templates/jobs/run-unit-tests.yml b/eng/ci/templates/jobs/run-unit-tests.yml index b3b5c68702..c237f1180d 100644 --- a/eng/ci/templates/jobs/run-unit-tests.yml +++ b/eng/ci/templates/jobs/run-unit-tests.yml @@ -7,18 +7,6 @@ jobs: value: | **\ExtensionsMetadataGeneratorTests.csproj **\WebJobs.Script.Tests.csproj - - name: log_dir - value: $(Build.ArtifactStagingDirectory)/log - - templateContext: - outputParentDirectory: $(Build.ArtifactStagingDirectory) - outputs: - - output: pipelineArtifact - displayName: Publish logs - path: $(log_dir) - artifact: Unit_Test_Log - sbomEnabled: false - condition: always() steps: - template: /eng/ci/templates/install-dotnet.yml@self @@ -28,14 +16,14 @@ jobs: inputs: command: custom custom: restore - arguments: -v m -bl:$(log_dir)/restore.binlog + arguments: -v m projects: $(test_projects) - task: DotNetCoreCLI@2 displayName: Build inputs: command: build - arguments: -v m -c release --no-restore -bl:$(log_dir)/build.binlog + arguments: -v m -c release --no-restore projects: $(test_projects) - task: DotNetCoreCLI@2 diff --git a/eng/ci/templates/official/jobs/run-integration-tests.yml b/eng/ci/templates/official/jobs/run-integration-tests.yml index f89e2f35f0..ff51673475 100644 --- a/eng/ci/templates/official/jobs/run-integration-tests.yml +++ b/eng/ci/templates/official/jobs/run-integration-tests.yml @@ -11,17 +11,6 @@ jobs: 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 - log_dir: $(Build.ArtifactStagingDirectory)/log - - templateContext: - outputParentDirectory: $(Build.ArtifactStagingDirectory) - outputs: - - output: pipelineArtifact - displayName: Publish logs - path: $(log_dir) - artifact: Integration_Test_Log - sbomEnabled: false - condition: always() steps: - template: /eng/ci/templates/install-dotnet.yml@self @@ -96,14 +85,14 @@ jobs: inputs: command: custom custom: restore - arguments: -v m -bl:$(log_dir)/restore.binlog + arguments: -v m projects: $(test_projects) - task: DotNetCoreCLI@2 displayName: Build inputs: command: build - arguments: -v m -c release --no-restore -bl:$(log_dir)/build.binlog + arguments: -v m -c release --no-restore projects: $(test_projects) - task: DotNetCoreCLI@2 diff --git a/eng/ci/templates/official/jobs/run-non-e2e-tests.yml b/eng/ci/templates/official/jobs/run-non-e2e-tests.yml index bd36100908..2080130147 100644 --- a/eng/ci/templates/official/jobs/run-non-e2e-tests.yml +++ b/eng/ci/templates/official/jobs/run-non-e2e-tests.yml @@ -9,17 +9,6 @@ jobs: variables: test_projects: test/WebJobs.Script.Tests.Integration/WebJobs.Script.Tests.Integration.csproj - log_dir: $(Build.ArtifactStagingDirectory)/log - - templateContext: - outputParentDirectory: $(Build.ArtifactStagingDirectory) - outputs: - - output: pipelineArtifact - displayName: Publish logs - path: $(log_dir) - artifact: Non_E2E_Test_Log - sbomEnabled: false - condition: always() steps: - template: /eng/ci/templates/install-dotnet.yml@self @@ -65,14 +54,14 @@ jobs: inputs: command: custom custom: restore - arguments: -v m -bl:$(log_dir)/restore.binlog + arguments: -v m projects: $(test_projects) - task: DotNetCoreCLI@2 displayName: Build inputs: command: build - arguments: -v m -c release --no-restore -bl:$(log_dir)/build.binlog + arguments: -v m -c release --no-restore projects: $(test_projects) - task: DotNetCoreCLI@2 From bcace8cf84f7570a3df68178658c84fdcaf361c5 Mon Sep 17 00:00:00 2001 From: Jacob Viau Date: Tue, 30 Jul 2024 12:20:20 -0700 Subject: [PATCH 13/13] Remove large pool usage --- eng/ci/templates/official/jobs/run-integration-tests.yml | 2 +- eng/ci/templates/official/jobs/run-non-e2e-tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/ci/templates/official/jobs/run-integration-tests.yml b/eng/ci/templates/official/jobs/run-integration-tests.yml index ff51673475..668d816c04 100644 --- a/eng/ci/templates/official/jobs/run-integration-tests.yml +++ b/eng/ci/templates/official/jobs/run-integration-tests.yml @@ -3,7 +3,7 @@ jobs: displayName: Run Integration Tests pool: - name: 1es-pool-azfunc-large + name: 1es-pool-azfunc image: 1es-windows-2022 os: windows diff --git a/eng/ci/templates/official/jobs/run-non-e2e-tests.yml b/eng/ci/templates/official/jobs/run-non-e2e-tests.yml index 2080130147..cb3e17ae8f 100644 --- a/eng/ci/templates/official/jobs/run-non-e2e-tests.yml +++ b/eng/ci/templates/official/jobs/run-non-e2e-tests.yml @@ -3,7 +3,7 @@ jobs: displayName: Run Non-E2E Integration Tests pool: - name: 1es-pool-azfunc-large + name: 1es-pool-azfunc image: 1es-windows-2022 os: windows