@@ -1807,11 +1807,12 @@ CMD ["npm", "start"]
1807
1807
})
1808
1808
1809
1809
It ("should not build images when odo dev is run" , func () {
1810
- _ , sessionOut , _ , err := helper .DevModeShouldFail (
1810
+ _ , sessionOut , _ , err := helper .WaitForDevModeToContain (
1811
1811
helper.DevSessionOpts {
1812
1812
EnvVars : env ,
1813
1813
},
1814
- "failed to retrieve " + url )
1814
+ "failed to retrieve " + url ,
1815
+ false )
1815
1816
Expect (err ).To (BeNil ())
1816
1817
Expect (sessionOut ).NotTo (ContainSubstring ("build -t quay.io/unknown-account/myimage -f " ))
1817
1818
Expect (sessionOut ).NotTo (ContainSubstring ("push quay.io/unknown-account/myimage" ))
@@ -2658,47 +2659,28 @@ CMD ["npm", "start"]
2658
2659
}))
2659
2660
}
2660
2661
2661
- Context ("using Kubernetes cluster " , func () {
2662
+ Context ("using a default namespace " , func () {
2662
2663
BeforeEach (func () {
2663
- if os .Getenv ("KUBERNETES" ) != "true" {
2664
- Skip ("This is a Kubernetes specific scenario, skipping" )
2665
- }
2666
- })
2667
-
2668
- It ("should run odo dev successfully on default namespace" , func () {
2669
- helper .CopyExample (filepath .Join ("source" , "nodejs" ), commonVar .Context )
2670
- helper .Cmd ("odo" , "init" , "--name" , cmpName , "--devfile-path" , helper .GetExamplePath ("source" , "devfiles" , "nodejs" , "devfile.yaml" )).ShouldPass ()
2671
- helper .CopyExample (filepath .Join ("source" , "devfiles" , "nodejs" , "project" ), commonVar .Context )
2672
-
2673
- session , _ , errContents , _ , err := helper .StartDevMode (helper.DevSessionOpts {})
2674
- Expect (err ).ToNot (HaveOccurred ())
2675
- defer func () {
2676
- session .Stop ()
2677
- session .WaitEnd ()
2678
- }()
2679
- helper .DontMatchAllInOutput (string (errContents ), []string {"odo may not work as expected in the default project" })
2664
+ commonVar .CliRunner .SetProject ("default" )
2680
2665
})
2681
- })
2682
-
2683
- /* TODO(feloy) Issue #5591
2684
- Context("using OpenShift cluster", func() {
2685
- BeforeEach(func() {
2686
- if os.Getenv("KUBERNETES") == "true" {
2687
- Skip("This is a OpenShift specific scenario, skipping")
2688
- }
2666
+ AfterEach (func () {
2667
+ commonVar .CliRunner .SetProject (commonVar .Project )
2689
2668
})
2690
- It("should run odo dev successfully on default namespace", func() {
2691
- helper.CopyExample(filepath.Join("source", "nodejs"), commonVar.Context)
2692
- helper.Cmd("odo", "init", "--name", cmpName, "--devfile-path", helper.GetExamplePath("source", "devfiles", "nodejs", "devfile.yaml")).ShouldPass()
2693
- helper.CopyExample(filepath.Join("source", "devfiles", "nodejs", "project"), commonVar.Context)
2694
-
2695
- session, _, errContents, err := helper.StartDevMode(helper.DevSessionOpts{})
2696
- Expect(err).ToNot(HaveOccurred())
2697
- defer session.Stop()
2698
- helper.MatchAllInOutput(string(errContents), []string{"odo may not work as expected in the default project"})
2669
+ When ("a component is created" , func () {
2670
+ BeforeEach (func () {
2671
+ helper .CopyExample (filepath .Join ("source" , "nodejs" ), commonVar .Context )
2672
+ helper .Cmd ("odo" , "init" , "--name" , cmpName , "--devfile-path" , helper .GetExamplePath ("source" , "devfiles" , "nodejs" , "devfile.yaml" )).ShouldPass ()
2673
+ helper .CopyExample (filepath .Join ("source" , "devfiles" , "nodejs" , "project" ), commonVar .Context )
2674
+ })
2675
+ It ("should print warning about default namespace when running odo dev" , func () {
2676
+ namespace := "project"
2677
+ if helper .IsKubernetesCluster () {
2678
+ namespace = "namespace"
2679
+ }
2680
+ helper .WaitForDevModeToContain (helper.DevSessionOpts {}, fmt .Sprintf ("You are using \" default\" %[1]s, odo may not work as expected in the default %[1]s." , namespace ), true )
2681
+ })
2699
2682
})
2700
2683
})
2701
- */
2702
2684
2703
2685
// Test reused and adapted from the now-removed `cmd_devfile_delete_test.go`.
2704
2686
// cf. https://github.com/redhat-developer/odo/blob/24fd02673d25eb4c7bb166ec3369554a8e64b59c/tests/integration/devfile/cmd_devfile_delete_test.go#L172-L238
0 commit comments