From 84830482e6c4d05ae3065a5827b7b539d7a88eda Mon Sep 17 00:00:00 2001 From: Jordan Olshevski Date: Tue, 12 Dec 2023 19:32:48 +0000 Subject: [PATCH] Test fixes --- internal/reconstitution/manager_test.go | 1 + internal/reconstitution/reconstituter_test.go | 3 ++- internal/testutil/testutil.go | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/reconstitution/manager_test.go b/internal/reconstitution/manager_test.go index c7334bf5..eab20fd4 100644 --- a/internal/reconstitution/manager_test.go +++ b/internal/reconstitution/manager_test.go @@ -35,6 +35,7 @@ func TestManagerBasics(t *testing.T) { comp.Status.CurrentState = &apiv1.Synthesis{ ObservedCompositionGeneration: comp.Generation, ResourceSlices: []*apiv1.ResourceSliceRef{{Name: "test-slice"}}, + Synthesized: true, } require.NoError(t, client.Status().Update(ctx, comp)) diff --git a/internal/reconstitution/reconstituter_test.go b/internal/reconstitution/reconstituter_test.go index bce35733..c80062a0 100644 --- a/internal/reconstitution/reconstituter_test.go +++ b/internal/reconstitution/reconstituter_test.go @@ -33,13 +33,14 @@ func TestReconstituterIntegration(t *testing.T) { comp.Status.CurrentState = &apiv1.Synthesis{ ObservedCompositionGeneration: comp.Generation, ResourceSlices: []*apiv1.ResourceSliceRef{{Name: "test-slice"}}, + Synthesized: true, } require.NoError(t, client.Status().Update(ctx, comp)) slice := &apiv1.ResourceSlice{} slice.Name = "test-slice" slice.Namespace = "default" - slice.Spec.CompositionGeneration = comp.Generation + slice.Spec.CompositionGeneration = comp.Generation // TODO: Do we actually need this? slice.Spec.Resources = []apiv1.Manifest{{ Manifest: `{"kind":"baz","apiVersion":"any","metadata":{"name":"foo","namespace":"bar"}}`, }} diff --git a/internal/testutil/testutil.go b/internal/testutil/testutil.go index 6e581e9b..b7222eaa 100644 --- a/internal/testutil/testutil.go +++ b/internal/testutil/testutil.go @@ -56,6 +56,7 @@ func NewContext(t *testing.T) context.Context { } func NewManager(t *testing.T) *Manager { + t.Parallel() _, b, _, _ := goruntime.Caller(0) root := filepath.Join(filepath.Dir(b), "..", "..")