Skip to content

Commit

Permalink
remove flaky test for incorrect deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
tejal29 committed Jul 10, 2019
1 parent 9992136 commit 23774e0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.
6 changes: 1 addition & 5 deletions integration/deploy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
package integration

import (
"strings"
"testing"

"github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/flags"
Expand Down Expand Up @@ -110,13 +109,10 @@ func TestDeployWithInCorrectConfig(t *testing.T) {
ns, _, deleteNs := SetupNamespace(t)
defer deleteNs()

out, err := skaffold.Deploy().InDir("testdata/unstable-deployment").InNs(ns.Name).RunWithOutput(t)
err := skaffold.Deploy().InDir("testdata/unstable-deployment").InNs(ns.Name).Run(t)
if err == nil {
t.Error("expected an error to see since the deployment is not stable. However deploy returned success")
}
if !strings.Contains(string(out), "exceeded its progress deadline") {
t.Errorf("expected to see message :exceeded progress deadline error. however saw this error %s", string(out))
}

skaffold.Delete().InDir("testdata/unstable-deployment").InNs(ns.Name).RunOrFail(t)
}
Expand Down
18 changes: 0 additions & 18 deletions integration/skaffold/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,24 +172,6 @@ func (b *RunBuilder) Run(t *testing.T) error {
return nil
}

// RunWithOutput runs the skaffold command with output.
func (b *RunBuilder) RunWithOutput(t *testing.T) ([]byte, error) {
t.Helper()

cmd := b.cmd(context.Background())
cmd.Stdout, cmd.Stderr = nil, nil
logrus.Infoln(cmd.Args)

start := time.Now()
out, err := cmd.Output()
if err != nil {
return out, errors.Wrapf(err, "skaffold %s", b.command)
}

logrus.Infoln("Ran in", time.Since(start))
return out, nil
}

// RunOrFailOutput runs the skaffold command and fails the test
// if the command returns an error.
// It only returns the standard output.
Expand Down

0 comments on commit 23774e0

Please sign in to comment.