Skip to content

Commit

Permalink
test: fix tests after the changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomasz Gągor committed Jan 15, 2025
1 parent 5d65a65 commit 236b1d7
Showing 1 changed file with 25 additions and 9 deletions.
34 changes: 25 additions & 9 deletions tests/smoke_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ func TestCase1(t *testing.T) {

out, err := shell.RunCommandAndGetOutputE(t, cmd)
assert.Nil(t, err)
assert.Regexp(t, "Building.*image=test-case-1", out)
// no --build flag in test
assert.NotNil(t, out)
// assert.Regexp(t, "Building.*image=test-case-1", out)

// command should not fail
code, err := shell.GetExitCodeForRunCommandError(err)
Expand Down Expand Up @@ -106,8 +108,10 @@ func TestCase2(t *testing.T) {

out, err := shell.RunCommandAndGetOutputE(t, cmd)
assert.Nil(t, err)
assert.Regexp(t, "Building.*image=test-case-2", out)
assert.Regexp(t, "Building.*image=test-case-2b", out)
// no --build flag
assert.NotNil(t, out)
// assert.Regexp(t, "Building.*image=test-case-2", out)
// assert.Regexp(t, "Building.*image=test-case-2b", out)

// not all of them match but should
assert.Contains(t, out, "\"maintainer\":\"Tomasz Gągor <[email protected]>\"")
Expand Down Expand Up @@ -166,7 +170,9 @@ func TestCase4(t *testing.T) {

out, err := shell.RunCommandAndGetOutputE(t, cmd)
assert.Nil(t, err)
assert.Regexp(t, "Building.*image=test-case-4", out)
// no --build flag
assert.NotNil(t, out)
// assert.Regexp(t, "Building.*image=test-case-4", out)

// do not fail
code, err := shell.GetExitCodeForRunCommandError(err)
Expand All @@ -187,7 +193,9 @@ func TestCase5(t *testing.T) {

out, err := shell.RunCommandAndGetOutputE(t, cmd)
assert.Nil(t, err)
assert.Regexp(t, "Building.*image=test-case-5", out)
// no --build flag
assert.NotNil(t, out)
// assert.Regexp(t, "Building.*image=test-case-5", out)

// do not fail
code, err := shell.GetExitCodeForRunCommandError(err)
Expand All @@ -207,7 +215,9 @@ func TestCase6(t *testing.T) {

out, err := shell.RunCommandAndGetOutputE(t, cmd)
assert.Nil(t, err)
assert.Regexp(t, "Building.*image=test-case-6", out)
// no --build flags
assert.NotNil(t, out)
// assert.Regexp(t, "Building.*image=test-case-6", out)

// do not fail
code, err := shell.GetExitCodeForRunCommandError(err)
Expand All @@ -226,7 +236,9 @@ func TestCase7(t *testing.T) {

out, err := shell.RunCommandAndGetOutputE(t, cmd)
assert.Nil(t, err)
assert.Regexp(t, "Building.*image=test-case-7", out)
// no --build flag
assert.NotNil(t, out)
// assert.Regexp(t, "Building.*image=test-case-7", out)

// do not fail
code, err := shell.GetExitCodeForRunCommandError(err)
Expand All @@ -246,7 +258,9 @@ func TestCase8(t *testing.T) {

out, err := shell.RunCommandAndGetOutputE(t, cmd)
assert.Nil(t, err)
assert.Regexp(t, "Building.*image=test-case-8", out)
// no --build flag
assert.NotNil(t, out)
// assert.Regexp(t, "Building.*image=test-case-8", out)
assert.Contains(t, out, "Skipping excluded config set=")

// do not fail
Expand All @@ -266,7 +280,9 @@ func TestCase9(t *testing.T) {

out, err := shell.RunCommandAndGetOutputE(t, cmd)
assert.Nil(t, err)
assert.Regexp(t, "Building.*image=test-case-9", out)
// no --build flag
assert.NotNil(t, out)
// assert.Regexp(t, "Building.*image=test-case-9", out)

// should generage args
// FIXME: amend after changes
Expand Down

0 comments on commit 236b1d7

Please sign in to comment.