unrip/test/ntfy_manifest_test.py
philipp f3676c201f
All checks were successful
deploy / deploy (push) Successful in 33s
Move ntfy ownership to cluster repo
Proof: npm test; PYTHONPATH=. python3 test/render_release_manifest_test.py; PYTHONPATH=. python3 test/repo_deployments_test.py; PYTHONPATH=. python3 test/ntfy_manifest_test.py; kubectl kustomize deploy/k8s/base.

Assumptions: ntfy is a shared cluster utility owned by ../unrip3, while this app repo only consumes the internal ntfy endpoint and keeps publisher-side client/config.

Still fake: No public ntfy ingress, auth token, iOS subscription, or runtime notification emission path is wired yet.
2026-04-16 00:22:08 +02:00

26 lines
1.1 KiB
Python

import pathlib
import unittest
ROOT = pathlib.Path(__file__).resolve().parents[1]
class NtfyManifestTest(unittest.TestCase):
def test_app_kustomization_does_not_own_cluster_ntfy_resources(self):
source = (ROOT / 'deploy/k8s/base/kustomization.yaml').read_text()
self.assertNotIn('utility-namespace.yaml', source)
self.assertNotIn('ntfy.yaml', source)
self.assertFalse((ROOT / 'deploy/k8s/base/utility-namespace.yaml').exists())
self.assertFalse((ROOT / 'deploy/k8s/base/ntfy.yaml').exists())
def test_unrip_services_receive_internal_notification_endpoint(self):
source = (ROOT / 'deploy/k8s/base/unrip.yaml').read_text()
self.assertIn('NOTIFICATION_NTFY_BASE_URL: http://ntfy.utility.svc.cluster.local', source)
self.assertIn('NOTIFICATION_NTFY_TOPIC: unrip', source)
def test_app_workflow_does_not_wait_on_cluster_owned_ntfy(self):
source = (ROOT / '.forgejo/workflows/deploy.yml').read_text()
self.assertNotIn('deployment/ntfy', source)
if __name__ == '__main__':
unittest.main()