Skip to content

E2E tests

E2E tests #331

Workflow file for this run

name: "E2E tests"
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '0 12 * * *'
jobs:
DynamicVersionMatrix:
name: Dynamic version matrix
runs-on: ubuntu-latest
outputs:
matrix: '[
{ tag: "develop", expected: "${{ steps.etherpad-version-cleaned.outputs.version }}" },
{ tag: "${{ steps.etherpad-version-cleaned.outputs.version }}", expected: "${{ steps.etherpad-version-cleaned.outputs.version }}" },
{ tag: "2.1.0", expected: "2.1.0" },
{ tag: "2.0.2", expected: "2.0.2" },
{ tag: "2.0.0", expected: "2.0.0" },
{ tag: "1.9.7", expected: "1.9.7" },
{ tag: "1.8.18", expected: "1.8.18" },
{ tag: "1.8.0", expected: "1.8.0" },
{ tag: "1.7.5", expected: "1.7.5" }
]'
version: ${{ steps.etherpad-version-cleaned.outputs.version }}
steps:
- id: etherpad
uses: pozetroninc/github-action-get-latest-release@master
with:
repository: ether/etherpad-lite
- id: etherpad-version-cleaned
run: |
LATEST_RELEASE=${{ steps.etherpad.outputs.release }}
CLEANED_VERSION="${LATEST_RELEASE//v/}"
echo "version=$CLEANED_VERSION" >> "$GITHUB_OUTPUT"
EtherpadWithNginxReverseProxy:
name: Docker [1.8.17] + Nginx (no websocket)
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Start docker containers
run: |
EP_VERSION=1.8.17 docker compose -f ./tests/e2e/docker/docker-compose.no_websocket.yml up -d --wait
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Scan etherpad instance
uses: GuillaumeFalourd/assert-command-line-output@v2.4
with:
command_line: bin/console.php ether:scan -vvv http://localhost:8080 | grep -E "Package version|HTTP/1.1 400" | sed 's/ *$//'
assert_file_path: tests/e2e/fixture/reverse_proxy_no_websocket.txt
expected_result: PASSED
Etherpad2WithNginxReverseProxy:
name: Docker [${{ matrix.versions.tag }}] + Nginx (no websocket)
runs-on: ubuntu-latest
strategy:
matrix:
versions: [
{ tag: "2.2.2", expected: "2.2.2" },
{ tag: "2.0.2", expected: "2.0.2" },
{ tag: "2.0.0", expected: "2.0.0" },
]
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Start docker containers
run: |
EP_VERSION=${{ matrix.versions.tag }} docker compose -f ./tests/e2e/docker/docker-compose.no_websocket.yml up -d --wait
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Scan etherpad instance
uses: GuillaumeFalourd/assert-command-line-output@v2.4
with:
command_line: bin/console.php ether:scan http://localhost:8080
contains: "Package version: ${{ matrix.versions.expected }}"
expected_result: PASSED
- name: Dump docker logs on failure
if: failure()
uses: jwalton/gh-docker-logs@v2
EtherpadWithNginxReverseProxyInSubPath:
name: Docker [${{ matrix.versions.tag }}] + Nginx (with subpath)
runs-on: ubuntu-latest
needs: DynamicVersionMatrix
strategy:
matrix:
versions: ${{ fromJSON(needs.DynamicVersionMatrix.outputs.matrix) }}
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Start docker containers
run: |
EP_VERSION=${{ matrix.versions.tag }} docker compose -f ./tests/e2e/docker/docker-compose.subpath.yml up -d --wait
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Scan etherpad instance
uses: GuillaumeFalourd/assert-command-line-output@v2.4
with:
command_line: bin/console.php ether:scan http://localhost:8080/etherpad
contains: "Package version: ${{ matrix.versions.expected }}"
expected_result: PASSED
EtherpadWithNginxReverseProxyWithoutSubPath:
name: Docker [1.9.7] + Nginx (without subpath)
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Start docker containers
run: |
EP_VERSION=1.9.7 docker compose -f ./tests/e2e/docker/docker-compose.reverse_proxy.yml up -d --wait
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Scan etherpad instance
uses: GuillaumeFalourd/assert-command-line-output@v2.4
with:
command_line: bin/console.php ether:scan http://localhost:8080/test
contains: "Package version: 1.9.7"
expected_result: PASSED
EtherpadWithPlugins:
name: Source [develop] with plugins
runs-on: ubuntu-latest
steps:
- name: Clone etherpad repository
uses: actions/checkout@v4
with:
repository: ether/etherpad-lite
path: etherpad
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: JarvusInnovations/background-action@v1
name: Start etherpad service
with:
run: |
npm install pnpm -g
bin/installDeps.sh
pnpm run plugins i ep_align ep_headings2 ep_table_of_contents ep_font_size ep_spellcheck ep_markdown
bin/run.sh &
wait-on: |
http://localhost:9001
log-output-if: failure
wait-for: 5m
working-directory: etherpad
- name: Checkout repository
uses: actions/checkout@v4
with:
path: app
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress
working-directory: ./app
- name: Scan etherpad instance
uses: GuillaumeFalourd/assert-command-line-output@v2.4
with:
command_line: app/bin/console.php ether:scan http://localhost:9001 | sed 's/ *$//' | grep -vE "(Version is|Package version)" | grep -v "Server running since" | cut -d'@' -f1
assert_file_path: app/tests/e2e/fixture/master_with_plugins.txt
expected_result: PASSED
LatestEtherpad:
name: Docker [latest]
runs-on: ubuntu-latest
needs: DynamicVersionMatrix
services:
etherpad:
image: etherpad/etherpad:latest
ports:
- 9001:9001
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Create expected output file
run: |
cat tests/e2e/fixture/latest.txt | sed 's/$EP_VERSION/${{ needs.DynamicVersionMatrix.outputs.version }}/' > /tmp/latest.txt
- name: Scan etherpad instance
uses: GuillaumeFalourd/assert-command-line-output@v2.4
with:
command_line: bin/console.php ether:scan http://localhost:9001 | sed 's/ *$//' | grep -v "Server running since"
assert_file_path: /tmp/latest.txt
expected_result: PASSED
EtherpadDifferentVersion:
name: Docker [${{ matrix.versions.tag }}]
runs-on: ubuntu-latest
needs: DynamicVersionMatrix
services:
etherpad:
image: etherpad/etherpad:${{ matrix.versions.tag }}
ports:
- 9001:9001
strategy:
matrix:
versions: ${{ fromJSON(needs.DynamicVersionMatrix.outputs.matrix) }}
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Scan etherpad instance
uses: GuillaumeFalourd/assert-command-line-output@v2.4
with:
command_line: bin/console.php ether:scan http://localhost:9001
contains: "Package version: ${{ matrix.versions.expected }}"
expected_result: PASSED