From a6949b7057b0c7822e2a933c5b8ceb66c3482610 Mon Sep 17 00:00:00 2001 From: jeff schultz Date: Fri, 2 Sep 2016 14:31:07 -0700 Subject: [PATCH 1/4] Add static analysis to build and publish to testsapce --- appveyor.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 62dd0f6..f5355f1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -6,16 +6,16 @@ install: mkdir .\money\packages\testspace - wget https://testspace-runner.s3.amazonaws.com/testspace-windows-latest.zip -outfile .\money\packages\testspace.zip + wget https://testspace-client.s3.amazonaws.com/testspace-windows.zip -outfile .\money\packages\testspace.zip 7z x .\money\packages\testspace.zip -omoney\packages\testspace -before_build: -- cmd: nuget restore money/cs-money.sln -build: - project: money/cs-money.sln - verbosity: minimal +build_script: +- ps: >- + nuget restore money/cs-money.sln + + msbuild money/cs-money.csproj /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /p:runCodeAnalysis=true /p:codeanalysislogfile=StaticAnalysis.xml test_script: - ps: >- .\money\packages\OpenCover.4.6.519\tools\OpenCover.Console.exe -target:".\money\packages\NUnit.ConsoleRunner.3.2.1\tools\nunit3-console.exe" -targetargs:'.\money\bin\Debug\cs-money.dll' -output:'.\coverage.xml' -filter:'+[*]* -[*]*MoneyTest*' -register:user - .\money\packages\testspace\testspace.exe publish .\testresult.xml .\coverage.xml "${ENV:TESTSPACE_URL}" + .\money\packages\testspace\testspace.exe publish .\testresult.xml .\coverage.xml money\staticanalysis.xml "${ENV:TESTSPACE_URL}" From 9060dd627a557976ac5a6d24baa6d8f9a6e52a05 Mon Sep 17 00:00:00 2001 From: jeff schultz Date: Fri, 2 Sep 2016 15:02:37 -0700 Subject: [PATCH 2/4] Update Testspace badges --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 063f6e7..03fb0a4 100644 --- a/README.md +++ b/README.md @@ -7,10 +7,10 @@ This is a sample for the use of the [NUnit](http://nunit.org/) test framework us [![Build status](https://ci.appveyor.com/api/projects/status/x76ee4x2hc84l55a?svg=true)](https://ci.appveyor.com/project/jeffs-s2/csharp-nunit) [![Space Health](https://samples.testspace.com/projects/94/spaces/343/badge)](https://samples.testspace.com/projects/94/spaces/343 "Test Cases") -[![Space Metric](https://samples.testspace.com/projects/94/spaces/343/metrics/287/badge)](https://samples.testspace.com/spaces/343/schema/coverage "Branch/Condition Coverage") -[![Space Metric](https://samples.testspace.com/projects/94/spaces/343/metrics/289/badge)](https://samples.testspace.com/spaces/343/schema/coverage "Function/Method Coverage") -[![Space Metric](https://samples.testspace.com/projects/94/spaces/343/metrics/288/badge)](https://samples.testspace.com/spaces/343/schema/coverage "Line/Statement Coverage") - +[![Space Metric](https://samples.testspace.com/projects/94/spaces/343/metrics/217/badge)](https://samples.testspace.com/spaces/343/schema/Code%20Coverage "Code Coverage (branches)") +[![Space Metric](https://samples.testspace.com/projects/94/spaces/343/metrics/218/badge)](https://samples.testspace.com/spaces/343/schema/Code%20Coverage "Code Coverage (methods)") +[![Space Metric](https://samples.testspace.com/projects/94/spaces/343/metrics/219/badge)](https://samples.testspace.com/spaces/343/schema/Code%20Coverage "Code Coverage (sequences)") +[![Space Metric](https://samples.testspace.com/projects/94/spaces/343/metrics/220/badge)](https://samples.testspace.com/spaces/343/schema/Static%20Analysis "Static Analysis (issues)") *** We have made a few minor modifications to to original samples for reporting purposes. In order to run this sample you will need a host workstation with Visual Studio, the [Nunit](http://nunit.org/) test framework and the [OpenCover](https://github.com/OpenCover/opencover) coverage tool. From 0fee95fbca0e5896ee82b2ee41d81de5b2223245 Mon Sep 17 00:00:00 2001 From: jeff schultz Date: Fri, 2 Sep 2016 15:35:24 -0700 Subject: [PATCH 3/4] Update execution commands --- README.md | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 03fb0a4..48603f8 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,15 @@ ## C#/NUnit sample for demonstrating Testspace -This is a sample for the use of the [NUnit](http://nunit.org/) test framework using C# [examples](https://github.com/nunit/nunit-csharp-samples). It is used to demonstrate Testspace usage models for easier test content management. +This sample demonstrates techniques for using Testspace with C# code and the [NUnit](http://nunit.org/) test framework, along with the [OpenCover](https://github.com/OpenCover/opencover) coverage tool and [Visual Studio's](https://msdn.microsoft.com/en-us/library/dd264939.aspx) static analysis tool using [NUnit's C# examples](https://github.com/nunit/nunit-csharp-samples). + +*** +Build using AppVeyor's Online CI: [![Build status](https://ci.appveyor.com/api/projects/status/x76ee4x2hc84l55a?svg=true)](https://ci.appveyor.com/project/jeffs-s2/csharp-nunit) +*** +Publishing **Test Content** using www.testspace.com. + [![Space Health](https://samples.testspace.com/projects/94/spaces/343/badge)](https://samples.testspace.com/projects/94/spaces/343 "Test Cases") [![Space Metric](https://samples.testspace.com/projects/94/spaces/343/metrics/217/badge)](https://samples.testspace.com/spaces/343/schema/Code%20Coverage "Code Coverage (branches)") [![Space Metric](https://samples.testspace.com/projects/94/spaces/343/metrics/218/badge)](https://samples.testspace.com/spaces/343/schema/Code%20Coverage "Code Coverage (methods)") @@ -13,14 +19,26 @@ This is a sample for the use of the [NUnit](http://nunit.org/) test framework us [![Space Metric](https://samples.testspace.com/projects/94/spaces/343/metrics/220/badge)](https://samples.testspace.com/spaces/343/schema/Static%20Analysis "Static Analysis (issues)") *** -We have made a few minor modifications to to original samples for reporting purposes. In order to run this sample you will need a host workstation with Visual Studio, the [Nunit](http://nunit.org/) test framework and the [OpenCover](https://github.com/OpenCover/opencover) coverage tool. +In order to run this sample you will need a host workstation with Visual Studio, the [Nunit](http://nunit.org/) test framework and the [OpenCover](https://github.com/OpenCover/opencover) coverage tool. -Publishing results example: +Building with static analysis: + +
+    msbuild money/cs-money.csproj  /p:runCodeAnalysis=true /p:codeanalysislogfile=StaticAnalysis.xml
+
+Running tests with code coverage:
 OpenCover.Console.exe -target:nunit3-console.exe -targetargs:cs-money.dll -output:codecoverage.xml -register:user
 
