CI/CD: Testing made easy

Introduction

The continuous methodologies of software development are based on automating the execution of scripts to minimize the chance of introducing errors while developing applications. They require less human intervention or even no intervention at all, from the development of new code until its deployment.

Many software companies are using this for development and integration of there platform. And one of the most famous open source tool used is Travis CI. It's used in many opensource packages and projects as well.

This is a small tool building the CI/CD framework for a small scale project. It's is build such that no knowledge of any tool or CI/CD concept is required. It can be used across project in your GIT Repository.

Goal of the tool

Mainly the tool automatically checks for code quality and static code check. A coverage report is generated if test cases are written in python unit-test. All the report and check is been deployed back in the gh-branch of the GIT.

Specific Requirement Performed By The Tool

  1. When Code is pushed to Github it should execute and produce the following reports
    1. Coverage Report
    2. Code Quality
    3. Code Spell
    4. Duplication
    5. Detect Dead Code
  2. All the reports should be generated in the branch in GIT. So that the master commit can be cleaner and don’t have multiple unnecessary commits.
  3. All the changes should automatically reflect without changing any configuration.
  4. In the Master branch in GIT, it should only build and check if it’s working. The maintainer of the GIT repository will have to check the essential and final commits in the branch and merge it with the master as per the requirement.

Tools Used To Build The Requirement


1.
2.
3.

How To Setup The System

First have to follow the following folder structure in there respective branches as shown below.

You can download the code for each of the branch for respective git branches from the link provided. And place it as per the folder Structure.
  1. master Link
  2. gh-pages Link

Setting Up The Token


Copy the token from GIT by following the below process.
1.Go to selecting by clicking on the blue rectangle.
2. Click on the blue rectangle on "Developer settings"
3. Click on the blue rectangle on "Personal access tokens"
4. Click on the blue rectangle on "Generate new token"
5. Give a suitable name in the “Note” section. And also tick all the below section according to the access needs.
6. Click on the blue rectangle on "Generate token"
7. Copy the token

Follow the below setps in the Travis CI. And past the token in the last step which was copied in GIT.

1.Go to "More options" by clicking on the blue rectangle.
2. Go to "Selecting" by clicking on the blue rectangle.
3. Scroll down.
4. Write "GITHUB_TOKEN" in the blue rectangle.
5.Past the Token copied from GIT here.
6. Click on the blue rectangle on "Add". To "Add" the token.
7. Similarly copy the token from the code-climate in the variable “CC_TEST_REPORTER_ID”.
Follow the steps below in CodeClimate.

1.Go to "Repo Selecting" by clicking on the blue rectangle.
2. Go to "Test coverage" by clicking on the blue rectangle.
3. Copy a token and pass it in GIT as shown above.


How To Use It

1.Select the Branch  Folder. Change in the blue rectangle area.
2.Select the Function Folder.Click in the blue rectangle area.
3.Create the folder of the file name you want. According to the naming convention.In this sample we are using DIAEngineAnalysis.
4.Go to Running_Pipline.csv.
5.Click on edit. [Click on the blue rectangle area]
6.Add the folder name in the CSV. In this sample it is DIAEngineAnalysis
7.Commit the changes.
8.Go to Travis CI by clicking on the blue box.
9.Check the output in the "Job Log " in Travis CI .
10.Check the output in the "Job Log " in Travis CI .
11.Check the error in the code if any.
12.You can check your coverage report in this folder in "index.html".


Existing project with that frame work.

VehicalDiagnosticAlgo . This is one project which has this framework