-
Notifications
You must be signed in to change notification settings - Fork 201
REVIT-238057: Add OOTB D4R sample smoke tests #3388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Fusneica-FlorentinCristian
wants to merge
24
commits into
master
Choose a base branch
from
fusneif/REVIT-238057/tests-for-OOTB-sample-scripts-D4R
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
6810393
REVIT-238057: Add OOTB D4R sample tests with SetupUnzip
1cdaf61
REVIT-238057: Address PR review — refactor OOTB_D4R_Tests
6714972
REVIT-238057: Update .gitignore to include packages directory
cd29ffc
Add logs directory to .gitignore to prevent tracking log files
a65d381
REVIT-238057: Add explicit using System for InvalidOperationException
28ffb6c
REVIT-238057: Update OOTB D4R sample tests to use correct models per …
09dbecb
Address PR feedback: rename class, add node warning check, extract to…
7d09993
Fix test model paths to use models available in repo
cccade8
Use version-keyed temp cache with atomic extraction
1718dcf
Add cache fallback when zip is absent
8ed8cac
Comment out zip extraction priorities, keep for future use
719f06e
Rename SetupUnzip to ResolveSamplePath, add locale probe, sort diagno…
bd26668
Fix double semicolon, add comment clarifying SamplesPath distinction
cb5cc31
Add graph-loaded assertion, clarify assembly location pattern
a1611aa
Improve assertion diagnostics: show node messages and connector details
090ca0f
REVIT-238057: Trim OOTB smoke test fixture (ponytail review)
076242c
REVIT-238057: Align StructuralFraming TestModel with journal path
74eed48
REVIT-238057: Harden OOTB smoke tests for graph execution
b7c6314
REVIT-238057: Use empty.rfa for OOTB Solids smoke test
145fcc4
Use DynamoSample_2020.rvt for OOTB sample-model smoke tests.
c3036d9
OOTB smoke: fail on Error only and rename colliding test names.
bd1d8b2
OOTB smoke: trim ResolveSamplePath and drop unrelated gitignore noise.
773f288
OOTB smoke: restore Warning checks and align TestModel with sample In…
ff6c8c2
Fix OOTB triage failures: DynamoSample model and Import Solid Level p…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
129 changes: 129 additions & 0 deletions
129
test/Libraries/RevitIntegrationTests/OOTB_D4R_SampleTests.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,129 @@ | ||
| using System; | ||
| using System.IO; | ||
| using System.Linq; | ||
| using System.Reflection; | ||
| using Dynamo.Graph.Nodes; | ||
| using NUnit.Framework; | ||
| using RevitTestServices; | ||
| using RTF.Framework; | ||
|
|
||
| namespace RevitSystemTests | ||
| { | ||
| [TestFixture] | ||
| class OOTB_D4R_SampleTests : RevitSystemTestBase | ||
| { | ||
| private static string ResolveSamplePath(string scriptFileName) | ||
| { | ||
| string assemblyDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); | ||
| string parentDir = Path.GetDirectoryName(assemblyDir); | ||
| string resolved = Path.Combine(parentDir, "samples", "en-US", "Revit", scriptFileName); | ||
| if (File.Exists(resolved)) | ||
| return resolved; | ||
|
|
||
| throw new FileNotFoundException( | ||
| $"Cannot locate OOTB D4R sample script '{scriptFileName}' under {Path.Combine(parentDir, "samples")}."); | ||
| } | ||
|
|
||
| private void OpenAndRunSample(string scriptFileName) | ||
| { | ||
| string testPath = Path.GetFullPath(ResolveSamplePath(scriptFileName)); | ||
|
|
||
| ViewModel.OpenCommand.Execute(testPath); | ||
|
|
||
| Assert.IsTrue( | ||
| ViewModel.Model.CurrentWorkspace.Nodes.Any(), | ||
| $"Graph '{scriptFileName}' opened but contains no nodes — file may not have loaded correctly."); | ||
|
|
||
| AssertNoDummyNodes(); | ||
|
|
||
| var brokenConnectors = ViewModel.Model.CurrentWorkspace.Connectors | ||
| .Where(c => c.Start == null || c.End == null).ToList(); | ||
| Assert.IsFalse(brokenConnectors.Any(), | ||
| $"Graph '{scriptFileName}' has {brokenConnectors.Count} broken connector(s)."); | ||
|
|
||
| RunCurrentModel(); | ||
|
|
||
| var errorNodes = ViewModel.Model.CurrentWorkspace.Nodes | ||
| .Where(n => n.State == ElementState.Error || n.State == ElementState.Warning).ToList(); | ||
| if (errorNodes.Any()) | ||
| { | ||
| var first = errorNodes[0]; | ||
| var msg = first.NodeInfos | ||
| .FirstOrDefault(i => i.State == ElementState.Error || i.State == ElementState.Warning)?.Message; | ||
| Assert.Fail( | ||
| $"After RunCurrentModel(), {errorNodes.Count} node(s) in error/warning in '{scriptFileName}'. " + | ||
| $"First: [{first.State}] {first.Name}" + (msg != null ? $": {msg}" : string.Empty)); | ||
| } | ||
| } | ||
|
|
||
| [Test, Category("SmokeTests")] | ||
| [TestModel(@".\AdaptiveComponents.rfa")] | ||
| public void Revit_Geometry_Creation_Points() | ||
| { | ||
| OpenAndRunSample("Revit Geometry Creation Points.dyn"); | ||
| } | ||
|
|
||
| [Test, Category("SmokeTests")] | ||
| [TestModel(@".\Snowdon Towers Sample Architectural.rvt")] | ||
| public void Revit_Geometry_Creation_Curves() | ||
| { | ||
| OpenAndRunSample("Revit Geometry Creation Curves.dyn"); | ||
| } | ||
|
|
||
| [Test, Category("SmokeTests")] | ||
| [TestModel(@".\empty.rfa")] | ||
| public void Revit_Geometry_Creation_Solids() | ||
| { | ||
| OpenAndRunSample("Revit Geometry Creation Solids.dyn"); | ||
| } | ||
|
|
||
| [Test, Category("SmokeTests")] | ||
| [TestModel(@".\empty.rfa")] | ||
| public void Revit_Geometry_Creation_Surfaces() | ||
| { | ||
| OpenAndRunSample("Revit Geometry Creation Surfaces.dyn"); | ||
| } | ||
|
|
||
| [Test, Category("SmokeTests")] | ||
| [TestModel(@".\DynamoSample_2021.rvt")] | ||
| public void OOTB_Revit_Adaptive_Component_Placement() | ||
| { | ||
| OpenAndRunSample("Revit Adaptive Component Placement.dyn"); | ||
| } | ||
|
|
||
| [Test, Category("SmokeTests")] | ||
| [TestModel(@".\Snowdon Towers Sample Architectural.rvt")] | ||
| public void OOTB_Revit_Color() | ||
| { | ||
| OpenAndRunSample("Revit Color.dyn"); | ||
| } | ||
|
|
||
| [Test, Category("SmokeTests")] | ||
| [TestModel(@".\Snowdon Towers Sample Architectural.rvt")] | ||
| public void OOTB_Revit_Floors_and_Framing() | ||
| { | ||
| OpenAndRunSample("Revit Floors and Framing.dyn"); | ||
| } | ||
|
|
||
| [Test, Category("SmokeTests")] | ||
| [TestModel(@".\Snowdon Towers Sample Architectural.rvt")] | ||
| public void Revit_Import_Solid() | ||
| { | ||
| OpenAndRunSample("Revit Import Solid.dyn"); | ||
| } | ||
|
|
||
| [Test, Category("SmokeTests")] | ||
| [TestModel(@".\Snowdon Towers Sample Architectural.rvt")] | ||
| public void Revit_Place_Families_By_Level_Set_Parameters() | ||
| { | ||
| OpenAndRunSample("Revit Place Families By Level Set Parameters.dyn"); | ||
| } | ||
|
|
||
| [Test, Category("SmokeTests")] | ||
| [TestModel(@".\Snowdon Towers Sample Architectural.rvt")] | ||
| public void Revit_Structural_Framing() | ||
| { | ||
| OpenAndRunSample("Revit Structural Framing.dyn"); | ||
| } | ||
| } | ||
| } | ||
Git LFS file not shown
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.