from pathlib import Path


def test_gcp_readiness_workflow_uses_uploadable_artifact_dir() -> None:
    workflow = Path(".github/workflows/gcp-readiness.yml").read_text()

    assert "service_account:" in workflow
    assert "restore_canary_capsule_b64:" in workflow
    assert "READINESS_SERVICE_ACCOUNT:" in workflow
    assert "RESTORE_CANARY_CAPSULE_B64:" in workflow
    assert "TELEO_GCP_RESTORE_CANARY_CAPSULE=" in workflow
    assert "sa-teleo-readiness@teleo-501523.iam.gserviceaccount.com" in workflow
    assert "sa-artifact-builder@teleo-501523.iam.gserviceaccount.com" not in workflow
    assert "READINESS_ARTIFACT_DIR: gcp-readiness-artifacts" in workflow
    assert 'mkdir -p "${READINESS_ARTIFACT_DIR}"' in workflow
    assert "path: ${{ env.READINESS_ARTIFACT_DIR }}/" in workflow
    assert "Enforce readiness result" in workflow
    assert "GCP readiness checker failed" in workflow
    assert "path: .gcp-readiness/" not in workflow
