Building Intelligent Pipelines with mabl and GitHub Actions 2.0
Building Intelligent Pipelines with mabl and GitHub Actions 2.0 Dan Belcher August 8, 2019
Building Intelligent Pipelines with mabl and GitHub Actions 2.0
Building Intelligent Pipelines with mabl and GitHub Actions 2.0
At mabl, we experience long envisioned a world where it was easy to configure and operate healthy CI/CD pipelines. In that world, new code changes are mechanically screen and assessed for their character and risk. If the risk is too high or the quality is too low, the change are automatically held back until the team takes appropriate activeness -- by fixing glitch, adding test reporting, critique change more thoroughly, or differently. If the risk is low and the quality is eminent, the changes are moved along in the grapevine quickly and efficiently. & nbsp;
In order to achieve that sight, we recognized that examination creature would need to become moreintelligent.For the past two geezerhood,mablhas focused on building the most intelligent end-to-end testing service on the planet. Today, citizenry can use mabl to make tests in minutes, run them on all major browser, and receive insights about their application quality, including functional correctness, visual presentation, performance, and more. & nbsp;
To achieve the vision of intelligent CI/CD, we also recognize that pipelines would need to become moreintegrated. Today, GitHub establish Actions 2.0, which we consider will function as a leading program for smarter, more incorporate CI/CD workflows. We start on the opportunity to integrate with Actions 2.0 and GitHub more generally. In this post, we 'll show you how those integrations work.
Overview of the
GitHub / mabl workflow
At the highest level, the workflow starts with you making code changes within a given GitHub repo, building them, and deploying them to an environment utilise Actions 2.0. & nbsp; At that point, a second Action triggers end-to-end test within mabl. If mabl discovers job during the test runs, it create corresponding GitHub issues within the relevant repo.
The challenge
Our challenge was to automate the most common activeness related to testing in a CI/CD pipeline; kicking off automated tests and track issues. We wanted to deliver those capabilities in a manner that was easy to configure for new exploiter but was besides elastic enough to support the needs of ability users.
Testing new deployment
In order to automatically kick off tests of new deployments, we created a JavaScript Action using Actions 2.0 that would callwhen new deployments occur. In addition to specifying the application and environment for the tryout, the Action can too specify which browsers should be used for the test, whether the current build should be considered the “ baseline ” for visual analysis, and more.
& nbsp; on: [deploy]
& nbsp; name: mabl
& nbsp; jobs:
& nbsp; & nbsp; test:
& nbsp; & nbsp; & nbsp; name: mabl Test
& nbsp; & nbsp; & nbsp; runs-on: ubuntu-latest
& nbsp; & nbsp; & nbsp; step:
& nbsp; & nbsp; & nbsp; & nbsp; - uses: actions/checkout @ superior
& nbsp; & nbsp; & nbsp; & nbsp; - gens: Run mabl tests against deployment
& nbsp; & nbsp; & nbsp; & nbsp; & nbsp; id: mabl-test-deployment
& nbsp; & nbsp; & nbsp; & nbsp; & nbsp; uses: mablhq/github-run-tests-action @ v1.1
& nbsp; & nbsp; & nbsp; & nbsp; & nbsp; env:
& nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; MABL_API_KEY: $
& nbsp; & nbsp; & nbsp; & nbsp; & nbsp; with:
& nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; application-id: l-j3VqIO6lLLOOEoFTPSxA-a
& nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; browser-types: [‘ firefox ’, ‘ chrome ’]
& nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; rebaseline-images: true
& nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; environment-id: rtb4kWD5LuTr2KxaHvwfaA-e
When mabl receives a deployment event, it automatically triggers the relevant tests based on the parameters that are specified in the Action. The Action then polls mabl to get the status of each of the triggered tryout until they are all complete. At that point, the Action completes.
By default, if any of the triggered tests miscarry, the Action returns a failure and stops the pipeline. & nbsp; Alternatively, you can configure the action to proceed on failure append the following:
& nbsp; continue-on-error: true
Part of the powerfulness of this model is its flexibility. The mabl activity uses the outputs lineament of Actions 2.0 to output a number of statistics about your test results. You can use these statistic to curb which subsequent activeness are action. For exemplar, preferably than miscarry the workflow ifanytest fails, you can tailor-make the action to exclusively fail if more than five exam miscarry by appending the following:
& nbsp; & nbsp; & nbsp; & nbsp;
& nbsp; & nbsp; & nbsp; & nbsp; & nbsp;continue-on-error: true
& nbsp; - name: Do something on failure
& nbsp; & nbsp; id: check-test-results
& nbsp; & nbsp; run: exit 1
& nbsp; & nbsp; if: (job.steps.mabl-test-deployment.outputs.journeys_failed & gt; 5)
For autonomous testing across multiple user personas, check out SUSATest — it explores your app like 10 different real users.
You can even configure your pipeline to automatically upgrade the build to the future surroundings if the tests all pass, so that you don ’ t need to manually tag or activate a thrust to product. In this example, we name another action to deploy the change to product:
& nbsp; - name: Deploy to prod
& nbsp; & nbsp; id: deploy-prod
& nbsp; & nbsp; utilization: myApp/deploy @ master
When the Action receives info on examination results, it also furnish you with deep links into mabl to catch the detailed logs, screen shots, DOM information, and more.
Actions log with links rearwards to mabl yield
We are so aroused about this integration because you can be up and running with the nucleus functionality truly quickly, but it also gives you the flexibility to tailor the workflow to converge the motivation of your team over time. & nbsp;
Creating issues automatically
In order to streamline issue direction, we created a simple mabl GitHub app that you can configure to read your mabl event current and create subject automatically based on the solvent of tests. This saves you the time of collecting the relevant info and manually creating each issue by hand.
You can also configure the integration to make issues when mabl detects Visual Changes, JavaScript Errors, Timing alteration, Broken Links, and more. & nbsp; & nbsp;
GitHub integration scene
The issue include screenshots from the test and colligate back to the detailedexamination resultsin order to help you triage and purpose issues as quickly as possible:
A GitHub issue with the latest screenshot and a link to the full mabl trial output & nbsp;
Bringing it all together
In order to make the experience truly unlined, we also wanted to create it easy for you to pilot across the GitHub and mabl interfaces. Fortunately, GitHub makes it easy to maintain the appropriate setting across the desegregation; the mabl activeness passes PR, committer, and leg information along to mabl automatically. As of today, you can filter your mabl tryout run ground on Commit information from GitHub.
Filter mabl test results based on commit information from GitHub
We 're working difficult to add deeper links betweenmabl tryout results, pull requests, subdivision, and more.
Next steps
This is the first in a series of integration and enhancements that we have planned to help you realize the potential of level-headed CI/CD pipelines, so pleaseto stick up to date. & nbsp; In the interim, you cansign-up for the GitHub actions Beta and get your free trial of mablto try it out for yourself!
Watch a quick overview of the new mabl GitHub Integrations:
Quality Engineering Resources
Automate This With SUSA
Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts needed.
Try SUSA FreeTest Your App Autonomously
Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts.
Try SUSA Free