App & Browser Testing Made Easy

Give your users a seamless experience by testing on 3000+ real devices and browsers. Don't compromise with emulators and simulators

Home Guide Building an Automated Test Pipeline with GoCD Cloud

Building an Automated Test Pipeline with GoCD Cloud

By Manish Saini, Community Contributor -

Table of Contents

Automated testing for CI/CD enables your teams to build, test and deploy frequently. This helps you improve your product’s reliability by reducing bugs, increasing quality, and allowing the developers confidence that their latest version has robust functionality. 

The business pressure to deliver faster shouldn’t diminish the quality of what is being produced. After all, your users expect stable and working software, even when they’re clamoring for the next shiny thing. In this article, we will learn about GoCDan open-source Continuous Integration and Continuous Delivery system, and how to use that for our test automation.

What is GoCD?

GoCD is a free CI/CD tool for DevOps projects. It helps software development teams to automate the testing and release process. It was designed for continuous delivery, and developers can configure pipelines as code. Not only is it a robust and scalable but also an extensible open-source continuous delivery tool.  

It supports several version control tools, including Git, Mercurial, Subversion, Perforce, and TFVC. Other version control software can be supported by installing additional plugins. It works in a master-slave architecture, i.e. there will be a single machine that controls the other agents.

GoCD Server

The GoCD Server acts as a master in the above diagram and delegates the jobs to the agents.

Main Features of GoCD

GoCD has an excellent feature list. Some of them are:

  • Free and open source
  • Parallel and sequential execution
  • Easily configure dependencies
  • Configure pipelines as code
  • Visualize workflows
  • Compare builds
  • Eliminate bottlenecks
  • Keep configuration tidy
  • Supports auditable deployment
  • Supports plugins
  • Deploy any version, any time

Set up GoCD Pipeline

A group of stages forms a pipeline. The pipeline can be dependent on the previous job’s completion status. Before setting up the GoCD pipeline, we should have these two essential components, installed in our system.

  • GoCD server: The one which provides work for the agents
  • GoCD agents: The ones that perform the assigned work like running scripts, building, deployment, etc.

Since installation instructions vary per operating system, the installation instruction pages linked below will ask you to choose your operating system and then provide you instructions for that operating system.

Steps to Install

After the installation, run the GoCD server locally on the default port http://localhost:8153/. Click on Admin -> Pipelines, which will take you to the pipelines administration page. 

Click on the “Create a new pipeline within this group” button to the “Add pipeline” page. 

Part 1: Material

GoCD Add Pipeline1. Choose the material type. The material can be your Source Control Management (SCM or version control) repository, pipeline, or package repository (e.g. Git). Currently, GoCD supports the following:

  • SCMs
  • Subversion
  • Mercurial
  • Git
  • Team Foundation Server.
  • Perforce
  • Package repository
  • Material Plugins

2. In the Repository URL, enter the repository URL.

3. Click Test Connection. If GoCD establishes a connection successfully, the Connection OK message appears.

Part 2: Pipeline Name

GoCD Pipeline Name

  1. Provide the pipeline a name, without spaces, for example, sample-pipeline.
  2. Select a pipeline group. Also, fill in the parameter if using a template.

Part 3: Stage Details

GoCD Pipeline Stage

  1.  Enter a name for the stage, for example, testing-stage.

Part 4: Job and Task

GoCD Job and Task

 

1- Enter a name for the job, for example, single-job.
2- In the console, add the commands required to run your project code. For example, if tests are based on Python, you need to add the commands required to set up and run a Python project.
3- Click Save + Run This Pipeline to save and run your pipeline.

The pipeline runs and the test result is displayed on your GoCD Dashboard page.

BrowserStack Integration with GoCD

Before you can start integration, ensure that you have access to the BrowserStack account credentials, namely Access Key and Username. For the Integration, you have to follow all the above steps same as before. But in the last step “Job and Task”, under “Advanced Settings”, in the Secure Variables section, You have to add your BrowserStack Username and Access key as the environment variables.

Integrate BrowserStack Automate with GoCD

With existing test cases, integrating BrowserStack involves editing your test cases to add BrowserStack capabilities, credentials, and, remote URLs.

Conclusion

A well-orchestrated pipeline makes the job easier for the team and ensures reliable deployment and delivery. In this GoCD pipeline tutorial, we had a detailed look at configuring the GoCD pipeline. Combined with BrowserStack Automate, you have the flexibility to scale as your testing grows, without having to worry about updating versions, adding devices, managing capacity, and most importantly, maintaining stability.

Building an Automated Test Pipeline with GoCD Cloud

Tags
Automation Testing CI CD Tools iOS devices

Featured Articles

GoCD vs Jenkins: Detailed Comparison

Top 14 CI CD Tools for your DevOps project

Curated for all your Testing Needs

Actionable Insights, Tips, & Tutorials delivered in your Inbox
By subscribing , you agree to our Privacy Policy.
thank you illustration

Thank you for Subscribing!

Expect a curated list of guides shortly.