From 0f0a16af9f2ab5e03381ea23765d798c070d0cb8 Mon Sep 17 00:00:00 2001 From: Andrea Fazzi Date: Fri, 7 Feb 2020 12:08:03 +0100 Subject: [PATCH] Add support for recording regression tests --- config/config.yaml | 29 +++++++++++++++++++ config/config_dev.yaml | 29 +++++++++++++++++++ .../oef_regression_test/Dockerfile.selenium | 4 ++- regression_test/.gitignore | 1 + regression_test/Makefile | 10 +++++++ watch_log.bash | 8 +++++ 6 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 config/config.yaml create mode 100644 config/config_dev.yaml create mode 100644 regression_test/.gitignore create mode 100644 regression_test/Makefile create mode 100755 watch_log.bash diff --git a/config/config.yaml b/config/config.yaml new file mode 100644 index 00000000..c644c8be --- /dev/null +++ b/config/config.yaml @@ -0,0 +1,29 @@ +url: "http://localhost:3000" +log_level: 2 +language: "it" + +keys: + cookie_store_key: "something-very-secret" + jwt_signing_key: "secret" + +orm: + connection: "oef:oef@tcp(db:3306)/oef_test" + options: "charset=utf8&parseTime=True&loc=Local" + automigrate: true + regenerate: false + +admin: + username: "admin" + password: "admin" + +subscriber: + password: "subscribe" + +smtp: + host: "localhost" + port: 1025 + username: "" + password: "" + from: "no-reply@olimpiadi-economiaefinanza.it" + bcc: "bcc@fake.org" + subject: "[OEF2020] - Credenziali di accesso della scuola" diff --git a/config/config_dev.yaml b/config/config_dev.yaml new file mode 100644 index 00000000..3d8eedf5 --- /dev/null +++ b/config/config_dev.yaml @@ -0,0 +1,29 @@ +url: "http://localhost:3000" +log_level: 2 +language: "it" + +keys: + cookie_store_key: "something-very-secret" + jwt_signing_key: "secret" + +orm: + connection: "oef:oef@tcp(localhost:3307)/oef_dev" + options: "charset=utf8&parseTime=True&loc=Local" + automigrate: true + regenerate: false + +admin: + username: "admin" + password: "admin" + +subscriber: + password: "subscribe" + +smtp: + host: "localhost" + port: 1025 + username: "" + password: "" + from: "no-reply@olimpiadi-economiaefinanza.it" + bcc: "bcc@fake.org" + subject: "[OEF2020] - Credenziali di accesso della scuola" \ No newline at end of file diff --git a/docker/oef_regression_test/Dockerfile.selenium b/docker/oef_regression_test/Dockerfile.selenium index 6c9d4d1d..1551060a 100644 --- a/docker/oef_regression_test/Dockerfile.selenium +++ b/docker/oef_regression_test/Dockerfile.selenium @@ -1,4 +1,6 @@ FROM selenium/standalone-firefox-debug USER root -RUN apt-get update && apt-get install -y ffmpeg gpac && rm -rf /var/lib/apt/lists/* +RUN apt-get update && apt-get install -y ffmpeg gpac psmisc && rm -rf /var/lib/apt/lists/* + +USER seluser diff --git a/regression_test/.gitignore b/regression_test/.gitignore new file mode 100644 index 00000000..d1b5f6ca --- /dev/null +++ b/regression_test/.gitignore @@ -0,0 +1 @@ +recordings diff --git a/regression_test/Makefile b/regression_test/Makefile new file mode 100644 index 00000000..dcb44042 --- /dev/null +++ b/regression_test/Makefile @@ -0,0 +1,10 @@ +.PHONY: all +.PHONY: test + +test: + docker exec -d oef_regression_test_selenium_1 ffmpeg -y -video_size 1360x1020 -framerate 15 -f x11grab -i :99.0 /tmp/recording.mp4 + go test + docker exec oef_regression_test_selenium_1 killall -s QUIT ffmpeg + docker cp oef_regression_test_selenium_1:/tmp/recording.mp4 recordings/recording.mp4 + +all: test diff --git a/watch_log.bash b/watch_log.bash new file mode 100755 index 00000000..94fd2ea1 --- /dev/null +++ b/watch_log.bash @@ -0,0 +1,8 @@ +#!/bin/bash + +until docker logs --tail 100 -f oef_regression_test +do + docker logs --tail 100 -f oef_regression_test +done + +docker logs --tail 100 -f oef_regression_test