Skip to content

REVIT-238057: Add OOTB D4R sample smoke tests - #3388

Open
Fusneica-FlorentinCristian wants to merge 24 commits into
masterfrom
fusneif/REVIT-238057/tests-for-OOTB-sample-scripts-D4R
Open

REVIT-238057: Add OOTB D4R sample smoke tests#3388
Fusneica-FlorentinCristian wants to merge 24 commits into
masterfrom
fusneif/REVIT-238057/tests-for-OOTB-sample-scripts-D4R

Conversation

@Fusneica-FlorentinCristian

@Fusneica-FlorentinCristian Fusneica-FlorentinCristian commented Apr 23, 2026

Copy link
Copy Markdown
Collaborator

Add OOTB_D4R_SampleTests.cs to RevitIntegrationTests with:\n- ResolveSamplePath() that resolves .dyn files from the already-deployed samples\n at DynamoForRevit\samples\{locale}\Revit\ (probes current UI culture then en-US fallback)\n- Commented-out zip-based extraction (priorities 2/3) kept for future use\n- OpenAndRunSample() helper with post-run node error/warning assertion\n- Smoke tests for all 10 OOTB sample scripts\n- Test models: empty.rfa (Points, Curves), MassWithBoxAndCone.rfa (Solids, Surfaces),\n AdaptiveComponents.rfa (Adaptive Placement), SampleModel.rvt (Color, Floors,\n Import Solid, Place Families), StructuralFraming\StructuralFraming.rvt (Structural Framing)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Revit integration test fixture to validate that the OOTB D4R sample graphs can be located (including from a shipped ZIP) and executed as smoke tests.

Changes:

  • Introduces SetupUnzip to resolve OOTB D4R sample .dyn files via extracted folder, ZIP artifact, or installed samples fallback.
  • Adds 10 smoke tests that open and run each OOTB D4R sample graph (geometry + Revit-element graphs with appropriate test models).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/Libraries/RevitIntegrationTests/OOTB_D4R_SampleTests.cs
Comment thread test/Libraries/RevitIntegrationTests/OOTB_D4R_SampleTests.cs Outdated
Comment thread test/Libraries/RevitIntegrationTests/OOTB_D4R_SampleTests.cs Outdated
Comment thread test/Libraries/RevitIntegrationTests/OOTB_D4R_SampleTests.cs Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/Libraries/RevitIntegrationTests/OOTB_D4R_SampleTests.cs Outdated
Comment thread test/Libraries/RevitIntegrationTests/OOTB_D4R_SampleTests.cs Outdated
Comment thread test/Libraries/RevitIntegrationTests/OOTB_D4R_SampleTests.cs Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated 9 comments.

Comment thread test/Libraries/RevitIntegrationTests/OOTB_D4R_SampleTests.cs Outdated
Comment thread test/Libraries/RevitIntegrationTests/OOTB_D4R_SampleTests.cs Outdated
Comment thread test/Libraries/RevitIntegrationTests/OOTB_D4R_SampleTests.cs Outdated
Comment thread test/Libraries/RevitIntegrationTests/OOTB_D4R_SampleTests.cs Outdated
Comment thread test/Libraries/RevitIntegrationTests/OOTB_D4R_SampleTests.cs Outdated
Comment thread test/Libraries/RevitIntegrationTests/OOTB_D4R_SampleTests.cs Outdated
Comment thread test/Libraries/RevitIntegrationTests/OOTB_D4R_SampleTests.cs Outdated
Comment thread test/Libraries/RevitIntegrationTests/OOTB_D4R_SampleTests.cs Outdated
Comment thread test/Libraries/RevitIntegrationTests/OOTB_D4R_SampleTests.cs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated 2 comments.

Comment thread test/Libraries/RevitIntegrationTests/OOTB_D4R_SampleTests.cs Outdated
Comment thread test/Libraries/RevitIntegrationTests/OOTB_D4R_SampleTests.cs Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated 2 comments.

Comment thread test/Libraries/RevitIntegrationTests/OOTB_D4R_SampleTests.cs Outdated
Comment thread test/Libraries/RevitIntegrationTests/OOTB_D4R_SampleTests.cs Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

Comment thread test/Libraries/RevitIntegrationTests/OOTB_D4R_SampleTests.cs Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

Comment thread test/Libraries/RevitIntegrationTests/OOTB_D4R_SampleTests.cs Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated 3 comments.

Comment thread test/Libraries/RevitIntegrationTests/OOTB_D4R_SampleTests.cs Outdated
Comment thread test/Libraries/RevitIntegrationTests/OOTB_D4R_SampleTests.cs Outdated
Comment thread test/Libraries/RevitIntegrationTests/OOTB_D4R_SampleTests.cs Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated 2 comments.

Comment thread test/Libraries/RevitIntegrationTests/OOTB_D4R_SampleTests.cs Outdated
Comment thread test/Libraries/RevitIntegrationTests/OOTB_D4R_SampleTests.cs Outdated
@Fusneica-FlorentinCristian Fusneica-FlorentinCristian changed the title REVIT-238057: Add OOTB D4R sample tests with SetupUnzip REVIT-238057: Add OOTB D4R sample smoke tests May 6, 2026
@Fusneica-FlorentinCristian
Fusneica-FlorentinCristian force-pushed the fusneif/REVIT-238057/tests-for-OOTB-sample-scripts-D4R branch 2 times, most recently from c16e68c to 2d7bdff Compare July 28, 2026 13:35
}

