fix(targets): Use correct error string in enterprise (#2984)

In enterprise the error is different, so we need a different
test error string to compare against. Create a variable
that can be overwritten in the enterprise repo.
This commit is contained in:
Johan Brandhorst-Satzkorn authored and GitHub committed 2023-02-16 20:34:25 -05:00
1 parent 8a0ee97f3b
commit 18eed58ec5
1 file changed
+4 -1
@@ -79,6 +79,9 @@ var testAuthorizedActions = []string{
"authorize-session",
}
// Create a variable that we can overwrite in enterprise tests
var expectedDeprecatedWorkerFilterError = "Use egress_worker_filter instead"
func testService(t *testing.T, ctx context.Context, conn *db.DB, kms *kms.Kms, wrapper wrapping.Wrapper) (targets.Service, error) {
rw := db.New(conn)
sche := scheduler.TestScheduler(t, conn, wrapper)
@@ -689,7 +692,7 @@ func TestCreate(t *testing.T) {
}},
res: nil,
err: handlers.ApiErrorWithCode(codes.InvalidArgument),
errStr: "Use egress_worker_filter instead",
errStr: expectedDeprecatedWorkerFilterError,
},
{
name: "Ingress filter unsupported on OSS",