Repository navigation
Automated test suite covering existing functionality - #48
Merged
flashgnash merged 1 commit intoSep 29, 2026
Merged
Conversation
Add an xUnit test project (OW3N.Tests/) with 114 tests covering unit and integration levels: - Unit: BuffFormula (parse/evaluate/stacked effects), BuffConverter and StatListConverter JSON (current + legacy formats), JSON-backed model properties, saved-roll parsing, character validation, DiscordService webhook payloads, Gauge lookup and LiveUpdateService events. - Integration (in-memory SQLite): CampaignService (DM authorisation, player/NPC/preset management, preset-based character creation), BuffService (libraries, export/import/pull, applying buffs) and PlayerCharacterService (character/gauge/roll persistence and the stubbed external roll-service call). Wire into a runnable command: 'nix run .#test' (new flake app) and a GitHub Actions 'test' job that runs on PRs and gates the build/publish job on master. The main project gains a SkipWebAssets flag to skip the npm/sass web-asset build for hermetic test runs, and excludes OW3N.Tests/ from its own globbing. Document the SQLite-vs-PostgreSQL choice explicitly (OW3N.Tests/README.md and the SqliteContextFactory doc comment): in-memory SQLite is used for isolation, hermetic zero-setup CI and speed, exercising the same EF Core code paths, with the fidelity gaps (notably EF.Functions.ILike being PostgreSQL-only) called out and a path to an opt-in PostgreSQL-backed run for behaviour that needs it. Two suspect behaviours are characterised (pinned) rather than changed and flagged with NOTE comments: GetLatestRollAsync returns the earliest roll, and SearchTemplatesAsync name filtering is PostgreSQL-only (ILike).
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Automated pull request for ticket
ow3n-77(branchAI/OW3N-77-automated-test-suite-covering-existing-f).