package
1.1.0
Repository: https://github.com/lightkool/fabric.git
Documentation: pkg.go.dev

# README

Welcome to the Behavioral Driven Development (BDD) subsytem for Fabric

Developers will find these mechanisms useful for both exploratory and verification purposes.

Getting started

Installation

Setup python virtual environment wrapper usage

    sudo pip install virtualenv
    sudo pip install virtualenvwrapper
    export WORKON_HOME=~/Envs
    source /usr/local/bin/virtualenvwrapper.sh

Setup your virtual environment for behave

Virtual Environment Guide

    mkvirtualenv -p /usr/bin/python2.7 behave_venv

This will automaticall switch you to the new environment if successful. In the future, you can switch to the virtual environment using the workon command as shown below.

    workon behave_venv

Now install required modules into the virtual environment

NOTE: If you have issues installing the modules below, and you are running the vagrant environment, consider performing a vagrant destroy followed by a vagrant up.

    pip install -r ../devenv/bddtests-requirements.txt

Running behave

Peer Executable and Docker containers

Behave requires the peer executable for packaging deployments. To make the peer execute the following command.

#Change to the root fabric folder to perform the following commands.
cd ..

# Optionally perform the following clean if you are unsure of your environments state.
make clean
make peer

The peer executable will be located in the build/bin folder. Make sure that your PATH enviroment variable contains the location. Execute the following command if necessary.

    export PATH=$PATH:$GOPATH/src/github.com/hyperledger/fabric/build/bin

The behave system also uses several docker containers. Execute the following commands to create the required docker containers.

    make peer-docker
    make orderer-docker

Change back to the bddtests folder (Where this readme is located) to execute subsequent behave commands.

    cd bddtests

Running all of the behave features and suppressing skipped steps (-k)

The following behave commands should be executed from within this folder.

    behave -k -D cache-deployment-spec

Running a specific feature

    behave -k -D cache-deployment-spec features/bootstrap.feature

Deactivating your behave virtual environment

Once you are done using behave and you wish to switch back to your normal python environment, issue the following command.

    deactivate

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License. s

# Functions

FeatureContextBootstrap setup the FeatureContext for bootstrap steps.
NewComposition create a new Composition specifying the project name (for isolation) and the compose files.
NewDockerCmdlineHelper returns a new command line DockerHelper instance.
NewGrpcClient return a new GRPC client connection for the specified peer address.

# Structs

BDDContext represents the current context for the executing scenario.
Composition represents a docker-compose execution and management.
KeyedProposalResponse the response for an endorsement for internal usage in maps.
UserRegistration represents a user in the peer network.

# Interfaces

DockerHelper helper for docker specific functions.

# Type aliases

KeyedProposalResponseMap map of composeServices to KeyedProposalResponse.