Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install --editable 'libs/tekton-dag-common[test]' --editable 'libs/baggage-python[test]'
python -m pytest libs/baggage-python/tests libs/tekton-dag-common/tests -q --tb=short
(cd libs/baggage-python && python -m pytest tests -q --tb=short)
(cd libs/tekton-dag-common && python -m pytest tests -q --tb=short)

node:
name: Node ${{ matrix.node }}
Expand Down
4 changes: 3 additions & 1 deletion helm/tekton-dag/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ echo " Repo root: $REPO_ROOT"

rm -rf "$CHART_DIR/raw"
mkdir -p "$CHART_DIR/raw/tasks" "$CHART_DIR/raw/pipelines" "$CHART_DIR/raw/stacks" \
"$CHART_DIR/raw/stack-crs" "$CHART_DIR/raw/team-crs"
"$CHART_DIR/raw/stack-crs" "$CHART_DIR/raw/team-crs" "$CHART_DIR/raw/scripts"

echo " Copying tasks..."
cp "$REPO_ROOT"/tasks/*.yaml "$CHART_DIR/raw/tasks/"
cp "$REPO_ROOT/scripts/run-stack-tests-runners.sh" \
"$CHART_DIR/raw/scripts/run-stack-tests-runners.sh"

echo " Copying pipelines and triggers..."
cp "$REPO_ROOT"/pipeline/*.yaml "$CHART_DIR/raw/pipelines/"
Expand Down
14 changes: 14 additions & 0 deletions helm/tekton-dag/templates/configmap-run-stack-tests-runners.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{- $script := .Files.Get "raw/scripts/run-stack-tests-runners.sh" -}}
{{- if $script }}
apiVersion: v1
kind: ConfigMap
metadata:
name: run-stack-tests-runners
namespace: {{ .Values.namespace }}
labels:
app.kubernetes.io/part-of: tekton-job-standardization
{{- include "tekton-dag.labels" . | nindent 4 }}
data:
run-stack-tests-runners.sh: |
{{- $script | nindent 4 }}
{{- end }}
2 changes: 2 additions & 0 deletions libs/tekton-dag-common/tests/test_m17_compatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ def test_compatibility_workflow_covers_documented_runtimes():
assert 'java: ["21"]' in workflow
assert 'php: ["8.3"]' in workflow
assert "bash scripts/check-support-matrix.sh" in workflow
assert "(cd libs/baggage-python && python -m pytest tests" in workflow
assert "(cd libs/tekton-dag-common && python -m pytest tests" in workflow
assert 'workflow: ".github/workflows/compatibility.yml"' in matrix


Expand Down
11 changes: 9 additions & 2 deletions libs/tekton-dag-common/tests/test_m17_stack_test_runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,18 @@

def test_task_sources_extracted_runner_script():
task = (ROOT / "tasks/run-stack-tests.yaml").read_text()
installer = (ROOT / "scripts/install-tekton.sh").read_text()
chart = (ROOT / "helm/tekton-dag/templates/configmap-run-stack-tests-runners.yaml").read_text()
packager = (ROOT / "helm/tekton-dag/package.sh").read_text()
script = (ROOT / "scripts/run-stack-tests-runners.sh").read_text()

assert "scripts/run-stack-tests-runners.sh" in task
assert "ERROR: run-stack-tests runners script missing" in task
assert "name: run-stack-tests-runners" in task
assert "mountPath: /opt/tekton-dag" in task
assert "ERROR: run-stack-tests runners ConfigMap missing" in task
assert "PHASE 2: Per-app tests" not in task
assert "kubectl create configmap run-stack-tests-runners" in installer
assert "raw/scripts/run-stack-tests-runners.sh" in chart
assert "raw/scripts/run-stack-tests-runners.sh" in packager
assert "run_newman" in script
assert "run_playwright" in script
assert "run_artillery" in script
Expand Down
11 changes: 11 additions & 0 deletions scripts/check-helm-chart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,16 @@ for filename in sys.argv[1:]:
documents = [document for document in yaml.safe_load_all(path.read_text()) if document]
if not documents:
raise SystemExit(f"{path}: rendered no resources")
runners = [
document
for document in documents
if document.get("kind") == "ConfigMap"
and document.get("metadata", {}).get("name") == "run-stack-tests-runners"
]
if not runners:
raise SystemExit(f"{path}: missing ConfigMap run-stack-tests-runners")
script = runners[0].get("data", {}).get("run-stack-tests-runners.sh", "")
if "run_newman" not in script:
raise SystemExit(f"{path}: runner ConfigMap is missing run_newman")
print(f"{path.name}: parsed {len(documents)} resource(s)")
PY
3 changes: 3 additions & 0 deletions scripts/install-tekton.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ kubectl apply -f "$TEKTON_GIT_CLONE_URL" -n "$NAMESPACE" 2>/dev/null || \

# 4. This repo's tasks and pipelines (kubectl apply is idempotent; triggers apply now that Triggers is installed)
echo " Applying stack tasks and pipelines..."
kubectl create configmap run-stack-tests-runners \
--from-file=run-stack-tests-runners.sh="$MILESTONE_DIR/scripts/run-stack-tests-runners.sh" \
-n "$NAMESPACE" --dry-run=client -o yaml | kubectl apply -f -
apply_with_retry -f "$MILESTONE_DIR/tasks/" -n "$NAMESPACE"
# EventListener reconciliation creates el-* Services. It can race the explicit
# Service in triggers.yaml between kubectl's read and create operations.
Expand Down
16 changes: 12 additions & 4 deletions tasks/run-stack-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ spec:
apps this validates the PR build directly. For non-intercepted
apps this validates they still work with the header present.

Runner logic lives in scripts/run-stack-tests-runners.sh in the
platform repo (cloned into the test-source workspace).
Runner logic lives in scripts/run-stack-tests-runners.sh and is
mounted from ConfigMap run-stack-tests-runners so the Task does
not depend on the cloned platform git-revision.
params:
- name: stack-json
type: string
Expand Down Expand Up @@ -68,6 +69,9 @@ spec:
- name: run-tests
image: node:22-alpine
workingDir: $(workspaces.test-source.path)
volumeMounts:
- name: runners-script
mountPath: /opt/tekton-dag
script: |
#!/bin/sh
set -e
Expand All @@ -91,10 +95,14 @@ spec:
DEFAULT_NS TESTS_TO_RUN UNMAPPED_AREA APPS_TO_TEST \
TEST_SOURCE TEST_SUMMARY_PATH

RUNNERS="${TEST_SOURCE}/scripts/run-stack-tests-runners.sh"
RUNNERS="/opt/tekton-dag/run-stack-tests-runners.sh"
if [ ! -f "$RUNNERS" ]; then
echo "ERROR: run-stack-tests runners script missing: $RUNNERS" >&2
echo "ERROR: run-stack-tests runners ConfigMap missing: $RUNNERS" >&2
exit 1
fi
# shellcheck disable=SC1090
. "$RUNNERS"
volumes:
- name: runners-script
configMap:
name: run-stack-tests-runners
Loading