Skip to content

Commit

Permalink
add check for existing data before collecting
Browse files Browse the repository at this point in the history
Signed-off-by: Charlie Wheeler-Robinson <[email protected]>
  • Loading branch information
crwr45 committed Apr 15, 2024
1 parent 04b02b7 commit bac43b0
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions cmd/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -267,17 +267,22 @@ EOF
popd >/dev/null 2>&1
}

audit_container > $DATADIR/repo_audit
if [ ! -z "$LOCAL_KUBECONFIG" ]; then
echo "Running Collection"
verify_env
collect_data
if [ -z "$(find $OUTPUTDIR/*.* -type f 2> /dev/null)" ] | [ -z "$(find $DATADIR/* -type f 2> /dev/null)" ]; then
echo "Running Collection"
verify_env
collect_data
else
echo "Cannot run data collection when $OUTPUTDIR contains files."
exit 1
fi
else
echo "Skipping data collection"
fi
analyse_data > $TESTJSON
create_junit
create_pdf
audit_container > $DATADIR/repo_audit

# Make exit code indicate test results rather than successful completion.
if grep -Eq '(errors|failures)=\"([^0].*?)\"' $FULLJUNIT; then
Expand Down

0 comments on commit bac43b0

Please sign in to comment.