8000 test(harness): reduce setup duplication in test suite by mwoods79 · Pull Request #110 · huddlz-hq/huddlz · GitHub
[go: up one dir, main page]

Skip to content

test(harness): reduce setup duplication in test suite - #110

Merged
mwoods79 merged 2 commits into
mainfrom
test/reduce-harness-duplication
Apr 20, 2026
Merged

mwoods79 merged 2 commits into
mainfrom
test/reduce-harness-duplication

Conversation

@mwoods79
@mwoods79 mwoods79 commented Apr 20, 2026 •
Copy link
Copy Markdown
Contributor

Summary

  • Added generate_group_with_members/2 to collapse the owner→group→members triple into one call (biggest win: group_live_permissions_test.exs, -59 lines).
  • Added Huddlz.Test.MoxHelpers (stub_places_autocomplete, stub_place_details, stub_geocode, plus error variants) with canonical Places fixtures, adopted in 6 test files.
  • Dropped all 7 Process.sleep calls from the test suite:
    • 3 in image tests — verified via tidewave that inserted_at is microsecond-precise and rapid inserts are reliably ≥385µs apart.
    • 4 in feature step defs (password reset, huddl creation) — the underlying flows are synchronous (Swoosh Mailer.deliver!, no Oban/Task, Ash async disabled in test).

Net: -168 LOC across 18 files. All 616 tests pass; 5 consecutive seeded runs clean.

Test plan

  • `mix precommit` (compile --warnings-as-errors, format, full test, credo strict)
  • `mix test` with seeds 1, 42, 777, 999999 (flakiness check)
  • `grep Process.sleep test/` returns zero hits
  • Reviewer: sanity-check the `MoxHelpers` API shape before broader adoption

- generate_group_with_members/2 collapses owner→group→members setup
- Huddlz.Test.MoxHelpers centralizes Places/Geocoding stub shapes
- drop Process.sleep(10) in image tests; inserted_at is microsecond-precise
- password reset send is synchronous (Swoosh Mailer.deliver!)
- huddl create is synchronous (no Task/Oban, Ash async disabled in test)
@mwoods79
mwoods79 merged commit 0132e99 into main Apr 20, 2026
1 check passed
@mwoods79
mwoods79 deleted the test/reduce-harness-duplication branch April 20, 2026 02:35
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.

1 participant

0