Pass the correct configuration to the test runners
This commit is contained in:
parent
430a62982e
commit
9b10be8612
|
|
@ -10,9 +10,13 @@ dotnet-test
|
|||
|
||||
projectFile=''
|
||||
Required. Path to the test project.json to execute
|
||||
|
||||
|
||||
configuration=''
|
||||
Optional. The configuration to build in. Defaults to 'Debug'.
|
||||
*/}
|
||||
|
||||
default configuration = 'Debug'
|
||||
|
||||
@{
|
||||
var projectText = File.ReadAllText(projectFile);
|
||||
var project = (JsonObject)Json.Deserialize(projectText);
|
||||
|
|
@ -25,13 +29,7 @@ projectFile=''
|
|||
var projectFolder = Path.GetDirectoryName(projectFile);
|
||||
var projectName = Path.GetFileName(projectFolder);
|
||||
|
||||
var noParallelTestProjects = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||
if (!string.IsNullOrEmpty(NO_PARALLEL_TEST_PROJECTS))
|
||||
{
|
||||
noParallelTestProjects.UnionWith(NO_PARALLEL_TEST_PROJECTS.Split((char)','));
|
||||
}
|
||||
|
||||
var testArgs = noParallelTestProjects.Contains(projectName) ? " -parallel none" : "";
|
||||
var testArgs = "--configuration " + configuration;
|
||||
|
||||
var configs = project.ValueAsJsonObject("frameworks");
|
||||
IEnumerable<string> targetFrameworks = configs == null?
|
||||
|
|
|
|||
|
|
@ -180,8 +180,8 @@ default NUGET_FEED = 'https://api.nuget.org/v3/index.json'
|
|||
#xunit-test target='test' if='Directory.Exists("test")'
|
||||
@{
|
||||
var projectFiles = Files.Include("test/**/project.json").Exclude("**/bin/*/app/project.json").ToList();
|
||||
projectFiles.ForEach(projectFile => XunitTest(projectFile, testParallel: false));
|
||||
projectFiles.ForEach(projectFile => DotnetTest(projectFile, testParallel: false));
|
||||
projectFiles.ForEach(projectFile => XunitTest(projectFile, testParallel: false, configuration: Configuration));
|
||||
projectFiles.ForEach(projectFile => DotnetTest(projectFile, testParallel: false, configuration: Configuration));
|
||||
projectFiles.ForEach(projectFile => DnxTest(projectFile, testParallel: false));
|
||||
}
|
||||
|
||||
|
|
@ -357,11 +357,14 @@ macro name="DotnetPack" projectFile='string' dotnetPackOutputDir='string' config
|
|||
|
||||
macro name="DotnetPublish" projectFile='string' outputFolder='string' framework='string'
|
||||
dotnet-publish
|
||||
|
||||
macro name="DotnetPublish" projectFile='string' outputFolder='string' framework='string' configuration='string'
|
||||
dotnet-publish
|
||||
|
||||
macro name="DotnetTest" projectFile='string' testParallel='bool'
|
||||
macro name="DotnetTest" projectFile='string' testParallel='bool' configuration='string'
|
||||
dotnet-test
|
||||
|
||||
macro name="XunitTest" projectFile='string' testParallel='bool'
|
||||
macro name="XunitTest" projectFile='string' testParallel='bool' configuration='string'
|
||||
xunit-test
|
||||
|
||||
macro name='Dnx' command='string' dnxDir='string' dnvmUse='string'
|
||||
|
|
|
|||
|
|
@ -12,8 +12,12 @@ xunit-test
|
|||
projectFile=''
|
||||
Required. Path to the test project.json to execute
|
||||
|
||||
configuration=''
|
||||
Optional. The configuration to build in. Defaults to 'Debug'.
|
||||
*/}
|
||||
|
||||
default configuration = 'Debug'
|
||||
|
||||
@{
|
||||
if (!string.Equals(KOREBUILD_TEST_SKIPMONO, "1") && !string.Equals(KOREBUILD_TEST_SKIPMONO, "true"))
|
||||
{
|
||||
|
|
@ -52,7 +56,7 @@ projectFile=''
|
|||
}
|
||||
|
||||
var publishFolder = Path.Combine(projectFolder, "obj", "testPublish-" + framework);
|
||||
DotnetPublish(projectFile, publishFolder, framework);
|
||||
DotnetPublish(projectFile, publishFolder, framework, configuration);
|
||||
|
||||
var runnerExe = "xunit.console.exe";
|
||||
string runnerFullPath;
|
||||
|
|
|
|||
Loading…
Reference in New Issue