Skip to content

Conversation

@google-labs-jules
Copy link
Contributor

Implemented mocking for GetPassageHTML to avoid external scraping in unit tests and updated api_client_test.go to support conditional real API integration tests based on environment variables. This reduces unnecessary external API calls while maintaining the ability to verify against the real system when configured.


PR created automatically by Jules for task 17903795904113914198 started by @julwrites

Streamlined test execution by:
- Mocking `GetPassageHTML` in `pkg/app/passage_test.go` and `pkg/app/devo_test.go` to prevent external network calls to BibleGateway during unit tests.
- Updating `pkg/app/api_client_test.go` to conditionally run integration tests against the real Bible AI API only if `BIBLE_API_URL` is explicitly set and not equal to "https://example.com". Otherwise, it defaults to a safe mock environment.
- Adding a `Fallback: Scrape` test case in `passage_test.go` to verify the fallback logic without triggering actual network requests.

These changes ensure that standard "MR tests" are fast and isolated, while still allowing a "comprehensive eval" against the real API via environment configuration.
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

New to Jules? Learn more at jules.google/docs.

@julwrites julwrites marked this pull request as ready for review December 13, 2025 13:39
- Created `docs/TESTING.md` to outline the hybrid testing strategy (standard mocks vs. conditional live integration).
- Refactored `pkg/app/passage_test.go` and `pkg/app/devo_test.go` to mock `GetPassageHTML`, preventing external scraping during unit tests.
- Updated `pkg/app/api_client_test.go` to support conditional live API testing when `BIBLE_API_URL` is configured.
- Cleaned up test logic to ensure proper isolation of global variable mocks.
@julwrites julwrites merged commit 900eead into staging Dec 14, 2025
1 check passed
@julwrites julwrites deleted the test-api-mocking-17903795904113914198 branch December 14, 2025 01: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.

2 participants