Skip to content

Commit

Permalink
test: Switch from Cilium test logger to Ginkgo
Browse files Browse the repository at this point in the history
When executing ginkgo according to the instructions[0], the only error
output was:

  FAIL: Cannot connect to vmName 'k8s1-1.18'

After this change, the logs show the underlying error:

  cat: ssh-config: No such file or directory

[0] https://docs.cilium.io/en/v1.8/contributing/testing/e2e/#running-end-to-end-tests-in-other-environments-via-ssh

Signed-off-by: Manuel Buil <mbuil@suse.com>
  • Loading branch information
manuelbuil authored and aanm committed Nov 11, 2020
1 parent 13ac099 commit 6e4b475
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test/helpers/vagrant.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (

"github.com/cilium/cilium/test/config"
ginkgoext "github.com/cilium/cilium/test/ginkgo-ext"
"github.com/cilium/cilium/test/logger"

"github.com/onsi/ginkgo"
"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -85,7 +84,7 @@ func GetVagrantSSHMetadata(vmName string) ([]byte, error) {
debugVms := func() {
cmd := getCmd("vagrant status --machine-readable")
output, _ := cmd.CombinedOutput()
fmt.Fprintf(&logger.TestLogWriter, "Vagrant status on failure:\n%s\n", output)
ginkgoext.Failf("Vagrant status on failure:\n%s\n", output)
}

var stdout, stderr bytes.Buffer
Expand All @@ -99,7 +98,7 @@ func GetVagrantSSHMetadata(vmName string) ([]byte, error) {

err := cmd.Run()
if err != nil {
fmt.Fprintf(&logger.TestLogWriter, "cmd='%s %s'\noutput:\n%s\nstderr:\n%s\n",
ginkgoext.GinkgoPrint("cmd='%s %s'\noutput:\n%s\nstderr:\n%s\n",
cmd.Path, strings.Join(cmd.Args, " "), stdout.String(), stderr.String())
debugVms()
return nil, err
Expand Down

0 comments on commit 6e4b475

Please sign in to comment.