diff --git a/netci.groovy b/netci.groovy
index 3828c78cdfbca6dda3addb88573b01af756721c0..4db5b48c4b6143b87d767413e0598731a942a27b 100644
--- a/netci.groovy
+++ b/netci.groovy
@@ -71,7 +71,7 @@ static void addUnitPublisher(def myJob) {
'xunit'('plugin': 'xunit@1.97') {
'types' {
'XUnitDotNetTestType' {
- 'pattern'('**/*TestResults.xml')
+ 'pattern'('**/xUnitResults/*.xml')
'skipNoTestFiles'(false)
'failIfNotNew'(true)
'deleteOutputFiles'(true)
diff --git a/src/Tools/Source/RunTests/Program.cs b/src/Tools/Source/RunTests/Program.cs
index 8436acd86e06f089b0c6e0f672e99ff570e8b0d1..b208734ac386474f2c3ac9677be8a181ec88062e 100644
--- a/src/Tools/Source/RunTests/Program.cs
+++ b/src/Tools/Source/RunTests/Program.cs
@@ -48,8 +48,8 @@ internal static int Main(string[] args)
var testRunner = new TestRunner(xunit, useHtml);
var start = DateTime.Now;
Console.WriteLine("Running {0} tests", list.Count);
- OrderAssemblyList(list);
- var result = testRunner.RunAllAsync(list, cts.Token).Result;
+ var orderedList = OrderAssemblyList(list);
+ var result = testRunner.RunAllAsync(orderedList, cts.Token).Result;
var span = DateTime.Now - start;
if (!result)
{
@@ -90,25 +90,11 @@ private static void ParseArgs(string[] args, ref int index, ref bool test64, ref
}
///
- /// Order the assembly list so the known slower test begin running earlier. This
- /// should really be dynamically calculated and not hard coded like this.
+ /// Order the assembly list so that the largest assemblies come first. This
+ /// is not ideal as the largest assembly does not necessarily take the most time.
///
///
- private static void OrderAssemblyList(List list)
- {
- var regex = new Regex(@"Roslyn.Services.Editor.(\w+).UnitTests", RegexOptions.IgnoreCase);
- var i = 1;
- while (i < list.Count)
- {
- var cur = list[i];
- if (regex.IsMatch(cur))
- {
- list.RemoveAt(i);
- list.Insert(0, cur);
- }
-
- i++;
- }
- }
+ private static IOrderedEnumerable OrderAssemblyList(List list) =>
+ list.OrderByDescending((assemblyName) => new FileInfo(assemblyName).Length);
}
}
diff --git a/src/Tools/Source/RunTests/TestRunner.cs b/src/Tools/Source/RunTests/TestRunner.cs
index 74be27c0d4afcfd69549b7c26d653bc83863ef67..7709459179269ead48b85523cd50478d0c1ccfa1 100644
--- a/src/Tools/Source/RunTests/TestRunner.cs
+++ b/src/Tools/Source/RunTests/TestRunner.cs
@@ -115,19 +115,13 @@ private void Print(List testResults)
Console.WriteLine("================");
}
- private static readonly string[] UpgradedTests = new string[] {
- "Microsoft.DiaSymReader.PortablePdb.UnitTests.dll",
- "Microsoft.CodeAnalysis.Scripting.VisualBasic.UnitTests.dll",
- "Microsoft.CodeAnalysis.Scripting.CSharp.UnitTests.dll"
- };
-
private async Task RunTest(string assemblyPath, CancellationToken cancellationToken)
{
try
{
var assemblyName = Path.GetFileName(assemblyPath);
- var extension = _useHtml ? ".TestResults.html" : ".TestResults.xml";
- var resultsPath = Path.Combine(Path.GetDirectoryName(assemblyPath), Path.ChangeExtension(assemblyName, extension));
+ var extension = _useHtml ? "html" : "xml";
+ var resultsPath = Path.Combine(Path.GetDirectoryName(assemblyPath), "xUnitResults", $"{assemblyName}.{extension}");
DeleteFile(resultsPath);
var builder = new StringBuilder();
@@ -138,7 +132,7 @@ private async Task RunTest(string assemblyPath, CancellationToken ca
var errorOutput = new StringBuilder();
var start = DateTime.UtcNow;
- var xunitPath = UpgradedTests.Contains(assemblyName) ? Path.Combine($"{Path.GetDirectoryName(_xunitConsolePath)}", @"..\..\..\xunit.runner.console\2.1.0\tools", $"{Path.GetFileName(_xunitConsolePath)}") : _xunitConsolePath;
+ var xunitPath = _xunitConsolePath;
var processOutput = await ProcessRunner.RunProcessAsync(
xunitPath,
builder.ToString(),