Skip to content

Commit

Permalink
addressed more Zalimeni comments
Browse files Browse the repository at this point in the history
  • Loading branch information
wilkermichael committed Jul 27, 2023
1 parent ecc6617 commit bbac998
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 19 deletions.
9 changes: 3 additions & 6 deletions acceptance/tests/sameness/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,9 @@ func TestMain(m *testing.M) {

if suite.Config().EnableMultiCluster && suite.Config().IsExpectedClusterCount(expectedNumberOfClusters) && suite.Config().UseKind {
os.Exit(suite.Run())
} else if suite.Config().EnableMultiCluster && suite.Config().IsExpectedClusterCount(expectedNumberOfClusters) {
fmt.Println(fmt.Sprintf("Skipping sameness tests because either -enable-multi-cluster is "+
"not set or the number of clusters did not match the expected count of %d", expectedNumberOfClusters))
os.Exit(0)
} else {
fmt.Println("Skipping sameness tests because UseKind is false. Sameness acceptance tests are currently only supported on Kind")
os.Exit(0)
fmt.Println(fmt.Sprintf("Skipping sameness tests because either -enable-multi-cluster is "+
"not set, the number of clusters did not match the expected count of %d, or --useKind is false. "+
"Sameness acceptance tests are currently only suopported on Kind clusters", expectedNumberOfClusters))
}
}
35 changes: 22 additions & 13 deletions acceptance/tests/sameness/sameness_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const (
primaryDatacenterPartition = "ap1"
primaryServerDatacenter = "dc1"
peer1Datacenter = "dc2"
peer2Datacenter = "dc2"
peer2Datacenter = "dc3"
staticClientNamespace = "ns1"
staticServerNamespace = "ns2"

Expand Down Expand Up @@ -65,18 +65,27 @@ func TestFailover_Connect(t *testing.T) {
for _, c := range cases {
t.Run(c.name, func(t *testing.T) {
/*
Architecture:
Architecture Overview:
Primary Datacenter (DC1)
Partitions:
Default Partition
AP1 Partition
Peer -> DC2
Peer -> DC3
Default Partition
Peer -> DC2 (cluster-02-a)
Peer -> DC3 (cluster-03-a)
AP1 Partition
Peer -> DC2 (cluster-02-a)
Peer -> DC3 (cluster-03-a)
Datacenter 2 (DC2)
Peer -> DC1
Default Partition
Peer -> DC1 (cluster-01-a)
Peer -> DC1 (cluster-01-b)
Peer -> DC3 (cluster-03-a)
Datacenter 3 (DC3)
Peer -> DC1
Default Partition
Peer -> DC1 (cluster-01-a)
Peer -> DC1 (cluster-01-b)
Peer -> DC2 (cluster-02-a)
Architecture Diagram + failover scenarios from perspective of DC1 Default Partition Static-Server
+-------------------------------------------+
| |
| DC1 |
Expand All @@ -93,7 +102,7 @@ func TestFailover_Connect(t *testing.T) {
| | +------------------+ | | | | | +------------------+ |
| | Admin Partitions: Default | | | | | |
| | Name: cluster-01-a | | | | | Admin Partitions: Default |
| | | | | | | Name: cluster-03-a |
| | | | | | | Name: cluster-02-a |
| +-----------------------------+ | | | | |
| | | | +-----------------------------------+
| Failover 1| | Failover 3 |
Expand All @@ -108,7 +117,7 @@ func TestFailover_Connect(t *testing.T) {
| | | | | | | +------------------+ |
| | +------------------+ | | | |
| | Admin Partitions: ap1 | | | Admin Partitions: Default |
| | Name: cluster-01-b | | | Name: cluster-02-a |
| | Name: cluster-01-b | | | Name: cluster-03-a |
| | | | | |
| +-------------------------------+ | | |
| | +-----------------------------------+
Expand Down Expand Up @@ -307,7 +316,7 @@ func TestFailover_Connect(t *testing.T) {
if labelSelector == "app=static-server" {
ip := &podList.Items[0].Status.PodIP
require.NotNil(t, ip)
logger.Logf(t, "partition-static-server-ip: %s", *ip)
logger.Logf(t, "default-static-server-ip: %s", *ip)
members[keyPrimaryServer].staticServerIP = ip
}

Expand All @@ -319,7 +328,7 @@ func TestFailover_Connect(t *testing.T) {
if labelSelector == "app=static-server" {
ip := &podList.Items[0].Status.PodIP
require.NotNil(t, ip)
logger.Logf(t, "default-static-server-ip: %s", *ip)
logger.Logf(t, "partition-static-server-ip: %s", *ip)
members[keyPartition].staticServerIP = ip
}
}
Expand Down

0 comments on commit bbac998

Please sign in to comment.