@@ -135,7 +135,8 @@ Task("Publish-NuGet")
135
135
. Description ( "Pushes the nuget packages in the nuget folder to a NuGet source. Also publishes the packages into the feeds." )
136
136
. Does ( ( ) =>
137
137
{
138
- if ( string . IsNullOrWhiteSpace ( apiKey ) ) {
138
+ if ( string . IsNullOrWhiteSpace ( apiKey ) )
139
+ {
139
140
throw new CakeException ( "No NuGet API key provided. You need to pass in --apikey=\" xyz\" " ) ;
140
141
}
141
142
@@ -234,8 +235,15 @@ Task("Test")
234
235
. IsDependentOn ( "Compile" )
235
236
. Does ( ( ) =>
236
237
{
238
+ /*
239
+ Exclude Nancy.ViewEngines.Spark.Tests from test execution until their problem
240
+ with duplicate assembly references (if the same assembly exists more than once
241
+ in the application domain, it fails to compile the views) has been fixed.
242
+ */
243
+
237
244
var projects =
238
- GetFiles ( "./test/**/*.csproj" ) ;
245
+ GetFiles ( "./test/**/*.csproj" ) -
246
+ GetFiles ( "./test/Nancy.ViewEngines.Spark.Tests/Nancy.ViewEngines.Spark.Tests.csproj" ) ;
239
247
240
248
if ( projects . Count == 0 )
241
249
{
@@ -247,21 +255,28 @@ Task("Test")
247
255
var content =
248
256
System . IO . File . ReadAllText ( project . FullPath , Encoding . UTF8 ) ;
249
257
250
- if ( IsRunningOnUnix ( ) && content . Contains ( ">" + fullFrameworkTarget + "<" ) ) {
258
+ if ( IsRunningOnUnix ( ) && content . Contains ( ">" + fullFrameworkTarget + "<" ) )
259
+ {
251
260
Information ( project . GetFilename ( ) + " only supports " + fullFrameworkTarget + " and tests cannot be executed on *nix. Skipping." ) ;
252
261
continue ;
253
262
}
254
263
255
264
var settings = new ProcessSettings {
256
- Arguments = string . Concat ( "xunit -configuration " , configuration , " -nobuild -verbose " ) ,
265
+ Arguments = string . Concat ( "xunit -configuration " , configuration , " -nobuild" ) ,
257
266
WorkingDirectory = project . GetDirectory ( )
258
267
} ;
259
268
260
- if ( IsRunningOnUnix ( ) ) {
269
+ if ( IsRunningOnUnix ( ) )
270
+ {
261
271
settings . Arguments . Append ( string . Concat ( "-framework " , netCoreTarget ) ) ;
262
272
}
263
273
264
- StartProcess ( "dotnet" , settings ) ;
274
+ Information ( "Executing tests for " + project . GetFilename ( ) + " with arguments: " + settings . Arguments . Render ( ) ) ;
275
+
276
+ if ( StartProcess ( "dotnet" , settings ) != 0 )
277
+ {
278
+ Error ( "One or more tests failed during execution of: " + project . GetFilename ( ) ) ;
279
+ }
265
280
}
266
281
} ) ;
267
282
0 commit comments