test: print merge commit (#581)

* test: printf merge commit

Signed-off-by: Gaius <gaius.qi@gmail.com>
This commit is contained in:
Gaius 2021-08-26 10:38:57 +08:00
parent 4185dd428c
commit 4963da47aa
No known key found for this signature in database
GPG Key ID: 8B4E5D1290FA2FFB
1 changed files with 2 additions and 3 deletions

View File

@ -30,20 +30,19 @@ var _ = BeforeSuite(func() {
out, err := e2eutil.GitCommand("rev-parse", "--short", "HEAD").CombinedOutput()
Expect(err).NotTo(HaveOccurred())
gitCommit := strings.Fields(string(out))[0]
fmt.Println(gitCommit)
fmt.Printf("git merge commit: %s\n", gitCommit)
out, err = e2eutil.KubeCtlCommand("-n", dragonflyNamespace, "get", "pod", "-l", "component=dfdaemon",
"-o", "jsonpath='{range .items[*]}{.metadata.name}{end}'").CombinedOutput()
podName := strings.Trim(string(out), "'")
Expect(err).NotTo(HaveOccurred())
fmt.Println(podName)
Expect(strings.HasPrefix(podName, "dragonfly-dfdaemon-")).Should(BeTrue())
pod := e2eutil.NewPodExec(dragonflyNamespace, podName, "dfdaemon")
out, err = pod.Command("dfget", "version").CombinedOutput()
Expect(err).NotTo(HaveOccurred())
dfgetGitCommit := strings.Fields(string(out))[7]
fmt.Println(dfgetGitCommit)
fmt.Printf("dfget merge commit: %s\n", gitCommit)
Expect(gitCommit).To(Equal(dfgetGitCommit))
})