Adding Your Unit Tests to Testery
At Testery, we believe you should have all of your test results available in one place. While the Testery platform is an ideal place to run your tests to take advantage of our fast, parallel run capabilities, there may be some situations where your tests need to run elsewhere.
For example, teams that have very fast Unit Test suites may choose to run the tests on their own CI system. Or you may have a testing system tied to physical hardware such as robotics that you need to test in a controlled environment.
By utilizing Testery's Test Upload Feature you can include these test runs in Testery so that you can track test results, regressions, and flakiness in one place.
At Testery Engineering, we recently had some tests that we needed to run offline, but still wanted to get results for. Here's how we did it. You'll need an active Testery account to begin. If you don't have one, click the button below to start your Free Trial.
First, we executed the junit tests on our local computer
./gradlew test
In our gradle setup, this resulted in a ton of junit.xml files, one for each test case. Since this is really 1 test run, we wanted to merge them together before uploading to Testery. There are a lot of tools out there to do this, but we chose Junit-Report-Merger
npm install -g junit-report-merger jrm merged-tests.xml '**/build/test-results/test/TEST-*.xml'
We now have a single file to upload to Testery using the CLI. Before uploading, you'll need to make sure you've created a project & environment in testery to hold your results.
testery upload-test-run --token TESTERY_TOKEN_HERE --project-key PROJECT_HERE --environment-key ENVIRONMENT_HERE --path "merged-tests.xml"
Once this succeeds, you'll have a new test run in your Testery account, and you'll be able to see your results in the familiar Testery UI.
Need help getting started with your Test Automation? Get in touch with the Test Orchestrators at Testery.