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

Fix E2E tests TestBaseImageBuild and TestParallelBaseImageBuild #9540

Merged
merged 5 commits into from
Apr 26, 2022
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .werft/jobs/build/deploy-to-preview-environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export async function deployToPreviewEnvironment(werft: Werft, jobConfig: JobCon
const domain = withVM ? `${destname}.preview.gitpod-dev.com` : `${destname}.staging.gitpod-dev.com`;
const monitoringDomain = `${destname}.preview.gitpod-dev.com`;
const url = `https://${domain}`;
const imagePullAuth = exec(`printf "%s" "_json_key:$(kubectl get secret ${IMAGE_PULL_SECRET_NAME} --namespace=keys -o yaml \
const imagePullAuth = exec(`printf "%s" "_json_key:$(kubectl --kubeconfig ${CORE_DEV_KUBECONFIG_PATH} get secret ${IMAGE_PULL_SECRET_NAME} --namespace=keys -o yaml \
| yq r - data['.dockerconfigjson'] \
| base64 -d)" | base64 -w 0`, { silent: true }).stdout.trim();

Expand Down
2 changes: 1 addition & 1 deletion components/ws-daemon/pkg/dispatch/dispatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func (d *Dispatch) handlePodUpdate(oldPod, newPod *corev1.Pod) {
d.mu.Lock()
s := d.ctxs[workspaceInstanceID]
if s == nil {
log.WithFields(owi).Error("pod disappaered from dispatch state before container was ready")
log.WithFields(owi).Error("pod disappeared from dispatch state before container was ready")
d.mu.Unlock()
return
}
Expand Down
18 changes: 9 additions & 9 deletions test/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Integration Tests

This directory containts Gitpod's integration tests, including the framework that makes them possible.
This directory contains Gitpod's integration tests, including the framework that makes them possible.

Integration tests work by instrumenting Gitpod's components to modify and verify its state.
Such tests are for example:
Expand Down Expand Up @@ -61,13 +61,13 @@ There are 4 different types of tests:
To run the tests:
1. Clone this repo (`git clone [email protected]:gitpod-io/gitpod.git`), and `cd` to `./gitpod/test`
2. Run the tests like so
```console
go test -v ./... \
-kubeconfig=<path_to_kube_config_file> \
-namespace=<namespace_where_gitpod_is_installed> \
-username=<gitpod_user_with_oauth_setup> \
-enterprise=<true|false> \
-gitlab=<true|false>
```
```console
go test -v ./... \
-kubeconfig=<path_to_kube_config_file> \
-namespace=<namespace_where_gitpod_is_installed> \
-username=<gitpod_user_with_oauth_setup> \
-enterprise=<true|false> \
-gitlab=<true|false>
```
3. Tests `TestUploadDownloadBlob` and `TestUploadDownloadBlobViaServer` will fail when testing locally, as they are trying to connect to cluster local resources directly. To test them use docker image instead that runs within the cluster.
4. If you want to run specific test, add `-run <test>` before `-kubeconfig` parameter.
2 changes: 1 addition & 1 deletion test/pkg/integration/common/port_forward.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (

// ForwardPort establishes a TCP port forwarding to a Kubernetes pod
// Uses kubectl instead of Go to use a local process that can reproduce the same behavior outside the tests
// Since we are using kubectl directly we need to pass kubeconfig explicetly
// Since we are using kubectl directly we need to pass kubeconfig explicitly
func ForwardPort(ctx context.Context, kubeconfig string, namespace, pod, port string) (readychan chan struct{}, errchan chan error) {
errchan = make(chan error, 1)
readychan = make(chan struct{}, 1)
Expand Down
5 changes: 2 additions & 3 deletions test/pkg/integration/workspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,18 +182,17 @@ func LaunchWorkspaceDirectly(ctx context.Context, api *ComponentAPI, opts ...Lau

wsm, err := api.WorkspaceManager()
if err != nil {
return nil, xerrors.Errorf("cannot start workspace: %q", err)
return nil, xerrors.Errorf("cannot start workspace manager: %q", err)
}

sresp, err := wsm.StartWorkspace(sctx, req)
scancel()
if err != nil {
return nil, xerrors.Errorf("cannot start workspace: %q", err)
}

lastStatus, err := WaitForWorkspaceStart(ctx, instanceID.String(), api, options.WaitForOpts...)
if err != nil {
return nil, xerrors.Errorf("cannot start workspace: %q", err)
return nil, xerrors.Errorf("cannot wait for workspace start: %q", err)
}

// it.t.Logf("workspace is running: instanceID=%s", instanceID.String())
Expand Down
2 changes: 1 addition & 1 deletion test/tests/workspace/mount_proc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func TestMountProc(t *testing.T) {

var wg sync.WaitGroup
wg.Add(parallel)
for i := 0; i < 5; i++ {
for i := 0; i < parallel; i++ {
go func() {
defer wg.Done()
loadMountProc(t, rsa)
Expand Down