SonarQube Analysis With Ginkgo on Mac

Ginkgo is the testing framework of choice for many projects developed in Golang. Here is an example setup for SonarQube project analysis.

Prerequisites

  • SonarQube server installation: For the purpose of the tutorial I have a docker image running on my machine on http://localhost:9000.
  • SonarQube project: For the purpose of the tutorial I have created a project with project key com.bdpanajotova.golang-sonar-example and name Golang Sonar Example.
  • Golang project for analysis with Ginkgo tests: Here is the example project I use in GitHub.

Here is the documentation for the fast local setup of SonarQube.

Running SonarQube Inside a Docker Container

Prerequisite

To follow this article, one will need to make sure that they have docker installed in their machine. I assume you know using docker containers. I will be analyzing a maven project, so please make sure that you've one maven project with some code that you can analyze.

Introduction

Sonarqube is a prevalent tool for analyzing bugs, Vulnerabilities, Security hotspots, and some other programming standards. You can use this tool to analyze your project's source code to keep your code standing with programming standards. Using SonarQube is very easy. You can download the sonar server from the official site, but we will be running SonarQube inside a docker container to analyze our source code in this article.