diff --git a/.travis.yml b/.travis.yml index d428abed..23b6529e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,7 @@ addons: before_install: - pip install coveralls flake8 coverage beautifulsoup4 py-dateutil pytz selenium + - gem install coveralls-lcov before_script: - python3 -m flake8 . @@ -29,8 +30,8 @@ script: - xvfb-run --server-args="-screen 0, 1280x1280x16" tests/python/coverage_run.sh after_success: - - coveralls - - npm coveralls + - coveralls-lcov -v -n coverage/lcov.info > coverage.json + - coveralls --merge=coverage.json notifications: email: diff --git a/docker-compose.yml b/docker-compose.yml index 6d6547f2..723ae729 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,7 +10,7 @@ nginx: - /etc/letsencrypt:/etc/letsencrypt - /tmp:/tmp webapp: - image: "selcolumbia/dokomoforms:0.2.4" + image: "selcolumbia/dokomoforms:0.2.5" command: bash -c "./docker-wait-for-postgres.sh db && head -c 24 /dev/urandom > cookie_secret && python webapp.py" links: - "db:db" diff --git a/installer.sh b/installer.sh index 1349ce45..c2a7863a 100755 --- a/installer.sh +++ b/installer.sh @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# Dokomo Forms installer for version 0.2.4 +# Dokomo Forms installer for version 0.2.5 set -e # Do you have docker installed? @@ -38,6 +38,7 @@ else printf " directory \n" printf "========================================\n" $CURL -o docker-compose -L https://github.com/docker/compose/releases/download/1.5.2/run.sh + sleep 1 chmod +x docker-compose ./docker-compose -v fi @@ -104,8 +105,8 @@ $SUDO openssl dhparam -out /etc/letsencrypt/live/$LETSENCRYPT_DIR/dhparam.pem 20 printf "========================================\n" printf " Downloading configuration files \n" printf "========================================\n" -$CURL -O https://raw.githubusercontent.com/SEL-Columbia/dokomoforms/v0.2.4/docker-compose.yml -$CURL -O https://raw.githubusercontent.com/SEL-Columbia/dokomoforms/v0.2.4/nginx.conf +$CURL -O https://raw.githubusercontent.com/SEL-Columbia/dokomoforms/v0.2.5/docker-compose.yml +$CURL -O https://raw.githubusercontent.com/SEL-Columbia/dokomoforms/v0.2.5/nginx.conf # Edit the configuration files printf "========================================\n" @@ -141,16 +142,6 @@ printf "Administrator user name:\n>>> " read ADMIN_NAME printf "admin_name = '${ADMIN_NAME:-$DEFAULT_NAME}'\n" >> local_config.py -# Let's Encrypt auto-renew (for now this is a cron job). -printf "========================================\n" -printf " Adding monthly cron job to renew SSL \n" -printf " certificate. \n" -printf "========================================\n" -CRON_CMD="mkdir -p /tmp/letsencrypt-auto && docker run -it --rm --name letsencrypt -v /etc/letsencrypt:/etc/letsencrypt:Z -v /var/lib/letsencrypt:/var/lib/letsencrypt:Z -v /tmp/letsencrypt-auto:/tmp/letsencrypt-auto:Z -v /var/log/letsencrypt:/var/log/letsencrypt:Z quay.io/letsencrypt/letsencrypt --renew certonly -a webroot -w /tmp/letsencrypt-auto $DOMAIN_ARGS && docker restart ${USER}_nginx_1" -CRON_JOB="0 0 1 * * $CRON_CMD" -cat <(fgrep -i -v "$CRON_CMD" <(crontab -l)) <(echo "$CRON_JOB") | crontab - -crontab -l - # Bring up Dokomo Forms printf "========================================\n" printf " Starting Dokomo Forms. \n" @@ -163,3 +154,14 @@ if [ -f /etc/redhat-release ] ; then chcon -Rt svirt_sandbox_file_t . fi $DOCKER_COMPOSE up -d +NGINX_CONTAINER_NAME=$($DOCKER_COMPOSE ps | grep nginx | cut -d' ' -f1) + +# Let's Encrypt auto-renew (for now this is a cron job). +printf "========================================\n" +printf " Adding monthly cron job to renew SSL \n" +printf " certificate. \n" +printf "========================================\n" +CRON_CMD="mkdir -p /tmp/letsencrypt-auto && docker run -it --rm --name letsencrypt -v /etc/letsencrypt:/etc/letsencrypt:Z -v /var/lib/letsencrypt:/var/lib/letsencrypt:Z -v /tmp/letsencrypt-auto:/tmp/letsencrypt-auto:Z -v /var/log/letsencrypt:/var/log/letsencrypt:Z quay.io/letsencrypt/letsencrypt --renew certonly -a webroot -w /tmp/letsencrypt-auto $DOMAIN_ARGS && docker restart $NGINX_CONTAINER_NAME" +CRON_JOB="0 0 1 * * $CRON_CMD" +crontab -l | fgrep -i -v "$CRON_CMD" | { cat; echo "$CRON_JOB"; } | crontab - +crontab -l diff --git a/package.json b/package.json index 85d162e8..4e63df61 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,6 @@ "babelify": "^7.2.0", "browserify": "^12.0.1", "browserify-shim": "^3.8.7", - "coveralls": "^2.11.2", "del": "^2.0.2", "eslint-plugin-react": "^3.3.0", "event-stream": "^3.3.1", @@ -127,8 +126,7 @@ } }, "scripts": { - "test": "jest", - "coveralls": "coveralls" + "test": "jest" }, "repository": { "type": "git", diff --git a/tests/python/test_selenium.py b/tests/python/test_selenium.py index fbf19a8c..6480b75e 100644 --- a/tests/python/test_selenium.py +++ b/tests/python/test_selenium.py @@ -849,7 +849,12 @@ def test_edit_user(self): self.sleep() self.click(edit_btn) self.sleep() - self.wait_for_element('user-name') + try: + self.wait_for_element('user-name') + except TimeoutException: + self.click(edit_btn) + self.sleep() + self.wait_for_element('user-name') ( self.drv .find_element_by_id('user-name') @@ -1437,6 +1442,7 @@ def test_change_language(self): self.get('/enumerate/{}'.format(survey_id)) + self.sleep() self.wait_for_element('menu', By.CLASS_NAME) self.click(self.drv.find_element_by_class_name('menu')) lang = Select(self.drv.find_element_by_class_name('language_select'))