Skip to content

Commit a288aec

Browse files
authored
Merge pull request #2995 from auslin-aot/bugfix/fwf-5460-Fix-backend-CI-fails
[Bugfix] Fix backend CI failures
2 parents 7d7ccfb + a289afa commit a288aec

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

.github/workflows/forms-flow-documents-ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ jobs:
7676
SKIP_IN_CI: "True"
7777
USE_DOCKER_MOCK: "True"
7878
JWT_OIDC_TEST_PRIVATE_KEY_PEM: ${{ secrets.JWT_OIDC_TEST_PRIVATE_KEY_PEM }}
79+
FORMIO_TEST_JWT_TOKEN: ${{ secrets.FORMIO_TEST_JWT_TOKEN}}
7980

8081
runs-on: ubuntu-24.04
8182
strategy:

forms-flow-api/tests/unit/api/test_form_process_mapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1140,7 +1140,7 @@ def test_form_flow_builder_update_invalid_payload(app, client, session, jwt, moc
11401140
# Test with empty payload
11411141
payload = {}
11421142
response = client.put(f"/form/form-flow-builder/{mapper_id}", headers=headers, json=payload)
1143-
assert response.status_code == 200 # Empty payload should still return success
1143+
assert response.status_code == 400
11441144

11451145
# Test with invalid form data (missing _id)
11461146
# Form data must include _id for update

forms-flow-documents/sample.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ FORMSFLOW_API_CORS_ORIGINS=*
3636
##Env For Unit Testing
3737
## JWT_OIDC_TEST_PRIVATE_KEY_PEM=
3838
## FLASK_ENV=testing
39+
## FORMIO_TEST_JWT_TOKEN=
3940

4041
#FORMIO configuration
4142
FORMIO_DEFAULT_PROJECT_URL=http://{your-ip-address}:3001

forms-flow-documents/tests/conftest.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Common setup and fixtures for the pytest suite used by this service."""
2+
import os
23
import time
34

45
import pytest
@@ -106,3 +107,13 @@ def get(self, key):
106107
return_value=mock_redis,
107108
) as _mock: # noqa
108109
yield mock_redis
110+
111+
112+
@pytest.fixture(autouse=True)
113+
def mock_formio_access_token():
114+
"""Mock formio access token."""
115+
with patch(
116+
"formsflow_api_utils.services.external.formio.FormioService.get_formio_access_token",
117+
return_value=os.getenv("FORMIO_TEST_JWT_TOKEN"),
118+
):
119+
yield

0 commit comments

Comments
 (0)