mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-17 15:35:09 +00:00
[FAB-15897] Improve FabCar test logging
Collect logs from all existing Docker containers instead of just limiting it to a predefined (and incorrect) set. Also clean up the directory structure for the logs, and remove any networks/volumes after each test run. Signed-off-by: Simon Stone <sstone1@uk.ibm.com> Change-Id: Ifcf88baeb9ba4d42f757f7cd23ab2a178ab39b41
This commit is contained in:
parent
dcce485561
commit
9040e28b55
1 changed files with 8 additions and 11 deletions
|
|
@ -3,18 +3,13 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
# docker container list - Check these from basic-network/docker-compose.yaml
|
||||
CONTAINER_LIST=(peer0.org1 orderer ca)
|
||||
|
||||
logs() {
|
||||
|
||||
for CONTAINER in ${CONTAINER_LIST[*]}; do
|
||||
docker logs $CONTAINER.example.com >& $WORKSPACE/$CONTAINER-$1.log
|
||||
echo
|
||||
done
|
||||
# Write couchdb container logs into couchdb.log file
|
||||
docker logs couchdb >& couchdb.log
|
||||
|
||||
LOG_DIRECTORY=$WORKSPACE/fabcar/$1
|
||||
mkdir -p ${LOG_DIRECTORY}
|
||||
CONTAINER_LIST=$(docker ps -a --format '{{.Names}}')
|
||||
for CONTAINER in ${CONTAINER_LIST}; do
|
||||
docker logs ${CONTAINER} > ${LOG_DIRECTORY}/${CONTAINER}.log 2>&1
|
||||
done
|
||||
}
|
||||
|
||||
copy_logs() {
|
||||
|
|
@ -65,5 +60,7 @@ for LANGUAGE in ${LANGUAGES}; do
|
|||
fi
|
||||
docker ps -aq | xargs docker rm -f
|
||||
docker rmi -f $(docker images -aq dev-*)
|
||||
docker volume prune -f
|
||||
docker network prune -f
|
||||
echo -e "\033[32m finished fabcar test (${LANGUAGE})" "\033[0m"
|
||||
done
|
||||
|
|
|
|||
Loading…
Reference in a new issue