Skip to content

Commit

Permalink
Fix test filter limit size arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
ricaun committed Dec 19, 2024
1 parent 8f84691 commit aa2f2f2
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Build/.nuke/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@
"ApplicationType": {
"type": "string"
},
"EnableForkedRepository": {
"type": "boolean"
},
"Folder": {
"type": "string"
},
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [1.8.0] / 2024-12-16
### Features
- Make project public
- Fix test filter limit size `arguments` (Fix: #65)
### Application
- Remove `net46` framework, remove `Revit 2017` and `Revit 2018` support.
### Command
- Fix `AppUtils` to show `ProductName`.
- Update `ProcessStart` to show `arguments` length in debug.
- Update `RevitTestProcessStart` to create temp file for test `arguments`.
- Update `RunCommand` to read test `arguments` from temp file.
### Console
- Update `ricaun.Revit.Installation` to `1.3.1`.
- Add `EnvironmentVariable` class, with `ProcessArguments` and `TimeoutNotBusyMaxSeconds` variables.
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project>
<PropertyGroup>
<Version>1.8.0-rc.3</Version>
<Version>1.8.0-rc.4</Version>
</PropertyGroup>
</Project>
15 changes: 15 additions & 0 deletions ricaun.RevitTest.Command/Command/RunCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,21 @@ private void ValidadeOptions()
if (!File.Exists(options.File))
throw new FileNotFoundException();

// Check if first argument is a file to read the test filters (Fix: #65)
if (options.Test.Count() == 1)
{
var tempFileTestFilters = options.Test.First();
if (File.Exists(tempFileTestFilters))
{
options.Test = File.ReadAllLines(tempFileTestFilters);
try
{
File.Delete(tempFileTestFilters);
}
catch { }
}
}

Log.Enabled = options.Log;
}

Expand Down
10 changes: 10 additions & 0 deletions ricaun.RevitTest.Command/Process/RevitTestProcessStart.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using ricaun.NUnit.Models;
using ricaun.RevitTest.Command.Extensions;
using System;
using System.IO;
using System.Linq;
using System.Threading.Tasks;

Expand Down Expand Up @@ -53,6 +54,15 @@ public RevitTestProcessStart SetTestFilter(string[] testFilters)
{
if (testFilters.Length == 0)
return this;

// Convert filter to file to fix the limit size of arguments (Fix: #65)
if (testFilters.Length > 32)
{
var tempFileTestFilters = Path.GetTempFileName();
File.WriteAllLines(tempFileTestFilters, testFilters);
return SetRevitArgument("test", tempFileTestFilters);
}

return SetRevitArgument("test", testFilters);
}
public RevitTestProcessStart SetTestFilter(string testFilter)
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion ricaun.RevitTest.TestAdapter/TestCaseUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private static void SplitTestName(string testName, out string fullyQualifiedName
fullyQualifiedName = string.Join(".", splitDots.Take(index));
displayName = string.Join(".", splitDots.Skip(index));

AdapterLogger.Logger.DebugOnlyLocal($"SplitTestName[{index}]: {testName} -\t {fullyQualifiedName}\t {displayName}");
// AdapterLogger.Logger.DebugOnlyLocal($"SplitTestName[{index}]: {testName} -\t {fullyQualifiedName}\t {displayName}");
}

private static int LastIndexSplitOfDisplayName(string[] splitDots)
Expand Down

0 comments on commit aa2f2f2

Please sign in to comment.