Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions extensions/base/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ package base

import (
"fmt"
"github.com/networkservicemesh/gotestmd/pkg/bash"
"github.com/sirupsen/logrus"
"strings"

"github.com/networkservicemesh/gotestmd/pkg/suites/shell"
"github.com/networkservicemesh/integration-tests/extensions/checkout"
"github.com/networkservicemesh/integration-tests/extensions/logs"
"github.com/networkservicemesh/integration-tests/extensions/prefetch"
)

Expand All @@ -38,12 +39,18 @@ type Suite struct {

// AfterTest stores logs after each test in the suite.
func (s *Suite) AfterTest(_, _ string) {
s.storeTestLogs()
runner, err := bash.New()
if err != nil {
return
}
_, _, exitCode, err := runner.Run("kubectl cluster-info dump " + "> " + s.T().Name() + ".log")
if exitCode != 0 || err != nil {
logrus.Errorf("An error while retrieving cluster-info dump")
}
}

// BeforeTest starts capture logs for each test in the suite.
func (s *Suite) BeforeTest(_, _ string) {
s.storeTestLogs = logs.Capture(s.T().Name())
}

// TearDownSuite stores logs from containers that spawned during SuiteSetup.
Expand Down Expand Up @@ -85,5 +92,5 @@ func (s *Suite) SetupSuite() {
s.prefetch.SetT(s.T())
s.prefetch.SetupSuite()

s.storeSuiteLogs = logs.Capture(s.T().Name())
// s.storeSuiteLogs = logs.Capture(s.T().Name()) TODO: check the suite, if basic => do the dump
}