Skip to content

Automated test suite covering existing functionality - #48

Merged
flashgnash merged 1 commit into
masterfrom
AI/OW3N-77-automated-test-suite-covering-existing-f
Sep 29, 2026
Merged

flashgnash merged 1 commit into
masterfrom
AI/OW3N-77-automated-test-suite-covering-existing-f

Conversation

@flashgnash

Copy link
Copy Markdown
Owner

Automated pull request for ticket ow3n-77 (branch AI/OW3N-77-automated-test-suite-covering-existing-f).

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).
@flashgnash
flashgnash merged commit 0166395 into master Sep 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant