fix(cd): run b5 database outside test container
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 1s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 1m6s
CD Pipeline / build-and-deploy (push) Successful in 5m31s
CD Pipeline / post-deploy-checks (push) Has been cancelled
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 1s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 1m6s
CD Pipeline / build-and-deploy (push) Successful in 5m31s
CD Pipeline / post-deploy-checks (push) Has been cancelled
This commit is contained in:
@@ -1001,10 +1001,10 @@ def test_post_start_recovery_verifiers_stay_on_controlled_runtime_profile() -> N
|
||||
assert source in text
|
||||
|
||||
|
||||
def test_controlled_runtime_skips_b5_before_docker_socket_use() -> None:
|
||||
def test_controlled_runtime_skips_b5_before_outer_docker_use() -> None:
|
||||
text = _workflow_text()
|
||||
b5_start = text.index("- name: Integration Tests (B5")
|
||||
docker_socket = text.index("-v /var/run/docker.sock:/var/run/docker.sock", b5_start)
|
||||
outer_docker = text.index("if ! docker info >/dev/null 2>&1; then", b5_start)
|
||||
persisted_profile_write = text.index('> .awoooi-cd-test-profile')
|
||||
persisted_profile_read = text.index(
|
||||
'tr -d \'\\r\\n\' < .awoooi-cd-test-profile',
|
||||
@@ -1017,7 +1017,7 @@ def test_controlled_runtime_skips_b5_before_docker_socket_use() -> None:
|
||||
exit_zero = text.index("exit 0", controlled_gate)
|
||||
assert persisted_profile_write < b5_start
|
||||
assert b5_start < persisted_profile_read < controlled_gate
|
||||
assert controlled_gate < exit_zero < docker_socket
|
||||
assert controlled_gate < exit_zero < outer_docker
|
||||
|
||||
|
||||
def test_metadata_only_marker_skips_deploy_jobs_after_tests() -> None:
|
||||
@@ -1033,19 +1033,25 @@ def test_metadata_only_marker_skips_deploy_jobs_after_tests() -> None:
|
||||
assert "metadata-only controlled-runtime fixes already run the" in text
|
||||
|
||||
|
||||
def test_b5_full_profile_fails_fast_when_docker_socket_or_db_network_is_unready() -> None:
|
||||
def test_b5_full_profile_uses_outer_docker_for_db_without_inner_socket_mount() -> None:
|
||||
text = _workflow_text()
|
||||
b5_block = text.split("- name: Integration Tests (B5", 1)[1]
|
||||
b5_block = b5_block.split("- name: Clean Test Workspace Artifacts", 1)[0]
|
||||
|
||||
assert "set -euo pipefail" in b5_block
|
||||
assert "docker info >/dev/null 2>&1" in b5_block
|
||||
assert "BLOCKER b5_docker_socket_unavailable" in b5_block
|
||||
assert "BLOCKER b5_outer_docker_unavailable" in b5_block
|
||||
assert "B5_DB_CONTAINER=\"pg-test-b5-${B5_RUN_ID_SAFE}\"" in b5_block
|
||||
assert 'B5_DB_HOST="${B5_DB_HOST:-pg-test-b5}"' in b5_block
|
||||
assert "--network-alias pg-test-b5" in b5_block
|
||||
assert "--network \"$B5_NET\"" in b5_block
|
||||
assert "-v /var/run/docker.sock:/var/run/docker.sock" not in b5_block
|
||||
assert "docker rm -f pg-test-b5 || true" not in b5_block
|
||||
assert "B5_DB_READY=0" in b5_block
|
||||
assert "BLOCKER b5_pg_test_container_not_ready" in b5_block
|
||||
assert "--user 0:0" in b5_block
|
||||
assert b5_block.index("docker info >/dev/null 2>&1") < b5_block.index(
|
||||
"docker run -d --name pg-test-b5"
|
||||
"docker run -d --name \"$B5_DB_CONTAINER\""
|
||||
)
|
||||
assert b5_block.index("BLOCKER b5_pg_test_container_not_ready") < b5_block.index(
|
||||
"/opt/api-venv/bin/pytest tests/integration/test_b5_core_flows.py"
|
||||
|
||||
Reference in New Issue
Block a user