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: e2e kamel cli tests #2126

Closed
wants to merge 5 commits into from
Closed

test: e2e kamel cli tests #2126

wants to merge 5 commits into from

Conversation

vsokolovskii
Copy link
Contributor

@vsokolovskii vsokolovskii commented Mar 15, 2021

Expect(Kamel("delete", "yaml", "-n", ns).Execute()).To(Succeed())
Expect(GetOutputString(Kamel("get", "-n", ns))).ShouldNot(ContainSubstring("yaml"))
Expect(Kamel("delete", "java", "-n", ns).Execute()).To(Succeed())
Expect(GetOutputString(Kamel("get", "-n", ns))).ShouldNot(ContainSubstring("java"))
Copy link
Contributor

@bouskaJ bouskaJ Mar 15, 2021

Choose a reason for hiding this comment

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

@vsokolov00 Since focus of this test is kamel delete you should verify that the integration resource and the pod were actually removed rather than kamel get command output.

@@ -38,20 +38,20 @@ func TestKamelCLIDelete(t *testing.T) {
Expect(Kamel("run", "-n", ns, "../files/yaml.yaml").Execute()).To(Succeed())
Eventually(IntegrationPodPhase(ns, "yaml"), TestTimeoutMedium).Should(Equal(v1.PodRunning))
Expect(Kamel("delete", "yaml", "-n", ns).Execute()).To(Succeed())
Expect(GetOutputString(Kamel("get", "-n", ns))).ShouldNot(ContainSubstring("yaml"))
Eventually(Integration("yaml", ns)).Should(BeNil())
Copy link
Contributor

Choose a reason for hiding this comment

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

@vsokolov00 can you verify that the IntegrationPod was removed as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done, please check if everything is ok in the latest commits

@astefanutti
Copy link
Member

Could you please rebase, and make sure to remove the extra merge commit "Merge branch 'e2e-test-cli'"?

@vsokolovskii vsokolovskii changed the title e2e kamel cli delete test e2e kamel cli tests Mar 16, 2021
@vsokolovskii
Copy link
Contributor Author

vsokolovskii commented Mar 16, 2021

Could you please rebase, and make sure to remove the extra merge commit "Merge branch 'e2e-test-cli'"?

Done :) the history is clean now

Expect(Kamel("run", "../files/yaml.yaml", "-n", ns).Execute()).To(Succeed())
Eventually(IntegrationPodPhase(ns, "yaml"), TestTimeoutLong).Should(Equal(v1.PodRunning))
str := GetOutputString(Kamel("get", "-n", ns))
Expect(str).Should(ContainSubstring("yaml\tRunning\tkit-"))
Copy link
Contributor

@bouskaJ bouskaJ Mar 17, 2021

Choose a reason for hiding this comment

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

You can check the whole kit name. Integration("yaml",ns)().Status.Kit

e2e/common/cli/get_test.go Outdated Show resolved Hide resolved
e2e/common/cli/get_test.go Outdated Show resolved Hide resolved
@vsokolovskii vsokolovskii changed the title e2e kamel cli tests test: e2e kamel cli tests Apr 9, 2021
@vsokolovskii
Copy link
Contributor Author

@oscerd Could you run the tests again please?

@oscerd
Copy link
Contributor

oscerd commented Jun 1, 2021

Restarted.

@vsokolovskii
Copy link
Contributor Author

vsokolovskii commented Jun 1, 2021

@oscerd tests on k8 were successful, made some changes to adjust the test suit to the openshift, but failure of builder-it (Buildah) was not affected by my changes, seems that there were some problems with github/dockerhub packages or sth. Could you run the pipe one more time please, hopefully the last one 😄

@astefanutti astefanutti added the area/cli Kamel CLI label Jun 15, 2021
@astefanutti
Copy link
Member

The root cause of the issue with running the debug command in a separate routine may lie in the usage of Viper static methods, that relies on a static instance:

fatal error: concurrent map iteration and map write

goroutine 2563 [running]:
runtime.throw(0x2517dd2, 0x26)
	/opt/hostedtoolcache/go/1.15.13/x64/src/runtime/panic.go:1116 +0x72 fp=0xc0006f1398 sp=0xc0006f1368 pc=0x439972
runtime.mapiternext(0xc001068720)
	/opt/hostedtoolcache/go/1.15.13/x64/src/runtime/map.go:853 +0x554 fp=0xc0006f1418 sp=0xc0006f1398 pc=0x412ab4
reflect.mapiternext(0xc001068720)
	/opt/hostedtoolcache/go/1.15.13/x64/src/runtime/map.go:1337 +0x2b fp=0xc0006f1430 sp=0xc0006f1418 pc=0x46bc0b
reflect.(*MapIter).Next(0xc0002143c0, 0x2213580)
	/opt/hostedtoolcache/go/1.15.13/x64/src/reflect/value.go:1277 +0xd6 fp=0xc0006f1458 sp=0xc0006f1430 pc=0x4deb36
internal/fmtsort.Sort(0x216a200, 0xc0007d7410, 0x15, 0x28d13c0)
	/opt/hostedtoolcache/go/1.15.13/x64/src/internal/fmtsort/sort.go:63 +0x1ac fp=0xc0006f1508 sp=0xc0006f1458 pc=0x4f1a4c
