Skip to content

Commit f5d264c

Browse files
committed
Fix tests
1 parent 69ae5e9 commit f5d264c

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,15 @@ jobs:
5858
--health-interval 2s
5959
--health-timeout 3s
6060
--health-retries 15
61+
redis:
62+
image: redis:7
63+
ports:
64+
- 6379:6379
65+
options: >-
66+
--health-cmd "redis-cli ping"
67+
--health-interval 2s
68+
--health-timeout 3s
69+
--health-retries 15
6170
steps:
6271
- uses: actions/checkout@v3
6372
- name: Set up database extensions
@@ -75,6 +84,8 @@ jobs:
7584
run: uv run pytest tests/ -v
7685
env:
7786
CABOTAGE_SQLALCHEMY_DATABASE_URI: postgresql://postgres@localhost/cabotage_test
87+
CABOTAGE_CELERY_BROKER_URL: redis://localhost:6379/0
88+
CABOTAGE_CELERY_RESULTS_URL: redis://localhost:6379/0
7889
CABOTAGE_TESTING: "True"
7990
FLASK_APP: cabotage.server.wsgi
8091

tests/test_process_github_hook.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
def app():
2626
_app.config["TESTING"] = True
2727
_app.config["WTF_CSRF_ENABLED"] = False
28+
_app.config["CABOTAGE_OMNIBUS_BUILDS"] = False
2829
with _app.app_context():
2930
yield _app
3031

@@ -355,6 +356,7 @@ def test_ignores_non_bot_creator(
355356
result = process_deployment_hook(hook)
356357
assert result is False
357358

359+
@patch("cabotage.celery.tasks.github.run_omnibus_build")
358360
@patch("cabotage.celery.tasks.github.run_image_build")
359361
@patch("cabotage.celery.tasks.github.post_deployment_status_update")
360362
@patch("cabotage.celery.tasks.github.github_session")
@@ -365,6 +367,7 @@ def test_creates_image_and_triggers_build(
365367
mock_session,
366368
mock_post_status,
367369
mock_build,
370+
mock_omnibus_build,
368371
db_session,
369372
project,
370373
environment,

0 commit comments

Comments
 (0)