Skip to content

Commit 3ac4ec0

Browse files
authored
Merge pull request #3877 from alephdata/chore/fix-e2e-locator
e2e test fix: Use newer locator API, make worker start up properly
2 parents 4adad5f + cdebb07 commit 3ac4ec0

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,20 +107,20 @@ e2e/test-results:
107107

108108
services-e2e:
109109
$(COMPOSE_E2E) up -d --remove-orphans \
110-
postgres elasticsearch ingest-file \
110+
postgres elasticsearch ingest-file rabbitmq worker \
111111

112112
e2e: services-e2e e2e/test-results
113113
$(COMPOSE_E2E) run --rm app aleph upgrade
114114
$(COMPOSE_E2E) run --rm app aleph createuser --name="E2E Admin" --admin --password="admin" [email protected]
115-
$(COMPOSE_E2E) up -d api ui worker
116-
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+
$(COMPOSE_E2E) up -d api ui
116+
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 --tracing retain-on-failure e2e/
117117

118118
e2e-local-setup: dev
119119
python3 -m pip install -q -r e2e/requirements.txt
120120
playwright install
121121

122122
e2e-local:
123-
pytest -s -v --screenshot only-on-failure e2e/
123+
pytest -s -v --screenshot only-on-failure --tracing retain-on-failure e2e/
124124

125125
.PHONY: build services e2e
126126

docker-compose.dev.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: "3.2"
2-
31
services:
42
postgres:
53
image: postgres:15
@@ -161,6 +159,8 @@ services:
161159
- aleph.env
162160

163161
worker:
162+
build:
163+
context: .
164164
image: alephdata/aleph:${ALEPH_TAG:-latest}
165165
command: aleph worker
166166
restart: on-failure
@@ -169,6 +169,7 @@ services:
169169
- elasticsearch
170170
- redis
171171
- ingest-file
172+
- rabbitmq
172173
tmpfs:
173174
- /tmp
174175
volumes:

docker-compose.e2e.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: "3.2"
2-
31
services:
42
postgres:
53
environment:
@@ -15,6 +13,10 @@ services:
1513
volumes:
1614
- redis-data-e2e:/data
1715

16+
rabbitmq:
17+
volumes:
18+
- rabbitmq-data-e2e:/var/lib/rabbitmq
19+
1820
api:
1921
volumes:
2022
- archive-data-e2e:/data
@@ -39,6 +41,7 @@ services:
3941
environment:
4042
ALEPH_DATABASE_URI: "postgresql://aleph:aleph@postgres/aleph_e2e"
4143
FTM_STORE_URI: "postgresql://aleph:aleph@postgres/aleph_e2e"
44+
TAGS_DATABASE_URI: "sqlite:///tags.db"
4245

4346
ui:
4447
environment:
@@ -60,9 +63,11 @@ services:
6063
ALEPH_DATABASE_URI: "postgresql://aleph:aleph@postgres/aleph_e2e"
6164
APP_NAME: "aleph-e2e"
6265
FTM_STORE_URI: "postgresql://aleph:aleph@postgres/aleph_e2e"
66+
PROMETHEUS_ENABLE: False
6367

6468
volumes:
6569
archive-data-e2e: {}
6670
elasticsearch-data-e2e: {}
6771
postgres-data-e2e: {}
6872
redis-data-e2e: {}
73+
rabbitmq-data-e2e: {}

e2e/models/investigations.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ def upload_document(self, filename: str):
3535
self.page.get_by_role("dialog", name="Upload documents").get_by_role(
3636
"button", name="Close"
3737
).first.click()
38-
self.page.wait_for_selector("div[role='progressbar']", state="detached")
38+
progress_bar = self.page.locator("div[role='progressbar']").first
39+
progress_bar.wait_for(state="detached")
3940

4041
def open_document(self, name: str):
4142
# TODO can't use exact=True below because the name is actually `Documents 0`

0 commit comments

Comments
 (0)