Skip to content

Commit

Permalink
YML all GREEN for Unit Tests (Azure#637)
Browse files Browse the repository at this point in the history
* Release Build validation

* Adding dummy test for quick fail

* Adding dummy test for quick fail

* Adding dummy test for quick fail

* Adding dummy test for quick fail

* Functional non-gate UT's

* Upgrading test FX to 16.2.0

* Minor tweaks

* Comments out non unit tests

* Moving more to funtional tests

* More to functional
  • Loading branch information
kirankumarkolli authored Aug 6, 2019
1 parent 372ce70 commit 6b19488
Show file tree
Hide file tree
Showing 10 changed files with 133 additions and 131 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1892,6 +1892,7 @@ FROM c
}

[TestMethod]
[TestCategory("Functional")]
public async Task TestQueryDistinct()
{
int seed = (int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<PackageReference Include="System.Security.SecureString" Version="4.3.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="1.1.2" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="2.1.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Moq" Version="4.8.2" />
<PackageReference Include="MSTest.TestAdapter" Version="1.3.2" />
<PackageReference Include="MSTest.TestFramework" Version="1.3.2" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<PackageReference Include="$(DirectPackageName)" Version="[$(DirectVersion)]" PrivateAssets="All" />
<PackageReference Include="Microsoft.Azure.Cosmos.Serialization.HybridRow" Version="[$(HybridRowVersion)]" PrivateAssets="All" />
<PackageReference Include="Microsoft.CSharp" Version="4.5.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Moq" Version="4.8.2" />
<PackageReference Include="MSTest.TestAdapter" Version="1.3.2" />
<PackageReference Include="MSTest.TestFramework" Version="1.3.2" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace Microsoft.Azure.Cosmos.NetFramework.Tests.Json
using Microsoft.VisualStudio.TestTools.UnitTesting;

[TestClass]
[TestCategory("Functional")]
public class JsonMicroBenchmarks
{
private static readonly bool runPerformanceTests = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace Microsoft.Azure.Cosmos.NetFramework.Tests.Json
using System.Globalization;

[TestClass]
[TestCategory("Functional")]
public class JsonNavigatorTests
{
[TestInitialize]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace Microsoft.Azure.Cosmos.NetFramework.Tests.Json
using Microsoft.VisualStudio.TestTools.UnitTesting;

[TestClass]
[TestCategory("Functional")]
public class JsonPerformanceTests
{
private static readonly bool runPerformanceTests = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace Microsoft.Azure.Cosmos.NetFramework.Tests.Json
using Microsoft.VisualStudio.TestTools.UnitTesting;

[TestClass]
[TestCategory("Functional")]
public class JsonRoundTripsTests
{
[TestInitialize]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<PackageReference Include="$(DirectPackageName)" Version="[$(DirectVersion)]" PrivateAssets="All" />
<PackageReference Include="Microsoft.Azure.Cosmos.Serialization.HybridRow" Version="[$(HybridRowVersion)]" PrivateAssets="All" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.1.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Moq" Version="4.8.3" />
<PackageReference Include="MSTest.TestAdapter" Version="1.2.0" />
<PackageReference Include="MSTest.TestFramework" Version="1.2.0" />
Expand Down
157 changes: 77 additions & 80 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,89 +1,86 @@
pr:
branches:
include:
- releases/*
# - master
- releases/*

variables:
DebugArguments: ' --filter "TestCategory!=Quarantine" --verbosity detailed'
ReleaseArguments: ' --filter "TestCategory!=Quarantine" --verbosity detailed '
VmImage: windows-latest # https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops
DebugArguments: ' --filter "TestCategory!=Quarantine & TestCategory!=Functional" --verbosity normal '
ReleaseArguments: ' --filter "TestCategory!=Quarantine & TestCategory!=Functional" --verbosity normal '
VmImage: vs2017-win2016 # https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops


jobs:
- job:
displayName: Static Analysis
pool:
vmImage: '$(VmImage)' # https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops

steps:
- checkout: self # self represents the repo where the initial Pipelines YAML file was found
clean: true # if true, execute `execute git clean -ffdx && git reset --hard HEAD` before fetching
lfs: true # whether to download Git-LFS files; defaults to false

#Analyze source code for type of content and target types to help determine which tools to run
- task: securedevelopmentteam.vss-secure-development-tools.build-task-autoapplicability.AutoApplicability@1
displayName: 'AutoApplicability'
inputs:
VerboseWriter: true
ExternalRelease: true
InternalRelease: true
IsService: true
IsSoftware: true

# Analyze source and build output text files for credentials
- task: securedevelopmentteam.vss-secure-development-tools.build-task-credscan.CredScan@2
displayName: 'CredScan'
inputs:
scanFolder: $(Build.SourcesDirectory)
suppressionsFile: CredScanSuppressions.json
debugMode: true

# Scan text elements including code, code comments, and content/web pages, for sensitive terms based on legal, cultural, or geopolitical reasons
- task: securedevelopmentteam.vss-secure-development-tools.build-task-policheck.PoliCheck@1
displayName: 'PoliCheck'
inputs:
targetType: F

# AntiMalware scan
- task: securedevelopmentteam.vss-secure-development-tools.build-task-antimalware.AntiMalware@3
displayName: 'AntiMalware'
inputs:
EnableServices: true

# Run checks for recently discovered vulnerabilities which are not yet incorporated to another tool
- task: securedevelopmentteam.vss-secure-development-tools.build-task-vulnerabilityassessment.VulnerabilityAssessment@0
displayName: 'Vulnerability Assessment'

- task: DotNetCoreCLI@2
displayName: Build Microsoft.Azure.Cosmos.sln
inputs:
command: build
projects: 'Microsoft.Azure.Cosmos.sln'
configuration: '$(BuildConfiguration)'
publishTestResults: true

# - task: securedevelopmentteam.vss-secure-development-tools.build-task-binskim.BinSkim@3
# displayName: 'BinSkim'
# inputs:
# InputType: Basic

# Publish Analysis Results (position after all tools ran)
- task: securedevelopmentteam.vss-secure-development-tools.build-task-publishsecurityanalysislogs.PublishSecurityAnalysisLogs@2
displayName: 'Publish Security Analysis Logs'

# The Post-Analysis build task will analyze the log files produced by the tools, and introduce a build break
- task: securedevelopmentteam.vss-secure-development-tools.build-task-postanalysis.PostAnalysis@1
displayName: 'Post Analysis'
inputs:
AllTools: true


#- template: templates/build-test.yml
# parameters:
# BuildConfiguration: Debug
# Arguments: $(DebugArguments)
# VmImage: $(VmImage)
##- job:
## displayName: Static Analysis
## pool:
## vmImage: '$(VmImage)' # https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops
##
## steps:
## - checkout: self # self represents the repo where the initial Pipelines YAML file was found
## clean: true # if true, execute `execute git clean -ffdx && git reset --hard HEAD` before fetching
## lfs: true # whether to download Git-LFS files; defaults to false
##
## #Analyze source code for type of content and target types to help determine which tools to run
## - task: securedevelopmentteam.vss-secure-development-tools.build-task-autoapplicability.AutoApplicability@1
## displayName: 'AutoApplicability'
## inputs:
## VerboseWriter: true
## ExternalRelease: true
## InternalRelease: true
## IsService: true
## IsSoftware: true
##
## # Analyze source and build output text files for credentials
## - task: securedevelopmentteam.vss-secure-development-tools.build-task-credscan.CredScan@2
## displayName: 'CredScan'
## inputs:
## scanFolder: $(Build.SourcesDirectory)
## suppressionsFile: CredScanSuppressions.json
## debugMode: true
##
## # Scan text elements including code, code comments, and content/web pages, for sensitive terms based on legal, cultural, or geopolitical reasons
## - task: securedevelopmentteam.vss-secure-development-tools.build-task-policheck.PoliCheck@1
## displayName: 'PoliCheck'
## inputs:
## targetType: F
##
## # AntiMalware scan
## - task: securedevelopmentteam.vss-secure-development-tools.build-task-antimalware.AntiMalware@3
## displayName: 'AntiMalware'
## inputs:
## EnableServices: true
##
## # Run checks for recently discovered vulnerabilities which are not yet incorporated to another tool
## - task: securedevelopmentteam.vss-secure-development-tools.build-task-vulnerabilityassessment.VulnerabilityAssessment@0
## displayName: 'Vulnerability Assessment'
##
## - task: DotNetCoreCLI@2
## displayName: Build Microsoft.Azure.Cosmos.sln
## inputs:
## command: build
## projects: 'Microsoft.Azure.Cosmos.sln'
## configuration: '$(BuildConfiguration)'
## publishTestResults: true
##
### - task: securedevelopmentteam.vss-secure-development-tools.build-task-binskim.BinSkim@3
### displayName: 'BinSkim'
### inputs:
### InputType: Basic
##
## # Publish Analysis Results (position after all tools ran)
## - task: securedevelopmentteam.vss-secure-development-tools.build-task-publishsecurityanalysislogs.PublishSecurityAnalysisLogs@2
## displayName: 'Publish Security Analysis Logs'
##
## # The Post-Analysis build task will analyze the log files produced by the tools, and introduce a build break
## - task: securedevelopmentteam.vss-secure-development-tools.build-task-postanalysis.PostAnalysis@1
## displayName: 'Post Analysis'
## inputs:
## AllTools: true
##
##
###- template: templates/build-test.yml
### parameters:
### BuildConfiguration: Debug
### Arguments: $(DebugArguments)
### VmImage: $(VmImage)

- template: templates/build-test.yml
parameters:
Expand Down
96 changes: 48 additions & 48 deletions templates/build-test.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# File: templates/build-test.yml

parameters:
BuildConfiguration: Debug
BuildConfiguration: ''
Arguments: ''
VmImage: windows-latest # https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops
VmImage: '' # https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops

jobs:
- job:
Expand All @@ -19,55 +19,55 @@ jobs:
- task: DotNetCoreCLI@2
displayName: Microsoft.Azure.Cosmos.Tests
condition: succeeded()
inputs:
inputs:
command: test
projects: 'Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/*.csproj'
arguments: ${{ parameters.Arguments }}
configuration: ${{ parameters.BuildConfiguration }}
projects: 'Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/*.csproj'
arguments: ${{ parameters.Arguments }} --configuration ${{ parameters.BuildConfiguration }}
publishTestResults: true
testRunTitle: Microsoft.Azure.Cosmos.Tests

- job:
displayName: ${{ parameters.BuildConfiguration }} Microsoft.Azure.NetFramework.Tests
pool:
vmImage: ${{ parameters.VmImage }}

steps:
- checkout: self # self represents the repo where the initial Pipelines YAML file was found
clean: true # if true, execute `execute git clean -ffdx && git reset --hard HEAD` before fetching
lfs: true # whether to download Git-LFS files; defaults to false

- template: emulator-setup.yml

- task: DotNetCoreCLI@2
displayName: Test Microsoft.Azure.Cosmos.NetFramework.Tests
condition: succeeded()
inputs:
command: test
projects: 'Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.NetFramework.Tests/*.csproj'
arguments: ${{ parameters.Arguments }}
configuration: ${{ parameters.BuildConfiguration }}
publishTestResults: true
##- job:
## displayName: ${{ parameters.BuildConfiguration }} Microsoft.Azure.NetFramework.Tests
## pool:
## vmImage: ${{ parameters.VmImage }}
##
## steps:
## - checkout: self # self represents the repo where the initial Pipelines YAML file was found
## clean: true # if true, execute `execute git clean -ffdx && git reset --hard HEAD` before fetching
## lfs: true # whether to download Git-LFS files; defaults to false
##
## - template: emulator-setup.yml
##
## - task: DotNetCoreCLI@2
## displayName: Test Microsoft.Azure.Cosmos.NetFramework.Tests
## condition: succeeded()
## inputs:
## command: test
## projects: 'Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.NetFramework.Tests/*.csproj'
## arguments: ${{ parameters.Arguments }} --configuration ${{ parameters.BuildConfiguration }}
## publishTestResults: true
## testRunTitle: Microsoft.Azure.Cosmos.Tests


- job:
displayName: ${{ parameters.BuildConfiguration }} Microsoft.Azure.Cosmos.EmulatorTests
pool:
vmImage: ${{ parameters.VmImage }}

steps:
- checkout: self # self represents the repo where the initial Pipelines YAML file was found
clean: true # if true, execute `execute git clean -ffdx && git reset --hard HEAD` before fetching
lfs: true # whether to download Git-LFS files; defaults to false

- template: emulator-setup.yml

- task: DotNetCoreCLI@2
displayName: Test Microsoft.Azure.Cosmos.EmulatorTests
condition: succeeded()
inputs:
command: test
projects: 'Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/*.csproj'
arguments: ${{ parameters.Arguments }}
configuration: ${{ parameters.BuildConfiguration }}
publishTestResults: true
##- job:
## displayName: ${{ parameters.BuildConfiguration }} Microsoft.Azure.Cosmos.EmulatorTests
## pool:
## vmImage: ${{ parameters.VmImage }}
##
## steps:
## - checkout: self # self represents the repo where the initial Pipelines YAML file was found
## clean: true # if true, execute `execute git clean -ffdx && git reset --hard HEAD` before fetching
## lfs: true # whether to download Git-LFS files; defaults to false
##
## - template: emulator-setup.yml
##
## - task: DotNetCoreCLI@2
## displayName: Test Microsoft.Azure.Cosmos.EmulatorTests
## condition: succeeded()
## inputs:
## command: test
## projects: 'Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/*.csproj'
## arguments: ${{ parameters.Arguments }} --configuration ${{ parameters.BuildConfiguration }}
## publishTestResults: true
## testRunTitle: Microsoft.Azure.Cosmos.Tests

0 comments on commit 6b19488

Please sign in to comment.