Skip to content

Commit 6e291da

Browse files
committed
try: prints logs on failure
1 parent 14e32bb commit 6e291da

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

.github/workflows/operator_bundle_tests.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,10 @@ jobs:
3030
cd go/src/github.com/${{ env.REPOSITORY }}
3131
make lint-prepare bundle-test
3232
shell: bash
33+
- name: Print test logs on failure
34+
if: ${{ failure() }}
35+
run: |
36+
cat /tmp/test.out
37+
echo -e "\n--------------------------------------------------------------------------\n"
38+
cat /tmp/op-test/log.out
39+
shell: bash

scripts/release/operatorhub.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,19 @@ if [[ $runTests -ne 0 ]]; then
9494
echo "Running tests: $tests"
9595

9696
cd "${TMP_DIR}"
97-
export OP_TEST_ANSIBLE_PULL_REPO="https://github.com/redhat-openshift-ecosystem/operator-test-playbooks" ## can be removed after https://github.com/redhat-openshift-ecosystem/operator-test-playbooks/pull/244 is merged
97+
98+
## can be removed after https://github.com/redhat-openshift-ecosystem/operator-test-playbooks/pull/244 is merged
99+
export OP_TEST_ANSIBLE_PULL_REPO="https://github.com/redhat-openshift-ecosystem/operator-test-playbooks"
100+
98101
bash <(curl -sL https://cutt.ly/AEeucaw) \
99102
"$tests" \
100-
"${OPERATOR_HUB}/${OPERATOR_NAME}/${OPERATOR_VERSION}"
101-
echo $?
103+
"${OPERATOR_HUB}/${OPERATOR_NAME}/${OPERATOR_VERSION}" > /tmp/test.out
104+
105+
## Until the script is fixed https://github.com/redhat-openshift-ecosystem/operator-test-playbooks/pull/247
106+
if tail -n 4 /tmp/test.out | grep "Failed with rc";
107+
then
108+
exit 1;
109+
fi # "Failed" was found in the logs
102110
fi
103111

104112
if [[ ! $dryRun && -z $GITHUB_TOKEN ]]; then

0 commit comments

Comments
 (0)