Skip to content
This repository has been archived by the owner on Sep 6, 2019. It is now read-only.

Checking e2e build succeeded #89

Open
wants to merge 1 commit into
base: master
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
12 changes: 9 additions & 3 deletions test/e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,15 @@ function run_buildpack_test() {
kubectl apply -f test/build-buildpack.yaml || return 1
# Wait 5s for processing to start
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that you can remove this sleep now, since you're checking for a successful build.

sleep 5
echo "Checking that build was started:"
kubectl get build buildpack-build -oyaml
# TODO(adrcunha): Add proper verification.
echo "Checking that build was successed:"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo "Checking that build was successed:"
echo -n "Waiting for build to finish"

for i in {1..100};do
kubectl get build buildpack-build -o 'jsonpath={.status.conditions[?(@.type=="Succeeded")].status}' 1>/dev/null 2>&1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume Jason agrees with this check?

if [ $? -ne 1 ]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-eq 0

break
fi
echo "The build was successed."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo "The build was successed."
echo -e "\nBuild succeeded."

sleep 2
done
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add some progress indicator here, I'm not sure how long the operation will take.

echo -n "."

Prior art:

https://github.com/knative/test-infra/blob/master/scripts/library.sh#L176

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't you fail the test if the build didn't succeed? Otherwise, this check adds no value.

}

# Script entry point.
Expand Down