Skip to content

Commit

Permalink
addressed Ashwin's comment to refactor fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
wilkermichael committed Jul 27, 2023
1 parent 04758d7 commit 5cb29f3
Show file tree
Hide file tree
Showing 21 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: MPL-2.0

resources:
- ../../../bases/exportedservices-ap1
- ../../../../bases/exportedservices-ap1

patchesStrategicMerge:
- patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: MPL-2.0

resources:
- ../../../bases/exportedservices-default
- ../../../../bases/exportedservices-default

patchesStrategicMerge:
- patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: MPL-2.0

resources:
- ../../../bases/static-server
- ../../../../bases/static-client

patchesStrategicMerge:
- patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: MPL-2.0

resources:
- ../../../bases/static-server
- ../../../../bases/static-client

patchesStrategicMerge:
- patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: MPL-2.0

resources:
- ../../../bases/static-client
- ../../../../bases/static-server

patchesStrategicMerge:
- patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: MPL-2.0

resources:
- ../../../bases/static-client
- ../../../../bases/static-server

patchesStrategicMerge:
- patch.yaml
16 changes: 8 additions & 8 deletions acceptance/tests/sameness/sameness_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@ func TestFailover_Connect(t *testing.T) {

// Sameness Defaults need to be applied first so that the sameness group exists.
applyResources(t, cfg.NoCleanupOnFailure, "../fixtures/bases/mesh-gateway", members[k].context.KubectlOptions(t))
applyResources(t, cfg.NoCleanupOnFailure, "../fixtures/bases/sameness-defaults", members[k].context.KubectlOptions(t))
applyResources(t, cfg.NoCleanupOnFailure, "../fixtures/bases/sameness", members[k].serverOpts)
applyResources(t, cfg.NoCleanupOnFailure, "../fixtures/bases/sameness/defaults-ns", members[k].context.KubectlOptions(t))
applyResources(t, cfg.NoCleanupOnFailure, "../fixtures/bases/sameness/override-ns", members[k].serverOpts)

// Only assign a client if the cluster is running a Consul server.
if v.hasServer {
Expand All @@ -284,15 +284,15 @@ func TestFailover_Connect(t *testing.T) {
// Create static server deployments.
logger.Log(t, "creating static-server and static-client deployments")
k8s.DeployKustomize(t, members[keyPrimaryServer].serverOpts, cfg.NoCleanupOnFailure, cfg.DebugDirectory,
"../fixtures/cases/static-server-sameness/default")
"../fixtures/cases/sameness/static-server/default")
k8s.DeployKustomize(t, members[keyPartition].serverOpts, cfg.NoCleanupOnFailure, cfg.DebugDirectory,
"../fixtures/cases/static-server-sameness/partition")
"../fixtures/cases/sameness/static-server/partition")

// Create static client deployments.
k8s.DeployKustomize(t, members[keyPrimaryServer].clientOpts, cfg.NoCleanupOnFailure, cfg.DebugDirectory,
"../fixtures/cases/static-client-sameness/default")
"../fixtures/cases/sameness/static-client/default")
k8s.DeployKustomize(t, members[keyPartition].clientOpts, cfg.NoCleanupOnFailure, cfg.DebugDirectory,
"../fixtures/cases/static-client-sameness/partition")
"../fixtures/cases/sameness/static-client/partition")

// Verify that both static-server and static-client have been injected and now have 2 containers in server cluster.
// Also get the server IP
Expand Down Expand Up @@ -323,8 +323,8 @@ func TestFailover_Connect(t *testing.T) {
}

logger.Log(t, "creating exported services")
applyResources(t, cfg.NoCleanupOnFailure, "../fixtures/cases/sameness-exported-services/default-partition", members[keyPrimaryServer].context.KubectlOptions(t))
applyResources(t, cfg.NoCleanupOnFailure, "../fixtures/cases/sameness-exported-services/ap1-partition", members[keyPartition].context.KubectlOptions(t))
applyResources(t, cfg.NoCleanupOnFailure, "../fixtures/cases/sameness/exported-services/default-partition", members[keyPrimaryServer].context.KubectlOptions(t))
applyResources(t, cfg.NoCleanupOnFailure, "../fixtures/cases/sameness/exported-services/ap1-partition", members[keyPartition].context.KubectlOptions(t))

// Setup DNS.
dnsService, err := members[keyPrimaryServer].context.KubernetesClient(t).CoreV1().Services("default").Get(context.Background(), fmt.Sprintf("%s-%s", releaseName, "consul-dns"), metav1.GetOptions{})
Expand Down

0 comments on commit 5cb29f3

Please sign in to comment.