2026-09-21 19:34:24 +00:00
|
|
|
"""email_report and the Lambda/API Gateway surface stay gone (PLAT-135 / PLAT-215)."""
|
2026-09-10 19:29:58 +00:00
|
|
|
|
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
|
|
|
TERRAFORM = ROOT / "terraform"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_email_report_handler_removed():
|
|
|
|
|
assert not (ROOT / "functions" / "email_report").exists()
|
2026-09-21 19:34:24 +00:00
|
|
|
assert not (ROOT / "functions").exists()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_lambda_and_api_gateway_packaging_removed():
|
|
|
|
|
for name in (
|
|
|
|
|
"lambda.tf",
|
|
|
|
|
"apigateway.tf",
|
|
|
|
|
"events.tf",
|
|
|
|
|
"artifacts.tf",
|
|
|
|
|
"build_packages.sh",
|
|
|
|
|
"build_packages_external.sh",
|
|
|
|
|
):
|
|
|
|
|
assert not (TERRAFORM / name).exists()
|
|
|
|
|
assert not (ROOT / "template.yaml").exists()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_email_report_not_in_remaining_config():
|
|
|
|
|
locals_tf = (TERRAFORM / "locals.tf").read_text()
|
|
|
|
|
iam_tf = (TERRAFORM / "iam.tf").read_text()
|
|
|
|
|
alarms = (TERRAFORM / "alarms.tf").read_text()
|
|
|
|
|
outputs = (TERRAFORM / "outputs.tf").read_text()
|
|
|
|
|
variables = (TERRAFORM / "variables.tf").read_text()
|
2026-09-10 19:29:58 +00:00
|
|
|
assert '"email_report"' not in locals_tf
|
|
|
|
|
assert "ses:SendRawEmail" not in iam_tf
|
|
|
|
|
assert "email-report" not in alarms
|
|
|
|
|
assert "email_report" not in outputs
|
|
|
|
|
assert "payroll_email" not in variables
|
|
|
|
|
assert "sender_email" not in variables
|
|
|
|
|
|
|
|
|
|
|
2026-09-21 19:34:24 +00:00
|
|
|
def test_job_schedules_disabled_outside_prod():
|
|
|
|
|
scheduler = (TERRAFORM / "scheduler.tf").read_text()
|
|
|
|
|
assert (
|
|
|
|
|
'state = local.is_prod ? "ENABLED" : "DISABLED"'
|
|
|
|
|
in scheduler
|
|
|
|
|
)
|