Skip to content

one_d4: add reanalysis unit/e2e tests and pin detector game position tests#1078

Merged
aaylward merged 1 commit intomainfrom
reanalyze_test
Feb 28, 2026
Merged

one_d4: add reanalysis unit/e2e tests and pin detector game position tests#1078
aaylward merged 1 commit intomainfrom
reanalyze_test

Conversation

@aaylward
Copy link
Copy Markdown
Collaborator

Summary

  • AdminControllerTest (new): 9 unit tests covering the POST /admin/reanalyze batching loop — null/blank PGN counted as failed, exceptions on individual games don't abort others, store methods (updateMotifs, deleteOccurrencesByGameUrl, insertOccurrences) called in the right order
  • GameFeatureDaoTest (11 new): fetchForReanalysis pagination/ordering + updateMotifs including the three derived columns (has_discovered_attack, has_checkmate, has_discovered_mate) derived from ATTACK occurrences' isDiscovered/isMate flags
  • ReanalysisE2ETest (new): 6 full-pipeline E2E tests — idempotency, stale-occurrence replacement, no-detector teardown (columns cleared), multi-game batch
  • PinDetectorTest (3 new): King's Gambit move-4 FEN (4.Bb5) with exact attacker/target assertions; regression guard confirming exactly one pin detected in that position (no false positives)
  • BUILD: AdminControllerTest added to api_validation_tests (+ :engine dep); ReanalysisE2ETest added to e2e_tests (+ :model dep)

Test plan

  • bazel test //domains/games/apis/one_d4:api_validation_tests — 29 pass
  • bazel test //domains/games/apis/one_d4:db_tests — pass
  • bazel test //domains/games/apis/one_d4:motifs_tests — pass
  • bazel test //domains/games/apis/one_d4:e2e_tests — pass

…tests

- AdminControllerTest: 9 unit tests covering batch processing, null/blank
  PGN handling, exception isolation, and store method call verification
- GameFeatureDaoTest: 11 new tests for fetchForReanalysis (pagination,
  ordering) and updateMotifs (direct flags + derived has_discovered_attack,
  has_checkmate, has_discovered_mate from ATTACK occurrences)
- ReanalysisE2ETest: 6 E2E tests — idempotency, occurrence replacement
  (stale occurrence removed after reanalyze), no-detector teardown,
  multi-game batch
- PinDetectorTest: 3 King's Gambit move-4 FEN tests verifying Bb5→nc6
  absolute pin fields and confirming no false-positive extra pins
- BUILD: add AdminControllerTest to api_validation_tests (+:engine dep),
  add ReanalysisE2ETest to e2e_tests (+:model dep)
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
1d4-web 855f9c8 Commit Preview URL

Branch Preview URL
Feb 28 2026, 06:14 PM

@aaylward aaylward enabled auto-merge (squash) February 28, 2026 18:15
@aaylward aaylward merged commit ebe5849 into main Feb 28, 2026
12 checks passed
@aaylward aaylward deleted the reanalyze_test branch February 28, 2026 18:20
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