Skip to content

Commit f8ce1a1

Browse files
authored
Merge pull request #42 from ricaun-io/develop
Version 1.3.2
2 parents 1d42b85 + 05329e1 commit f8ce1a1

File tree

10 files changed

+29
-16
lines changed

10 files changed

+29
-16
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
## [1.3.2] / 2024-05-09
8+
### Fixed
9+
- Fix `ApplicationUtils` to clear temp folder after some minutes. (Fix: #41)
10+
- Fix Net Core tests not stay after rebuild. (Fix: #40)
11+
### TestAdapter
12+
- Fix application and rebuild issue.
13+
- Update `ApplicationUtils` to use `Guid` temp folder.
14+
715
## [1.3.1] / 2024-04-02
816
### Features
917
- Support Revit 2025 to 2017.
@@ -401,6 +409,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
401409
- [x] TestsFail
402410

403411
[vNext]: ../../compare/1.0.0...HEAD
412+
[1.3.2]: ../../compare/1.3.1...1.3.2
404413
[1.3.1]: ../../compare/1.3.0...1.3.1
405414
[1.3.0]: ../../compare/1.2.1...1.3.0
406415
[1.2.1]: ../../compare/1.2.0...1.2.1

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<Project>
22
<PropertyGroup>
3-
<Version>1.3.1</Version>
3+
<Version>1.3.2</Version>
44
</PropertyGroup>
55
</Project>
-92 Bytes
Binary file not shown.
-104 Bytes
Binary file not shown.
-111 Bytes
Binary file not shown.

ricaun.RevitTest.TestAdapter/Services/ApplicationUtils.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,19 @@ internal static class ApplicationUtils
1717

1818
private static void ClearTemporaryDirectory(string folderDirectory)
1919
{
20+
const int MINUTES = 2;
2021
try
2122
{
2223
foreach (var delete in Directory.GetDirectories(folderDirectory))
2324
{
2425
try
2526
{
26-
Directory.Delete(delete);
27+
var directoryInfo = new DirectoryInfo(delete);
28+
var isTimeToDeleteDirectory = directoryInfo.CreationTime < DateTime.Now.AddMinutes(-MINUTES);
29+
if (isTimeToDeleteDirectory)
30+
{
31+
Directory.Delete(delete, true);
32+
}
2733
}
2834
catch { }
2935
}
@@ -44,7 +50,7 @@ public static string CreateTemporaryDirectory(string file = null)
4450
ClearTemporaryDirectory(folderDirectory);
4551

4652
string fileName = Path.GetFileNameWithoutExtension(file);
47-
string tempFolderName = $"{fileName}_{DateTime.Now.Ticks}";
53+
string tempFolderName = $"{fileName}_{Guid.NewGuid()}";
4854
string tempDirectory = Path.Combine(folderDirectory, tempFolderName);
4955
Directory.CreateDirectory(tempDirectory);
5056
return tempDirectory;

ricaun.RevitTest.TestAdapter/Services/RevitTestConsole.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,15 @@ private string GetEnvironmentVariable(string applicationPath)
2727
return applicationPath;
2828
}
2929

30-
private string ValidadeApplication(string applicationPath)
30+
private string ValidadeApplication(string applicationPath, bool showApplicationName = false)
3131
{
3232
if (string.IsNullOrWhiteSpace(applicationPath))
3333
return null;
3434

35-
AdapterLogger.Logger.InfoAny($"Application: {Path.GetFileName(applicationPath)}");
35+
if (showApplicationName)
36+
AdapterLogger.Logger.InfoAny($"Application: {Path.GetFileName(applicationPath)}");
37+
else
38+
AdapterLogger.Logger.Info($"Application: {Path.GetFileName(applicationPath)}");
3639

3740
applicationPath = GetEnvironmentVariable(applicationPath);
3841

@@ -60,7 +63,7 @@ private string ValidadeApplication(string applicationPath)
6063

6164
public RevitTestConsole(string application = null)
6265
{
63-
applicationPath = ValidadeApplication(application);
66+
applicationPath = ValidadeApplication(application, true);
6467
if (applicationPath is null)
6568
{
6669
var name = ResourceConsoleUtils.Name;

ricaun.RevitTest.TestAdapter/TestCaseUtils.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ public static TestCase Create(string source, string testName)
2626
var testCase = new TestCase(fullyQualifiedName, TestAdapter.ExecutorUri, source)
2727
{
2828
DisplayName = displayName,
29-
Id = GetGuid(testName),
3029
};
3130

3231
return testCase;
@@ -53,11 +52,6 @@ private static int LastIndexOfDisplayName(string testName)
5352
return lastIndexOfDot;
5453
}
5554

56-
private static System.Guid GetGuid(string testName)
57-
{
58-
return new System.Guid(testName.GetHashCode(), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
59-
}
60-
6155
#endregion
6256
}
6357
}

ricaun.RevitTest.TestAdapter/TestDiscoverer.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,10 @@ internal static List<TestCase> GetTests(
8080

8181
foreach (var testName in testNames)
8282
{
83-
AdapterLogger.Logger.Info($"TestCase: {testName}");
8483
var testCase = TestCaseUtils.Create(source, testName);
8584

85+
AdapterLogger.Logger.Info($"TestCase: {testCase} [{testCase.DisplayName}] \t{testCase.Id}");
86+
8687
discoverySink?.SendTestCase(testCase);
8788
tests.Add(testCase);
8889
}

ricaun.RevitTest.TestAdapter/TestExecutor.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,13 @@ await revit.RunTestAction(source,
164164
private static void RecordResultTestModel(IFrameworkHandle frameworkHandle, string source, List<TestCase> tests, TestModel testModel)
165165
{
166166
TestCase testCase = TryFindSimilarTestCaseUsingTestModel(tests, testModel);
167-
168-
if (testCase is null)
167+
var needToCreateTestCase = testCase is null;
168+
if (needToCreateTestCase)
169169
{
170170
testCase = TestCaseUtils.Create(source, testModel.FullName);
171171
}
172172

173-
AdapterLogger.Logger.Info($"\tTestCase: {testCase} [{testCase.DisplayName}]");
173+
AdapterLogger.Logger.Info($"\tTestCase: {testCase} [{testCase.DisplayName}] \t{testCase.Id}");
174174

175175
var testResult = new TestResult(testCase);
176176

0 commit comments

Comments
 (0)