diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index e6287f3a0..842f9d496 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -1,17 +1,34 @@ name: E2E Tests on: - workflow_dispatch # disabled pending db seeding - # push: - # branches: [ main ] - # pull_request: - # branches: [ main ] + push: + branches: [ main ] + pull_request: + branches: [ main ] jobs: - build: + e2e: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: build containers and run cypress e2e tests - # TODO: seed the database with a sparse(r) dump so there are pages to test.. + + - name: deploy services in e2e mode run: make e2e + + - name: run e2e tests + uses: cypress-io/github-action@v6 + with: + working-directory: e2e + wait-on: "http://localhost:8000" + wait-on-timeout: 300 + + - name: display service logs + if: failure() + run: docker compose -f docker-compose.yml -f e2e.yml logs + + - name: upload cypress videos + if: failure() + uses: actions/upload-artifact@v4 + with: + name: cypress-videos + path: e2e/cypress/videos diff --git a/Makefile b/Makefile index be21cc88a..f9fc5e07d 100644 --- a/Makefile +++ b/Makefile @@ -84,7 +84,7 @@ release-version: .env .PHONY: docker-compose.yml docker-compose.yml: base.yml dev.yml staging.yml prod.yml config.mk $(PGPASS_PATH) release-version case "$(DEPLOY_ENVIRONMENT)" in \ - dev|staging|e2e) docker compose -f base.yml -f $(DEPLOY_ENVIRONMENT).yml config > docker-compose.yml;; \ + dev|staging) docker compose -f base.yml -f $(DEPLOY_ENVIRONMENT).yml config > docker-compose.yml;; \ prod) docker compose -f base.yml -f staging.yml -f $(DEPLOY_ENVIRONMENT).yml config > docker-compose.yml;; \ *) echo "invalid environment. must be either dev, staging or prod" 1>&2; exit 1;; \ esac @@ -140,9 +140,21 @@ clean_deploy: clean test: build docker compose run --rm server /code/deploy/test.sh +# e2e testing setup + +E2E_SHARED_DIR=${DOCKER_SHARED_DIR}/e2e +E2E_BACKUPS_PATH=${E2E_SHARED_DIR}/backups +E2E_REPO_PATH=${E2E_BACKUPS_PATH}/repo + +$(E2E_REPO_PATH): + mkdir -p $(E2E_BACKUPS_PATH) + wget -c ${BORG_REPO_URL} -P $(E2E_BACKUPS_PATH) + tar -Jxf $(E2E_BACKUPS_PATH)/repo.tar.xz -C $(E2E_BACKUPS_PATH) + .PHONY: e2e -e2e: DEPLOY_ENVIRONMENT=e2e -e2e: build - docker compose run server inv collectstatic - docker compose run --rm e2e npm run test - docker compose down +e2e: docker-compose.yml secrets $(DOCKER_SHARED_DIR) $(E2E_REPO_PATH) + docker compose -f docker-compose.yml -f e2e.yml up -d --build + docker compose -f docker-compose.yml -f e2e.yml exec server bash -c "\ + inv borg.restore --force && \ + ./manage.py migrate && \ + inv prepare" diff --git a/django/core/jinja2/common.jinja b/django/core/jinja2/common.jinja index d7786abc0..3a2bb3dda 100644 --- a/django/core/jinja2/common.jinja +++ b/django/core/jinja2/common.jinja @@ -186,9 +186,9 @@
- -
diff --git a/django/core/jinja2/core/events/list.jinja b/django/core/jinja2/core/events/list.jinja index 501d5218d..0c38629eb 100644 --- a/django/core/jinja2/core/events/list.jinja +++ b/django/core/jinja2/core/events/list.jinja @@ -5,7 +5,7 @@ {% macro render_event(item, detail_url_name) %} -
+
diff --git a/django/core/jinja2/core/jobs/list.jinja b/django/core/jinja2/core/jobs/list.jinja index c0d66753a..997e40418 100644 --- a/django/core/jinja2/core/jobs/list.jinja +++ b/django/core/jinja2/core/jobs/list.jinja @@ -7,7 +7,7 @@ {% endblock ogp_tags %} {% macro render_job(item, detail_url_name) %} -
+
diff --git a/django/core/jinja2/core/member_profiles/retrieve.jinja b/django/core/jinja2/core/member_profiles/retrieve.jinja index 204b5df85..addb9cc4b 100644 --- a/django/core/jinja2/core/member_profiles/retrieve.jinja +++ b/django/core/jinja2/core/member_profiles/retrieve.jinja @@ -171,7 +171,7 @@