Skip to content

Commit

Permalink
Run devfile watch integration test on kubernetes cluster (#2916)
Browse files Browse the repository at this point in the history
  • Loading branch information
prietyc123 committed Apr 20, 2020
1 parent 18f9f3b commit 0a3f5de
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ jobs:
# Run devfile integration test on Kubernetes cluster
- <<: *base-test
stage: test
name: "devfile catalog command integration tests on kubernetes cluster"
name: "devfile catalog, watch command integration tests on kubernetes cluster"
before_script:
# Download kubectl, a cli tool for accessing Kubernetes cluster
- curl -sLo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.7.0/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
Expand All @@ -172,3 +172,4 @@ jobs:
- sudo cp odo /usr/bin
- export KUBERNETES=true
- travis_wait make test-cmd-devfile-catalog
- travis_wait make test-cmd-devfile-watch
14 changes: 11 additions & 3 deletions tests/integration/devfile/cmd_devfile_watch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,25 @@ var _ = Describe("odo devfile watch command tests", func() {
// This is run after every Spec (It)
var _ = BeforeEach(func() {
SetDefaultEventuallyTimeout(10 * time.Minute)
namespace = helper.CreateRandProject()
context = helper.CreateNewContext()
os.Setenv("GLOBALODOCONFIG", filepath.Join(context, "config.yaml"))
if os.Getenv("KUBERNETES") == "true" {
namespace = helper.CreateRandNamespace(context)
} else {
namespace = helper.CreateRandProject()
}
currentWorkingDirectory = helper.Getwd()
helper.Chdir(context)
os.Setenv("GLOBALODOCONFIG", filepath.Join(context, "config.yaml"))
})

// Clean up after the test
// This is run after every Spec (It)
var _ = AfterEach(func() {
helper.DeleteProject(namespace)
if os.Getenv("KUBERNETES") == "true" {
helper.DeleteNamespace(namespace)
} else {
helper.DeleteProject(namespace)
}
helper.Chdir(currentWorkingDirectory)
helper.DeleteDir(context)
os.Unsetenv("GLOBALODOCONFIG")
Expand Down

0 comments on commit 0a3f5de

Please sign in to comment.