The CI/CD and DevOps Blog

Learn about various tried-and-tested strategies that will help you ship code faster

How to link GitHub and Bitbucket accounts

Two among the most popular source control providers are GitHub and Bitbucket. Both these providers offer free repositories and it is not uncommon for software teams to have few of their projects on GitHub and few others on Bitbucket. So if you are a developer who has accounts with both GitHub/Bitbucket and looking to run Continuous Integration on projects hosted on both of these source control providers, this tutorial will help you acheive it in an easy way.

First, let's take a brief look at how source control providers are used. Software developers use web-based, hosted source code systems for software projects, to leverage functions such as distributed revision control, bug tracking, source code management and wiki-based documentation. The source code repositories store large amounts of software source code, kept either publicly (for open source projects) or privately and enable multiple developers to collaborate on the code.

Automatically retry scripts to avoid network hiccups during CI process

Sometimes intermittent network issues happen to the best of us, and it is particularly frustrating if it happens in the middle of a software install.

Setting up code coverage for tests in Continuous Integration

I set up Continuous Integration (CI) test results visualization, in the previous tutorial. In this one, I'll set up code coverage visualization for the CI project.

What is Code coverage and why is it useful?

Code coverage is a measure used to describe the degree to which a source code of a program is tested using a particular test suite. In other words, it tells you the percentage of your code that is being tested. It is used as a guide to write more comprehensive tests to parts of your code. 

In practice, developers use it as part of exit criteria for milestons, to write tests for untested parts of  code, review developers have written good unit tests, etc.

While it is useful, one should remember not to use it as the only value to determine the quality of your code. In the words of Martin Fowler "Test coverage (also called code coverage) is a useful tool for finding untested parts of a codebase. Test coverage is of little use as a numeric statement of how good your tests are."

Create visualizations of your continuous integration test results

In this tutorial, I'll show you how to configure visualizations of Continuous Integration test results. This visualization not only looks good, but also helps a developer to drill down on tests that failed and find the root cause much quicker.

Here's how a successful Continuous Integration test result would look.

Configuring a build badge for a Node.js project status

I have gone through the steps of running  basic Continuous Integration (CI) on a Node.js app hosted on a private repository. Now I'll configure a visual indicator to display the status of the Node.js app when CI is run, using build badges. As shown below, I use it to update my team mates about the latest build status of my project in a convenient way.

First, what is a Badge and where is it used?

Badges, in the context of continuous integration, are used to display the meta-data of a build. For example, at the completion of a build, a status is displayed on whether a build succeeded or failed. This build status is incorporated into a build badge and can be displayed to viewers in different ways and in different locations. Badges are used to display different meta-data such as build status, code coverage percentage, status of third party dependencies, release versions, etc.

In this tutorial, I'll configure the Node.js app on Shippable to embed build status in two ways and show few examples of the outcome.