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

test: add e2e framework #6

Merged
merged 4 commits into from Mar 22, 2023
Merged

test: add e2e framework #6

merged 4 commits into from Mar 22, 2023

Conversation

ghost
Copy link

@ghost ghost commented Mar 17, 2023

No description provided.

@linear
Copy link

linear bot commented Mar 17, 2023

ENG-1107 DevPod E2E Tests

Create a couple of e2e tests that make sure DevPod works correctly with the Local Provider.

We need:

  • Github Action that runs the e2e tests on PR (similar to how we do it in vcluster, devspace etc.)

  • Github Action that runs the existing unit tests on PR (similar to how we do it in vcluster, devspace etc.)

  • Boilerplate code for e2e tests, I would suggest we use ginkgo as we do in our other projects

  • Couple of e2e tests that test the following:

  • Create/delete/stop/start workspace via devpod up (use provider local)

  • Check ssh is working via devpod ssh --comand

  • Check adding/updating/deleting a provider works via devpod provider add examples/simple-k8s-provider

}

ginkgo.It("should start a new workspace with a local provider", func() {
tempDir, err := framework.CopyToTempDir("tests/up/testdata/local-provider")
Copy link
Member

Choose a reason for hiding this comment

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

put an actual devcontainer.json into the testdata folder that is used


err = upCmd.RunE(nil, []string{tempDir})
framework.ExpectNoError(err)
fmt.Println("got to the end")
Copy link
Member

Choose a reason for hiding this comment

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

please check if the workspace is actually usable. To check if a workspace is usable, run:

ssh local-test.devpod -- echo FromContainter

and check if return is FromContainer

panic(err)
}

ginkgo.It("should start a new workspace with a local provider", func() {
Copy link
Member

Choose a reason for hiding this comment

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

Remove debug fmt.Println's

e2e/README.md Outdated
ginkgo e2e/...
```

#### Run a specific e2e test suite
Copy link
Member

Choose a reason for hiding this comment

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

Update here

@@ -83,6 +84,7 @@ func UpdateProvider(devPodConfig *config.Config, providerName, providerSourceRaw
}

func resolveProvider(providerSource string, log log.Logger) ([]byte, *provider2.ProviderSource, error) {
fmt.Println("provider source: ", providerSource)
Copy link
Member

Choose a reason for hiding this comment

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

Remove this here

@ghost ghost marked this pull request as ready for review March 20, 2023 16:49
@ghost ghost requested a review from FabianKramm March 22, 2023 16:44
@FabianKramm FabianKramm merged commit f670866 into loft-sh:main Mar 22, 2023
@ghost ghost deleted the test/ENG-1107-e2e-framework-and-smoke-test branch March 22, 2023 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant