diff --git a/.buildkite/pipeline.yaml b/.buildkite/pipeline.yaml index c560fccebe..7cb859234e 100644 --- a/.buildkite/pipeline.yaml +++ b/.buildkite/pipeline.yaml @@ -8,17 +8,18 @@ steps: - docker#v3.0.1: image: "node:10" -# - label: ":chains: End-to-End Tests" -# command: -# # TODO: Remove hacky chmod for BuildKite -# - "chmod +x ./scripts/ci/*.sh" -# - "chmod +x ./scripts/*" -# - "sudo apt-get install build-essential python2.7-dev libffi-dev python-pip python-setuptools sqlite3 libssl-dev python-virtualenv libjpeg-dev libxslt1-dev" -# - "./scripts/ci/install-deps.sh" -# - "./scripts/ci/end-to-end-tests.sh" -# plugins: -# - docker#v3.0.1: -# image: "node:10" + - label: ":chains: End-to-End Tests" + command: + # TODO: Remove hacky chmod for BuildKite + - "echo '--- Setup'" + - "chmod +x ./scripts/ci/*.sh" + - "chmod +x ./scripts/*" + - "echo '--- Install js-sdk'" + - "./scripts/ci/install-deps.sh" + - "./scripts/ci/end-to-end-tests.sh" + plugins: + - docker#v3.0.1: + image: "matrixdotorg/riotweb-ci-e2etests-env:latest" - label: ":karma: Tests" agents: diff --git a/scripts/ci/Dockerfile b/scripts/ci/Dockerfile new file mode 100644 index 0000000000..c153d11cc7 --- /dev/null +++ b/scripts/ci/Dockerfile @@ -0,0 +1,9 @@ +# Update on docker hub with the following commands in the directory of this file: +# docker build -t matrixdotorg/riotweb-ci-e2etests-env:latest . +# docker log +# docker push matrixdotorg/riotweb-ci-e2etests-env:latest +FROM node:10 +RUN apt-get update +RUN apt-get -y install build-essential python3-dev libffi-dev python-pip python-setuptools sqlite3 libssl-dev python-virtualenv libjpeg-dev libxslt1-dev uuid-runtime +# dependencies for chrome (installed by puppeteer) +RUN apt-get -y install gconf-service libasound2 libatk1.0-0 libatk-bridge2.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget diff --git a/scripts/ci/end-to-end-tests.sh b/scripts/ci/end-to-end-tests.sh index d0b1a30ce2..0ec26df450 100644 --- a/scripts/ci/end-to-end-tests.sh +++ b/scripts/ci/end-to-end-tests.sh @@ -6,16 +6,38 @@ set -ev +upload_logs() { + echo "--- Uploading logs" + buildkite-agent artifact upload "logs/**/*;synapse/installations/consent/homeserver.log" +} + +handle_error() { + EXIT_CODE=$? + if [ $TESTS_STARTED -eq 1 ]; then + upload_logs + fi + exit $EXIT_CODE +} + +trap 'handle_error' ERR + RIOT_WEB_DIR=riot-web REACT_SDK_DIR=`pwd` + +echo "--- Building Riot" scripts/ci/build.sh # run end to end tests +echo "--- Fetching end-to-end tests from master" scripts/fetchdep.sh matrix-org matrix-react-end-to-end-tests master pushd matrix-react-end-to-end-tests ln -s $REACT_SDK_DIR/$RIOT_WEB_DIR riot/riot-web # PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true ./install.sh # CHROME_PATH=$(which google-chrome-stable) ./run.sh +echo "--- Install synapse & other dependencies" ./install.sh -./run.sh --travis +mkdir logs +echo "+++ Running end-to-end tests" +TESTS_STARTED=1 +./run.sh --no-sandbox --log-directory logs/ popd