-
Notifications
You must be signed in to change notification settings - Fork 507
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added targets for running unit and integration tests Change-Id: I171709bc90e76d2f6f26aa9453c13ebcc4afedce Signed-off-by: Divyank Katira <[email protected]>
- Loading branch information
Showing
3 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# | ||
# Copyright SecureKey Technologies Inc. All Rights Reserved. | ||
# | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# 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: | ||
# unit-test: runs all the unit tests | ||
# integration-test: runs all the integration tests | ||
|
||
unit-test: | ||
sh scripts/unit.sh | ||
|
||
unit-tests: unit-test | ||
|
||
integration-test: | ||
sh scripts/integration.sh | ||
|
||
integration-tests: integration-test | ||
|
||
clean: | ||
cd test/fixtures && docker-compose down && docker ps -q -a | xargs docker rm -f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
# Packages to exclude | ||
PKGS=`go list github.com/hyperledger/fabric-sdk-go/test/... 2> /dev/null | \ | ||
grep -v /vendor/` | ||
|
||
echo "Starting fabric and fabric-ca docker images..." | ||
cd ./test/fixtures && docker-compose up --force-recreate -d | ||
|
||
sleep 1 | ||
|
||
echo "Running tests..." | ||
gocov test -ldflags "$GO_LDFLAGS" $PKGS -p 1 -timeout=10m | gocov-xml > report.xml | ||
|
||
docker-compose down |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Packages to exclude | ||
PKGS=`go list github.com/hyperledger/fabric-sdk-go/... 2> /dev/null | \ | ||
grep -v /vendor/ | \ | ||
grep -v /test/` | ||
echo "Running tests..." | ||
gocov test -ldflags "$GO_LDFLAGS" $PKGS -p 1 -timeout=5m | gocov-xml > report.xml |