[Test, Category("SmokeTests")]
[TestModel(@".\AdaptiveComponents.rfa")]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image This should be run on Snowdon Towers Sample Architectural.rvt, as specified in a note. The same is true for other test cases, the info note specifies in which model/family to run the sample.

RunCurrentModel();

var errorNodes = ViewModel.Model.CurrentWorkspace.Nodes
.Where(n => n.State == ElementState.Error).ToList();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert back to using warnings as well

Fusneica-FlorentinCristian pushed a commit that referenced this pull request Jul 29, 2026
…fo notes.

Address Mikhinja D4R #3388 review — fail on Error+Warning (revert dbcc30b),
point Snowdon-dependent tests at Samples/Snowdon Towers Sample Architectural.rvt,
Points at AdaptiveComponents.rfa; add Snowdon LFS test asset from Merrimack.

Co-authored-by: Cursor <cursoragent@cursor.com>
Fusneica-FlorentinCristian and others added 23 commits July 30, 2026 16:59
Add OOTB_D4R_SampleTests.cs to RevitIntegrationTests with:
- SetupUnzip() that resolves .dyn files from:
  1. Previously-extracted D4RSamples folder
  2. revit-d4r-content-samples-*-net10.zip in DynamoForRevit\samples
  3. Already-deployed DynamoForRevit\samples\en-US\Revit (fallback)
- Smoke tests for all 10 OOTB sample scripts
- Geometry tests (Points, Curves, Solids, Surfaces) use empty.rfa
- Revit-element tests use DynamoSample_2021.rvt
- Make SetupUnzip private (not needed outside the fixture)
- Add File.Exists checks on resolved paths before returning
- Throw on multiple matching zip files (ambiguous source)
- Extract OpenAndRunSample helper to reduce duplication in 10 tests
- Use FileNotFoundException for missing scripts (more specific)
Fixes CS0122 build error where InvalidOperationException was
inaccessible without explicit System namespace import.
… temp

- Rename class to OOTB_D4R_SampleTests (matches filename)
- Reorder SetupUnzip priorities: installed samples first
- Extract zip to %TEMP%\D4RSamples instead of install dir
- Use overwriteFiles:true for re-extraction robustness
- Add post-run assertion: fail if any node is in Error/Warning state
- Replace Snowdon Towers (not in repo) with SampleModel.rvt, empty.rfa,
  AdaptiveComponents.rfa, StructuralFraming.rvt as appropriate
- Replace ConceptualMass.rfa (not in repo) with MassWithBoxAndCone.rfa
- All referenced models now exist under test/System/
- Derive cache folder from zip filename (invalidates on version change)
- Extract to staging dir, move atomically into place
- Clean up staging on failure for self-healing retry
- Simplify to 2 priorities: installed samples, then zip cache
Scan existing %TEMP%\D4RSamples\ subdirectories (most recent first) as
priority 3, so a previously extracted cache remains usable even after the
source zip is removed.
Only the installed samples path is active (priority 1). Zip-based
extraction (priorities 2/3) is preserved as commented code in a
#region block for potential future enablement.
…stics

- Rename method since zip code is commented out (clearer intent)
- Probe CurrentUICulture locale first, then fall back to en-US
- Sort directory listing in diagnostic exceptions for determinism
- Remove extra trailing semicolon after throw statement
- Add comment explaining why we use assembly-relative path instead of
  base class SamplesPath (D4R OOTB samples vs doc/distrib/Samples)
- Assert CurrentWorkspace.Nodes.Any() after OpenCommand to catch load failures
- Add comment explaining GetExecutingAssembly() is the standard test pattern
  used throughout RevitSystemTestBase/SystemTest/CoreTests/RegressionTests
- Use NodeInfos to surface actual error/warning messages per node
- Include node type name for easier identification
- Report connector GUID and Start/End port details for broken connectors
Co-authored-by: Cursor <cursoragent@cursor.com>
Use empty.rfa for Surfaces and assert no error/warning nodes after RunCurrentModel.
Align with farm-available QATestData model; matches legacy Sample/Geometry_Solids regression.
Align TestModel paths with legacy Sample regression model used by CrsTest journals after Newport failures on SampleModel_2023.rvt.
Avoid RTF testName collisions with legacy SampleTests and align smoke checks with legacy behavior by ignoring Warning-state nodes after RunCurrentModel.
Co-authored-by: Cursor <cursoragent@cursor.com>
…fo notes.

Address Mikhinja D4R #3388 review — fail on Error+Warning (revert dbcc30b),
point Snowdon-dependent tests at Samples/Snowdon Towers Sample Architectural.rvt,
Points at AdaptiveComponents.rfa; add Snowdon LFS test asset from Merrimack.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Fusneica-FlorentinCristian
Fusneica-FlorentinCristian force-pushed the fusneif/REVIT-238057/tests-for-OOTB-sample-scripts-D4R branch from 4663ac3 to 773f288 Compare July 30, 2026 14:02
…aram.

Adaptive test uses DynamoSample_2021.rvt to match graph bindings; Snowdon TestModel paths align to journal cwd. Import Solid SetParameterByName uses Level instead of Work Plane (missing on ImportInstance in R28).

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants