Continuous Integration in HipTest
  January 30, 2019

What is Continuous Integration?

Continuous Integration is the software development practice of making small changes to a single code repository, that multiple developers may be working on, and integrating those changes often. This is helpful as developers are often working independently on the same master branch. When it comes time to integrate all of the changes, developers will merge their code changes, at the same time, often causing things to break and plenty of bugs to appear. When you implement smaller pieces of code, you can avoid a massive breakage, track down defects more quickly, and pinpoint where the problem is — making your code more dependable and significantly reducing frustration.

Problems Continuous Testing Helps Address

Software development has evolved as teams continue to feel the pressure to deliver high-quality software, that fits their customers’ needs, faster. Previously teams would wait until all of the code was written, often times by independent developers, and then merge the code at the same time. This would happen whether it was newly written code, or if there were changes made to the previous code.

The above process is time-consuming, makes it difficult to locate bugs and fix them quickly, and has many barriers in communication. Many teams have turned to automation in favor of faster feedback and delivery. However, there are ways to take your test automation efforts to the next level. For teams who are using a tool like Jenkins or TeamCity, after every code commit to the master branch, an auto build is triggered and automatically deployed to the test server. From there a feedback loop is created — if the test results flag a bug in the code, then the developers know where to start looking for a problem as it should be in the last commit. This faster feedback not only helps you identify bugs more quickly but also helps developers and testers to fix these bugs in a timely manner. The feedback loop is critical to the frequency and quality of software releases.

The "How to" Guide for Setting Up Your Continuous Integration Process with HipTest

Continuous Integration has become essential for Agile and DevOps teams who are trying to release software quickly while still meeting the ever-increasing needs of their customers —this is why teams should look to setup their continuous integration process as soon as possible. Here are some prerequisites for setting up a successful continuous integration process with HipTest:

  • You have a free trial or paid version of HipTest
  • You have generated tests with HipTest-Publisher and structured your project for automation
  • You are looking to have the results of the HipTest tests execution sent back to HipTest
  • You already have set up a CI server and task for your project

Steps to Setting Up Your Continuous Integration Tool with HipTest

Create the test run:

Then click the 3 dots and select “Automate” :

This modal should now appear:

Installing HipTest-Publisher on Your Continuous Integration Tool

You are probably looking to synchronize both the test run as well as the code between your Continuous Integration Tool and HipTest. Here are the steps you need to take in order to do that.

First install HipTest-Publisher on the machine that will run the tests.

Next run the command:

 gem install hiptest-publisher

This will install or update the tool. We recommend including this command line before executing the test every time in order to ensure you have the latest version of HipTest-Publisher installed.

Updating the Test from the Test Run

Next, you are probably looking to update these tests from the test run. The second command line should be in the pre-build part of your CI job configuration and should look something like this:

hiptest-publisher —config-file<path to your config file> —test-run-id 215 — without = action words —verbose

The reason to include this commend is because you want to make sure you are executing the correct version of the test. This command will also add some annotations to the tests, so HipTest will be able to match the results and the tests.

Pushing the results back to HipTest

The final command you should include is to push the results back to HipTest, and this should be executed after the tests. The command should look something like this:

hiptest - publisher —config-file <path to your config file> —push <path to you results file> —push-format unit —verbose

Now this command may vary according to the type of report generated by your test framework, so make sure you have selected the correct format before copying the command line.

Once every command line from above has been included you should be able to see the results appear in the test run you created at the beginning.

In Conclusion

Continuous Integration is crucial for those Agile and DevOps teams looking to deploy high-quality software faster. Whether it’s shipping releases more frequently, improving communication, or quickly identifying bugs, continuous integration is helping software development teams everywhere meet the needs of their customers.

Try HipTest for free to see how it can easily fit right into your Continuous Integration process.