From f25e195f1fb1b652a07901077be34a60f3bce312 Mon Sep 17 00:00:00 2001 From: Mikhail Shilkov Date: Wed, 27 Nov 2024 18:03:43 +0100 Subject: [PATCH] Adjust replay tests --- dynamic/provider_test.go | 1 + pkg/pf/tests/provider_check_test.go | 6 +++-- pkg/pf/tests/provider_configure_test.go | 15 ++++++++---- pkg/pf/tests/provider_read_test.go | 6 +++-- .../genrandom/random-delete-preview.json | 3 ++- .../genrandom/random-delete-update.json | 3 ++- .../genrandom/random-empty-preview.json | 3 ++- .../genrandom/random-empty-update.json | 3 ++- .../genrandom/random-initial-preview.json | 3 ++- .../genrandom/random-initial-update.json | 3 ++- .../genrandom/random-replace-preview.json | 3 ++- .../genrandom/random-replace-update.json | 3 ++- pkg/pf/tests/testdata/updateprogram.json | 24 ++++++++++++------- pkg/tfbridge/provider_test.go | 21 ++++++++++------ pkg/x/muxer/tests/muxer_test.go | 9 ++++--- x/muxer/tests/muxer_test.go | 23 ++++++++++-------- 16 files changed, 84 insertions(+), 45 deletions(-) diff --git a/dynamic/provider_test.go b/dynamic/provider_test.go index 101cb59b4b..e855f9b8ac 100644 --- a/dynamic/provider_test.go +++ b/dynamic/provider_test.go @@ -234,6 +234,7 @@ func TestConfigure(t *testing.T) { }), }, noParallel, expect(autogold.Expect(`{ "acceptResources": true, + "supportsAutonamingConfiguration": true, "supportsPreview": true }`)))(t) diff --git a/pkg/pf/tests/provider_check_test.go b/pkg/pf/tests/provider_check_test.go index 30fc24d8dd..87e12764ca 100644 --- a/pkg/pf/tests/provider_check_test.go +++ b/pkg/pf/tests/provider_check_test.go @@ -190,7 +190,8 @@ func TestCheck(t *testing.T) { }, "response": { "supportsPreview": true, - "acceptResources": true + "acceptResources": true, + "supportsAutonamingConfiguration": true } }, { @@ -238,7 +239,8 @@ func TestCheck(t *testing.T) { }, "response": { "supportsPreview": true, - "acceptResources": true + "acceptResources": true, + "supportsAutonamingConfiguration": true } }, { diff --git a/pkg/pf/tests/provider_configure_test.go b/pkg/pf/tests/provider_configure_test.go index c294f2e668..a1602b2dfd 100644 --- a/pkg/pf/tests/provider_configure_test.go +++ b/pkg/pf/tests/provider_configure_test.go @@ -491,7 +491,8 @@ func TestConfigureToCreate(t *testing.T) { }, "response": { "supportsPreview": true, - "acceptResources": true + "acceptResources": true, + "supportsAutonamingConfiguration": true } }, { @@ -527,7 +528,8 @@ func TestConfigureBooleans(t *testing.T) { }, "response": { "supportsPreview": true, - "acceptResources": true + "acceptResources": true, + "supportsAutonamingConfiguration": true } }`) } @@ -610,7 +612,8 @@ func TestJSONNestedConfigure(t *testing.T) { }, "response": { "supportsPreview": true, - "acceptResources": true + "acceptResources": true, + "supportsAutonamingConfiguration": true } }`) } @@ -635,7 +638,8 @@ func TestJSONNestedConfigureWithSecrets(t *testing.T) { }, "response": { "supportsPreview": true, - "acceptResources": true + "acceptResources": true, + "supportsAutonamingConfiguration": true } }, { @@ -687,7 +691,8 @@ func TestConfigureWithSecrets(t *testing.T) { }, "response": { "supportsPreview": true, - "acceptResources": true + "acceptResources": true, + "supportsAutonamingConfiguration": true } }, { diff --git a/pkg/pf/tests/provider_read_test.go b/pkg/pf/tests/provider_read_test.go index 6012f9b918..0688fd5faa 100644 --- a/pkg/pf/tests/provider_read_test.go +++ b/pkg/pf/tests/provider_read_test.go @@ -57,7 +57,8 @@ func TestReadFromRefresh(t *testing.T) { }, "response": { "supportsPreview": true, - "acceptResources": true + "acceptResources": true, + "supportsAutonamingConfiguration": true }, "metadata": { "kind": "resource", @@ -433,7 +434,8 @@ func TestRefreshSupportsCustomID(t *testing.T) { }, "response": { "supportsPreview": true, - "acceptResources": true + "acceptResources": true, + "supportsAutonamingConfiguration": true }, "metadata": { "kind": "resource", diff --git a/pkg/pf/tests/testdata/genrandom/random-delete-preview.json b/pkg/pf/tests/testdata/genrandom/random-delete-preview.json index 6a72641504..78dac0ff58 100644 --- a/pkg/pf/tests/testdata/genrandom/random-delete-preview.json +++ b/pkg/pf/tests/testdata/genrandom/random-delete-preview.json @@ -328,7 +328,8 @@ }, "response": { "supportsPreview": true, - "acceptResources": true + "acceptResources": true, + "supportsAutonamingConfiguration": true }, "metadata": { "kind": "resource", diff --git a/pkg/pf/tests/testdata/genrandom/random-delete-update.json b/pkg/pf/tests/testdata/genrandom/random-delete-update.json index 5681bea1f8..6bc378219e 100644 --- a/pkg/pf/tests/testdata/genrandom/random-delete-update.json +++ b/pkg/pf/tests/testdata/genrandom/random-delete-update.json @@ -327,7 +327,8 @@ }, "response": { "supportsPreview": true, - "acceptResources": true + "acceptResources": true, + "supportsAutonamingConfiguration": true }, "metadata": { "kind": "resource", diff --git a/pkg/pf/tests/testdata/genrandom/random-empty-preview.json b/pkg/pf/tests/testdata/genrandom/random-empty-preview.json index 219e358085..c40350f99c 100644 --- a/pkg/pf/tests/testdata/genrandom/random-empty-preview.json +++ b/pkg/pf/tests/testdata/genrandom/random-empty-preview.json @@ -373,7 +373,8 @@ }, "response": { "supportsPreview": true, - "acceptResources": true + "acceptResources": true, + "supportsAutonamingConfiguration": true }, "metadata": { "kind": "resource", diff --git a/pkg/pf/tests/testdata/genrandom/random-empty-update.json b/pkg/pf/tests/testdata/genrandom/random-empty-update.json index d785476774..65c4715f6f 100644 --- a/pkg/pf/tests/testdata/genrandom/random-empty-update.json +++ b/pkg/pf/tests/testdata/genrandom/random-empty-update.json @@ -373,7 +373,8 @@ }, "response": { "supportsPreview": true, - "acceptResources": true + "acceptResources": true, + "supportsAutonamingConfiguration": true }, "metadata": { "kind": "resource", diff --git a/pkg/pf/tests/testdata/genrandom/random-initial-preview.json b/pkg/pf/tests/testdata/genrandom/random-initial-preview.json index 3cc612a363..51ff10f5e2 100644 --- a/pkg/pf/tests/testdata/genrandom/random-initial-preview.json +++ b/pkg/pf/tests/testdata/genrandom/random-initial-preview.json @@ -348,7 +348,8 @@ }, "response": { "supportsPreview": true, - "acceptResources": true + "acceptResources": true, + "supportsAutonamingConfiguration": true }, "metadata": { "kind": "resource", diff --git a/pkg/pf/tests/testdata/genrandom/random-initial-update.json b/pkg/pf/tests/testdata/genrandom/random-initial-update.json index e0b41e54f2..4065ec8ff2 100644 --- a/pkg/pf/tests/testdata/genrandom/random-initial-update.json +++ b/pkg/pf/tests/testdata/genrandom/random-initial-update.json @@ -348,7 +348,8 @@ }, "response": { "supportsPreview": true, - "acceptResources": true + "acceptResources": true, + "supportsAutonamingConfiguration": true }, "metadata": { "kind": "resource", diff --git a/pkg/pf/tests/testdata/genrandom/random-replace-preview.json b/pkg/pf/tests/testdata/genrandom/random-replace-preview.json index d3f47b7339..f8396d4ff6 100644 --- a/pkg/pf/tests/testdata/genrandom/random-replace-preview.json +++ b/pkg/pf/tests/testdata/genrandom/random-replace-preview.json @@ -373,7 +373,8 @@ }, "response": { "supportsPreview": true, - "acceptResources": true + "acceptResources": true, + "supportsAutonamingConfiguration": true }, "metadata": { "kind": "resource", diff --git a/pkg/pf/tests/testdata/genrandom/random-replace-update.json b/pkg/pf/tests/testdata/genrandom/random-replace-update.json index 705f918598..a1086188a0 100644 --- a/pkg/pf/tests/testdata/genrandom/random-replace-update.json +++ b/pkg/pf/tests/testdata/genrandom/random-replace-update.json @@ -373,7 +373,8 @@ }, "response": { "supportsPreview": true, - "acceptResources": true + "acceptResources": true, + "supportsAutonamingConfiguration": true }, "metadata": { "kind": "resource", diff --git a/pkg/pf/tests/testdata/updateprogram.json b/pkg/pf/tests/testdata/updateprogram.json index 580db34cbc..84436a6ad8 100644 --- a/pkg/pf/tests/testdata/updateprogram.json +++ b/pkg/pf/tests/testdata/updateprogram.json @@ -124,7 +124,8 @@ }, "response": { "supportsPreview": true, - "acceptResources": true + "acceptResources": true, + "supportsAutonamingConfiguration": true }, "metadata": { "kind": "resource", @@ -376,7 +377,8 @@ }, "response": { "supportsPreview": true, - "acceptResources": true + "acceptResources": true, + "supportsAutonamingConfiguration": true }, "metadata": { "kind": "resource", @@ -558,7 +560,8 @@ }, "response": { "supportsPreview": true, - "acceptResources": true + "acceptResources": true, + "supportsAutonamingConfiguration": true }, "metadata": { "kind": "resource", @@ -844,7 +847,8 @@ }, "response": { "supportsPreview": true, - "acceptResources": true + "acceptResources": true, + "supportsAutonamingConfiguration": true }, "metadata": { "kind": "resource", @@ -1099,7 +1103,8 @@ }, "response": { "supportsPreview": true, - "acceptResources": true + "acceptResources": true, + "supportsAutonamingConfiguration": true }, "metadata": { "kind": "resource", @@ -1200,7 +1205,8 @@ }, "response": { "supportsPreview": true, - "acceptResources": true + "acceptResources": true, + "supportsAutonamingConfiguration": true }, "metadata": { "kind": "resource", @@ -1536,7 +1542,8 @@ }, "response": { "supportsPreview": true, - "acceptResources": true + "acceptResources": true, + "supportsAutonamingConfiguration": true }, "metadata": { "kind": "resource", @@ -1839,7 +1846,8 @@ }, "response": { "supportsPreview": true, - "acceptResources": true + "acceptResources": true, + "supportsAutonamingConfiguration": true }, "metadata": { "kind": "resource", diff --git a/pkg/tfbridge/provider_test.go b/pkg/tfbridge/provider_test.go index 0857a07fae..4c34440170 100644 --- a/pkg/tfbridge/provider_test.go +++ b/pkg/tfbridge/provider_test.go @@ -896,7 +896,8 @@ func TestCheckCallback(t *testing.T) { } }, "response": { - "supportsPreview": true + "supportsPreview": true, + "supportsAutonamingConfiguration": true } }, { @@ -1932,7 +1933,8 @@ func TestConfigure(t *testing.T) { "acceptResources": true }, "response": { - "supportsPreview": true + "supportsPreview": true, + "supportsAutonamingConfiguration": true } }`) }) @@ -3668,7 +3670,8 @@ func TestMaxItemsOneConflictsWith(t *testing.T) { "variables": {} }, "response": { - "supportsPreview": true + "supportsPreview": true, + "supportsAutonamingConfiguration": true } }, { @@ -3701,7 +3704,8 @@ func TestMaxItemsOneConflictsWith(t *testing.T) { "variables": {} }, "response": { - "supportsPreview": true + "supportsPreview": true, + "supportsAutonamingConfiguration": true } }, { @@ -3767,7 +3771,8 @@ func TestMinMaxItemsOneOptional(t *testing.T) { "variables": {} }, "response": { - "supportsPreview": true + "supportsPreview": true, + "supportsAutonamingConfiguration": true } }, { @@ -3798,7 +3803,8 @@ func TestMinMaxItemsOneOptional(t *testing.T) { "variables": {} }, "response": { - "supportsPreview": true + "supportsPreview": true, + "supportsAutonamingConfiguration": true } }, { @@ -3872,7 +3878,8 @@ func TestComputedMaxItemsOneNotSpecified(t *testing.T) { "variables": {} }, "response": { - "supportsPreview": true + "supportsPreview": true, + "supportsAutonamingConfiguration": true } }, { diff --git a/pkg/x/muxer/tests/muxer_test.go b/pkg/x/muxer/tests/muxer_test.go index ba2edce7ed..67de0eecfb 100644 --- a/pkg/x/muxer/tests/muxer_test.go +++ b/pkg/x/muxer/tests/muxer_test.go @@ -136,7 +136,8 @@ func TestConfigure(t *testing.T) { "c": "3" } }`, `{ - "supportsPreview": true + "supportsPreview": true, + "supportsAutonamingConfiguration": true }`, nil, part(0, `{ "args": { @@ -146,7 +147,8 @@ func TestConfigure(t *testing.T) { } }`, `{ "acceptSecrets": true, - "supportsPreview": true + "supportsPreview": true, + "supportsAutonamingConfiguration": true }`, nil), part(1, `{ "args": { @@ -156,7 +158,8 @@ func TestConfigure(t *testing.T) { } }`, `{ "supportsPreview": true, - "acceptResources": true + "acceptResources": true, + "supportsAutonamingConfiguration": true }`, nil), )) } diff --git a/x/muxer/tests/muxer_test.go b/x/muxer/tests/muxer_test.go index 64f6de92c2..47545e1c95 100644 --- a/x/muxer/tests/muxer_test.go +++ b/x/muxer/tests/muxer_test.go @@ -35,7 +35,7 @@ import ( ) func TestSimpleDispatch(t *testing.T) { - t.Parallel() + t.Parallel() var m muxer.DispatchTable m.Resources = map[string]int{ "test:mod:A": 0, @@ -70,7 +70,7 @@ func TestSimpleDispatch(t *testing.T) { } func TestCheckConfigErrorNotDuplicated(t *testing.T) { - t.Parallel() + t.Parallel() var m muxer.DispatchTable m.Resources = map[string]int{ "test:mod:A": 0, @@ -85,7 +85,7 @@ func TestCheckConfigErrorNotDuplicated(t *testing.T) { } func TestCheckConfigDifferentErrorsNotDropped(t *testing.T) { - t.Parallel() + t.Parallel() var m muxer.DispatchTable m.Resources = map[string]int{ "test:mod:A": 0, @@ -106,7 +106,7 @@ func TestCheckConfigDifferentErrorsNotDropped(t *testing.T) { } func TestCheckConfigOneErrorReturned(t *testing.T) { - t.Parallel() + t.Parallel() var m muxer.DispatchTable m.Resources = map[string]int{ "test:mod:A": 0, @@ -121,7 +121,7 @@ func TestCheckConfigOneErrorReturned(t *testing.T) { } func TestConfigure(t *testing.T) { - t.Parallel() + t.Parallel() var m muxer.DispatchTable m.Resources = map[string]int{ "test:mod:A": 0, @@ -136,7 +136,8 @@ func TestConfigure(t *testing.T) { "c": "3" } }`, `{ - "supportsPreview": true + "supportsPreview": true, + "supportsAutonamingConfiguration": true }`, nil, part(0, `{ "args": { @@ -146,7 +147,8 @@ func TestConfigure(t *testing.T) { } }`, `{ "acceptSecrets": true, - "supportsPreview": true + "supportsPreview": true, + "supportsAutonamingConfiguration": true }`, nil), part(1, `{ "args": { @@ -156,13 +158,14 @@ func TestConfigure(t *testing.T) { } }`, `{ "supportsPreview": true, - "acceptResources": true + "acceptResources": true, + "supportsAutonamingConfiguration": true }`, nil), )) } func TestDivergentCheckConfig(t *testing.T) { - t.Parallel() + t.Parallel() // Early versions of muxer failed hard on divergent responses from CheckConfig. This test ensures that it can // tolerate such responses (with logging or warning). The practical case is divergent handling of secret markers // where pf and v3 based providers respond with the same value but do not agree on the secret markers. @@ -203,7 +206,7 @@ func TestDivergentCheckConfig(t *testing.T) { } func TestGetMapping(t *testing.T) { - t.Parallel() + t.Parallel() t.Run("single-responding-server", func(t *testing.T) { var m muxer.DispatchTable m.Resources = map[string]int{