Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

e2e tests #250

Merged
merged 52 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
56105cd
First setup for e2e tests
cbroeren Sep 17, 2024
f8acb26
Remove node_modules from git history
cbroeren Sep 18, 2024
326fa29
Add first tests as an example
cbroeren Sep 18, 2024
161dc88
auto format code
cbroeren Sep 19, 2024
a7416aa
Add first visual editor drag-and-drop tests
cbroeren Sep 23, 2024
8abcfa7
Some missing changes after merge conflict
cbroeren Sep 23, 2024
acc7fdc
Add test for DnD persistency (note: needs db reset after each test)
cbroeren Sep 26, 2024
0f0f8e8
First generic tests for visual editor
cbroeren Sep 26, 2024
ca52951
Spawn dynamic site in a new node
leandrocp Sep 26, 2024
3bd6158
clean up
leandrocp Sep 26, 2024
0cdcf2f
format
leandrocp Sep 26, 2024
573b63f
gitignore node_modules
leandrocp Sep 26, 2024
82eb247
Merge branch 'main' into cb/issue-243-e2e-tests
leandrocp Sep 26, 2024
b12d908
Fix index tests: reorder pages
leandrocp Sep 26, 2024
83022b3
update readme
leandrocp Sep 27, 2024
0bab9d8
Merge branch 'main' into cb/issue-243-e2e-tests
leandrocp Sep 27, 2024
62b8885
serve test app with bandit
leandrocp Sep 27, 2024
faadec0
separate :test and :e2e test apps
leandrocp Sep 27, 2024
4ef3cc2
CI: add job to run e2e:test
leandrocp Sep 27, 2024
db332bd
downgrade ubuntu 20
leandrocp Sep 27, 2024
3a2b671
install unzip required by setup-beam
leandrocp Sep 27, 2024
0d91ff3
try to include ssl dev package
leandrocp Sep 27, 2024
ba5c9ca
revert ImageOS env
leandrocp Sep 27, 2024
cbc060f
fix OS version and try openssl
leandrocp Sep 27, 2024
f24d226
define tailwind config and version
leandrocp Sep 27, 2024
3369c59
start pg and epmd
leandrocp Sep 27, 2024
ecec843
start beacon in same node
leandrocp Oct 1, 2024
b02c218
sandbox env
leandrocp Oct 1, 2024
2486a4a
format
leandrocp Oct 1, 2024
447284a
Merge branch 'main' into cb/issue-243-e2e-tests
leandrocp Oct 1, 2024
97f1d4e
auto format code
leandrocp Oct 1, 2024
e99779b
data-test-id -> data-testid
leandrocp Oct 3, 2024
0437eaa
use :testing mode and fix tests
leandrocp Oct 3, 2024
56cd754
use better suitted report for each env
leandrocp Oct 3, 2024
c257847
auto format code
leandrocp Oct 3, 2024
c6fe6df
use beacon-test branch
leandrocp Oct 3, 2024
5203d51
separate DBs
leandrocp Oct 3, 2024
4567718
fix default e2e DB name
leandrocp Oct 3, 2024
46adef3
inspect repo
leandrocp Oct 3, 2024
52dc015
beacon main
leandrocp Oct 11, 2024
4fc8840
Merge branch 'main' into cb/issue-243-e2e-tests
leandrocp Oct 16, 2024
cde79da
Test executing on the host OS
leandrocp Oct 16, 2024
5f3129a
remove envs
leandrocp Oct 16, 2024
27ab048
use external action to manage OS deps
leandrocp Oct 16, 2024
96f0158
fix regular test and limit e2e to 1 worker
leandrocp Oct 16, 2024
d91afd1
skip failing tests
leandrocp Oct 16, 2024
6ef1b1b
organize
leandrocp Oct 17, 2024
fd4d38b
auto format code
leandrocp Oct 17, 2024
192316f
move fixtures to e2e/support/
leandrocp Oct 17, 2024
a5182ae
clean up
leandrocp Oct 17, 2024
94d6441
fix ci
leandrocp Oct 17, 2024
3fa7748
fix ci
leandrocp Oct 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
114 changes: 98 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@ on:
paths-ignore:
- 'guides/**'


permissions:
contents: write

jobs:
test:
name: "test: OTP ${{matrix.otp}} | Elixir ${{matrix.elixir}} | Phoenix ${{matrix.phoenix}} | LiveView ${{matrix.phoenix-live-view}} | PG ${{matrix.postgres}}"
name: "test: OTP ${{matrix.otp}} | Elixir ${{matrix.elixir}} | Phoenix ${{matrix.phoenix}} | LV ${{matrix.phoenix-live-view}}"

strategy:
fail-fast: false
Expand All @@ -25,19 +24,19 @@ jobs:
# minimum required versions
- otp: "25.1"
elixir: "1.14.0"
phoenix-version: "1.7.0"
phoenix-live-view-version: "0.20.2"
phoenix: "1.7.0"
phoenix-live-view: "0.20.2"

# latest
- otp: "27"
elixir: "1.17"
phoenix-version: "~> 1.7"
phoenix-live-view-version: "~> 0.20"
phoenix: "~> 1.7"
phoenix-live-view: "~> 0.20"

