unrip/test/bootstrap_script_static_test.py
philipp 6ff3f55b0f
All checks were successful
deploy / deploy (push) Successful in 46s
Recreate topic bootstrap job during deploy
Proof: full npm test passes 238/238; deploy workflow static test and bootstrap script static test cover deletion of immutable redpanda-topic-bootstrap job before manifest apply.

Assumptions: redpanda-topic-bootstrap is idempotent and safe to recreate because it only ensures Kafka topics and retention settings.

Still fake: venue-native terminal fill ids and realized fee/PnL attribution remain unavailable.
2026-05-18 21:09:02 +02:00

33 lines
1.7 KiB
Python

import pathlib
import unittest
ROOT = pathlib.Path(__file__).resolve().parents[1]
class BootstrapScriptStaticTest(unittest.TestCase):
def test_bootstrap_renders_existing_release_image_instead_of_reapplying_placeholders(self):
source = (ROOT / 'scripts/deploy/bootstrap.sh').read_text()
self.assertIn('PROJECT_RELEASE_IMAGE', source)
self.assertIn('current_release_image', source)
self.assertIn('render_release_manifest.py', source)
self.assertIn('ghcr.io/example/unrip:bootstrap', source)
self.assertIn('kubectl kustomize "$ROOT_DIR/deploy/k8s/base"', source)
def test_bootstrap_preserves_operator_dashboard_password_secret(self):
source = (ROOT / 'scripts/deploy/bootstrap.sh').read_text()
self.assertIn('OPERATOR_DASHBOARD_AUTH_PASSWORD="$(secret_value OPERATOR_DASHBOARD_AUTH_PASSWORD)"', source)
self.assertIn('OPERATOR_DASHBOARD_AUTH_PASSWORD:?set OPERATOR_DASHBOARD_AUTH_PASSWORD', source)
self.assertIn('--from-literal=OPERATOR_DASHBOARD_AUTH_PASSWORD="$OPERATOR_DASHBOARD_AUTH_PASSWORD"', source)
self.assertIn('--operator-dashboard-auth-password "$OPERATOR_DASHBOARD_AUTH_PASSWORD"', source)
def test_bootstrap_recreates_immutable_topic_bootstrap_job(self):
source = (ROOT / 'scripts/deploy/bootstrap.sh').read_text()
delete_index = source.find('delete job redpanda-topic-bootstrap --ignore-not-found=true')
apply_index = source.find('kubectl kustomize "$ROOT_DIR/deploy/k8s/base"')
self.assertGreater(delete_index, -1)
self.assertGreater(apply_index, -1)
self.assertLess(delete_index, apply_index)
if __name__ == '__main__':
unittest.main()