Skip to content

Commit b273510

Browse files
author
Obada Haddad
committed
fix compose exec command; change circle-ci config
1 parent ed659c6 commit b273510

2 files changed

Lines changed: 24 additions & 67 deletions

File tree

.circleci/config.yml

Lines changed: 23 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,115 +1,72 @@
11
version: 2
2-
executors:
3-
main_executor:
4-
machine:
5-
image: ubuntu-2204:2024.01.2
6-
resource_class: large
2+
73
jobs:
8-
build:
4+
test:
95
machine:
106
image: ubuntu-2204:2024.01.2
117
resource_class: large
128
steps:
139
- checkout
14-
- run:
15-
# NOTE: To connect to this, use an SSH tunnel in front, like so..
16-
#
17-
# In one terminal:
18-
# $ ssh -p PORT ubuntu@CIRCLE_IP_ADDRESS -L 5900:localhost:5900
19-
#
20-
# In another terminal:
21-
# $ open vnc://0.0.0.0:5900
22-
name: "Setup: Enable VNC access"
23-
command: |
24-
sudo apt-get update
25-
sudo apt-get install -y x11vnc
26-
# x11vnc -forever -nopw
27-
background: true
28-
2910
- run:
3011
name: "Setup: Copy environment variables"
3112
command: cp .env_circleci .env
3213

3314
- run:
3415
name: "Setup: Create directories for MinIO (cannot be made by docker for some reason)"
3516
command: |
36-
sudo mkdir -p var/minio/public
37-
sudo mkdir -p var/minio/private
17+
mkdir -p var/minio/public
18+
mkdir -p var/minio/private
3819
- run:
3920
name: "Setup: Prepare the playwright environment"
4021
command: |
41-
cd tests
42-
yarn install
43-
background: true
22+
cd playwrightPython
23+
curl -LsSf https://astral.sh/uv/install.sh | sh
24+
$HOME/.local/bin/uv sync
25+
$HOME/.local/bin/uv run playwright install --with-deps
4426
- run:
4527
name: "Docker: Build containers and collect static files"
4628
command: |
47-
docker compose -f docker-compose.yml -f docker-compose.selenium.yml -f docker-compose.playwright.yml up -d
29+
docker compose -f docker-compose.yml -f docker-compose.selenium.yml up -d
4830
docker compose -f docker-compose.yml -f docker-compose.selenium.yml exec django python manage.py collectstatic --noinput
4931
docker compose -f docker-compose.yml -f docker-compose.selenium.yml exec django python manage.py migrate
5032
docker compose -f docker-compose.yml exec django python ./manage.py createsuperuser --no-input
5133
34+
- run:
35+
name: "Lint: Check code style with flake8"
36+
command: docker compose -f docker-compose.yml -f docker-compose.selenium.yml exec django flake8 src/
37+
5238
- run:
5339
name: "Docker: Pull required images"
5440
# not available without "not e2e" tests as they pull ahead of time
5541
command: |
5642
docker pull codalab/codalab-legacy:py37
57-
docker pull codalab/codalab-legacy:py3
58-
docker pull vergilgxw/autotable:v2
59-
background: true
60-
linter:
61-
machine:
62-
image: ubuntu-2204:2024.01.2
63-
resource_class: large
64-
steps:
65-
- run:
66-
name: "Lint: Check code style with flake8"
67-
command: docker-compose exec django flake8 src/
68-
- store_artifacts:
69-
path: artifacts/
70-
unit_tests:
71-
machine:
72-
image: ubuntu-2204:2024.01.2
73-
resource_class: large
74-
steps:
43+
docker pull codalab/codalab-legacy:py3
44+
7545
- run:
7646
name: "Tests: Run unit/integration tests (excluding e2e)"
7747
command: docker compose -f docker-compose.yml -f docker-compose.selenium.yml exec django py.test src/ -m "not e2e"
78-
- store_artifacts:
79-
path: artifacts/
80-
e2e_tests:
81-
machine:
82-
image: ubuntu-2204:2024.01.2
83-
resource_class: large
84-
steps:
48+
8549
# - run:
8650
# name: "Tests: Run end-to-end (E2E) tests"
8751
# command: docker compose -f docker-compose.yml -f docker-compose.selenium.yml exec django py.test src/tests/functional/ -m e2e
8852
# no_output_timeout: 60m
8953
- run:
9054
name: "Tests: Run end-to-end (E2E) tests"
9155
command: |
92-
cd tests && PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:3000/ yarn playwright test
93-
no_output_timeout: 10m
56+
cd playwrightPython && $HOME/.local/bin/uv run pytest test_auth.py test_account_creation.py test_submission.py
57+
no_output_timeout: 30m
58+
9459
# Example to run specific set of tests (for debugging individual tests from a batch of tests)
9560
# - run:
9661
# name: e2e tests - competitions
9762
# command: docker compose -f docker-compose.yml -f docker-compose.selenium.yml exec django py.test src/tests/functional/test_competitions.py -m e2e
9863
# no_output_timeout: 60m
9964

65+
- store_artifacts:
66+
path: artifacts/
67+
10068
workflows:
10169
version: 2
10270
build_and_test:
10371
jobs:
104-
- build
105-
- linter:
106-
requires:
107-
- build
108-
- unit_tests:
109-
requires:
110-
- build
111-
- linter
112-
- e2e_tests:
113-
requires:
114-
- build
115-
- linter
72+
- test

.github/workflows/tests_pytest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
needs: [build]
3636
steps:
3737
- name: "Lint: Check code style with flake8"
38-
run: docker compose -f docker-compose.yml -f docker-compose.selenium.yml django flake8 src/
38+
run: docker compose -f docker-compose.yml -f docker-compose.selenium.yml exec django flake8 src/
3939
unit_tests:
4040
name: Unit test with Selenium
4141
runs-on: self-hosted

0 commit comments

Comments
 (0)