From 0004aeb69c11c033c5433c87a8d741219c98ed86 Mon Sep 17 00:00:00 2001 From: First Crazy Developer Date: Wed, 12 Feb 2020 19:53:41 +0530 Subject: [PATCH 01/12] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b3891e2..67d40a6 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -51,6 +51,32 @@ stages: - publish: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip artifact: drop +- stage: Build_Test + displayName: Run Test Cases + dependsOn: Build + condition: succeeded() + + jobs: + - deployment: Run_Test_Cases + displayName: Run Test Cases + environment: 'development' + pool: + vmImage: $(vmImageName) + + strategy: + runOnce: + deploy: + + steps: + - task: VSTest@2 + inputs: + testSelector: 'testAssemblies' + testAssemblyVer2: | + **\*test*.dll + !**\*TestAdapter.dll + !**\obj\** + searchFolder: '$(System.DefaultWorkingDirectory)' + - stage: Dev_Deployment displayName: Dev Deployment stage dependsOn: Build From ce439b0b0a0dfa8aa89bdd3d1294840ad12bc415 Mon Sep 17 00:00:00 2001 From: First Crazy Developer Date: Wed, 12 Feb 2020 20:12:21 +0530 Subject: [PATCH 02/12] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 67d40a6..0b4dd36 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -5,7 +5,7 @@ trigger: - master -- branch +- feature/* variables: # Azure Resource Manager connection created during pipeline creation @@ -19,6 +19,7 @@ variables: # Working Directory workingDirectory: '$(System.DefaultWorkingDirectory)/source/src/SampleAzureFunctionCode' + testsDirectory: '$(System.DefaultWorkingDirectory)/source/tests/SampleAzureFunctionCode.Tests' stages: - stage: Build @@ -68,6 +69,12 @@ stages: deploy: steps: + - task: DotNetCoreCLI@2 + displayName: Build + inputs: + command: 'build' + projects: | + $(testsDirectory)/*.csproj - task: VSTest@2 inputs: testSelector: 'testAssemblies' @@ -75,7 +82,7 @@ stages: **\*test*.dll !**\*TestAdapter.dll !**\obj\** - searchFolder: '$(System.DefaultWorkingDirectory)' + searchFolder: '$(testsDirectory)' - stage: Dev_Deployment displayName: Dev Deployment stage From 64fc7c486675a14273d837ccd3302caaab1b24f1 Mon Sep 17 00:00:00 2001 From: First Crazy Developer Date: Wed, 12 Feb 2020 20:20:27 +0530 Subject: [PATCH 03/12] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0b4dd36..266554e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -75,6 +75,7 @@ stages: command: 'build' projects: | $(testsDirectory)/*.csproj + arguments: --output $(System.DefaultWorkingDirectory)/tests_publish_output --configuration Release - task: VSTest@2 inputs: testSelector: 'testAssemblies' @@ -82,11 +83,12 @@ stages: **\*test*.dll !**\*TestAdapter.dll !**\obj\** - searchFolder: '$(testsDirectory)' + SampleAzureFunctionCode.Tests.dll + searchFolder: '$(System.DefaultWorkingDirectory)/tests_publish_output' - stage: Dev_Deployment displayName: Dev Deployment stage - dependsOn: Build + dependsOn: Build_Test condition: succeeded() jobs: From 9dd8d71e0d3cf0965629bfeb4e24576807af3df2 Mon Sep 17 00:00:00 2001 From: First Crazy Developer Date: Wed, 12 Feb 2020 20:39:20 +0530 Subject: [PATCH 04/12] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 266554e..8bb4d75 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -32,6 +32,13 @@ stages: vmImage: $(vmImageName) steps: + - task: DotNetCoreCLI@2 + displayName: 'Install dotnetsay' + inputs: + command: custom + custom: tool + arguments: 'install -g dotnetsay' + - task: DotNetCoreCLI@2 displayName: Build inputs: @@ -70,21 +77,17 @@ stages: steps: - task: DotNetCoreCLI@2 - displayName: Build inputs: - command: 'build' - projects: | - $(testsDirectory)/*.csproj - arguments: --output $(System.DefaultWorkingDirectory)/tests_publish_output --configuration Release - - task: VSTest@2 + command: test + projects: $(testsDirectory)/*.csproj + arguments: --configuration Release + + - script: dotnet test $(testsDirectory)/SampleAzureFunctionCode.Tests.csproj --logger trx --collect "Code coverage" + - task: PublishTestResults@2 + condition: succeededOrFailed() inputs: - testSelector: 'testAssemblies' - testAssemblyVer2: | - **\*test*.dll - !**\*TestAdapter.dll - !**\obj\** - SampleAzureFunctionCode.Tests.dll - searchFolder: '$(System.DefaultWorkingDirectory)/tests_publish_output' + testRunner: VSTest + testResultsFiles: '**/*.trx' - stage: Dev_Deployment displayName: Dev Deployment stage From 45fe833156968b6784f37fef718683034635de8f Mon Sep 17 00:00:00 2001 From: First Crazy Developer Date: Wed, 12 Feb 2020 20:59:45 +0530 Subject: [PATCH 05/12] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8bb4d75..c01d684 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -82,7 +82,7 @@ stages: projects: $(testsDirectory)/*.csproj arguments: --configuration Release - - script: dotnet test $(testsDirectory)/SampleAzureFunctionCode.Tests.csproj --logger trx --collect "Code coverage" + - script: dotnet test $(System.DefaultWorkingDirectory)\source\tests\SampleAzureFunctionCode.Tests\SampleAzureFunctionCode.Tests.csproj --logger trx --collect "Code coverage" - task: PublishTestResults@2 condition: succeededOrFailed() inputs: From 83595f6faa93475be8efed3e8f43a3f50383dd69 Mon Sep 17 00:00:00 2001 From: First Crazy Developer Date: Wed, 12 Feb 2020 21:09:45 +0530 Subject: [PATCH 06/12] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c01d684..684ff97 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -76,12 +76,6 @@ stages: deploy: steps: - - task: DotNetCoreCLI@2 - inputs: - command: test - projects: $(testsDirectory)/*.csproj - arguments: --configuration Release - - script: dotnet test $(System.DefaultWorkingDirectory)\source\tests\SampleAzureFunctionCode.Tests\SampleAzureFunctionCode.Tests.csproj --logger trx --collect "Code coverage" - task: PublishTestResults@2 condition: succeededOrFailed() From 46b76f33a1cf6acd526d8fcac7991416c833b89b Mon Sep 17 00:00:00 2001 From: First Crazy Developer Date: Wed, 12 Feb 2020 21:25:16 +0530 Subject: [PATCH 07/12] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 684ff97..09864ce 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -74,14 +74,12 @@ stages: strategy: runOnce: deploy: - steps: - - script: dotnet test $(System.DefaultWorkingDirectory)\source\tests\SampleAzureFunctionCode.Tests\SampleAzureFunctionCode.Tests.csproj --logger trx --collect "Code coverage" - - task: PublishTestResults@2 - condition: succeededOrFailed() + - task: DotNetCoreCLI@2 inputs: - testRunner: VSTest - testResultsFiles: '**/*.trx' + command: test + projects: '**/*Tests/*.csproj' + arguments: '--configuration $(buildConfiguration)' - stage: Dev_Deployment displayName: Dev Deployment stage From 1ce5df850bc924f8c800f13f26a0bd595f626669 Mon Sep 17 00:00:00 2001 From: First Crazy Developer Date: Wed, 12 Feb 2020 21:25:53 +0530 Subject: [PATCH 08/12] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 09864ce..334923b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -79,7 +79,7 @@ stages: inputs: command: test projects: '**/*Tests/*.csproj' - arguments: '--configuration $(buildConfiguration)' + arguments: '--configuration Release' - stage: Dev_Deployment displayName: Dev Deployment stage From aae97145f96b4bd4283851e2eb11154af4d15fd0 Mon Sep 17 00:00:00 2001 From: First Crazy Developer Date: Wed, 12 Feb 2020 21:38:51 +0530 Subject: [PATCH 09/12] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 334923b..64b2c36 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -47,6 +47,7 @@ stages: $(workingDirectory)/*.csproj arguments: --output $(System.DefaultWorkingDirectory)/publish_output --configuration Release + - task: ArchiveFiles@2 displayName: 'Archive files' inputs: @@ -75,11 +76,14 @@ stages: runOnce: deploy: steps: + - task: DotNetCoreCLI@2 inputs: - command: test - projects: '**/*Tests/*.csproj' + command: 'test' + projects: 'testsDirectory: ''$(System.DefaultWorkingDirectory)/source/tests/SampleAzureFunctionCode.Tests''' arguments: '--configuration Release' + testRunTitle: 'Run_Unit_Test' + - stage: Dev_Deployment displayName: Dev Deployment stage From b0b224290e6c2461bcb81bd0488f6720ec783a6c Mon Sep 17 00:00:00 2001 From: First Crazy Developer Date: Wed, 12 Feb 2020 21:56:24 +0530 Subject: [PATCH 10/12] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 64b2c36..0132307 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -60,34 +60,35 @@ stages: - publish: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip artifact: drop -- stage: Build_Test +- stage: Start_Run_Test displayName: Run Test Cases dependsOn: Build condition: succeeded() jobs: - - deployment: Run_Test_Cases - displayName: Run Test Cases - environment: 'development' + - job: Start_Run_Test + displayName: Test Builder pool: vmImage: $(vmImageName) - strategy: - runOnce: - deploy: - steps: + steps: + - task: DotNetCoreCLI@2 + displayName: 'Install dotnetsay' + inputs: + command: custom + custom: tool + arguments: 'install -g dotnetsay' - - task: DotNetCoreCLI@2 - inputs: - command: 'test' - projects: 'testsDirectory: ''$(System.DefaultWorkingDirectory)/source/tests/SampleAzureFunctionCode.Tests''' - arguments: '--configuration Release' - testRunTitle: 'Run_Unit_Test' - + - task: DotNetCoreCLI@2 + inputs: + command: 'test' + projects: 'testsDirectory: ''$(System.DefaultWorkingDirectory)/source/tests/SampleAzureFunctionCode.Tests''' + arguments: '--configuration Release' + testRunTitle: 'Run_Unit_Test' - stage: Dev_Deployment displayName: Dev Deployment stage - dependsOn: Build_Test + dependsOn: Start_Run_Test condition: succeeded() jobs: From f5e627503d34799d57926032e4ae1663e74e286a Mon Sep 17 00:00:00 2001 From: First Crazy Developer Date: Wed, 12 Feb 2020 22:05:07 +0530 Subject: [PATCH 11/12] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0132307..74f8782 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -79,12 +79,12 @@ stages: custom: tool arguments: 'install -g dotnetsay' - - task: DotNetCoreCLI@2 + - script: dotnet test $(System.DefaultWorkingDirectory)/source/tests/SampleAzureFunctionCode.Tests/SampleAzureFunctionCode.Tests.csproj --logger trx --collect "Code coverage" + - task: PublishTestResults@2 inputs: - command: 'test' - projects: 'testsDirectory: ''$(System.DefaultWorkingDirectory)/source/tests/SampleAzureFunctionCode.Tests''' - arguments: '--configuration Release' - testRunTitle: 'Run_Unit_Test' + testRunner: VSTest + testResultsFiles: '**/*.trx' + - stage: Dev_Deployment displayName: Dev Deployment stage From d687d8d37411bc851ce4e123bbd7185bae2277b6 Mon Sep 17 00:00:00 2001 From: First Crazy Developer Date: Thu, 13 Feb 2020 10:45:34 +0530 Subject: [PATCH 12/12] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 74f8782..4c9b8eb 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -9,7 +9,7 @@ trigger: variables: # Azure Resource Manager connection created during pipeline creation - devazureSubscription: 'f27beff6-c5b7-41a5-bd50-2b9fce4760ca' + devazureSubscription: 'AzureFunction' # Function app name devFunctionAppName: 'fcd-dev-web-app'