Skip to content

Commit 24664ca

Browse files
committed
Fix tests for token flow having different error message
Depending on whether the test is executed in CA vs. running them locally with `make test`, the resulting error message was different for the `multiple-select-ui` and `ignore-provisioner-flag` test cases. For now we just test for an error, but it would be nice to refactor a bit and trigger specific error cases in the future.
1 parent 65cf93e commit 24664ca

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

utils/cautils/token_flow_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,7 @@ func TestProvisionerPromptPrompts(t *testing.T) {
9191
p2 := &provisioner.SCEP{Name: "scep"}
9292

9393
got, err := provisionerPrompt(clictx, []provisioner.Interface{p1, p2})
94-
require.Nil(t, got)
95-
require.ErrorContains(t, err, "error allocating terminal") // TODO(hs): would be nice to refactor to configurable output
94+
require.Error(t, err) // TODO(hs): would be nice to refactor to configurable output, and catch specific error cases (again)
9695
require.Nil(t, got)
9796
})
9897

@@ -158,7 +157,7 @@ func TestProvisionerPromptPrompts(t *testing.T) {
158157
p2 := &provisioner.OIDC{Name: "oidc-2", ClientID: "client-id-1"}
159158

160159
got, err := provisionerPrompt(clictx, []provisioner.Interface{p1, p2})
161-
require.ErrorContains(t, err, "error allocating terminal") // TODO(hs): would be nice to refactor to configurable output
160+
require.Error(t, err) // TODO(hs): would be nice to refactor to configurable output, and catch specific error cases (again)
162161
require.Nil(t, got)
163162
})
164163
}

0 commit comments

Comments
 (0)