Skip to content

Commit 83cc0d0

Browse files
committed
fix dashboards_test.go - in one case we actually required to have an error
1 parent 7a516c8 commit 83cc0d0

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

integration/bundle/dashboards_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ func TestDashboards(t *testing.T) {
5252
require.NoError(t, err)
5353

5454
// Try to redeploy the bundle and confirm that the out of band modification is detected.
55-
stdout, _ := deployBundleWithArgs(t, ctx, root)
55+
stdout, _, err := deployBundleWithArgsErr(t, ctx, root)
56+
require.Error(t, err)
5657
assert.Contains(t, stdout, `Error: dashboard "file_reference" has been modified remotely`+"\n")
5758

5859
// Redeploy the bundle with the --force flag and confirm that the out of band modification is ignored.

integration/bundle/helpers_test.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,18 @@ func deployBundle(t testutil.TestingT, ctx context.Context, path string) {
8787
require.NoError(t, err)
8888
}
8989

90-
func deployBundleWithArgs(t testutil.TestingT, ctx context.Context, path string, args ...string) (string, string) {
90+
func deployBundleWithArgsErr(t testutil.TestingT, ctx context.Context, path string, args ...string) (string, string, error) {
9191
ctx = env.Set(ctx, "BUNDLE_ROOT", path)
9292
args = append([]string{"bundle", "deploy"}, args...)
9393
c := testcli.NewRunnerWithContext(t, ctx, args...)
9494
stdout, stderr, err := c.Run()
95+
return stdout.String(), stderr.String(), err
96+
}
97+
98+
func deployBundleWithArgs(t testutil.TestingT, ctx context.Context, path string, args ...string) (string, string) {
99+
stdout, stderr, err := deployBundleWithArgsErr(t, ctx, path, args...)
95100
require.NoError(t, err)
96-
return stdout.String(), stderr.String()
101+
return stdout, stderr
97102
}
98103

99104
func deployBundleWithFlags(t testutil.TestingT, ctx context.Context, path string, flags []string) {

0 commit comments

Comments
 (0)