-
Notifications
You must be signed in to change notification settings - Fork 955
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BE-654 Add script to setup fabric for GUI e2e test
Use first-network as underlying fabric network for GUI e2e test environment. Add scripts for GUI e2e test to package.json You can run e2e test for GUI manually with the following command: npm run e2e-gui-test Change-Id: I3b2aaced5fa5039268f72975d9502d70e6d5119d Signed-off-by: Atsushi Neki <atsushin@fast.au.fujitsu.com>
- Loading branch information
Showing
6 changed files
with
253 additions
and
18 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
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,91 @@ | ||
#!/bin/bash | ||
|
||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
|
||
ROOTDIR="$(cd "$(dirname "$0")"/.. && pwd)" | ||
export CORE_PEER_NETWORKID=e2egui | ||
export COMPOSE_PROJECT_NAME=$CORE_PEER_NETWORKID | ||
export NETWORK_PROFILE=first-network | ||
|
||
docker rm -f $(docker ps -aq) | ||
docker volume rm -f $(docker volume ls -q) | ||
|
||
TIMEOUT=600 | ||
DELAY=10 | ||
|
||
# | ||
# Setup fabric-samples/first-network | ||
# | ||
pushd $ROOTDIR/app/platform/fabric/e2e-test/fabric-samples/first-network | ||
|
||
rm -rf ../../configs/$CORE_PEER_NETWORKID | ||
rm -rf channel-artifacts/* ordererOrganizations peerOrganizations | ||
|
||
mkdir -p ../../configs/$CORE_PEER_NETWORKID | ||
./byfn.sh generate -c mychannel | ||
|
||
cp -a channel-artifacts ordererOrganizations peerOrganizations ../../configs/$CORE_PEER_NETWORKID | ||
|
||
docker-compose -f docker-compose-cli.yaml down -v | ||
docker-compose -f docker-compose-cli.yaml up -d | ||
|
||
# continue to poll | ||
# we either get a matched keyword, or reach TIMEOUT | ||
rc=1 | ||
starttime=$(date +%s) | ||
while | ||
[[ "$(($(date +%s) - starttime))" -lt "$TIMEOUT" ]] && [[ $rc -ne 0 ]]; | ||
do | ||
sleep $DELAY | ||
set -x | ||
docker logs cli | grep -q "All GOOD, BYFN execution completed" | ||
rc=$? | ||
set +x | ||
done | ||
|
||
popd | ||
|
||
# | ||
# Bring up Explorer | ||
# | ||
pushd $ROOTDIR/app/platform/fabric/e2e-test/docker-compose | ||
docker-compose -f docker-compose-explorer.yaml down -v | ||
docker-compose -f docker-compose-explorer.yaml up -d | ||
|
||
rc=1 | ||
starttime=$(date +%s) | ||
while | ||
[[ "$(($(date +%s) - starttime))" -lt "$TIMEOUT" ]] && [[ $rc -ne 0 ]]; | ||
do | ||
sleep $DELAY | ||
set -x | ||
docker logs explorer.mynetwork.com | grep -q "Please open web browser to access" | ||
rc=$? | ||
set +x | ||
done | ||
|
||
popd | ||
|
||
# | ||
# Start selenium standalone server | ||
# | ||
pushd $ROOTDIR/client/test | ||
docker-compose down | ||
docker-compose up -d | ||
|
||
rc=1 | ||
starttime=$(date +%s) | ||
while | ||
[[ "$(($(date +%s) - starttime))" -lt "$TIMEOUT" ]] && [[ $rc -ne 0 ]]; | ||
do | ||
sleep $DELAY | ||
set -x | ||
docker logs selenium-chrome | grep -q "The node is registered to the hub and ready to use" | ||
rc=$? | ||
set +x | ||
done | ||
|
||
popd |
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
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,28 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
version: '2.1' | ||
|
||
networks: | ||
e2egui-net: | ||
external: | ||
name: e2egui_behave | ||
|
||
services: | ||
chrome: | ||
image: selenium/node-chrome:3.141.59-palladium | ||
container_name: selenium-chrome | ||
volumes: | ||
- /dev/shm:/dev/shm | ||
depends_on: | ||
- hub | ||
environment: | ||
HUB_HOST: hub | ||
networks: | ||
- e2egui-net | ||
|
||
hub: | ||
image: selenium/hub:3.141.59-palladium | ||
container_name: selenium-hub | ||
ports: | ||
- "4444:4444" | ||
networks: | ||
- e2egui-net |
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
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