Running automated QA tests against your web service every time you deploy to Heroku is the best way to complete your continuous integration pipeline. Using Heroku Review Apps along with our GitHub deployment integration makes this trivial using Assertible.
In this post I will demonstrate how to setup an automated continuous integration and continuous testing QA pipeline for a web app using Heroku and GitHub. This app will be setup to deploy all branches to a unique environment and runs automated API tests against the web app.
- Deploy every single pull request to a unique Heroku app (using Heroku Review Apps).
- Automatically run API tests against the web service immediately after a deployment.
1. Connect Heroku and GitHub
In the Heroku dashboard, navigate to the app you would like to test and click the Deploy tab.
In the Deployment method section, select GitHub. Next, in the Connect to GitHub section, select a repository (you may need to click Search, see the image below).
Once Heroku recognizes your repo, click Connect. This should enable new options titled Automatic Deploys & Manual Deploys. The heroku dashboard should indicate that GitHub is now connected. For more information about setting up Heroku w/ GitHub, check out the Heroku documentation.
2. Connect Assertible w/ GitHub
In order to automatically run API tests to validate your web service functionality after a deployment you should use Assertible. The first step is to connect Assertible with GitHub. If you don't have an account, click the link below:
Once your Assertible account is ready, create your first API test by entering the URL of a web service or importing a Swagger spec. Once you have created a test, navigate to the Deployments tab. Click the Add to GitHub button found on the GitHub integration and select a repository.
NOTE! If you aren't using GitHub, there are several
ways to automate API tests after you deploy your web service. See our
deployments API docs for more
3. Create a pull request
At this point, Assertible is completely configured to receive deployment events from GitHub when your app is deployed. To initiate a deployment to Heroku, you can push a new pull request (you can also initiate a manual deployment from the Heroku dashboard).
As you're app is deployed, Assertible will update your pull requests with your web service's test status. If your API tests fail, Assertible will mark the status check on the PR as failing.
Continue the discussion
Resources and documentation
- Heroku has a seamless GitHub deployment integration
- GitHub repo with examples
- GitHub deployments integration docs
:: Christopher Reichert
The easiest way to test and
monitor your web services
Reduce bugs in web applications by using Assertible to create an automated QA pipeline that helps you catch failures & ship code faster.Get started with GitHubSign up for free
Assertible joins the OpenAPI initiative 05/09/2018