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

Run watch command test in parallel #1826

Merged
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 Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ test-link-e2e:
# Run watch e2e tests
.PHONY: test-watch-e2e
test-watch-e2e:
go test -v github.com/openshift/odo/tests/integration --ginkgo.focus="odoWatchE2e" -ginkgo.slowSpecThreshold=$(SLOW_SPEC_THRESHOLD) -ginkgo.v -timeout $(TIMEOUT)
ginkgo -v -nodes=$(TEST_EXEC_NODES) -focus="odoWatchE2e" slowSpecThreshold=$(SLOW_SPEC_THRESHOLD) -randomizeAllSpecs tests/integration/ -timeout $(TIMEOUT)

# Run storage command integration tests
.PHONY: test-cmd-storage
Expand Down
14 changes: 14 additions & 0 deletions docs/development.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,13 @@ $ make test-cmd-storage
----
+

Run watch command integration test
+
----
$ make test-watch-e2e
----
+

* To run the test sequentially or on single ginkgo test node use enviornment variable `TEST_EXEC_NODES`:
+
Run component command integration test
Expand All @@ -212,6 +219,13 @@ $ make test-cmd-storage TEST_EXEC_NODES=1
----
+

Run watch command integration test
+
----
$ make test-watch-e2e TEST_EXEC_NODES=1
----
+

* For the entire integration test suite use:
+
----
Expand Down
51 changes: 51 additions & 0 deletions tests/integration/cmd_watch_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package integration

import (
"os"
"path/filepath"
"time"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

"github.com/openshift/odo/tests/helper"
)

var _ = Describe("odoWatchE2e", func() {
var project string
var context string

// Setup up state for each test spec
// create new project (not set as active) and new context directory for each test spec
// This is before every spec (It)
BeforeEach(func() {
SetDefaultEventuallyTimeout(10 * time.Minute)
project = helper.CreateRandProject()
context = helper.CreateNewContext()
os.Setenv("GLOBALODOCONFIG", filepath.Join(context, "config.yaml"))
})

// Clean up after the test
// This is run after every Spec (It)
AfterEach(func() {
helper.DeleteProject(project)
helper.DeleteDir(context)
os.Unsetenv("GLOBALODOCONFIG")
})

Context("when running help for watch command", func() {
It("should display the help", func() {
appHelp := helper.CmdShouldPass("odo", "watch", "-h")
Expect(appHelp).To(ContainSubstring("Watch for changes"))
})
})

Context("when executing watch without pushing the component", func() {
It("should fail", func() {
helper.CopyExample(filepath.Join("source", "nodejs"), context)
helper.CmdShouldPass("odo", "component", "create", "nodejs", "--project", project, "--context", context)
output := helper.CmdShouldFail("odo", "watch", "--context", context)
Expect(output).To(ContainSubstring("component does not exist. Please use `odo push` to create you component"))
})
})
})
64 changes: 0 additions & 64 deletions tests/integration/watch_test.go

This file was deleted.