Skip to content

Commit adc797a

Browse files
authored
Merge pull request #2 from munderseth/master
Simplifying build script
2 parents fbe828a + 11189e3 commit adc797a

File tree

4 files changed

+37
-27
lines changed

4 files changed

+37
-27
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ TestResult.xml
1414
TestResults
1515

1616
# open cover results
17-
codecoverage.xml
17+
coverage.xml
18+
19+
# code analysis
20+
analysis.xml
21+
cs-money.dll.lastcodeanalysissucceeded
1822

1923
packages

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ This sample demonstrates techniques for using Testspace with C# code and the [NU
88
***
99
Build using AppVeyor's Online CI:
1010

11-
[![Build status](https://ci.appveyor.com/api/projects/status/x76ee4x2hc84l55a?svg=true)](https://ci.appveyor.com/project/jeffs-s2/csharp-nunit)
11+
[![Build status](https://ci.appveyor.com/api/projects/status/78g1co48hr5xq7wd?svg=true)](https://ci.appveyor.com/project/munderseth/csharp-nunit-mffbo)
12+
1213
***
1314
Publishing **Test Content** using www.testspace.com.
1415

@@ -24,28 +25,27 @@ In order to run this sample you will need a host workstation with Visual Studio,
2425
Building with static analysis:
2526

2627
<pre>
27-
msbuild money/cs-money.csproj /p:runCodeAnalysis=true /p:codeanalysislogfile=StaticAnalysis.xml
28+
msbuild money\cs-money.csproj /p:platform=anycpu /p:configuration=debug /p:runCodeAnalysis=true /p:codeanalysislogfile=..\analysis.xml
2829
</pre>
2930
Running tests with code coverage:
3031

3132
<pre>
32-
OpenCover.Console.exe -target:nunit3-console.exe -targetargs:cs-money.dll -output:codecoverage.xml -register:user
33-
33+
OpenCover.Console -target:"nunit3-console.exe" -targetargs:"cs-money.dll" -output:"coverage.xml" -filter:"+[*]* -[*]*MoneyTest*" -register:user
3434
</pre>
3535

36-
Publishing Results using **Testspace** in powershell:
36+
Publishing Test Content using **Testspace**:
3737

3838
<pre>
39-
wget https://testspace-client.s3.amazonaws.com/testspace-windows.zip -outfile .\money\packages\testspace.zip
40-
extract to preferred location
41-
testspace .\testresult.xml .\coverage.xml money\staticanalysis.xml ${ENV:TESTSPACE_TOKEN}/${ENV:BRANCH_NAME}
39+
curl -fsS -o testspace-windows.zip https://testspace-client.s3.amazonaws.com/testspace-windows.zip
40+
7z x -y .\testspace-windows.zip
41+
estspace publish analysis.xml [Tests]TestResult.xml coverage.xml "master"
4242
</pre>
4343

44-
Checkout the [Space](https://samples.testspace.com/projects/csharp/spaces/nunit).
44+
Checkout the [Testspace Project](https://samples.testspace.com/projects/csharp.nunit).
4545

4646
To fork this example using AppVeyor requires:
4747
- Account at www.testspace.com.
4848
- AppVeyor Environment Variable:
49-
- `TESTSPACE_URL` = `credentials:@my-org-name.testspace.com/my-project/my-space`
49+
- `TESTSPACE_TOKEN` = `credentials:@my-org-name.testspace.com/my-project`
5050
- `credentials` set to `username:password` or your [access token](http://help.testspace.com/using-your-organization:user-settings).
51-
- `my-org-name.testspace.com/my-project/my-space` based on your subdomain, project, and space names. Refer [here](http://help.testspace.com/reference:runner-reference#login-credentials) for more details.
51+
- `my-org-name.testspace.com/my-project` based on your subdomain, and project names. Refer [here](http://help.testspace.com/reference:runner-reference#login-credentials) for more details.

appveyor.yml

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,14 @@
11
version: 1.0.{build}
22
configuration: Debug
3-
install:
4-
- ps: >-
5-
mkdir .\money\packages
63

7-
mkdir .\money\packages\testspace
8-
9-
wget https://testspace-client.s3.amazonaws.com/testspace-windows.zip -outfile .\money\packages\testspace.zip
10-
11-
7z x .\money\packages\testspace.zip -omoney\packages\testspace
124
build_script:
13-
- ps: >-
14-
nuget restore money/cs-money.sln
15-
16-
msbuild money/cs-money.csproj /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /p:runCodeAnalysis=true /p:codeanalysislogfile=StaticAnalysis.xml
5+
- nuget restore money/cs-money.sln
6+
177
test_script:
18-
- ps: >-
19-
.\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
8+
- msbuild money/cs-money.csproj /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /p:runCodeAnalysis=true /p:codeanalysislogfile=..\analysis.xml
9+
- .\money\packages\OpenCover.4.6.519\tools\OpenCover.Console -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
2010

21-
.\money\packages\testspace\testspace.exe publish .\testresult.xml .\coverage.xml .\money\staticanalysis.xml "${ENV:TESTSPACE_URL}"
11+
after_test:
12+
- curl -fsS -o testspace-windows.zip https://testspace-client.s3.amazonaws.com/testspace-windows.zip
13+
- 7z x -y testspace-windows.zip
14+
- testspace publish analysis.xml [Tests]TestResult.xml coverage.xml %TESTSPACE_TOKEN%/%APPVEYOR_REPO_BRANCH%#appveyor.build.%APPVEYOR_BUILD_NUMBER%

desktopbuild.bat

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
REM Remove any old test content
2+
del *.xml
3+
4+
REM "test_script:"
5+
msbuild money\cs-money.csproj /p:platform=anycpu /p:configuration=debug /p:runCodeAnalysis=true /p:codeanalysislogfile=..\analysis.xml
6+
.\money\packages\OpenCover.4.6.519\tools\OpenCover.Console -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
7+
8+
REM "after_test:"
9+
REM curl -fsS -o testspace-windows.zip https://testspace-client.s3.amazonaws.com/testspace-windows.zip
10+
REM 7z x -y .\testspace-windows.zip
11+
REM del testspace-windows.zip
12+
13+
testspace publish analysis.xml [Tests]TestResult.xml coverage.xml "master.desktop"

0 commit comments

Comments
 (0)