Skip to content

Reuse integration test project data in RootSite tests#891

Merged
johnml1135 merged 3 commits into
mainfrom
no_more_dummy_projects
May 22, 2026
Merged

Reuse integration test project data in RootSite tests#891
johnml1135 merged 3 commits into
mainfrom
no_more_dummy_projects

Conversation

@johnml1135
Copy link
Copy Markdown
Contributor

@johnml1135 johnml1135 commented May 18, 2026

Summary

  • reuse a fixed integration_test_data project name in RealDataTestsBase instead of generating a new RealDataTest_<guid> project for each run
  • delete the actual created project directory before setup and after teardown so repeated test runs do not accumulate dummy projects
  • keep the change scoped to the RootSite real-data test base used by the render verification/timing fixtures

Validation

  • ./test.ps1 -TestProject RootSiteTests -TestFilter "FullyQualifiedName~RenderVerifyTests" -NoBuild
  • CI: Whitespace check
  • CI: Commit messages

This change is Reviewable

Copilot AI review requested due to automatic review settings May 18, 2026 21:50
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

Note

Copilot was unable to run its full agentic suite in this review.

Reworks RootSite real-data test setup/teardown to reuse a fixed integration test project name and clean up the created project directory between runs, avoiding accumulation of dummy projects.

Changes:

  • Use a constant project name (integration_test_data) instead of a per-run GUID project name.
  • Delete the project directory before setup and after teardown.
  • Track the created project directory from CreateNewLangProj and reuse it for cleanup.

Comment thread Src/Common/RootSite/RootSiteTests/RealDataTestsBase.cs
Comment thread Src/Common/RootSite/RootSiteTests/RealDataTestsBase.cs Outdated
Comment thread Src/Common/RootSite/RootSiteTests/RealDataTestsBase.cs
Comment thread Src/Common/RootSite/RootSiteTests/RealDataTestsBase.cs Outdated
Comment thread Src/Common/RootSite/RootSiteTests/RealDataTestsBase.cs Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 18, 2026

NUnit Tests

    1 files  ±0      1 suites  ±0   11m 34s ⏱️ + 1m 1s
4 204 tests  - 1  4 133 ✅  - 1  71 💤 ±0  0 ❌ ±0 
4 213 runs   - 1  4 142 ✅  - 1  71 💤 ±0  0 ❌ ±0 

Results for commit 9dab396. ± Comparison against base commit 5ce891b.

This pull request removes 2 and adds 1 tests. Note that renamed tests count towards both.
SIL.FieldWorks.Language.ManagedVwWindowTests ‑ NotSettingWindowTest
SIL.FieldWorks.Language.ManagedVwWindowTests ‑ SimpleWindowTest
SIL.FieldWorks.Common.RootSites.RootSiteTests.RealDataTestsBaseCleanupTests ‑ RunSetupFailureCleanup_ReleasesMutexEvenWhenDisposeFails

♻️ This comment has been updated with latest results.

@johnml1135 johnml1135 force-pushed the no_more_dummy_projects branch from c547de1 to 9348219 Compare May 19, 2026 00:20
@jasonleenaylor
Copy link
Copy Markdown
Contributor

Src/Common/RootSite/RootSiteTests/RealDataTestsBase.cs line 246 at r2 (raw file):

			}

			Exception lastException = null;

Look at SIL.IO.RobustIO.DeleteDirectoryAndContents to replace most of this methd.

@jasonleenaylor
Copy link
Copy Markdown
Contributor

Src/Common/RootSite/RootSiteTests/RealDataTestsBase.cs line 107 at r2 (raw file):

				DisposeCache();
				TryDeleteProjectDirectoryAfterSetupFailure();
				ReleaseProjectMutex();

There is an unlikely but potentially problematic situation where either DisposeCache or the TryDeleteProjectDirectoryAfterSetupFailure throw, which would not release the Mutex. Might want to guard against that.

@johnml1135 johnml1135 force-pushed the no_more_dummy_projects branch from 9348219 to f5fed92 Compare May 22, 2026 11:27
@johnml1135
Copy link
Copy Markdown
Contributor Author

Addressed Jason's two review points in the local follow-up.

  • Setup failure cleanup now routes through RunSetupFailureCleanup so mutex release is guaranteed even if earlier cleanup steps fail unexpectedly. The setup-failure path also uses TryDisposeCacheAfterSetupFailure so a cache-disposal problem does not strand the mutex or mask the original setup exception.
  • Directory cleanup keeps the existing sentinel and exact-path safety checks, but now reuses SIL.IO.RobustIO.DeleteDirectoryAndContents instead of the custom recursive delete loop.

Local validation:

  • ./test.ps1 -TestProject RootSiteTests -TestFilter "FullyQualifiedName~RealDataTestsBaseCleanupTests"
  • ./test.ps1 -NoBuild -TestProject RootSiteTests -TestFilter "FullyQualifiedName~RenderVerifyTests"

Relevant local anchors:

  • Src/Common/RootSite/RootSiteTests/RealDataTestsBase.cs lines 104, 183, 219, 308
  • Src/Common/RootSite/RootSiteTests/RealDataTestsBaseCleanupTests.cs line 11

@johnml1135
Copy link
Copy Markdown
Contributor Author

Src/Common/RootSite/RootSiteTests/RealDataTestsBase.cs line 107 at r2 (raw file):

Previously, jasonleenaylor (Jason Naylor) wrote…

There is an unlikely but potentially problematic situation where either DisposeCache or the TryDeleteProjectDirectoryAfterSetupFailure throw, which would not release the Mutex. Might want to guard against that.

fixed

@johnml1135
Copy link
Copy Markdown
Contributor Author

Src/Common/RootSite/RootSiteTests/RealDataTestsBase.cs line 246 at r2 (raw file):

Previously, jasonleenaylor (Jason Naylor) wrote…

Look at SIL.IO.RobustIO.DeleteDirectoryAndContents to replace most of this methd.

Changed out - I also added a skill to guide the AI to use SIL's models.

Copy link
Copy Markdown
Contributor

@jasonleenaylor jasonleenaylor left a comment

Choose a reason for hiding this comment

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

:lgtm:

@jasonleenaylor reviewed 3 files and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on johnml1135).

@johnml1135 johnml1135 merged commit 25e5bf0 into main May 22, 2026
7 checks passed
@johnml1135 johnml1135 deleted the no_more_dummy_projects branch May 22, 2026 23:26
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