Skip to content

Commit

Permalink
Use a private kcp per disruptive replication test
Browse files Browse the repository at this point in the history
Signed-off-by: Andy Goldstein <andy.goldstein@redhat.com>
  • Loading branch information
ncdc committed Feb 2, 2023
1 parent 26d200c commit ba4a15b
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions test/e2e/reconciler/cache/replication_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,28 +444,30 @@ func TestReplication(t *testing.T) {
}
}

// TestReplicationDisruptive runs all disruptive tests in a private environment.
// TestReplicationDisruptive runs each disruptive test in its own private environment.
func TestReplicationDisruptive(t *testing.T) {
t.Parallel()
framework.Suite(t, "control-plane")

tokenAuthFile := framework.WriteTokenAuthFile(t)
server := framework.PrivateKcpServer(t,
framework.WithCustomArguments(framework.TestServerArgsWithTokenAuthFile(tokenAuthFile)...))
ctx, cancel := context.WithCancel(context.Background())
t.Cleanup(cancel)

kcpRootShardConfig := server.RootShardSystemMasterBaseConfig(t)
kcpRootShardDynamicClient, err := kcpdynamic.NewForConfig(kcpRootShardConfig)
require.NoError(t, err)
cacheClientRT := ClientRoundTrippersFor(kcpRootShardConfig)
cacheKcpClusterDynamicClient, err := kcpdynamic.NewForConfig(cacheClientRT)
require.NoError(t, err)

for _, scenario := range disruptiveScenarios {
scenario := scenario

t.Run(scenario.name, func(t *testing.T) {
t.Parallel()

tokenAuthFile := framework.WriteTokenAuthFile(t)
server := framework.PrivateKcpServer(t,
framework.WithCustomArguments(framework.TestServerArgsWithTokenAuthFile(tokenAuthFile)...))
ctx, cancel := context.WithCancel(context.Background())
t.Cleanup(cancel)

kcpRootShardConfig := server.RootShardSystemMasterBaseConfig(t)
kcpRootShardDynamicClient, err := kcpdynamic.NewForConfig(kcpRootShardConfig)
require.NoError(t, err)
cacheClientRT := ClientRoundTrippersFor(kcpRootShardConfig)
cacheKcpClusterDynamicClient, err := kcpdynamic.NewForConfig(cacheClientRT)
require.NoError(t, err)

scenario.work(ctx, t, server, kcpRootShardDynamicClient, cacheKcpClusterDynamicClient)
})
}
Expand Down

0 comments on commit ba4a15b

Please sign in to comment.