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)