-testspace publish TestResult.xml codecoverage.xml
+
+ +Publishing Results using **Testspace** in powershell: + +
+wget https://testspace-client.s3.amazonaws.com/testspace-windows.zip -outfile .\money\packages\testspace.zip
+extract to preferred location
+testspace .\testresult.xml .\coverage.xml money\staticanalysis.xml ${ENV:TESTSPACE_TOKEN}/${ENV:BRANCH_NAME}
 
Checkout the [Space](https://samples.testspace.com/projects/csharp/spaces/nunit). From 536e3c939ab99c8734a4c0074e99a525e406073f Mon Sep 17 00:00:00 2001 From: jeff schultz Date: Sat, 3 Sep 2016 08:25:30 -0700 Subject: [PATCH 4/4] Fix typos in files --- README.md | 2 +- appveyor.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 48603f8..449619f 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ In order to run this sample you will need a host workstation with Visual Studio, Building with static analysis:
-    msbuild money/cs-money.csproj  /p:runCodeAnalysis=true /p:codeanalysislogfile=StaticAnalysis.xml
+msbuild money/cs-money.csproj  /p:runCodeAnalysis=true /p:codeanalysislogfile=StaticAnalysis.xml
 
Running tests with code coverage: diff --git a/appveyor.yml b/appveyor.yml index f5355f1..fc9ad15 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -18,4 +18,4 @@ test_script: - ps: >- .\money\packages\OpenCover.4.6.519\tools\OpenCover.Console.exe -target:".\money\packages\NUnit.ConsoleRunner.3.2.1\tools\nunit3-console.exe" -targetargs:'.\money\bin\Debug\cs-money.dll' -output:'.\coverage.xml' -filter:'+[*]* -[*]*MoneyTest*' -register:user - .\money\packages\testspace\testspace.exe publish .\testresult.xml .\coverage.xml money\staticanalysis.xml "${ENV:TESTSPACE_URL}" + .\money\packages\testspace\testspace.exe publish .\testresult.xml .\coverage.xml .\money\staticanalysis.xml "${ENV:TESTSPACE_URL}"