Skip to content

e2e/standard: add tests for backup & restore #253

e2e/standard: add tests for backup & restore

e2e/standard: add tests for backup & restore #253

Workflow file for this run

name: Standard E2E Tests
on:
push:
pull_request:
env:
LOG_LEVEL: DEBUG
jobs:
standard-e2e:
timeout-minutes: 15
# TODO should we use the same container as circle & central?
runs-on: ubuntu-latest
services:
# see: https://docs.github.com/en/[email protected]/actions/using-containerized-services/creating-postgresql-service-containers
postgres:
image: postgres:14.10
env:
POSTGRES_PASSWORD: odktest
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- run: pg_dump --version
- run: sudo apt-get update
- run: sudo apt-get --yes remove --purge 'postgres*'
- run: echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list
- run: wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo tee /etc/apt/trusted.gpg.d/pgdg.asc
- run: sudo apt-get update
- run: sudo apt-get --yes install postgresql-14 postgresql-client-14
- name: Check pg_dump version
run: pg_dump --version && [[ "$(pg_dump --version | cut -d' ' -f3)" = 14.* ]]
# - name: Grant create database permission to jubilant user
# run: psql -c 'ALTER USER jubilant CREATEDB' postgresql://postgres:odktest@localhost/postgres
- uses: actions/checkout@v4
- name: Set node version
uses: actions/setup-node@v4
with:
node-version: 22.12.0
cache: 'npm'
- run: npm ci
- run: node lib/bin/create-docker-databases.js
- name: E2E Test
timeout-minutes: 10
run: ./test/e2e/standard/run-tests.sh
- name: Backup/restore tests
timeout-minutes: 10
run: ./test/e2e/standard/backup-restore.sh
- name: Backend Logs
if: always()
run: "! [[ -f ./server.log ]] || cat ./server.log"