env:
MIX_ENV: test
PHOENIX_VERSION: ${{matrix.phoenix-version}}
PHOENIX_LIVE_VIEW_VERSION: ${{matrix.phoenix-live-view-version}}
PHOENIX_VERSION: ${{matrix.phoenix}}
PHOENIX_LIVE_VIEW_VERSION: ${{matrix.phoenix-live-view}}

runs-on: ubuntu-20.04

Expand Down Expand Up @@ -73,9 +72,9 @@ jobs:
path: |
deps
_build
key: mix-${{ env.MIX_ENV }}-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ matrix.phoenix-version }}-${{ matrix.phoenix-live-view-version }}-${{ hashFiles('**/mix.lock') }}
key: mix-${{ env.MIX_ENV }}-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ matrix.phoenix }}-${{ matrix.phoenix-live-view }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
mix-${{ env.MIX_ENV }}-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ matrix.phoenix-version }}-${{ matrix.phoenix-live-view-version }}-${{ hashFiles('**/mix.lock') }}
mix-${{ env.MIX_ENV }}-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ matrix.phoenix }}-${{ matrix.phoenix-live-view }}-${{ hashFiles('**/mix.lock') }}

- run: mix deps.get

Expand All @@ -88,8 +87,91 @@ jobs:
epmd -daemon
mix test

e2e-test:
name: "e2e-test: OTP ${{matrix.otp}} | Elixir ${{matrix.elixir}} | Phoenix ${{matrix.phoenix}} | LV ${{matrix.phoenix-live-view}}"

strategy:
fail-fast: false
matrix:
include:
# latest
- otp: "27"
elixir: "1.17"
phoenix: "~> 1.7"
phoenix-live-view: "~> 0.20"

env:
MIX_ENV: e2e
PHOENIX_VERSION: ${{matrix.phoenix}}
PHOENIX_LIVE_VIEW_VERSION: ${{matrix.phoenix-live-view}}

runs-on: ubuntu-20.04
timeout-minutes: 60

services:
postgres:
image: postgres:13.1
env:
POSTGRES_DB: beacon_live_admin_test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install OS packages
uses: ConorMacBride/install-package@v1
with:
apt: unzip openssl

- uses: actions/setup-node@v4
with:
node-version: lts/*

- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
elixir-version: ${{ matrix.elixir }}

- name: Cache mix deps
uses: actions/cache@v4
id: cache-deps
with:
path: |
deps
_build
key: mix-${{ env.MIX_ENV }}-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ matrix.phoenix }}-${{ matrix.phoenix-live-view }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
mix-${{ env.MIX_ENV }}-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ matrix.phoenix }}-${{ matrix.phoenix-live-view }}-${{ hashFiles('**/mix.lock') }}

- name: Restore npm cache
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- run: npm run setup

- run: npm run e2e:setup

- name: Run e2e tests
env:
DATABASE_URL: postgresql://postgres:postgres@localhost:${{job.services.postgres.ports[5432]}}/beacon_live_admin_test
run: npm run e2e:test

quality:
name: "quality: OTP ${{matrix.otp}} | Elixir ${{matrix.elixir}} | Phoenix ${{matrix.phoenix-version}} | LiveView ${{matrix.phoenix-live-view-version}}"
name: "quality: OTP ${{matrix.otp}} | Elixir ${{matrix.elixir}} | Phoenix ${{matrix.phoenix}} | LiveView ${{matrix.phoenix-live-view}}"

strategy:
fail-fast: false
Expand All @@ -98,8 +180,8 @@ jobs:
# latest
- otp: "27"
elixir: "1.17"
phoenix-version: "~> 1.7"
phoenix-live-view-version: "~> 0.20"
phoenix: "~> 1.7"
phoenix-live-view: "~> 0.20"

env:
MIX_ENV: dev
Expand All @@ -114,8 +196,8 @@ jobs:
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
elixir-version: ${{ matrix.elixir }}

- name: Cache mix deps
uses: actions/cache@v4
Expand All @@ -124,9 +206,9 @@ jobs:
path: |
deps
_build
key: mix-${{ env.MIX_ENV }}-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ matrix.phoenix-version }}-${{ matrix.phoenix-live-view-version }}-${{ hashFiles('**/mix.lock') }}
key: mix-${{ env.MIX_ENV }}-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ matrix.phoenix }}-${{ matrix.phoenix-live-view }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
mix-${{ env.MIX_ENV }}-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ matrix.phoenix-version }}-${{ matrix.phoenix-live-view-version }}-${{ hashFiles('**/mix.lock') }}
mix-${{ env.MIX_ENV }}-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ matrix.phoenix }}-${{ matrix.phoenix-live-view }}-${{ hashFiles('**/mix.lock') }}

- run: mix deps.get

Expand Down
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ beacon_live_admin-*.tar

# In case you use Node.js/npm, you want to ignore these.
npm-debug.log
node_modules/
/assets/node_modules/

# Dialyzer PTLs
Expand All @@ -59,3 +60,11 @@ npm-debug.log

# `direnv` local environment config
.envrc

node_modules

# e2e test
/test/e2e/test-results/
/blob-report/
/playwright-report/
/playwright/.cache/
7 changes: 7 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
css/app.css
/assets/vendor/
package-lock.json
/guides/
/priv/static/
*.md
*.yml
File renamed without changes.
3 changes: 0 additions & 3 deletions assets/.prettierignore

This file was deleted.

Loading
Loading