Skip to content

Commit 75135cb

Browse files
committed
WIP
1 parent 6f2fa3d commit 75135cb

File tree

3 files changed

+5
-92
lines changed

3 files changed

+5
-92
lines changed

.werft/jobs/build/trigger-integration-tests.ts

+1-15
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,7 @@ export async function triggerIntegrationTests(werft: Werft, config: JobConfig, u
2323
}
2424

2525
try {
26-
const imageVersion = exec(
27-
`docker run --rm eu.gcr.io/gitpod-core-dev/build/versions:${config.version} cat /versions.yaml | yq r - 'components.integrationTest.version'`,
28-
{ silent: true },
29-
).stdout.trim();
30-
31-
const containerID = exec(`docker create -e GOOGLE_APPLICATION_CREDENTIALS= eu.gcr.io/gitpod-core-dev/build/integration-tests:${imageVersion} -kubeconfig=/kubeconfig -namespace=default`, {slice: phases.TRIGGER_INTEGRATION_TESTS}).trim()
32-
werft.log(phases.TRIGGER_INTEGRATION_TESTS, `Created container with ID ${containerID}`)
33-
34-
werft.log(phases.TRIGGER_INTEGRATION_TESTS, `Will copy over files`)
35-
exec(`docker cp ${PREVIEW_K3S_KUBECONFIG_PATH} ${containerID}:/kubeconfig`, {slice: phases.TRIGGER_INTEGRATION_TESTS})
36-
exec(`docker cp /home/gitpod/.config/gcloud/legacy_credentials/[email protected]/adc.json ${containerID}:/adc.json`, {slice: phases.TRIGGER_INTEGRATION_TESTS})
37-
38-
werft.log(phases.TRIGGER_INTEGRATION_TESTS, `Will start container`)
39-
exec(`docker start --interactive --attach ${containerID}`, {slice: phases.TRIGGER_INTEGRATION_TESTS})
40-
26+
exec(`KUBECONFIG="${PREVIEW_K3S_KUBECONFIG_PATH}" GOOGLE_APPLICATION_CREDENTIALS=/home/gitpod/.config/gcloud/legacy_credentials/[email protected]/adc.json /workspace/tests/run.sh`, {slice: phases.TRIGGER_INTEGRATION_TESTS})
4127
werft.done(phases.TRIGGER_INTEGRATION_TESTS);
4228
} catch (err) {
4329
if (!config.mainBuild) {

test/README.md

+4-15
Original file line numberDiff line numberDiff line change
@@ -21,33 +21,22 @@ Such tests are for example:
2121

2222
### Automatically at Gitpod
2323

24-
There is a [werft job](../.werft/run-integration-tests.yaml) that runs the integration tests against `core-dev` preview environments.
24+
You can opt-in to run the integrations tests as part of the build job. that runs the integration tests against preview environments.
2525

2626
> For tests that require an existing user the framework tries to automatically select one from the DB.
2727
> - On preview envs make sure to create one before running tests against it!
2828
> - If it's important to use a certain user (with fixed settings, for example) pass the additional `username` parameter.
2929
3030
Example command:
31-
```
32-
werft run github -j .werft/run-integration-tests.yaml -a namespace=staging-gpl-2658-int-tests -a version=gpl-2658-int-tests.57 -f
31+
32+
```sh
33+
werft run github -a with-preview=true -a with-integration-tests=true -f
3334
```
3435

3536
### Manually
3637

3738
You may want to run tests to assert whether a Gitpod installation is successfully integrated.
3839

39-
#### Using a pod
40-
41-
Best for when you want to validate an environment.
42-
43-
1. Update image name in `integration.yaml` for job `integration-job` to latest built by werft.
44-
2. Optionally add your username in that job argument or any other additional params.
45-
2. Apply yaml file that will add all necessary permissions and create a job that will run tests.
46-
* [`kubectl apply -f ./integration.yaml`](./integration.yaml)
47-
3. Check logs to inspect test results like so `kubectl logs -f jobs/integration-job`.
48-
4. Tear down the integration user and job when testing is done.
49-
* [`kubectl delete -f ./integration.yaml`](./integration.yaml)
50-
5140
#### Go test
5241

5342
This is best for when you're actively developing Gitpod.

test/integration.yaml

-62
This file was deleted.

0 commit comments

Comments
 (0)