Skip to content

Commit 78c76d8

Browse files
authored
Merge pull request alephdata#3700 from alephdata/playwright-fixes
Playwright fixes (cherry-picked from develop)
2 parents 335e0b8 + 0ee224c commit 78c76d8

File tree

7 files changed

+31
-22
lines changed

7 files changed

+31
-22
lines changed

.github/dependabot.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,20 @@ updates:
1111
patterns:
1212
- "bump2version"
1313
- "black"
14-
- "playwright"
1514
- "pytest*"
1615
- "ruff"
1716

17+
- package-ecosystem: pip
18+
directory: "/e2e"
19+
schedule:
20+
interval: monthly
21+
open-pull-requests-limit: 99
22+
target-branch: develop
23+
groups:
24+
e2e-dependencies:
25+
patterns:
26+
- "*"
27+
1828
- package-ecosystem: npm
1929
directory: "/ui"
2030
schedule:
@@ -50,13 +60,6 @@ updates:
5060
open-pull-requests-limit: 99
5161
target-branch: develop
5262

53-
- package-ecosystem: docker
54-
directory: "/e2e"
55-
schedule:
56-
interval: monthly
57-
open-pull-requests-limit: 99
58-
target-branch: develop
59-
6063
- package-ecosystem: github-actions
6164
directory: "/"
6265
schedule:

Makefile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ COMPOSE_E2E=docker-compose -f docker-compose.dev.yml -f docker-compose.e2e.yml
33
APPDOCKER=$(COMPOSE) run --rm app
44
UIDOCKER=$(COMPOSE) run --no-deps --rm ui
55
ALEPH_TAG=latest
6+
BLACK_FLAGS=--exclude aleph/migrate
67

78
all: build upgrade web
89

@@ -28,13 +29,13 @@ lint-ui:
2829
$(UIDOCKER) npm run lint
2930

3031
format:
31-
black aleph/
32+
black $(BLACK_FLAGS) aleph/
3233

3334
format-ui:
3435
$(UIDOCKER) npm run format
3536

3637
format-check:
37-
black --check aleph/
38+
black --check $(BLACK_FLAGS) aleph/
3839

3940
format-check-ui:
4041
$(UIDOCKER) npm run format:check
@@ -75,7 +76,7 @@ build-ui:
7576
docker build -t ghcr.io/alephdata/aleph-ui-production:$(ALEPH_TAG) -f ui/Dockerfile.production ui
7677

7778
build-e2e:
78-
$(COMPOSE_E2E) build
79+
$(COMPOSE_E2E) build --build-arg PLAYWRIGHT_VERSION=$(shell awk -F'==' '/^playwright==/ { print $$2 }' e2e/requirements.txt)
7980

8081
build-full: build build-ui build-e2e
8182

@@ -111,9 +112,10 @@ e2e: services-e2e e2e/test-results
111112
$(COMPOSE_E2E) run --rm app aleph upgrade
112113
$(COMPOSE_E2E) run --rm app aleph createuser --name="E2E Admin" --admin --password="admin" admin@admin.admin
113114
$(COMPOSE_E2E) up -d api ui worker
114-
BASE_URL=http://ui:8080 $(COMPOSE_E2E) run --rm e2e pytest -s -v --output=/e2e/test-results/ --screenshot=only-on-failure --video=retain-on-failure e2e/
115+
BASE_URL=http://ui:8080 $(COMPOSE_E2E) run --rm --build-arg PLAYWRIGHT_VERSION=$(shell awk -F'==' '/^playwright==/ { print $$2 }' e2e/requirements.txt) e2e pytest -s -v --output=/e2e/test-results/ --screenshot=only-on-failure --video=retain-on-failure e2e/
115116

116117
e2e-local-setup: dev
118+
python3 -m pip install -q -r e2e/requirements.txt
117119
playwright install
118120

119121
e2e-local:

aleph/logic/profiles.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
1414
Outside of its own collection, any entity can be linked to any number of profiles.
1515
"""
16+
1617
import logging
1718
from sqlalchemy import or_
1819
from sqlalchemy.orm import aliased

aleph/tests/test_profiles.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@ def test_decide_xref(self):
2626
assert profile_t1.id == profile_t2.id, (profile_t1, profile_t2)
2727
assert len(profile_t2.items().all()) == 3, profile_t2
2828
assert all(
29-
e.judgement == Judgement.POSITIVE
30-
if e.entity_id.startswith("a")
31-
else Judgement.NEGATIVE
29+
(
30+
e.judgement == Judgement.POSITIVE
31+
if e.entity_id.startswith("a")
32+
else Judgement.NEGATIVE
33+
)
3234
for e in profile_t2.items()
3335
)
3436

e2e/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
FROM mcr.microsoft.com/playwright/python:v1.42.0-focal
2-
COPY entrypoint.sh wait-for ./
1+
ARG PLAYWRIGHT_VERSION
2+
FROM mcr.microsoft.com/playwright/python:v${PLAYWRIGHT_VERSION}
3+
COPY entrypoint.sh wait-for requirements.txt ./
34
RUN apt update -y \
45
&& apt install -y netcat wget \
56
&& apt-get -qq -y autoremove \
67
&& apt-get clean \
78
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
8-
RUN pip install pytest-playwright
9+
RUN pip install -r requirements.txt
910
ENTRYPOINT ["./entrypoint.sh"]

e2e/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
playwright==1.43.0
2+
pytest-playwright==0.4.4

requirements-dev.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
bump2version==1.0.1
22
Babel==2.12.1
3-
black==23.12.1
4-
playwright==1.42.0
5-
pytest-playwright==0.4.3
6-
ruff===0.1.9
3+
black==24.3.0
4+
ruff===0.3.5

0 commit comments

Comments
 (0)