Update Gitlab tests to allow for dynamic URLs
In both types of tests the URL for the Gitlab instance is hardcoded in the test rather than being dynamically passed in via ENV.
See:
- cypress test - https://repo1.dso.mil/platform-one/big-bang/apps/developer-tools/gitlab/-/blob/main/chart/tests/cypress/cypress.json#L5
- script test - https://repo1.dso.mil/platform-one/big-bang/apps/developer-tools/gitlab/-/blob/main/chart/tests/scripts/test.sh#L11
NOTE: There are additional spots, at least in the script test, where this is also an issue.
We need to ability to pass down these URLs via helm values so that in BB CI we can use the istio VS address for them.
For cypress this can be done by:
- Adding an env named cypress_url in the test values - https://repo1.dso.mil/platform-one/big-bang/apps/collaboration-tools/mattermost/-/blob/main/tests/test-values.yml#L17
bbtests:
cypress:
envs:
cypress_url: http://gitlab-webservice-default.gitlab.svc.cluster.local:8181
- Referencing that env when navigating in cypress - https://repo1.dso.mil/platform-one/big-bang/apps/collaboration-tools/mattermost/-/blob/main/chart/tests/cypress/mattermost-health.spec.js#L4
cy.visit(Cypress.env('url'))
// Should also work
cy.visit(Cypress.env('url') + '/login')
For scripts you can do the same thing, supplying it via an env value and referencing it in the script.
bbtests:
scripts:
envs:
URL: http://gitlab-webservice-default.gitlab.svc.cluster.local:8181
curl ${URL}
Edited by Micah Nagel