Skip to content

Commit 346c00b

Browse files
committed
FAB-5208 create release testsuite
Create release test suite in test/regression/release folder to run release tests after each release is created. We run this for every job and look for the IS_RELEASE condition. If the condition satisfies, job executes all release tests otherwise will skip tests. Will run this job in silent mode and disable gerrit voting. Instructions to run this patch: clone fabric repo cd test/regression/release ./runReleaseTestSuite.sh Change-Id: If45bcdeee4f5ecb28df405815718fe6a8ee2b583 Signed-off-by: rameshthoomu <[email protected]>
1 parent 4709b33 commit 346c00b

9 files changed

+478
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Copyright IBM Corp. All Rights Reserved.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
6+
import unittest
7+
import subprocess
8+
9+
class byfn_cli_release_tests(unittest.TestCase):
10+
11+
def test_byfn_cli_default_channel(self):
12+
'''
13+
In this cli test, we execute the byfn_cli tests on published release
14+
docker images and pull published fabric binaries and perform tests on
15+
fabric-samples repository.
16+
17+
Passing criteria: byfn_cli test completed successfully with
18+
exit code 0
19+
'''
20+
logfile = open("output_byfn_cli_default_channel.log", "w")
21+
returncode = subprocess.call(
22+
"./run_byfn_cli_release_tests.sh",
23+
shell=True, stderr=subprocess.STDOUT, stdout=logfile)
24+
logfile.close()
25+
self.assertEqual(returncode, 0, msg="test_byfn_cli_default_channel "
26+
"tests are failed. \nPlease check the logfile "
27+
+logfile.name+" for more details.")
28+
29+
def test_byfn_cli_custom_channel(self):
30+
'''
31+
In this cli test, we execute the byfn_cli tests on published release
32+
docker images and pull published fabric binaries and perform tests on
33+
fabric-samples repository.
34+
35+
Passing criteria: test_byfn_cli_custom_channel test completed successfully with
36+
exit code 0
37+
'''
38+
logfile = open("output_byfn_cli_custom_channel.log", "w")
39+
returncode = subprocess.call(
40+
"././run_byfn_cli_release_tests.sh byfnchannel",
41+
shell=True, stderr=subprocess.STDOUT, stdout=logfile)
42+
logfile.close()
43+
self.assertEqual(returncode, 0, msg="test_byfn_cli_custom_channel "
44+
"tests are failed. \nPlease check the logfile "
45+
+logfile.name+" for more details.")
46+
47+
def test_node_sdk_byfn(self):
48+
'''
49+
In this node_sdk_byfn test, we pull published docker images from
50+
docker hub account and verify integration tests.
51+
52+
Passing criteria: Underlying node_sdk byfn tests are completed successfully
53+
with exit code 0
54+
'''
55+
logfile = open("output_node_sdk_byfn.log", "w")
56+
returncode = subprocess.call(
57+
"./run_node_sdk_byfn.sh",
58+
shell=True, stderr=subprocess.STDOUT, stdout=logfile)
59+
logfile.close()
60+
self.assertEqual(returncode, 0, msg="node_sdk_byfn test"
61+
" failed. \nPlease check the logfile "+logfile.name+" for more "
62+
"details.")
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Copyright IBM Corp. All Rights Reserved.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
6+
import unittest
7+
import subprocess
8+
9+
class sdk_Release_Tests(unittest.TestCase):
10+
11+
def test_e2e_node_sdk_release_tests(self):
12+
'''
13+
In this e2e node sdk release test, we execute all node sdk unit and e2e tests
14+
are working without any issues.
15+
16+
Passing criteria: e2e node sdk release test completed successfully with
17+
exit code 0
18+
'''
19+
logfile = open("output_e2e_node_sdk_release_tests.log", "w")
20+
returncode = subprocess.call(
21+
"./run_e2e_node_sdk.sh",
22+
shell=True, stderr=subprocess.STDOUT, stdout=logfile)
23+
logfile.close()
24+
self.assertEqual(returncode, 0, msg="Run e2e_node_sdk_release_tests"
25+
"e2e_node_sdk_release_tests are failed. \nPlease check the logfile "
26+
+logfile.name+" for more details.")
27+
28+
29+
def test_e2e_java_sdk_release_tests(self):
30+
'''
31+
In this e2e java sdk release test, we execute all java sdk unit and e2e tests
32+
are working without any issues.
33+
34+
Passing criteria: e2e java sdk release test completed successfully with
35+
exit code 0
36+
'''
37+
logfile = open("output_e2e_java_sdk_release_tests.log", "w")
38+
returncode = subprocess.call(
39+
"./run_e2e_java_sdk.sh",
40+
shell=True, stderr=subprocess.STDOUT, stdout=logfile)
41+
logfile.close()
42+
self.assertEqual(returncode, 0, msg="Run e2e_java_sdk_release_tests"
43+
"e2e_java_sdk_release_tests are failed. \nPlease check the logfile "
44+
+logfile.name+" for more details.")
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Copyright IBM Corp. All Rights Reserved.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
6+
import unittest
7+
import subprocess
8+
9+
class make_targets(unittest.TestCase):
10+
11+
12+
def test_makeNative(self):
13+
'''
14+
In this make targets test, we execute makeNative target to make sure native target
15+
is working without any issues.
16+
17+
Passing criteria: make native test completed successfully with
18+
exit code 0
19+
'''
20+
logfile = open("output_make_native_release_tests.log", "w")
21+
returncode = subprocess.call(
22+
"./run_make_targets.sh makeNative",
23+
shell=True, stderr=subprocess.STDOUT, stdout=logfile)
24+
logfile.close()
25+
self.assertEqual(returncode, 0, msg="Run make native targets "
26+
"make native target tests failed. \nPlease check the logfile ")
27+
28+
29+
def test_makeBinary(self):
30+
'''
31+
In this make targets test, we execute make binary target to make sure binary target
32+
is working without any issues.
33+
34+
Passing criteria: make binary test completed successfully with
35+
exit code 0
36+
'''
37+
logfile = open("output_make_binary_release_tests.log", "w")
38+
returncode = subprocess.call(
39+
"./run_make_targets.sh makeBinary",
40+
shell=True, stderr=subprocess.STDOUT, stdout=logfile)
41+
logfile.close()
42+
self.assertEqual(returncode, 0, msg="Run make binary target "
43+
"make binary target tests failed. \nPlease check the logfile ")
44+
45+
46+
def test_makeDistAll(self):
47+
'''
48+
In this make targets test, we execute make dist-all target to make sure dist-all target
49+
is working without any issues.
50+
51+
Passing criteria: make dist-all test completed successfully with
52+
exit code 0
53+
'''
54+
logfile = open("output_make_dist-all_release_tests.log", "w")
55+
returncode = subprocess.call(
56+
"./run_make_targets.sh makeDistAll",
57+
shell=True, stderr=subprocess.STDOUT, stdout=logfile)
58+
logfile.close()
59+
self.assertEqual(returncode, 0, msg="Run make dist-all target "
60+
"make dist-all target tests failed. \nPlease check the logfile ")
61+
62+
63+
def test_makeDocker(self):
64+
'''
65+
In this make targets test, we execute make docker target to make sure docker target
66+
is working without any issues.
67+
68+
Passing criteria: make docker test completed successfully with
69+
exit code 0
70+
'''
71+
logfile = open("output_make_docker_release_tests.log", "w")
72+
returncode = subprocess.call(
73+
"./run_make_targets.sh makeDocker",
74+
shell=True, stderr=subprocess.STDOUT, stdout=logfile)
75+
logfile.close()
76+
self.assertEqual(returncode, 0, msg="Run make Docker target "
77+
"make Docker target tests failed. \nPlease check the logfile ")
78+
79+
def test_makeVersion(self):
80+
'''
81+
In this make targets test, we execute version check to make sure binaries version
82+
is correct.
83+
84+
Passing criteria: make version test completed successfully with
85+
exit code 0
86+
'''
87+
logfile = open("output_make_version_release_tests.log", "w")
88+
returncode = subprocess.call(
89+
"./run_make_targets.sh makeVersion",
90+
shell=True, stderr=subprocess.STDOUT, stdout=logfile)
91+
logfile.close()
92+
self.assertEqual(returncode, 0, msg="Run make version target "
93+
"make version target tests failed. \nPlease check the logfile ")
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/bin/bash
2+
#
3+
# Copyright IBM Corp. All Rights Reserved.
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
#
7+
8+
DAILYDIR="$GOPATH/src/github.com/hyperledger/fabric/test/regression/daily"
9+
RELEASEDIR="$GOPATH/src/github.com/hyperledger/fabric/test/regression/release"
10+
11+
export FABRIC_ROOT_DIR=$GOPATH/src/github.com/hyperledger/fabric
12+
13+
cd $FABRIC_ROOT_DIR || exit
14+
15+
IS_RELEASE=`cat Makefile | grep IS_RELEASE | awk '{print $3}'`
16+
echo "=======>" $IS_RELEASE
17+
18+
# IS_RELEASE=True specify the Release check. Trigger Release tests only
19+
# if IS_RELEASE=TRUE
20+
21+
if [ $IS_RELEASE != "true" ]; then
22+
echo "=======> TRIGGER ONLY on RELEASE !!!!!"
23+
exit 0
24+
else
25+
26+
cd $RELEASEDIR
27+
28+
docker rm -f $(docker ps -aq) || true
29+
echo "=======> Execute make targets"
30+
chmod +x run_make_targets.sh
31+
py.test -v --junitxml results_make_targets.xml make_targets_release_tests.py
32+
33+
echo "=======> Execute SDK tests..."
34+
chmod +x run_e2e_node_sdk.sh
35+
chmod +x run_e2e_java_sdk.sh
36+
py.test -v --junitxml results_e2e_sdk.xml e2e_sdk_release_tests.py
37+
38+
docker rm -f $(docker ps -aq) || true
39+
echo "=======> Execute byfn tests..."
40+
chmod +x run_byfn_cli_release_tests.sh
41+
chmod +x run_node_sdk_byfn.sh
42+
py.test -v --junitxml results_byfn_cli.xml byfn_release_tests.py
43+
44+
cd $DAILYDIR
45+
46+
docker rm -f $(docker ps -aq) || true
47+
echo "=======> Ledger component performance tests..."
48+
py.test -v --junitxml results_ledger_lte.xml ledger_lte.py
49+
50+
docker rm -f $(docker ps -aq) || true
51+
echo "=======> Test Auction Chaincode ..."
52+
py.test -v --junitxml results_auction_daily.xml testAuctionChaincode.py
53+
54+
fi
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/bash
2+
#
3+
# Copyright IBM Corp. All Rights Reserved.
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
#
7+
8+
# RUN BYFN Test
9+
#####################
10+
11+
CH_NAME="$1"
12+
rm -rf ${GOPATH}/src/github.com/hyperledger/fabric-samples
13+
14+
WD="${GOPATH}/src/github.com/hyperledger/fabric-samples"
15+
REPO_NAME=fabric-samples
16+
17+
git clone ssh://[email protected]:29418/$REPO_NAME $WD
18+
cd $WD
19+
20+
curl -L https://raw.githubusercontent.com/hyperledger/fabric/master/scripts/bootstrap-1.0.0-rc1.sh -o bootstrap-1.0.0-rc1.sh
21+
chmod +x bootstrap-1.0.0-rc1.sh
22+
./bootstrap-1.0.0-rc1.sh
23+
24+
cd $WD/first-network
25+
export PATH=$WD/bin:$PATH
26+
echo y | ./byfn.sh -m down
27+
28+
if [ -z "${CH_NAME}" ]; then
29+
echo "Generating artifacts for default channel"
30+
echo y | ./byfn.sh -m generate
31+
echo "setting to default channel 'mychannel'"
32+
echo y | ./byfn.sh -m up -t 10
33+
echo
34+
else
35+
echo "Generate artifacts for custom Channel"
36+
echo y | ./byfn.sh -m generate -c $CH_NAME
37+
echo "Setting to non-default channel $CH_NAME"
38+
echo y | ./byfn.sh -m up -c $CH_NAME -t 10
39+
echo
40+
fi
41+
echo y | ./byfn.sh -m down
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
#
4+
# Copyright IBM Corp. All Rights Reserved.
5+
#
6+
# SPDX-License-Identifier: Apache-2.0
7+
#
8+
# Test Java SDK e2e tests
9+
#
10+
11+
WD="${GOPATH}/src/github.com/hyperledger/fabric-sdk-java"
12+
#WD="${WORKSPACE}/gopath/src/github.com/hyperledger/fabric-sdk-java"
13+
SDK_REPO_NAME=fabric-sdk-java
14+
git clone https://github.com/hyperledger/fabric-sdk-java $WD
15+
cd $WD
16+
git checkout tags/v1.0.0-rc1
17+
export GOPATH=$WD/src/test/fixture
18+
19+
cd $WD/src/test
20+
chmod +x cirun.sh
21+
source cirun.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
3+
#
4+
# Copyright IBM Corp. All Rights Reserved.
5+
#
6+
# SPDX-License-Identifier: Apache-2.0
7+
#
8+
9+
rm -rf $GOPATH/src/github.com/hyperledger/fabric-sdk-node
10+
11+
WD="$GOPATH/src/github.com/hyperledger/fabric-sdk-node"
12+
SDK_REPO_NAME=fabric-sdk-node
13+
git clone https://github.com/hyperledger/$SDK_REPO_NAME $WD
14+
cd $WD
15+
git checkout tags/v1.0.0-rc1
16+
cd test/fixtures
17+
docker rm -f "$(docker ps -aq)" || true
18+
docker-compose up >> node_dockerlogfile.log 2>&1 &
19+
sleep 10
20+
docker ps -a
21+
cd ../.. && npm install
22+
npm config set prefix ~/npm && npm install -g gulp && npm install -g istanbul
23+
gulp || true
24+
gulp ca || true
25+
rm -rf node_modules/fabric-ca-client && npm install
26+
gulp test
27+
28+
docker rm -f "$(docker ps -aq)" || true

0 commit comments

Comments
 (0)