Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add check for existing data before collecting #83

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
14 changes: 10 additions & 4 deletions cmd/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ else
fi

mkdir -p $DATADIR
rm -rf $ARTEFACTDIR/*
mkdir -p $ARTEFACTDIR
mkdir -p $REPORTARTEFACTDIR
mkdir -p $LOGARTEFACTDIR
Expand Down Expand Up @@ -267,17 +268,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
Loading