MCPcopy Create free account
hub / github.com/devfile/devworkspace-operator / createDevWorkspace

Function createDevWorkspace

controllers/workspace/util_test.go:45–59  ·  view source on GitHub ↗
(name, fromFile string)

Source from the content-addressed store, hash-verified

43var clock kubeclock.Clock = &kubeclock.RealClock{}
44
45func createDevWorkspace(name, fromFile string) {
46 By("Loading DevWorkspace from test file")
47 devworkspace := &dw.DevWorkspace{}
48 Expect(loadObjectFromFile(name, devworkspace, fromFile)).Should(Succeed())
49
50 By("Creating DevWorkspace on cluster")
51 Expect(k8sClient.Create(ctx, devworkspace)).Should(Succeed())
52 createdDW := &dw.DevWorkspace{}
53 Eventually(func() bool {
54 if err := k8sClient.Get(ctx, namespacedName(devWorkspaceName, testNamespace), createdDW); err != nil {
55 return false
56 }
57 return createdDW.Status.DevWorkspaceId != ""
58 }, 10*time.Second, 250*time.Millisecond).Should(BeTrue())
59}
60
61func createStartedDevWorkspace(name, fromFile string) {
62 createDevWorkspace(name, fromFile)

Calls 3

loadObjectFromFileFunction · 0.85
namespacedNameFunction · 0.70
GetMethod · 0.65

Tested by

no test coverage detected