Skip to content

Deduplicate ITS pipeline and local script - #114

Merged
guillermodotn merged 1 commit into
mainfrom
overseer/113
Jul 16, 2026
Merged

guillermodotn merged 1 commit into
mainfrom
overseer/113

Conversation

@lubomir

@lubomir lubomir commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

🤖 This was posted automatically by an AI agent.

Extract five reusable shell scripts from the duplicated inline code in integration-tests/run-local.sh and .tekton/integration-test-eaas.yaml:

  • integration-tests/scripts/kubeconfig.sh — setup_kubeconfig(): retrieve kubeconfig from a K8s secret
  • integration-tests/scripts/dex-tls.sh — generate_dex_tls(): self-signed CA + Dex TLS cert generation and secret creation; uses printf instead of a heredoc, fixing the indentation bug in the YAML task that caused [SAN] to be written with leading spaces
  • integration-tests/scripts/deploy-manifests.sh — deploy_postgres(), deploy_openldap(), deploy_dex_manifests(), deploy_kafka(): apply manifests + per-service wait with debug output on failure
  • integration-tests/scripts/deploy-cts.sh — deploy_cts(): idempotent ConfigMap creation + CTS deployment + wait
  • integration-tests/scripts/pytest-cmd.sh — run_pytest(): standardised pytest invocation (including -s in both consumers)

Each function accepts an optional KUBECTL argument so it can be used both with a namespace-scoped kubeconfig (YAML tasks) and with kubectl -n $NAMESPACE (local script).

Both run-local.sh and the six Tekton tasks now source the relevant snippet files and call functions instead of duplicating the logic inline. The combined single kube wait in run-local.sh is replaced by the per-service waits inside each deploy function (matching YAML task timeouts: 180 s for postgres/ldap/dex, 300 s for kafka and CTS).

All acceptance criteria verified:

  • bash -n exits 0 on all new/modified shell files
  • openssl genrsa has 0 occurrences in both run-local.sh and the YAML
  • kubectl get secret … base64 pattern has 0 occurrences in the YAML
  • setup_kubeconfig appears 6 times in the YAML (once per task)
  • python3 -m pytest has 0 occurrences in both run-local.sh and the YAML
  • subjectAltName=DNS:dex in dex-tls.sh has no leading spaces

Closes #113

- Add integration-tests/scripts/ with five helper scripts:
  - kubeconfig.sh: setup_kubeconfig() to retrieve kubeconfig from a K8s secret
  - dex-tls.sh: generate_dex_tls() for self-signed CA + Dex TLS cert creation
    (uses printf to avoid heredoc indentation bug present in the YAML task)
  - deploy-manifests.sh: deploy_postgres(), deploy_openldap(),
    deploy_dex_manifests(), deploy_kafka() with per-service waits and debug output
  - deploy-cts.sh: deploy_cts() with idempotent ConfigMap creation
  - pytest-cmd.sh: run_pytest() with standardised -v -s flags

- Update integration-tests/run-local.sh to source all snippet files and
  replace all inline blocks with the corresponding function calls

- Update .tekton/integration-test-eaas.yaml to source snippet files in each
  task and replace inline blocks with function calls; fixes the EXTEOF
  heredoc indentation bug in the deploy-dex task; standardises pytest flags
  to include -s across both consumers

Closes #113
Generated-By: OpenCode (anthropic/claude-sonnet-4-6)
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.65%. Comparing base (4d6f375) to head (72103fa).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #114   +/-   ##
=======================================
  Coverage   83.65%   83.65%           
=======================================
  Files          13       13           
  Lines        1328     1328           
=======================================
  Hits         1111     1111           
  Misses        217      217           
Flag Coverage Δ
unit-tests 83.65% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@guillermodotn guillermodotn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good.

Local run tested with Podman on my side.

@guillermodotn
guillermodotn merged commit 34cc0d8 into main Jul 16, 2026
4 checks passed
@lubomir
lubomir deleted the overseer/113 branch July 16, 2026 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deduplicate ITS pipeline and local script

3 participants