Skip to content

Commit

Permalink
added hermetic flag to konflux configs
Browse files Browse the repository at this point in the history
Signed-off-by: dislbenn <[email protected]>
  • Loading branch information
dislbenn committed Jan 20, 2025
1 parent 90e853b commit 7b202a1
Show file tree
Hide file tree
Showing 3 changed files with 1,058 additions and 1,060 deletions.
10 changes: 6 additions & 4 deletions .tekton/backplane-operator-main-unit-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ spec:
name: EXPECTED_OUTPUT
default: ""
type: string
- name: hermetic
value: "true"
tasks:
- name: unit-test
params:
Expand Down Expand Up @@ -63,21 +65,21 @@ spec:
REPO_URL=$(echo $SNAPSHOT | jq -r --arg name "$TARGET_COMPONENT_NAME" '.components[] | select(.name == $name) | .source.git.url')
REPO_COMMIT=$(echo $SNAPSHOT | jq -r --arg name "$TARGET_COMPONENT_NAME" '.components[] | select(.name == $name) | .source.git.revision')
test_output_file=${PWD}/test_output.json
# Log Vars for Tracibility
echo "REPO_URL: $REPO_URL"
echo "TARGET_COMPONENT_NAME: $TARGET_COMPONENT_NAME"
echo "REPO_COMMIT: $REPO_COMMIT"
echo "SNAPSHOT: $(echo $SNAPSHOT | jq)"
# Clone Repo and checkout at snapshot commit
git clone $REPO_URL $TARGET_COMPONENT_NAME
cd $TARGET_COMPONENT_NAME
git checkout $REPO_COMMIT
# Run unit tests with JSON output
make test unit_test_json_output="$test_output_file"
# Read, process, and write output in accepted format
# Formatting docs: https://redhat-appstudio.github.io/book/ADR/0030-tekton-results-naming-convention.html#test_output-schema-validation
FAILURES=$(cat $test_output_file | jq 'select(.Action == "fail")' | jq -r --slurp 'length')
Expand Down
Loading

0 comments on commit 7b202a1

Please sign in to comment.