Skip to content

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

Open
Fusneica-FlorentinCristian wants to merge 17 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 17 commits into
masterfrom
fusneif/REVIT-238057/tests-for-OOTB-sample-scripts-D4R

Conversation

@Fusneica-FlorentinCristian
Copy link
Copy Markdown
Collaborator

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

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)

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
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 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
- 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.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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
… 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
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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
- 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/
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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
- 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
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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
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.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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
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.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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
Comment thread test/Libraries/RevitIntegrationTests/OOTB_D4R_SampleTests.cs
Comment thread test/Libraries/RevitIntegrationTests/OOTB_D4R_SampleTests.cs
…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
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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
Comment thread test/Libraries/RevitIntegrationTests/OOTB_D4R_SampleTests.cs Outdated
- 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)
@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
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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
Comment thread test/Libraries/RevitIntegrationTests/OOTB_D4R_SampleTests.cs
- 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
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 no new comments.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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
- 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
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 no new comments.

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.

2 participants