Naive attempt at improving our end-to-end tests in Github Actions

This commit is contained in:
Michael Telatynski 2021-06-18 18:32:45 +01:00 committed by Germain Souquet
parent b380e43e4f
commit 6c64f564e4
3 changed files with 25 additions and 12 deletions

View file

@ -11,10 +11,13 @@ jobs:
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: End-to-End tests - name: Prepare End-to-End tests
run: ./scripts/ci/end-to-end-tests.sh run: ./scripts/ci/prepare-end-to-end-tests.sh
- name: Run End-to-End tests
run: ./scripts/ci/run-end-to-end-tests.sh
- name: Archive logs - name: Archive logs
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
if: ${{ always() }}
with: with:
path: | path: |
test/end-to-end-tests/logs/**/* test/end-to-end-tests/logs/**/*

View file

@ -1,8 +1,4 @@
#!/bin/bash #!/bin/bash
#
# script which is run by the CI build (after `yarn test`).
#
# clones element-web develop and runs the tests against our version of react-sdk.
set -ev set -ev
@ -19,7 +15,7 @@ cd element-web
element_web_dir=`pwd` element_web_dir=`pwd`
CI_PACKAGE=true yarn build CI_PACKAGE=true yarn build
cd .. cd ..
# run end to end tests # prepare end to end tests
pushd test/end-to-end-tests pushd test/end-to-end-tests
ln -s $element_web_dir element/element-web ln -s $element_web_dir element/element-web
# PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true ./install.sh # PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true ./install.sh
@ -28,9 +24,4 @@ echo "--- Install synapse & other dependencies"
./install.sh ./install.sh
# install static webserver to server symlinked local copy of element # install static webserver to server symlinked local copy of element
./element/install-webserver.sh ./element/install-webserver.sh
rm -r logs || true
mkdir logs
echo "+++ Running end-to-end tests"
TESTS_STARTED=1
./run.sh --no-sandbox --log-directory logs/
popd popd

View file

@ -0,0 +1,19 @@
#!/bin/bash
set -ev
handle_error() {
EXIT_CODE=$?
exit $EXIT_CODE
}
trap 'handle_error' ERR
# run end to end tests
pushd test/end-to-end-tests
rm -r logs || true
mkdir logs
echo "--- Running end-to-end tests"
TESTS_STARTED=1
./run.sh --no-sandbox --log-directory logs/
popd