Skip to content

Commit

Permalink
[FAB-3027] Updated CI scripts
Browse files Browse the repository at this point in the history
Change-Id: I528cb18b860938ff17900e9e636636e528dcee59
Signed-off-by: Divyank Katira <Divyank.Katira@securekey.com>
  • Loading branch information
d1vyank committed Apr 7, 2017
1 parent 1ec6bf1 commit 10712fe
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 12 deletions.
18 changes: 12 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,32 @@
# limitations under the License.
#


#
# This MakeFile assumes that fabric, and fabric-ca were cloned and their docker
# images were created using the make docker command in the respective directories
#
# Supported Targets:
# all : runs unit and integration tests
# depend: installs test dependencies
# unit-test: runs all the unit tests
# integration-test: runs all the integration tests
# clean: stops docker conatainers used for integration testing
#

all: unit-test integration-test

unit-test:
sh scripts/unit.sh
depend:
go get github.com/axw/gocov/... && go get github.com/AlekSi/gocov-xml

unit-test: depend
sh test/scripts/unit.sh

unit-tests: unit-test

integration-test:
sh scripts/integration.sh
integration-test: clean depend
sh test/scripts/integration.sh

integration-tests: integration-test

clean:
cd test/fixtures && docker-compose down && docker ps -q -a | xargs docker rm -f
cd test/fixtures && docker-compose down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ Execute `go test` in the `test/integration` to run end-to-end tests. This requir

This client was last tested and found to be compatible with the following Hyperledger Fabric commit levels:
- fabric: v1.0.0-alpha
- fabric-ca: `4651512e4e85728e6ecaf21b8cba52f51ed16633`
- fabric-ca: v1.0.0-alpha
5 changes: 5 additions & 0 deletions test/scripts/fabric_test_commitlevel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
#file used for automatic integration build test
#This should always match what's in the README.md
export FABRIC_COMMIT=fa3d88cde177750804c7175ae000e0923199735c
export FABRIC_CA_COMMIT=b587a4809438cc91787c49c11198dea70e2647b4
10 changes: 5 additions & 5 deletions scripts/integration.sh → test/scripts/integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ PKGS=`go list github.com/hyperledger/fabric-sdk-go/test/... 2> /dev/null | \
echo "Starting fabric and fabric-ca docker images..."
cd ./test/fixtures && docker-compose up --force-recreate -d

sleep 1
echo "Running integration tests..."
cd ../../
gocov test -ldflags "$GO_LDFLAGS" $PKGS -p 1 -timeout=10m | gocov-xml > integration-report.xml

echo "Running tests..."
gocov test -ldflags "$GO_LDFLAGS" $PKGS -p 1 -timeout=10m | gocov-xml > report.xml

docker-compose down
echo "Cleaning up..."
cd ./test/fixtures && docker-compose down
File renamed without changes.

0 comments on commit 10712fe

Please sign in to comment.