fmt.(*pp).printValue(0xc0009c60d0, 0x216a200, 0xc0007d7410, 0x15, 0x7fb900000076, 0x0)
	/opt/hostedtoolcache/go/1.15.13/x64/src/fmt/print.go:773 +0xca5 fp=0xc0006f16e0 sp=0xc0006f1508 pc=0x4fb1c5
fmt.(*pp).printArg(0xc0009c60d0, 0x216a200, 0xc0007d7410, 0x76)
	/opt/hostedtoolcache/go/1.15.13/x64/src/fmt/print.go:716 +0x2b4 fp=0xc0006f1778 sp=0xc0006f16e0 pc=0x4f9e74
fmt.(*pp).doPrintf(0xc0009c60d0, 0x254d701, 0x37, 0xc0006f1918, 0x2, 0x2)
	/opt/hostedtoolcache/go/1.15.13/x64/src/fmt/print.go:1030 +0x168 fp=0xc0006f1860 sp=0xc0006f1778 pc=0x4fd468
fmt.Errorf(0x254d701, 0x37, 0xc0006f1918, 0x2, 0x2, 0x30, 0x30)
	/opt/hostedtoolcache/go/1.15.13/x64/src/fmt/errors.go:20 +0x77 fp=0xc0006f18c8 sp=0xc0006f1860 pc=0x4f33b7
github.com/spf13/cast.ToStringMapE(0x216a200, 0xc0007d7410, 0x1e87015, 0x2f0000c00076b320, 0xc0007d7380)
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/caste.go:989 +0x217 fp=0xc0006f19a8 sp=0xc0006f18c8 pc=0x1e29b77
github.com/spf13/cast.ToStringMap(...)
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/cast.go:139
github.com/spf13/viper.(*Viper).isPathShadowedInFlatMap(0xc00076b320, 0xc0009c99b0, 0x3, 0x3, 0x216a200, 0xc0007d7410, 0x0, 0x3)
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/viper.go:663 +0x73 fp=0xc0006f1a10 sp=0xc0006f19a8 pc=0x1e87173
github.com/spf13/viper.(*Viper).find(0xc00076b320, 0xc00021adb0, 0x24, 0x1, 0x41617b, 0xc0006f1bd0)
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/viper.go:1092 +0xe6e fp=0xc0006f1b30 sp=0xc0006f1a10 pc=0x1e8a12e
github.com/spf13/viper.(*Viper).Get(0xc00076b320, 0xc00021adb0, 0x24, 0xf, 0xc000af9528)
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/viper.go:728 +0x85 fp=0xc0006f1bc0 sp=0xc0006f1b30 pc=0x1e87465
github.com/spf13/viper.(*Viper).AllSettings(0xc00076b320, 0xc00168a248)
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/viper.go:1923 +0xbc fp=0xc0006f1c80 sp=0xc0006f1bc0 pc=0x1e9191c
github.com/spf13/viper.AllSettings(...)
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/viper.go:1918
github.com/apache/camel-k/pkg/cmd.decodeKey(0x22d5ec0, 0xc0009f40e0, 0xc0008a1355, 0xb, 0x1, 0x3)
	/home/runner/work/camel-k/camel-k/pkg/cmd/util.go:120 +0xb8 fp=0xc0006f1d98 sp=0xc0006f1c80 pc=0x1f1a458
github.com/apache/camel-k/pkg/cmd.decode.func1(0xc00092e000, 0xc000af23f0, 0x1, 0x3, 0x0, 0x0)
	/home/runner/work/camel-k/camel-k/pkg/cmd/util.go:164 +0x71 fp=0xc0006f1de8 sp=0xc0006f1d98 pc=0x1f2e011
github.com/spf13/cobra.(*Command).execute(0xc00092e000, 0xc000af2390, 0x3, 0x3, 0xc00092e000, 0xc000af2390)
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:839 +0x530 fp=0xc0006f1ec0 sp=0xc0006f1de8 pc=0x1374450
github.com/spf13/cobra.(*Command).ExecuteC(0xc000ffe000, 0x0, 0xc000e3afc0, 0xc00026f080)
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:958 +0x375 fp=0xc0006f1f98 sp=0xc0006f1ec0 pc=0x1374f15
github.com/spf13/cobra.(*Command).Execute(0xc000ffe000, 0xc000ffe000, 0x0)
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:895 +0x2b fp=0xc0006f1fc8 sp=0xc0006f1f98 pc=0x1374b6b
runtime.goexit()
	/opt/hostedtoolcache/go/1.15.13/x64/src/runtime/asm_amd64.s:1374 +0x1 fp=0xc0006f1fd0 sp=0xc0006f1fc8 pc=0x472421
created by github.com/apache/camel-k/e2e/common/cli.TestKamelCLIDebug.func1.3
	/home/runner/work/camel-k/camel-k/e2e/common/cli/debug_test.go:71 +0x3a7

A possible solution would be to create a separate Viper instance, for each command execution.

@astefanutti
Copy link
Member

Superseded by #2422. Tests for the kamel debug command will be part of a new PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli Kamel CLI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants