Code Monkey home page Code Monkey logo

fabric8-common's Introduction

Fabric8 Common

1. Overview

A repository containing all common packages used by the fabric8 services. This repository addresses issue #3553

Go code shared between fabric8 services can be added here, and then imported by the services. This will add consistency, reliability, clarity, and (hopefully) reduce bugs and circular repo-to-repo dependencies.

Any code added to this repository should also have test code added, that passes "go test .".

Contents of this repository are anticipated to include:

  • Configuration

  • Event bus

  • Logging

    • Common logging format

    • Single initialization

    • Error handling

    • Common HTTP error response format

    • Metrics

  • Utility

  • Validation routines (application name, etc)

  • HTTP/REST (closing result body, URL utils)

  • Auth

    • Loading/parsing public key

    • Service Account token management

    • JWT token parsing (jwt_token to token_string and token_string to jwt_token)

For Contributing to this project, please refer CONTRIBUTING.md

2. Build Project

To build → make build

This will mainly run go build and report any compilation errors. This will NOT generate any executable as fabric8-common is not a service but collection of go packages which will be imported by other fabric8 services.

3. Run Tests

There are two kind of test, unit test and integration test. Unit test does not required Database while Integration test requies Database.

There are two ways to run tests, without docker and with docker. Without docker are mainly use for development and testing on developer machine while with docker are mainly use by CI/CD jobs.

3.1. Without docker

For Unit test, it can be run directly.

  • Run Unit tests → make test-unit-no-coverage, make test-unit

For Integration test, first need to set Database and then run tests.

  • Set Database → docker-compose up -d db

  • Run Integration tests → make test-integration-no-coverage, make test-integration

To remove Database started with docker-compose up -d db, run docker-compose down

3.2. With docker

One can run tests with docker locally but needs extra setup.

First start docker image for this project.

  • Start Docker image → make docker-start (This will start docker image "fabric8-common-local-build")

For Unit test, it can be run directly.

  • Run Unit tests → make docker-test-unit-no-coverage, make docker-test-unit

For Integration test, first need to set Database and then run tests.

  • Set Database → make integration-test-env-prepare (This will start docker image "make_postgres_integration_test_1")

  • Run Integration tests → make docker-test-integration-no-coverage, make docker-test-integration

To remove Docker image started with make docker-start, run make docker-rm

To remove Database started with make integration-test-env-prepare, run make integration-test-env-tear-down

fabric8-common's People

Contributors

xcoulon avatar kwk avatar aslakknutsen avatar alexeykazakov avatar dipak-pawar avatar nurali-techie avatar pranavgore09 avatar sbose78 avatar surajssd avatar baijum avatar tsmaeder avatar stooke avatar bartoszmajsak avatar kishansagathiya avatar michaelkleinhenz avatar

Watchers

James Cloos avatar Piyush Garg avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.