Dispatch integration tests when deploying to heroku test env - #971
Merged
Conversation
zetter-rpf
marked this pull request as ready for review
August 18, 2026 13:44
Test coverage93.34% line coverage reported by SimpleCov. |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new integration_tests:dispatch rake task to trigger the external “learner experience” integration test workflow during Heroku’s release phase, so tests can run against the freshly deployed test environment.
Changes:
- Introduces
integration_tests:dispatchrake task that calls GitHub’s repository dispatch API with deploy metadata. - Wires the task into the Heroku
releaseprocess viaProcfile. - Adds RSpec coverage for dispatch/skipping/error-reporting behavior and documents the new env var in
.env.example.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
lib/tasks/integration_tests.rake |
New rake task that conditionally dispatches the external GitHub Actions workflow and reports failures to Sentry. |
Procfile |
Runs integration_tests:dispatch during Heroku release (after migrations and existing seed task). |
spec/lib/tasks/integration_tests_spec.rb |
Adds task specs covering dispatch payload/header, skip behavior, and error reporting. |
.env.example |
Documents LEARNER_EXPERIENCE_TESTS_DISPATCH_TOKEN for local/dev configuration. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
zetter-rpf
marked this pull request as draft
August 18, 2026 13:51
Triggers the learner-experience-integration-tests GitHub Actions workflow via repository_dispatch after a deploy to the editor-api-test Heroku app, so end-to-end tests run automatically against the test environment. Errors are reported to Sentry rather than failing the deploy step. Using the release step isn't perfect as the app won't have switched over until after it completes, but since this is the last release step and the integration tests take a while to start I think this is safe. It's not easy to get the git commit message in heroku so I'm linking to the commit on github instead Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
zetter-rpf
force-pushed
the
test-dispatch
branch
from
August 18, 2026 13:56
94826ee to
c6e1472
Compare
In CI the app is fully loaded already including tasks. This might cause the tasks to be loaded (and run) twice. This line still needs to be here for running tests locally.
raspberrypiherokubot
temporarily deployed
to
editor-api-p-test-dispa-byf3aq
August 18, 2026 14:19
Inactive
zetter-rpf
marked this pull request as ready for review
August 18, 2026 14:21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Status
What's changed?
Trigger the learner experience tests while app is deploying to the test environment.
See commit for more
Testing
I have tested this locally by setting the relevant environment variables, can see the test here:
https://github.com/RaspberryPiFoundation/learner-experience-integration-tests/actions/runs/32142867344/job/95729480208
Steps to perform before deploying to production
Set new
LEARNER_EXPERIENCE_TESTS_DISPATCH_TOKENenv var in editor API - https://github.com/RaspberryPiFoundation/terraform/pull/1458