mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-03 12:48:46 -04:00
Fix/main build 2 (#2819)
* Removed double slash * Fixing race condition with testing * Created cleaner solution * Keeping flash alive longer so tests finish in main build
This commit is contained in:
@@ -629,10 +629,10 @@
|
||||
"filename": "tests/conftest.py",
|
||||
"hashed_secret": "f8377c90fcfd699f0ddbdcb30c2c9183d2d933ea",
|
||||
"is_verified": false,
|
||||
"line_number": 3267,
|
||||
"line_number": 3279,
|
||||
"is_secret": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"generated_at": "2025-07-31T21:07:14Z"
|
||||
"generated_at": "2025-08-07T18:05:06Z"
|
||||
}
|
||||
|
||||
3
.github/workflows/checks.yml
vendored
3
.github/workflows/checks.yml
vendored
@@ -101,7 +101,8 @@ jobs:
|
||||
# above make e2e-test
|
||||
|
||||
run: |
|
||||
make run-flask-and-wait > admin-server.log 2>&1 &
|
||||
make run-flask > admin-server.log 2>&1 &
|
||||
make wait-for-flask
|
||||
tail -f admin-server.log &
|
||||
make e2e-test
|
||||
|
||||
|
||||
6
Makefile
6
Makefile
@@ -44,6 +44,12 @@ watch-frontend: ## Build frontend and watch for changes
|
||||
run-flask: ## Run flask
|
||||
poetry run newrelic-admin run-program flask run -p 6012 --host=0.0.0.0
|
||||
|
||||
.PHONY: wait-for-flask
|
||||
wait-for-flask:
|
||||
@echo "Waiting for Flask to start..."
|
||||
@timeout 30 bash -c 'until curl -sf http://localhost:6012 > /dev/null 2>&1; do sleep 1; done'
|
||||
@echo "Flask is ready!"
|
||||
|
||||
.PHONY: run-flask-and-wait
|
||||
run-flask-and-wait:
|
||||
@make run-flask &
|
||||
|
||||
@@ -556,6 +556,18 @@ def mock_update_service_raise_httperror_duplicate_name(mocker):
|
||||
return mocker.patch("app.service_api_client.update_service", side_effect=_update)
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _disable_e2e_mode_for_unit_tests(monkeypatch, request):
|
||||
"""
|
||||
Disable E2E test mode for all unit tests to prevent unmocked API calls.
|
||||
E2E tests are run in a separate job and should not interfere with unit tests.
|
||||
"""
|
||||
# Only disable if unit tests are not being run
|
||||
if "end_to_end" not in request.node.nodeid:
|
||||
monkeypatch.delenv("NOTIFY_E2E_TEST_EMAIL", raising=False)
|
||||
monkeypatch.delenv("NOTIFY_E2E_TEST_PASSWORD", raising=False)
|
||||
|
||||
|
||||
SERVICE_ONE_ID = "596364a0-858e-42c8-9062-a8fe822260eb"
|
||||
SERVICE_TWO_ID = "147ad62a-2951-4fa1-9ca0-093cd1a52c52"
|
||||
ORGANISATION_ID = "c011fa40-4cbe-4524-b415-dde2f421bd9c"
|
||||
|
||||
Reference in New Issue
Block a user