Skip to content

Add WordRepository integration tests with embedded MongoDB#4196

Closed
Copilot wants to merge 7 commits intomt2from
copilot/sub-pr-4194-again
Closed

Add WordRepository integration tests with embedded MongoDB#4196
Copilot wants to merge 7 commits intomt2from
copilot/sub-pr-4194-again

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 9, 2026

  • Add EphemeralMongo7 runtime packages
  • Create MongoDbTestRunner.cs
  • Create WordRepositoryTests.cs (48 integration tests)
  • Add [Category("IntegrationTest")] and test:integration / test:unit scripts
  • Update WordRepositoryTests.cs to match updated WordRepository:
    • Renamed RepoCreate → Create
    • Renamed RepoUpdateFrontier → UpdateFrontier
    • Renamed RepoReplaceFrontier → ReplaceFrontier
    • Renamed RepoRevertReplaceFrontier → RevertReplaceFrontier (returns bool)
    • Renamed RepoDeleteFrontier → DeleteFrontier
    • Renamed RepoRestoreFrontier → RestoreFrontier (single string arg, returns bool)
    • Reordered test sections to match WordRepository method order
    • Fixed assertions for changed return types

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.


This change is Reviewable

Copilot AI changed the title [WIP] Implement Mongo transactions for improved data handling Add WordRepository integration tests with embedded MongoDB Mar 9, 2026
@github-actions github-actions bot added backend test dependencies Pull requests that update a dependency file github_actions Pull requests that update GitHub Actions code labels Mar 9, 2026
@imnasnainaec
Copy link
Copy Markdown
Collaborator

@copilot Add an "IntegrationTest" category for all these new tests. Add test:integration and test:unit scripts in package.json to test all in and out of that catagory.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 9, 2026

@copilot Add an "IntegrationTest" category for all these new tests. Add test:integration and test:unit scripts in package.json to test all in and out of that catagory.

Done in commit 043333f.

  • [Category("IntegrationTest")] added to the WordRepositoryTests class (applies to all 48 tests)
  • test:integration runs dotnet test --filter "TestCategory=IntegrationTest" (48 tests)
  • test:unit runs dotnet test --filter "TestCategory!=IntegrationTest" (all 1101 non-integration backend tests)

@imnasnainaec imnasnainaec force-pushed the copilot/sub-pr-4194-again branch from 043333f to 72bf3df Compare March 9, 2026 21:11
@imnasnainaec
Copy link
Copy Markdown
Collaborator

@copilot I've rebased this on an updated mt2 branch. Update the tests to match the new WordRepository, including the order of the methods.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 9, 2026

@copilot I've rebased this on an updated mt2 branch. Update the tests to match the new WordRepository, including the order of the methods.

Done in commit 9adeb0f. Updated the tests to match the new WordRepository:

  • RepoCreateCreate
  • RepoUpdateFrontierUpdateFrontier
  • RepoReplaceFrontierReplaceFrontier
  • RepoRevertReplaceFrontierRevertReplaceFrontier (now returns bool; fixed assertions and renamed EmptyListsReturnsEmptyEmptyListsReturnsTrue)
  • RepoDeleteFrontierDeleteFrontier
  • RepoRestoreFrontierRestoreFrontier (now takes a single string and returns bool; replaced the empty-list test with TestRestoreFrontierNotFoundReturnsFalse)
  • Test sections reordered to match WordRepository method order

Copilot AI and others added 5 commits March 11, 2026 16:03
Co-authored-by: imnasnainaec <6411521+imnasnainaec@users.noreply.github.com>
Co-authored-by: imnasnainaec <6411521+imnasnainaec@users.noreply.github.com>
Co-authored-by: imnasnainaec <6411521+imnasnainaec@users.noreply.github.com>
Co-authored-by: imnasnainaec <6411521+imnasnainaec@users.noreply.github.com>
@imnasnainaec imnasnainaec force-pushed the copilot/sub-pr-4194-again branch from 9adeb0f to 375eed5 Compare March 11, 2026 20:04
@imnasnainaec
Copy link
Copy Markdown
Collaborator

@copilot I've rebased this on an updated mt2 branch. Update the tests to match the new WordRepository.

Co-authored-by: imnasnainaec <6411521+imnasnainaec@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 11, 2026

@copilot I've rebased this on an updated mt2 branch. Update the tests to match the new WordRepository.

Done in commit a27113e. The rebase added an explicit ArgumentException check in RestoreFrontierWithSession when the word's ID is already in the Frontier (previously MongoDB would throw a MongoWriteException on the duplicate key violation). Added TestRestoreFrontierAlreadyInFrontierThrows to cover this new behavior.

@imnasnainaec imnasnainaec marked this pull request as ready for review March 13, 2026 19:25
@imnasnainaec imnasnainaec marked this pull request as draft March 13, 2026 19:25
@imnasnainaec
Copy link
Copy Markdown
Collaborator

Subsumed in #4198

@imnasnainaec imnasnainaec deleted the copilot/sub-pr-4194-again branch March 19, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend dependencies Pull requests that update a dependency file github_actions Pull requests that update GitHub Actions code test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants