Skip to content

Commit 9570eeb

Browse files
committed
Core tests on Appveyor
1 parent d27295c commit 9570eeb

9 files changed

+48
-89
lines changed

Build/BuildScripts/CodeJam.AppVeyor.FixVersionProps.ps1

Lines changed: 0 additions & 40 deletions
This file was deleted.

Build/BuildScripts/CodeJam.AppVeyor.MsTest.Tests.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
$include = "*-tests.MSTest.dll"
1+
$include = "*.Tests.MSTest.dll"
22

33
#run .net tests
44
$a = (gci -include $include -r | `
5-
where { $_.fullname -match "\\bin\\Publish\\net\d" } | `
5+
where { $_.fullname -match "\\bin\\Release\\net\d" } | `
66
select -ExpandProperty FullName)
77
echo "vstest.console /logger:Appveyor $a /Platform:x86"
88
&"vstest.console" /logger:Appveyor $a /Platform:x86
@@ -11,7 +11,7 @@ if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
1111
#run .net core tests
1212
# waiting for https://github.com/Microsoft/vstest/issues/1128
1313
#$a = (gci -include $include -r | `
14-
# where { $_.fullname -match "\\bin\\Publish\\netcore" } | `
14+
# where { $_.fullname -match "\\bin\\Release\\netcore" } | `
1515
# select -ExpandProperty FullName)
1616
#
1717
#$logFileName = "$env:APPVEYOR_BUILD_FOLDER\_Results\netcore_mstest_results.xml"

Build/BuildScripts/CodeJam.AppVeyor.NUnit.Tests.ps1

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
$include = "*-tests.dll", "*-tests.NUnit.dll"
2-
$includePerfTests = "*-tests.performance.dll"
3-
$exclude = "Experimental\\.*?\\CodeJam-Tests.Performance.dll"
1+
$include = "*.Tests.dll", "*.Tests.NUnit.dll"
2+
$includePerfTests = "*.Tests.Performance.dll"
3+
$exclude = "Experimental\\.*?\\CodeJam.Tests.Performance.dll"
44

55
$wc = New-Object System.Net.WebClient
66

77
#run .net tests
88
$logFileName = "$env:APPVEYOR_BUILD_FOLDER\_Results\net_nunit_results.xml"
99
$a = (gci -include $include -r | `
10-
where { $_.fullname -match "\\bin\\Publish\\net\d" -and $_.fullname -notmatch $exclude } | `
10+
where { $_.fullname -match "\\bin\\Release\\net\d" -and $_.fullname -notmatch $exclude } | `
1111
select -ExpandProperty FullName)
1212
echo "nunit3-console $a --result=$logFileName"
1313
&"nunit3-console" $a "--result=$logFileName"
@@ -20,23 +20,23 @@ if ($LastExitCode -ne 0) {
2020
}
2121

2222
#run .net perftests
23-
$logFileName = "$env:APPVEYOR_BUILD_FOLDER\_Results\net_perftest_nunit_results.xml"
24-
$a = (gci -include $includePerfTests -r | `
25-
where { $_.fullname -match "\\bin\\Publish\\net\d" -and $_.fullname -notmatch $exclude } | `
26-
select -ExpandProperty FullName)
27-
echo "nunit3-console $a --result=$logFileName" --agents=1
28-
&"nunit3-console" $a "--result=$logFileName" --agents=1
29-
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
30-
echo "UploadFile: https://ci.appveyor.com/api/testresults/nunit3/$env:APPVEYOR_JOB_ID from $logFileName"
31-
$wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit3/$env:APPVEYOR_JOB_ID", "$logFileName")
32-
if ($LastExitCode -ne 0) {
33-
echo "FAIL: UploadFile: https://ci.appveyor.com/api/testresults/nunit3/$env:APPVEYOR_JOB_ID from $logFileName"
34-
$host.SetShouldExit($LastExitCode)
35-
}
23+
#$logFileName = "$env:APPVEYOR_BUILD_FOLDER\_Results\net_perftest_nunit_results.xml"
24+
#$a = (gci -include $includePerfTests -r | `
25+
# where { $_.fullname -match "\\bin\\Release\\net\d" -and $_.fullname -notmatch $exclude } | `
26+
# select -ExpandProperty FullName)
27+
#echo "nunit3-console $a --result=$logFileName" --agents=1
28+
#&"nunit3-console" $a "--result=$logFileName" --agents=1
29+
#if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
30+
#echo "UploadFile: https://ci.appveyor.com/api/testresults/nunit3/$env:APPVEYOR_JOB_ID from $logFileName"
31+
#$wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit3/$env:APPVEYOR_JOB_ID", "$logFileName")
32+
#if ($LastExitCode -ne 0) {
33+
# echo "FAIL: UploadFile: https://ci.appveyor.com/api/testresults/nunit3/$env:APPVEYOR_JOB_ID from $logFileName"
34+
# $host.SetShouldExit($LastExitCode)
35+
#}
3636

3737
#run .net core tests
3838
$a = (gci -include $include -r | `
39-
where { $_.fullname -match "\\bin\\Publish\\netcore" -and $_.fullname -notmatch $exclude } | `
39+
where { $_.fullname -match "\\bin\\Release\\netcore" -and $_.fullname -notmatch $exclude } | `
4040
select -ExpandProperty FullName)
4141

4242
$logFileName = "$env:APPVEYOR_BUILD_FOLDER\_Results\netcore_nunit_results.xml"

Build/BuildScripts/CodeJam.AppVeyor.xUnit.Tests.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
$include = "*-tests.xUnit.dll"
1+
$include = "*.Tests.xUnit.dll"
22

33
#run .net tests
44
$a = (gci -include $include -r | `
5-
where { $_.fullname -match "\\bin\\Publish\\net\d" } | `
5+
where { $_.fullname -match "\\bin\\Release\\net\d" } | `
66
select -ExpandProperty FullName)
77
echo "$env:xunit20\xunit.console $a -appveyor"
88
&"$env:xunit20\xunit.console" $a -appveyor
99
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
1010

1111
#run .net core tests
1212
$a = (gci -include $include -r | `
13-
where { $_.fullname -match "\\bin\\Publish\\netcore" } | `
13+
where { $_.fullname -match "\\bin\\Release\\netcore" } | `
1414
select -ExpandProperty FullName)
1515

1616
$logFileName = "$env:APPVEYOR_BUILD_FOLDER\_Results\netcore_xunit_results.xml"

Build/BuildScripts/RunMe.BuildPublishConfiguration.cmd

Lines changed: 0 additions & 1 deletion
This file was deleted.

Build/BuildScripts/RunMe.RestorePublishConfiguration.cmd

Lines changed: 0 additions & 1 deletion
This file was deleted.

CodeJam.Main.Tests/Threading/ParallelQueueTest.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
using System;
1+
using NUnit.Framework;
2+
using System;
23
using System.Linq;
34
using System.Threading;
45

5-
using NUnit.Framework;
6-
76
namespace CodeJam.Threading
87
{
98
[TestFixture]
@@ -25,24 +24,26 @@ public void MultipleConsumerProviderTest()
2524
_consumerCount = 0;
2625

2726
Enumerable.Range(1, 100).RunInParallel(
28-
5, i =>
27+
5,
28+
i =>
2929
{
3030
if (!_providerInit)
3131
{
3232
_providerInit = true;
3333
Interlocked.Increment(ref _providerCount);
34-
Thread.Sleep(100);
34+
Thread.Sleep(300);
3535
}
3636

3737
return i.ToString();
3838
},
39-
2, s =>
39+
2,
40+
s =>
4041
{
4142
if (!_consumerInit)
4243
{
4344
_consumerInit = true;
4445
Interlocked.Increment(ref _consumerCount);
45-
Thread.Sleep(100);
46+
Thread.Sleep(300);
4647
}
4748
});
4849

CodeJamDoc.sln

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 14
44
VisualStudioVersion = 14.0.25123.0
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeJam.Main", "Main\src\CodeJam.Main.csproj", "{2F2046CC-FB47-4318-B335-5A82B04B6C40}"
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeJam.Main", "CodeJam.Main\CodeJam.Main.csproj", "{2F2046CC-FB47-4318-B335-5A82B04B6C40}"
77
EndProject
8-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CodeJam.Blocks", "Blocks\src\CodeJam.Blocks.csproj", "{0DFF0859-2400-4487-83AD-0ED10203D6D9}"
8+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CodeJam.Blocks", "CodeJam.Blocks\CodeJam.Blocks.csproj", "{0DFF0859-2400-4487-83AD-0ED10203D6D9}"
99
EndProject
1010
Project("{7CF6DF6D-3B04-46F8-A40B-537D21BCA0B4}") = "CodeJamDoc", "CodeJamDoc.shfbproj", "{383368D3-567C-4BF6-96D4-7A292DA5D486}"
1111
EndProject

appveyor.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,27 +49,27 @@ nuget:
4949
build_script:
5050
msbuild CodeJam.sln /p:Configuration=Release /t:Restore;Build /v:m
5151

52-
test:
53-
assemblies:
54-
only:
55-
- '**\*.Tests.dll'
52+
#test:
53+
# assemblies:
54+
# only:
55+
# - '**\*.Tests.dll'
5656

57-
artifacts:
58-
- path: 'Results\*.nupkg'
57+
test_script:
58+
- ps: .\Build\BuildScripts\CodeJam.AppVeyor.NUnit.Tests.ps1
59+
# - ps: .\Build\BuildScripts\CodeJam.AppVeyor.xUnit.Tests.ps1
60+
# - ps: .\Build\BuildScripts\CodeJam.AppVeyor.MsTest.Tests.ps1
5961

60-
#test_script:
61-
# - ps: .\Build\CodeJam.AppVeyor.NUnit.Tests.ps1
62-
# - ps: .\Build\CodeJam.AppVeyor.xUnit.Tests.ps1
63-
# - ps: .\Build\CodeJam.AppVeyor.MsTest.Tests.ps1
62+
artifacts:
63+
- path: '_Results\*.nupkg'
6464

6565
#after_build:
6666
# - ps: Get-ChildItem .\_Results\*.nupkg | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
6767

68-
#on_finish:
68+
on_finish:
6969
# artifacts for perftests
70-
# - ps: Get-ChildItem *.csv -r | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
71-
# - ps: Get-ChildItem *results.xml -r | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
72-
# - ps: Get-ChildItem *.PerfTests.log -r | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
70+
- ps: Get-ChildItem *.csv -r | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
71+
- ps: Get-ChildItem *results.xml -r | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
72+
- ps: Get-ChildItem *.PerfTests.log -r | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
7373
# to troubleshoot via RDP:
7474
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
7575

0 commit comments

Comments
 (0)