Skip to content

Commit c16e68c

Browse files
509456_adskcursoragent
andcommitted
OOTB smoke: trim ResolveSamplePath and drop unrelated gitignore noise.
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 7695cea commit c16e68c

2 files changed

Lines changed: 6 additions & 34 deletions

File tree

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,13 +217,11 @@ pip-log.txt
217217

218218
#Mr Developer
219219
.mr.developer.cfg
220-
221220
src/AssemblySharedInfoGenerator/AssemblySharedInfo.cs
222221
test/Libraries/RevitIntegrationTests/RevitTestConfiguration.xml
223222
test/**/*.txt
224223
test/**/*.addin
225224
test/SystemInJson
226225

227226
# Icon resources
228-
/src/DynamoRevitIcons/*.resources
229-
logs/*
227+
/src/DynamoRevitIcons/*.resources

test/Libraries/RevitIntegrationTests/OOTB_D4R_SampleTests.cs

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -9,43 +9,19 @@
99

1010
namespace RevitSystemTests
1111
{
12-
/// <summary>
13-
/// Smoke tests for OOTB D4R sample scripts. Resolves .dyn files from
14-
/// DynamoForRevit\samples\{locale}\Revit\ via <see cref="ResolveSamplePath"/>.
15-
/// </summary>
1612
[TestFixture]
1713
class OOTB_D4R_SampleTests : RevitSystemTestBase
1814
{
1915
private static string ResolveSamplePath(string scriptFileName)
2016
{
2117
string assemblyDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
22-
// Deployed layout: {parentDir}\samples\{locale}\Revit\ (not doc/distrib/Samples)
2318
string parentDir = Path.GetDirectoryName(assemblyDir);
24-
string samplesFolder = Path.Combine(parentDir, "samples");
25-
26-
if (Directory.Exists(samplesFolder))
27-
{
28-
foreach (var locale in new[] { System.Globalization.CultureInfo.CurrentUICulture.Name, "en-US" }.Distinct())
29-
{
30-
string localePath = Path.Combine(samplesFolder, locale, "Revit");
31-
if (Directory.Exists(localePath))
32-
{
33-
var resolved = Path.Combine(localePath, scriptFileName);
34-
if (File.Exists(resolved))
35-
return resolved;
36-
}
37-
}
38-
}
39-
40-
var hint = Directory.Exists(samplesFolder)
41-
? $"Contents:{string.Concat(Directory.EnumerateFileSystemEntries(samplesFolder).OrderBy(e => e).Select(e => $"\n {e}"))}"
42-
: Directory.Exists(parentDir)
43-
? $"Parent dir contents:{string.Concat(Directory.EnumerateDirectories(parentDir).OrderBy(e => e).Select(e => $"\n {e}"))}"
44-
: string.Empty;
19+
string resolved = Path.Combine(parentDir, "samples", "en-US", "Revit", scriptFileName);
20+
if (File.Exists(resolved))
21+
return resolved;
4522

4623
throw new FileNotFoundException(
47-
$"Cannot locate OOTB D4R sample script '{scriptFileName}'.\n" +
48-
$"Samples folder: {samplesFolder}\n{hint}");
24+
$"Cannot locate OOTB D4R sample script '{scriptFileName}' under {Path.Combine(parentDir, "samples")}.");
4925
}
5026

5127
private void OpenAndRunSample(string scriptFileName)
@@ -72,11 +48,9 @@ private void OpenAndRunSample(string scriptFileName)
7248
if (errorNodes.Any())
7349
{
7450
var first = errorNodes[0];
75-
var msg = first.NodeInfos
76-
.FirstOrDefault(i => i.State == ElementState.Error)?.Message;
7751
Assert.Fail(
7852
$"After RunCurrentModel(), {errorNodes.Count} node(s) in error in '{scriptFileName}'. " +
79-
$"First: [{first.State}] {first.Name}" + (msg != null ? $": {msg}" : string.Empty));
53+
$"First: [{first.State}] {first.Name}");
8054
}
8155
}
8256

0 commit comments

Comments
 (0)