test: add integration tests for OSRS and RS3 wiki searches and page fetches #2

Merged
sam merged 3 commits from claude/issue-1-write-unit-tests into main 2026-03-05 20:09:38 -06:00
Collaborator

Summary

  • Adds scripts/rsw/internal/wiki/integration_test.go with integration tests hitting the live OSRS and RS3 wiki APIs
  • Tests cover search results, page wikitext content, section listing, and specific section fetching for both games
  • Tests are resilient to formatting changes — all assertions use keyword/substring matching, not exact string equality

Test coverage

Search tests (OSRS & RS3):

  • Dragon scimitar, Abyssal whip, Monkey Madness (OSRS)
  • Dragon bones, Plague's End, Blue partyhat, Prayer training (RS3)
  • Mining training search results
  • Snippet keyword presence

Page content tests:

  • Key info keywords present in wikitext (e.g. "slayer" for Abyssal whip, "prayer" for Dragon bones)
  • Quest pages contain "quest", relevant thematic keywords, and "requirements"

Section tests:

  • Pages have non-empty section lists
  • Section names contain expected keywords
  • Specific sections fetchable by index (using GetPageSection)
  • Bones/altars section in Prayer training (RS3), Slayer masters section (RS3)
  • Mining training first section contains mining/xp keywords

Unit tests (no network):

  • FindSectionIndex found, not found, and empty slice cases

Closes #1

## Summary - Adds `scripts/rsw/internal/wiki/integration_test.go` with integration tests hitting the live OSRS and RS3 wiki APIs - Tests cover search results, page wikitext content, section listing, and specific section fetching for both games - Tests are resilient to formatting changes — all assertions use keyword/substring matching, not exact string equality ## Test coverage **Search tests (OSRS & RS3):** - Dragon scimitar, Abyssal whip, Monkey Madness (OSRS) - Dragon bones, Plague's End, Blue partyhat, Prayer training (RS3) - Mining training search results - Snippet keyword presence **Page content tests:** - Key info keywords present in wikitext (e.g. "slayer" for Abyssal whip, "prayer" for Dragon bones) - Quest pages contain "quest", relevant thematic keywords, and "requirements" **Section tests:** - Pages have non-empty section lists - Section names contain expected keywords - Specific sections fetchable by index (using `GetPageSection`) - Bones/altars section in Prayer training (RS3), Slayer masters section (RS3) - Mining training first section contains mining/xp keywords **Unit tests (no network):** - `FindSectionIndex` found, not found, and empty slice cases Closes #1
claude added 1 commit 2026-03-05 19:37:39 -06:00
Owner

@claude Add a gitea CI action that automatically runs these tests. It should run on pull requests. It should not run on pushes to main.

@claude Add a gitea CI action that automatically runs these tests. It should run on pull requests. It should not run on pushes to main.
Author
Collaborator

Claude finished @sam's task —— View job


Tasks

  • Gather context and understand request
  • Check existing CI workflows
  • Create Gitea CI workflow for integration tests
  • Commit and push changes

Created .gitea/workflows/test.yml which:

  • Triggers on pull_request events only (not on pushes to main)
  • Sets up Go using the go.mod in scripts/rsw/
  • Runs go test ./internal/wiki/... from the scripts/rsw working directory
**Claude finished @sam's task** —— [View job](http://100.100.131.50:3000/sam/claude-plugin-runescape/actions/runs/7) --- ### Tasks - [x] Gather context and understand request - [x] Check existing CI workflows - [x] Create Gitea CI workflow for integration tests - [x] Commit and push changes Created `.gitea/workflows/test.yml` which: - Triggers on `pull_request` events only (not on pushes to main) - Sets up Go using the `go.mod` in `scripts/rsw/` - Runs `go test ./internal/wiki/...` from the `scripts/rsw` working directory
gitea-actionsbot added 1 commit 2026-03-05 19:54:30 -06:00
sam added 1 commit 2026-03-05 20:07:21 -06:00
Bugfix
All checks were successful
Integration Tests / test (pull_request) Successful in 53s
efc227ac90
sam merged commit efc227ac90 into main 2026-03-05 20:09:38 -06:00
sam deleted branch claude/issue-1-write-unit-tests 2026-03-05 20:09:39 -06:00
Sign in to join this conversation.
No Reviewers
No Label
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/claude-plugin-runescape#2