Product
|
Cloud costs
|
released
November 21, 2023
|
3
min read
|

Run Ruby Builds Up To 4x Faster Using Harness CI Test Intelligence

Updated

Companies strive to deliver software of the highest quality at the lowest possible cost. The quality of every software project is determined by balancing time, resources, and scope, otherwise known as the project management triangle. Since these three factors are linked, delivering high quality software quickly and efficiently almost always means sacrificing scope (features).

The exception to this rule is innovation.

Harness Test Intelligence™ (TI) helps companies innovate by decreasing test execution time, without reducing quality, sacrificing features, or increasing costs.

Harness Test Intelligence, which debuted in October 2022, is one of the features that makes Harness CI up to 4x faster than other CI solutions. TI reduces test time by running only the subset of tests relevant to the code changes that triggered the pipeline. TI supports Java, Kotlin, Scala, C#, and today we are thrilled to announce that support for Ruby is currently in public preview.

Demo

Vagrant is a popular open source project with over 5,000 Ruby rspec tests. Check out this demo to see how TI reduces Vagrant’s Ruby test times over 90% compared to other CI providers.

In this post, we will give you an overview of TI, along with steps to reproduce the above demo in your own Harness account.

Where Test Intelligence Fits in Your SDLC

Testing is a vital component of every Continuous Integration pipeline. Testing ensures the quality of your application before code advances to the next phase in your SDLC. Running all tests on every code change is expensive and time-consuming. This leaves developers with the difficult decision of running all tests when introducing changes or to deferring tests until later in the development cycle.

Author Robert Galanakis says, “The fastest code is the code which does not run”, in the spirit of writing simple, maintainable code. We can extend this perspective to software testing: The fastest tests are the tests which do not run.

How Does Test Intelligence Work?

Using Machine Learning (ML), Test Intelligence examines changes to source code and tests to determine what tests should be run for a given change. When a code change is pushed to a repository, TI uses the following metrics to select tests:

  • Changed code: TI uses the list of files changed in the commit range to select tests that are associated directly or indirectly with the changes.
  • Changed tests: When a test is changed, TI selects the test for execution, even if the code related to the test hasn’t changed.
  • New tests: When new tests are added, TI finds any correlations between any new or existing code, and selects and runs those tests.

TI is always up to date and syncs when you merge code to any branch.

Try Ruby Test Intelligence Yourself

To reproduce the above demo in your Harness account, follow these steps.

  1. Sign up for your free Harness account.
  2. Follow this guide.
  3. You will see a subset of tests run between the two stages in your pipeline. Instead of running all 5,000+ Ruby rspec tests, TI selects only the subset of tests relevant to the change.
  4. In the log output, you can see the number of tests that were selected in each parallel stage.

If you’d like to learn more, schedule a demo to see how Harness can revolutionize your software development process.

Sign up now

Sign up for our free plan, start building and deploying with Harness, take your software delivery to the next level.

Get a demo

Sign up for a free 14 day trial and take your software development to the next level

Documentation

Learn intelligent software delivery at your own pace. Step-by-step tutorials, videos, and reference docs to help you deliver customer happiness.

Case studies

Learn intelligent software delivery at your own pace. Step-by-step tutorials, videos, and reference docs to help you deliver customer happiness.

We want to hear from you

Enjoyed reading this blog post or have questions or feedback?
Share your thoughts by creating a new topic in the Harness community forum.

Sign up for our monthly newsletter

Subscribe to our newsletter to receive the latest Harness content in your inbox every month.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Continuous Integration