diff --git a/e2e-tests.Dockerfile b/e2e-tests.Dockerfile index 0e81d591..ed9666db 100644 --- a/e2e-tests.Dockerfile +++ b/e2e-tests.Dockerfile @@ -50,7 +50,7 @@ ENV SLACK_WEBHOOK_APPS=$SLACK_WEBHOOK_APPS # https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#running-puppeteer-in-docker RUN export DEBIAN_FRONTEND=noninteractive \ && apt-get update \ - && apt-get install -y wget gnupg curl \ + && apt-get install -y wget gnupg curl unzip \ && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \ && apt-get update \ @@ -69,6 +69,17 @@ RUN export DEBIAN_FRONTEND=noninteractive \ libxext-dev \ --no-install-recommends \ && rm -rf /var/lib/apt/lists/* + +# Install Rclone +RUN curl -O https://downloads.rclone.org/rclone-current-linux-amd64.zip \ + && unzip rclone-current-linux-amd64.zip \ + && cd rclone-*-linux-amd64 \ + && cp rclone /usr/bin/ \ + && chown root:root /usr/bin/rclone \ + && chmod 755 /usr/bin/rclone \ + && mkdir -p /usr/local/share/man/man1 \ + && cp rclone.1 /usr/local/share/man/man1/ \ + && mandb # Copy Puppeteer cache from builder COPY --from=Builder --chown=node:node /root/.cache/puppeteer /home/node/.cache/puppeteer @@ -79,7 +90,10 @@ COPY --from=Builder --chown=node:node /opt/kalisio /opt/kalisio # From now on, run stuff as 'node' USER node -# Run tests +# Grant execute permissions WORKDIR /opt/kalisio/$APP/scripts RUN chmod +x run_e2e_test.sh + +# Run tests +WORKDIR /opt/kalisio/$APP CMD ["bash", "-c", "/opt/kalisio/$APP/scripts/run_e2e_test.sh $APP $SLACK_WEBHOOK_APPS"] \ No newline at end of file diff --git a/scripts/run_e2e_test.sh b/scripts/run_e2e_test.sh index ef289f83..4809bce9 100644 --- a/scripts/run_e2e_test.sh +++ b/scripts/run_e2e_test.sh @@ -7,6 +7,7 @@ SLACK_WEBHOOK=$2 THIS_FILE=$(readlink -f "${BASH_SOURCE[0]}") THIS_DIR=$(dirname "$THIS_FILE") +ROOT_DIR=$(dirname "$THIS_DIR") . "$THIS_DIR/kash/kash.sh" @@ -15,7 +16,12 @@ THIS_DIR=$(dirname "$THIS_FILE") trap 'slack_e2e_report "$APP" "$?" "$SLACK_WEBHOOK"' EXIT -## Run tests +## Run tests & redirect output to a log file ## -cd .. && yarn test:client \ No newline at end of file +yarn test:client > "$ROOT_DIR/test/run/e2e_test_log.txt" 2>&1 + +## Upload logs & screenshots to S3 bucket +## + +#rclone copy "$ROOT_DIR/test/run" ovh:/dev/e2e_test