Git Product home page Git Product logo

fabric-test's Introduction

Welcome to fabric-test


Build Status

You are in the right place if you are interested in testing the Hyperledger Fabric and related repositories.

Getting Started

Here are some recommended setup steps. The following repositories will need to be cloned separately with their corresponding images built.

  • fabric:
    • fabric-orderer
    • fabric-peer
    • fabric-kafka
    • fabric-zookeeper
    • fabric-tools
    • fabric-couchdb
    • fabric-testenv
    • fabric-ccenv
  • fabric-ca
  • fabric-test

Setup the Submodules

Once the fabric, fabric-ca and fabric-test repositories are in place, in $GOPATH/src/github.com/hyperledger/, initialize and populate the submodules. Execute the following:

  cd $GOPATH/src/github.com/hyperledger/fabric-test
  git submodule update --init --recursive

Update git submodules (Optional)

The fabric-test repository contains submodules of other Hyperledger Fabric projects that are used in testing. Tests may be run with the submodule commit levels saved with the commit-level of fabric-test. Or, the git submodules may be updated to run tests with the bleeding edge of development master branches. If you would like to update the git submodules, use the following command:

  git submodule foreach git pull origin master

Note: When making changes for committing to a submodule (for example, fabric code), then make the change in the actual repository and not here in the submodules. This makes managing changes much easier when working with submodules.

Build the images, binaries and gotools

Ensure you are in your $GOPATH/src/github.com/hyperledger/fabric-test directory. These steps will help prepare the environment.

To install dependencies - NodeJS,NPM (one time only):

  make pre-setup

To build all images and binaries in fabric, fabric-ca, as required by tests (execute each time you update the repositories commit levels, after each make git-update)

  cd $GOPATH/src/github.com/hyperledger/fabric-test/fabric

  make docker     #  Builds all fabric images.
  make native     #  Builds all binaries.


  cd $GOPATH/src/github.com/hyperledger/fabric-test/fabric-ca

  make docker     # Builds all fabric-ca images.

To install all the gotools, required for testing, execute the following command

  cd $GOPATH/src/github.com/hyperledger/fabric-test

  make gotools     # Downloads the gotools like ginkgo, golint, goimports, gocov and govendor

To update the go version in the repo, follow the below steps

  Step 1: Change GO_VER in fabric-test/ci.properties and also update the same in azure-pipeline yml files in fabric-test/ci directory.

  Step 2: Find all files in repo called go.mod. 'cd' into each of those directories. Remove go.mod and go.sum files and execute the following steps
          1. go mod init
          2. go get -u github.com/hyperledger/fabric-test@master
          3. go mod tidy

  Step 3: Commit all the go.mod and go.sum files that get changed in those directories

Then, choose a tool and a test to run by following the instructions. For example, to run a Behave test, execute the following:

cd ../feature
../scripts/install_behave.sh
behave -t smoke -k

Easy Method to build all images and run tests with a single make target

You can run the automated test suites with a makefile target given below. This handles all the steps for you as the procedure installs all the prerequisites that include cloning fabric, fabric-ca repositories, building images and binaries and executing the daily tests or smoke tests in the fabric-test repository. Simply run one of the following commands,


  make ci-daily    # Cleans environment, updates submodules, clones & builds
                   # fabric & fabric-ca images, executes Daily tests from
                   # regression/daily folder.

  make ci-smoke    # Cleans environment, updates submodules, clones & builds
                   # fabric & fabric-ca images, executes Smoke tests from
                   # regression/smoke folder.

Tools Used to Execute Tests

NetworkLauncher - dynamically build a Fabric network

Please see the README located in the tools/NL directory for more detailed information for using the command line to run the Networker Launcher to dynamically create a Fabric network on a single host machine.

Performance Traffic Engine

Please see the README located in the tools/PTE directory for more detailed information for using the Performance Traffic Engine to drive transactions through a Fabric network.

Ledger Traffic Engine

Please see the README located in the tools/LTE directory for more detailed information for using the Ledger Traffic Engine to execute APIs to test the functionality and throughput of Ledger code that exists inside the peer.

Cello Ansible Agent

Cello is a Hyperledger Project (https://www.hyperledger.org/projects/cello) with its own repository. It contains the Cello Ansible Agent, an easy-to-use tool for deploying and managing a fabric network on one or more hosts in the cloud. Refer to these instructions https://github.com/hyperledger/cello/blob/master/src/agent/ansible/README.md to clone it and set up an ansible controller to deploy a network.

Continuous Integration

Many tests are now integrated into CI. Every patch set triggers a fabric-test-verify job and executes smoke tests. Once the build is successfully executed, the CI job sends All checks have passed vote back to the corresponding github pull request; otherwise it sends an error message. Please see the fabric-test CI job page:

Note: Migrating from Jenkins to Azure CI.

.. Licensed under Creative Commons Attribution 4.0 International License https://creativecommons.org/licenses/by/4.0/

fabric-test's People

Contributors

2016nishi avatar adnan-c avatar asararatnakar avatar awjh-ibm avatar bharadwajambati95 avatar chandrachavva avatar christo4ferris avatar denyeart avatar gennadylaventman avatar johndsheehan avatar lhaskins avatar luomin avatar mastersingh24 avatar nileshdeotale avatar nklincoln avatar rameshthoomu avatar rennman avatar ricjhill avatar ryjones avatar sambhavdutt avatar scottz64 avatar shimos avatar shw8927 avatar suryalnvs avatar sykesm avatar vijaypunugubati avatar vmorris avatar vramakrishna avatar wenjianqiao avatar yuki-kon avatar

Watchers

 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.