Skip to content

Commit 4a45e6e

Browse files
Merge pull request #197 from rabbitmq/rabbitmq-dotnet-client-192
moving to nunit3
2 parents 7436ce9 + a6b2e55 commit 4a45e6e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+194
-17050
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ TestResult.xml
2020
rabbit-mock.snk
2121
test.sh
2222
*.VisualState.xml
23-
23+
test-output.log
24+
InternalTrace*
25+
nunit-agent*
2426
#################
2527
## Visual Studio
2628
#################

RUNNING_TESTS.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ On osx/linux run:
4040

4141

4242
Running individual tests and fixtures on Windows is trivial using the Visual Studio test runner.
43-
To run a single test fixture on osx/linux you can use:
43+
To run a specific tests fixture on osx/linux you can use nunit3 where expressions to select the tests
44+
to be run:
4445

45-
./fake.sh Test fixture=MyNameSpace.MyFixture
46+
./fake.sh Test where="test =~ /SomeTest/"
47+

appveyor.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,7 @@ after_build:
4343
4444
artifacts:
4545
- path: '*.nupkg'
46+
- path: '*.log'
47+
name: Logs
4648

4749
deploy: off

build.fsx

Lines changed: 33 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,13 @@ let amqpSpec0_9BaseName = "amqp0-9.stripped.xml"
5858
let amqpSpec0_9_1i = specsDir </> amqpSpec0_9_1BaseName
5959
let autogeneratedApi0_9_1BaseName = "autogenerated-api-0-9-1.cs"
6060

61+
let setRabbitMqCtlPath () =
62+
let current = Environment.GetEnvironmentVariable "RABBITMQ_RABBITMQCTL_PATH"
63+
let ctlPath = __SOURCE_DIRECTORY__ </> "../rabbit/scripts/rabbitmqctl"
64+
if current = null then
65+
trace <| sprintf "setting RABBITMQ_RABBITMQCTL_PATH to %s" ctlPath
66+
Environment.SetEnvironmentVariable("RABBITMQ_RABBITMQCTL_PATH", ctlPath)
67+
6168
let createGensrcDirs () =
6269
projects
6370
|> List.map (fun p -> "./gensrc" </> p)
@@ -117,39 +124,47 @@ Target "UpdateAssemblyInfos"
117124
ReplaceAssemblyInfoVersionsBulk assemblyInfos (fun f ->
118125
{ f with AssemblyVersion = version }))
119126

120-
let test excludes =
121-
let fixture = getBuildParamOrDefault "fixture" ""
122-
trace <| sprintf "fixture %s" fixture
127+
let test ``where`` =
128+
setRabbitMqCtlPath ()
129+
let w =
130+
match ``where``, getBuildParamOrDefault "where" "" with
131+
| (""|null), w -> w
132+
| _, (""|null) -> ``where``
133+
| w, x ->
134+
sprintf "(%s) & (%s)" w x
135+
trace <| sprintf "where %s" w
123136
!! ("./projects/client/**/build/**/unit-tests.dll")
124-
|> NUnit (fun p ->
137+
|> Testing.NUnit3.NUnit3 (fun p ->
125138
{ p with
126-
Fixture = fixture
139+
Labels = Testing.NUnit3.LabelsLevel.All
140+
ProcessModel = Testing.NUnit3.SingleProcessModel
127141
TimeOut = TimeSpan.FromMinutes 30.
128-
ExcludeCategory = excludes
129-
DisableShadowCopy = true;
130-
OutputFile = "./TestResults.xml"})
142+
Where = w
143+
OutputDir = "test-output.log"})
131144

132145
Target "Test" (fun _ ->
133146
match buildEnv with
134-
| Mono -> "MonoBug"
147+
| Mono -> "cat != MonoBug"
135148
| _ -> ""
136149
|> test)
137150

138151
Target "TestQuick" (fun _ ->
139-
let excludes =
152+
setRabbitMqCtlPath ()
153+
let ``where`` =
140154
match buildEnv with
141-
| Mono -> "RequireSMP,LongRunning,MonoBug"
142-
| _ -> "RequireSMP,LongRunning"
155+
| Mono -> "cat != RequireSMP & cat != LongRunning & cat != MonoBug"
156+
| _ -> "cat != RequireSMP & cat != LongRunning"
143157
!! ("./projects/client/Unit/build/**/unit-tests.dll")
144-
|> NUnit (fun p ->
158+
|> Testing.NUnit3.NUnit3 (fun p ->
145159
{ p with
160+
Labels = Testing.NUnit3.LabelsLevel.All
161+
ProcessModel = Testing.NUnit3.SingleProcessModel
146162
TimeOut = TimeSpan.FromMinutes 30.
147-
ExcludeCategory = excludes
148-
DisableShadowCopy = true;
149-
OutputFile = "./TestResults.xml"}))
150-
163+
Where = ``where``
164+
OutputDir = "test-output.log"}))
165+
151166
Target "AppVeyorTest" (fun _ ->
152-
test "RequireSMP,LongRunning,GCTest")
167+
test "cat != RequireSMP & cat != LongRunning & cat != GCTest")
153168

154169
Target "CreateGensrcDir" createGensrcDirs
155170

fake.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
IF %1 == "" GOTO End
33
.paket\paket.bootstrapper.exe
44
.paket\paket.exe restore
5-
packages\FAKE\tools\FAKE.exe build.fsx %1
5+
packages\FAKE\tools\FAKE.exe build.fsx %*
66

77
:End
88
ECHO "no target specified"

lib/nunit/Images/Ellipsis.gif

-101 Bytes
Binary file not shown.
-761 Bytes
Binary file not shown.
-688 Bytes
Binary file not shown.
-734 Bytes
Binary file not shown.
-689 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)