File tree Expand file tree Collapse file tree
projects/policyengine-apis-integ
tests/simulation_workflow Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -188,4 +188,6 @@ jobs:
188188 full_integ_test_access_token : ${{ steps.get-full-id-token.outputs.id_token }}
189189 full_integ_test_base_url : ${{ needs.deploy.outputs.full_api_url }}
190190 simulation_integ_test_access_token : ${{ steps.get-simulation-id-token.outputs.id_token }}
191- simulation_integ_test_base_url : ${{ needs.deploy.outputs.simulation_api_url }}
191+ simulation_integ_test_base_url : ${{ needs.deploy.outputs.simulation_api_url }}
192+ workflow_integ_test_project_id : ${{ vars.PROJECT_ID }}
193+ workflow_integ_test_us_model_version : ${{ steps.versions.outputs.us_version }}
Original file line number Diff line number Diff line change @@ -131,8 +131,8 @@ jobs:
131131 run : |
132132 cd projects/policyengine-apis-integ
133133 uv sync --extra test
134- # Run tests that don't require authentication
135- uv run pytest tests/full/test_ping.py tests/simulation/test_ping.py -v
134+ # Run tests that don't require GCP credentials
135+ uv run pytest tests/ -v -m "not requires_gcp"
136136
137137 - name : Show service logs on failure
138138 if : failure()
Original file line number Diff line number Diff line change @@ -113,11 +113,12 @@ test-integration: generate-clients
113113 @echo " Make sure services are running with 'make up' first!"
114114 @cd projects/policyengine-apis-integ && \
115115 uv sync --extra test && \
116- uv run pytest tests/full/test_ping.py tests/simulation/test_ping.py -v
116+ uv run pytest tests/ -v -m " not requires_gcp "
117117
118118test-integration-all : generate-clients
119119 @echo " Running all integration tests against local services..."
120120 @echo " Make sure services are running with 'make up' first!"
121+ @echo " Note: Workflow tests will be skipped without GCP credentials"
121122 @cd projects/policyengine-apis-integ && \
122123 uv sync --extra test && \
123124 uv run pytest tests/ -v
Original file line number Diff line number Diff line change @@ -24,6 +24,9 @@ pythonpath = [
2424 " src" ,
2525]
2626testpaths = [" tests" ]
27+ markers = [
28+ " requires_gcp: mark test as requiring GCP credentials and workflow access" ,
29+ ]
2730
2831[tool .uv .sources ]
2932policyengine_api_full_client = { path = " ../policyengine-api-full/artifacts/clients/python" }
Original file line number Diff line number Diff line change 11from pydantic_settings import BaseSettings , SettingsConfigDict
22import pytest
33from .simplified_workflow_client import SimplifiedWorkflowClient
4+ import os
45
56
67class Settings (BaseSettings ):
@@ -15,6 +16,15 @@ class Settings(BaseSettings):
1516settings = Settings ()
1617
1718
19+ # Skip all workflow tests if we don't have proper GCP configuration
20+ pytestmark = pytest .mark .skipif (
21+ settings .project_id == "UNKNOWN_PROJECT_ID" or
22+ settings .us_model_version == "UNKNOWN_US_MODEL_VERSION" or
23+ not os .getenv ("GOOGLE_APPLICATION_CREDENTIALS" , "" ),
24+ reason = "Workflow tests require GCP credentials and configuration"
25+ )
26+
27+
1828@pytest .fixture ()
1929def us_model_version () -> str :
2030 return settings .us_model_version
Original file line number Diff line number Diff line change 1+ import pytest
12from .simplified_workflow_client import SimplifiedWorkflowClient
23from google .cloud .workflows .executions_v1 .types import executions
34
45
6+ @pytest .mark .requires_gcp
57def test_calculate_default_model (client : SimplifiedWorkflowClient ):
68 execution = client .execute (
79 argument = {
@@ -19,6 +21,7 @@ def test_calculate_default_model(client: SimplifiedWorkflowClient):
1921 assert execution .state == executions .Execution .State .SUCCEEDED
2022
2123
24+ @pytest .mark .requires_gcp
2225def test_calculate_specific_model (
2326 client : SimplifiedWorkflowClient , us_model_version : str
2427):
Original file line number Diff line number Diff line change @@ -37,8 +37,11 @@ check_service "api-simulation" 8082
3737check_service " api-tagger" 8083
3838
3939echo " "
40- echo " Running integration tests..."
41- make test-integration
40+ echo " Running integration tests (excluding GCP workflow tests)..."
41+ cd projects/policyengine-apis-integ
42+ uv sync --extra test
43+ uv run pytest tests/ -v -m " not requires_gcp"
44+ cd ../..
4245
4346echo " "
4447echo " Stopping services..."
You can’t perform that action at this time.
0 commit comments