Skip to content

Commit

Permalink
Upload services logs in e2e and ultimate tests (#568)
Browse files Browse the repository at this point in the history
  • Loading branch information
k1rill-fedoseev authored May 15, 2021
1 parent 0d72414 commit 98155e3
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 4 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@ jobs:
run: docker login ${DOCKER_REGISTRY} -u ${{ github.actor }} -p ${{ github.token }}
- name: yarn run ${{ matrix.task }}
run: ${{ !matrix.use-cache || steps.cache-repo.outputs.cache-hit }} && yarn run ${{ matrix.task }}
- name: Upload logs
if: always()
uses: actions/upload-artifact@v2
with:
name: logs-${{ matrix.task }}
path: e2e-commons/logs
deployment:
runs-on: ubuntu-latest
needs:
Expand Down Expand Up @@ -210,3 +216,12 @@ jobs:
run: sudo chown -R $USER:docker /var/run/docker.sock
- name: Run oracle e2e tests
run: docker-compose -f ./e2e-commons/docker-compose.yml run -e ULTIMATE=true e2e yarn workspace oracle-e2e run ${{ matrix.task }}
- name: Save logs
if: always()
run: e2e-commons/down.sh
- name: Upload logs
if: always()
uses: actions/upload-artifact@v2
with:
name: logs-ultimate-${{ matrix.task }}
path: e2e-commons/logs
28 changes: 27 additions & 1 deletion e2e-commons/down.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,33 @@
#!/usr/bin/env bash
cd $(dirname $0)

if [ $CI ]; then exit $rc; fi
if [ $CI ]; then
rm -rf logs || true

mkdir ./logs

for project in "" validator{1,2,3}; do
for container in $(docker-compose -p "$project" ps | tail -n +3 | awk '{print $1}') ; do
if [[ -z "$project" ]]; then
path="./logs/$container.log"
else
mkdir -p "./logs/$project"
path="./logs/$project/$container.log"
fi
docker logs "$container" > "$path" 2>&1
done
done

touch ../oracle/.env
for file in ../oracle/docker-compose-{amb,transfer}.yml; do
for container in $(docker-compose -f "$file" ps | tail -n +3 | awk '{print $1}') ; do
mkdir -p "./logs/oracle"
docker logs "$container" > "./logs/oracle/$container.log" 2>&1
done
done

exit $rc;
fi

ps | grep node | grep -v grep | grep -v yarn | awk '{print "kill " $1}' | /bin/bash
docker-compose down
Expand Down
2 changes: 1 addition & 1 deletion monitor-e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "",
"main": "index.js",
"scripts": {
"start": "mocha --timeout 120000",
"start": "mocha --timeout 120000 --exit",
"lint": "eslint . --ignore-path ../.eslintignore"
},
"author": "",
Expand Down
2 changes: 1 addition & 1 deletion oracle-e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "",
"main": "index.js",
"scripts": {
"start": "mocha --exit",
"start": "mocha",
"lint": "eslint . --ignore-path ../.eslintignore",
"amb": "mocha test/amb.js",
"erc-to-native": "mocha test/ercToNative.js",
Expand Down
2 changes: 1 addition & 1 deletion oracle-e2e/test/mocha.opts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
--timeout 120000
--timeout 120000 --exit

0 comments on commit 98155e3

Please sign in to comment.