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

Template test is not reentrant #7078

Merged
merged 1 commit into from Feb 8, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions test/cmd/templates.sh
Expand Up @@ -13,6 +13,9 @@ os::log::install_errexit
(
set +e
oc delete all,templates --all
oc delete template/ruby-helloworld-sample -n openshift
oc delete project test-template-project
os::cmd::try_until_failure 'oc get project test-template-project'
exit 0
) &>/dev/null

Expand Down Expand Up @@ -76,6 +79,9 @@ echo "template data precision: ok"

os::cmd::expect_success 'oc create -f examples/sample-app/application-template-dockerbuild.json -n openshift'
os::cmd::expect_success 'oc policy add-role-to-user admin test-user'
new="$(mktemp -d)/tempconfig"
os::cmd::expect_success "oc config view --raw > $new"
export KUBECONFIG=$new
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this is done to avoid trashing the shared kubeconfig file? I'd rather give each subscript its own copy in the test-cmd.sh script.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, that doesn't fix the reentrancy problem. It ruins your local script. So this is correct as is.

Copy link
Contributor

Choose a reason for hiding this comment

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

how does copying the KUBECONFIG and invoking the tmp project creation and sub-script with KUBECONFIG=... break anything?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because the point of this change is to not require you to run hack/test-cmd.sh to test this. You just run test/cmd/templates.

os::cmd::expect_success 'oc login -u test-user -p password'
os::cmd::expect_success 'oc new-project test-template-project'
# make sure the permissions on the new project are set up
Expand Down