Merge branch 'main' into rename
Keep pouch naming and .pouch/ack project state, and bring in ACK regression mode, deployer test-environment binding, and manage-release updates from main.
This commit is contained in:
+19
-20
@@ -314,7 +314,7 @@ class AckDeliveryValidationTests(unittest.TestCase):
|
||||
|
||||
self.assertEqual(validate_delivery.validate_builtin(contract), [])
|
||||
|
||||
def test_intents_must_point_at_matching_stop_points(self) -> None:
|
||||
def test_test_environment_intent_requires_deployer_binding(self) -> None:
|
||||
contract = valid_contract()
|
||||
contract["intents"] = {
|
||||
"testEnvironment": "review",
|
||||
@@ -323,33 +323,32 @@ class AckDeliveryValidationTests(unittest.TestCase):
|
||||
|
||||
errors = validate_delivery.validate_builtin(contract)
|
||||
self.assertTrue(
|
||||
any("intents.testEnvironment" in item and "validation_ready" in item for item in errors)
|
||||
any("已改为 deployer 绑定" in item for item in errors)
|
||||
)
|
||||
|
||||
contract["intents"]["testEnvironment"] = "local-validation"
|
||||
contract["profiles"]["local-validation"] = {
|
||||
"stopAt": "validation_ready",
|
||||
"steps": [
|
||||
{"id": "build-local", "action": "build", "artifact": "service-deb"},
|
||||
{
|
||||
"id": "deploy-local",
|
||||
"action": "deploy",
|
||||
"artifact": "service-deb",
|
||||
"environment": "test-server",
|
||||
},
|
||||
{
|
||||
"id": "health-local",
|
||||
"action": "health-check",
|
||||
"environment": "test-server",
|
||||
},
|
||||
],
|
||||
}
|
||||
contract["intents"]["testEnvironment"] = {"via": "deployer", "env": "test"}
|
||||
self.assertEqual(validate_delivery.validate_builtin(contract), [])
|
||||
|
||||
contract["intents"]["release"] = "missing-release"
|
||||
errors = validate_delivery.validate_builtin(contract)
|
||||
self.assertTrue(any("未定义 profile 'missing-release'" in item for item in errors))
|
||||
|
||||
def test_test_environment_binding_requires_deployer_env_directory(self) -> None:
|
||||
contract = valid_contract()
|
||||
contract["intents"] = {
|
||||
"testEnvironment": {"via": "deployer", "env": "test"},
|
||||
"release": None,
|
||||
}
|
||||
with tempfile.TemporaryDirectory() as temp_dir:
|
||||
root = Path(temp_dir)
|
||||
errors = validate_delivery.validate_builtin(contract, root)
|
||||
self.assertTrue(
|
||||
any(".pouch/deployer/test" in item for item in errors)
|
||||
)
|
||||
env_dir = root / ".pouch" / "deployer" / "test"
|
||||
env_dir.mkdir(parents=True)
|
||||
self.assertEqual(validate_delivery.validate_builtin(contract, root), [])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user