mirror of
https://github.com/Sea-Haven-Industries/meal-order-manager.git
synced 2026-09-30 12:23:13 +00:00
Wall-clock skip windows dropped the only weekly SQS attempt when Scheduler already fired in Eastern time. Dev schedules stay disabled.
43 lines
1.4 KiB
Python
43 lines
1.4 KiB
Python
"""email_report and the Lambda/API Gateway surface stay gone (PLAT-135 / PLAT-215)."""
|
|
|
|
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()
|
|
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()
|
|
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
|
|
|
|
|
|
def test_job_schedules_disabled_outside_prod():
|
|
scheduler = (TERRAFORM / "scheduler.tf").read_text()
|
|
assert 'state = local.is_prod ? "ENABLED" : "DISABLED"' in scheduler
|