teamhephy / workflow-e2e

MIT License
0 stars 4 forks source link

Make test code print an informational error message if it doesn't find 'DEIS_CONTROLLER_URL' in the environment #13

Open Cryptophobia opened 6 years ago

Cryptophobia commented 6 years ago

From @arschles on April 12, 2016 20:13

After https://github.com/deis/workflow-e2e/pull/157, the tests look for DEIS_CONTROLLER_URL in the environment to determine what server to talk to in order to run tests. This variable can be set to a variety of different values, and the test should explain the options:

Copied from original issue: deis/workflow-e2e#163

Cryptophobia commented 6 years ago

From @arschles on April 12, 2016 20:13

cc/ @krancour

Cryptophobia commented 6 years ago

From @krancour on April 12, 2016 20:28

If you're inside a Kubernetes pod inside a namespace with a full Deis install, set the value to the internal router address: DEIS_CONTROLLER_URL=${DEIS_ROUTER_SERVICE_HOST}:${DEIS_ROUTER_SERVICE_PORT}

In this case, you shouldn't have to worry about the value of DEIS_CONTROLLER_URL at all. If unset, it's already derived automatically (in the Makefile) from the value of DEIS_ROUTER_SERVICE_HOST, which is automatically set by k8s when Workflow is installed.

If you're not inside a Kubernets pod, set the value to the external router address. This value depends on what kind of ingress server you have set up. It might be a cloud load balancer or otherwise. Assuming you have a public IP for the router: DEIS_CONTROLLER_URL=deis.${EXTERNAL_ROUTER_IP}.xip.io (or you can use .nip.io, or your own domain if you've configured one...)

The Makefile already offers this explanation if DEIS_CONTROLLER_URL is unset and cannot be derived from DEIS_ROUTER_SERVICE_HOST:

DEIS_CONTROLLER_URL is not exported. You must export this variable to proceed.
Its value should match the Deis Controller URL you would ordinarily use with
the `deis register` or `deis login` commands.

I would suggest that the only real problem we have on this front is that if someone executes ginkgo directly (instead of via the provided make target), then none of what I just said applies. We should transplant that logic from the Makefile to the tests themselves.

Cryptophobia commented 6 years ago

From @arschles on April 21, 2016 15:50

As far as I can tell, the remaining work in here is to transplant the makefile logic to translate some Makefile logic into tests themselves.

Cryptophobia commented 6 years ago

From @arschles on April 21, 2016 15:50

Punting to beta4

Cryptophobia commented 6 years ago

From @arschles on May 9, 2016 19:48

@krancour does it make sense to leave this open? Regardless, moving to RC1