Skip to content

Commit 97e0076

Browse files
authored
Update E2E tests (#2302)
* Update E2E tests * Add to leaderboard only for submissions expected to work * Update filenames * Fix typos in filenames * Add py312 to images to pull * Relax regex for Failed * Update documentation * Update Running-tests.md
1 parent c8e4643 commit 97e0076

24 files changed

Lines changed: 133 additions & 49 deletions

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ jobs:
4646
name: "Docker: Pull required images"
4747
# not available without "not e2e" tests as they pull ahead of time
4848
command: |
49+
docker pull codalab/codalab-legacy:py312
4950
docker pull codalab/codalab-legacy:py37
5051
docker pull codalab/codalab-legacy:py3
5152
docker pull vergilgxw/autotable:v2

documentation/docs/Developers_and_Administrators/Robot-submissions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ On the Leaderboard, you can see the score details of each of your tasks.
127127

128128
* Create a competition with robot submissions enabled
129129

130-
[Example competition bundle](https://github.com/codalab/competitions-v2/blob/develop/src/tests/functional/test_files/competition.zip)
130+
[Example competition bundle](https://github.com/codalab/competitions-v2/blob/develop/src/tests/functional/test_files/competition_v2_wheat_code.zip)
131131

132132

133133
![Edit Competition Page Allow Bots Checkbox](../_attachments/87486437-3037af00-c5f0-11ea-8edf-e758c969ab84_1752851308355029.jpeg)

documentation/docs/Developers_and_Administrators/Running-tests.md

Lines changed: 57 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ $ docker compose exec django py.test -m "not e2e"
44

55
# Playwright tests (make sure to install uv first: https://docs.astral.sh/uv/getting-started/installation/)
66
uv sync --frozen
7+
uv add playwright
78
uv run playwright install
89
docker compose exec -e DJANGO_SUPERUSER_PASSWORD=codabench django python manage.py createsuperuser --username codabench --email codabench@test.mail --no-input
910
uv run pytest test_auth.py test_account_creation.py test_competition.py test_submission.py
@@ -21,16 +22,60 @@ docker compose -f docker-compose.yml exec django py.test src/ -m "not e2e"
2122

2223
The repo comes with a couple examples that are used during tests:
2324

24-
### v2 test data
25-
```
26-
src/tests/functional/test_files/submission.zip
27-
src/tests/functional/test_files/competition.zip
28-
```
29-
### v1.5 legacy test data
30-
```
31-
src/tests/functional/test_files/submission15.zip
32-
src/tests/functional/test_files/competition15.zip
33-
```
25+
### Codabench (v2) test data
26+
27+
Competition bundles:
28+
29+
```
30+
codabench/tests/test_files/competitions/competition_v2_miniautoml.zip
31+
codabench/tests/test_files/competitions/competition_v2_multi_task.zip
32+
codabench/tests/test_files/competitions/competition_v2_multi_task_fact_sheet.zip
33+
codabench/tests/test_files/competitions/competition_v2_wheat_code.zip
34+
codabench/tests/test_files/competitions/competition_v2_wheat_results.zip
35+
```
36+
37+
And the corresponding submissions:
38+
39+
```
40+
codabench/tests/test_files/submissions/submission_v2_miniautoml.zip
41+
codabench/tests/test_files/submissions/submission_v2_wheat_code.zip
42+
codabench/tests/test_files/submissions/submission_v2_wheat_results.zip
43+
codabench/tests/test_files/submissions/submission_v2_wheat_results_failure.zip
44+
```
45+
46+
### CodaLab (v1.8) test data
47+
48+
Competition bundle:
49+
50+
```
51+
codabench/tests/test_files/competitions/competition_v18_autowsl.zip
52+
```
53+
54+
And the corresponding submission:
55+
56+
```
57+
codabench/tests/test_files/submissions/submission_v18_autowsl.zip
58+
```
59+
60+
### CodaLab (v1.5) test data
61+
62+
Competition bundles:
63+
64+
```
65+
codabench/tests/test_files/competitions/competition_v15_iris.zip
66+
codabench/tests/test_files/competitions/competition_v15_sncf.zip
67+
```
68+
69+
And the corresponding submissions:
70+
71+
```
72+
codabench/tests/test_files/submissions/submission_v15_iris_code.zip
73+
codabench/tests/test_files/submissions/submission_v15_iris_results.zip
74+
codabench/tests/test_files/submissions/submission_v15_sncf.zip
75+
```
3476

35-
### Other Codalab Competition examples
36-
[https://github.com/codalab/competition-examples/tree/master/v2/](https://github.com/codalab/competition-examples/tree/master/v2/)
77+
### Other competition examples
78+
79+
The following repository contains Codabench and CodaLab competition examples:
80+
81+
[https://github.com/codalab/competition-examples/](https://github.com/codalab/competition-examples/)

tests/test_competition.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def test_competition_upload(page: Page):
2525
with page.expect_file_chooser() as fc_info:
2626
page.get_by_role("button", name="").click()
2727
file_chooser = fc_info.value
28-
file_chooser.set_files("test_files/competitions/competition.zip")
28+
file_chooser.set_files("test_files/competitions/competition_v2_wheat_code.zip")
2929
expect(page.get_by_text("Competition created!")).to_be_visible()
3030

3131

@@ -75,7 +75,7 @@ def test_manual_competition_creation(page: Page):
7575
with page.expect_file_chooser() as fc_info:
7676
page.get_by_role("button", name="").click()
7777
file_chooser = fc_info.value
78-
file_chooser.set_files("test_files/competition/test_logo.png")
78+
file_chooser.set_files("test_files/competitions/test_logo.png")
7979
page.locator(".CodeMirror-scroll").first.click()
8080
page.get_by_role("application").get_by_role("textbox").fill("Test Description ")
8181
page.get_by_role("textbox", name="Example: $1000 for the top").click()
-149 KB
Binary file not shown.

tests/test_files/competitions/competition_15_iris.zip renamed to tests/test_files/competitions/competition_v15_iris.zip

File renamed without changes.
File renamed without changes.
File renamed without changes.
675 KB
Binary file not shown.
393 KB
Binary file not shown.

0 commit comments

Comments
 (0)