Repository navigation
Deduplicate ITS pipeline and local script - #114
Merged
Merged
Conversation
- 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 Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
guillermodotn
left a comment
Contributor
There was a problem hiding this comment.
All good.
Local run tested with Podman on my side.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extract five reusable shell scripts from the duplicated inline code in
integration-tests/run-local.shand.tekton/integration-test-eaas.yaml:integration-tests/scripts/kubeconfig.sh—setup_kubeconfig(): retrieve kubeconfig from a K8s secretintegration-tests/scripts/dex-tls.sh—generate_dex_tls(): self-signed CA + Dex TLS cert generation and secret creation; usesprintfinstead of a heredoc, fixing the indentation bug in the YAML task that caused[SAN]to be written with leading spacesintegration-tests/scripts/deploy-manifests.sh—deploy_postgres(),deploy_openldap(),deploy_dex_manifests(),deploy_kafka(): apply manifests + per-service wait with debug output on failureintegration-tests/scripts/deploy-cts.sh—deploy_cts(): idempotent ConfigMap creation + CTS deployment + waitintegration-tests/scripts/pytest-cmd.sh—run_pytest(): standardised pytest invocation (including-sin both consumers)Each function accepts an optional
KUBECTLargument so it can be used both with a namespace-scoped kubeconfig (YAML tasks) and withkubectl -n $NAMESPACE(local script).Both
run-local.shand the six Tekton tasks now source the relevant snippet files and call functions instead of duplicating the logic inline. The combined singlekube waitinrun-local.shis 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 -nexits 0 on all new/modified shell filesopenssl genrsahas 0 occurrences in bothrun-local.shand the YAMLkubectl get secret … base64pattern has 0 occurrences in the YAMLsetup_kubeconfigappears 6 times in the YAML (once per task)python3 -m pytesthas 0 occurrences in bothrun-local.shand the YAMLsubjectAltName=DNS:dexindex-tls.shhas no leading spacesCloses #113