Skip to content

Commit

Permalink
fix: TOOLS-2971 fix in existing failing test cases (#56)
Browse files Browse the repository at this point in the history
* fix: Fix existing test cases

* fix: Change the Test Cases Expects rather than Generated Values

* fix: move the ConfigDCContext out for more readibilty

* Revert "fix: move the ConfigDCContext out for more readibilty"

This reverts commit 1769dfc.

* fix: Same Fix for ConfigNamespaceContext
  • Loading branch information
a-spiker authored Sep 13, 2024
1 parent a8c2fff commit b2b0505
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 41 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ test: mocks

.PHONY: coverage
coverage: mocks
go test ./... -coverprofile coverage.cov -coverpkg ./... || true
go test ./... -coverprofile coverage.cov -coverpkg ./...
grep -v "_mock.go" coverage.cov > coverage_no_mocks.cov && mv coverage_no_mocks.cov coverage.cov
grep -v "test/" coverage.cov > coverage_no_mocks.cov && mv coverage_no_mocks.cov coverage.cov
go tool cover -func coverage.cov
Expand Down
46 changes: 8 additions & 38 deletions asconfig/generate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -769,8 +769,6 @@ var namespaceTC = GenerateTC{
"direct-files": false,
"disable-odsync": false,
"enable-benchmarks-storage": false,
"encryption-key-file": "",
"encryption-old-key-file": "",
"files": []string{
"/opt/aerospike/data/bar.dat /opt/aerospike/data/bar-shadow.dat",
"/opt/aerospike/data/foo.dat /opt/aerospike/data/foo-shadow.dat",
Expand Down Expand Up @@ -963,7 +961,6 @@ var networkTC = GenerateTC{
"port": 3001,
"recv-rearm-threshold": 1024,
"send-threads": 8,
"tls-name": "",
"tls-port": 0,
},
"heartbeat": Conf{
Expand Down Expand Up @@ -995,26 +992,16 @@ var networkTC = GenerateTC{
},
"tls": []Conf{
{
"ca-file": "",
"ca-path": "",
"cert-blacklist": "",
"cert-file": "/data/certs/file0.pem",
"cipher-suite": "",
"key-file": "/data/certs/key0.pem",
"key-file-password": "",
"name": "aerospike-a-0",
"protocols": "TLSv1.2",
"cert-file": "/data/certs/file0.pem",
"key-file": "/data/certs/key0.pem",
"name": "aerospike-a-0",
"protocols": "TLSv1.2",
},
{
"ca-file": "",
"ca-path": "",
"cert-blacklist": "",
"cert-file": "/data/certs/file1.pem",
"cipher-suite": "",
"key-file": "/data/certs/key1.pem",
"key-file-password": "",
"name": "aerospike-a-1",
"protocols": "TLSv1.2",
"cert-file": "/data/certs/file1.pem",
"key-file": "/data/certs/key1.pem",
"name": "aerospike-a-1",
"protocols": "TLSv1.2",
},
},
},
Expand Down Expand Up @@ -1227,29 +1214,20 @@ var serviceTC = GenerateTC{
"migrate-threads": 1,
"min-cluster-size": 1,
"node-id": "BB9050011AC4202",
"node-id-interface": "",
"os-group-perms": false,
"pidfile": "",
"proto-fd-idle-ms": 0,
"proto-fd-max": 15000,
"query-max-done": 100,
"query-threads-limit": 128,
"run-as-daemon": true,
"salt-allocations": false,
"secrets-address-port": "",
"secrets-tls-context": "",
"service-threads": 8,
"sindex-builder-threads": 4,
"sindex-gc-period": 10,
"stay-quiesced": false,
"ticker-interval": 10,
"transaction-max-ms": 1000,
"transaction-retry-ms": 1002,
"vault-ca": "",
"vault-namespace": "",
"vault-path": "",
"vault-token-file": "",
"vault-url": "",
"work-directory": "/opt/aerospike",
},
},
Expand Down Expand Up @@ -1344,8 +1322,6 @@ var xdr5TC = GenerateTC{
{
"name": "DC1",
"auth-mode": "none",
"auth-password-file": "",
"auth-user": "",
"connector": false,
"max-recoveries-interleaved": 0,
"namespaces": []Conf{
Expand All @@ -1362,7 +1338,6 @@ var xdr5TC = GenerateTC{
"ignore-bins": []string{},
"ignore-sets": []string{},
"max-throughput": 100000,
"remote-namespace": "",
"sc-replication-wait-ms": 100,
"ship-bin-luts": false,
"ship-nsup-deletes": false,
Expand All @@ -1375,14 +1350,11 @@ var xdr5TC = GenerateTC{
},
"node-address-ports": []string{},
"period-ms": 100,
"tls-name": "",
"use-alternate-access-address": false,
},
{
"name": "DC2",
"auth-mode": "none",
"auth-password-file": "",
"auth-user": "",
"connector": false,
"max-recoveries-interleaved": 0,
"namespaces": []Conf{
Expand All @@ -1399,7 +1371,6 @@ var xdr5TC = GenerateTC{
"ignore-bins": []string{"tip", "wip"},
"ignore-sets": []string{"zip", "zap"},
"max-throughput": 100000,
"remote-namespace": "",
"sc-replication-wait-ms": 100,
"ship-bin-luts": false,
"ship-nsup-deletes": false,
Expand All @@ -1412,7 +1383,6 @@ var xdr5TC = GenerateTC{
},
"node-address-ports": []string{},
"period-ms": 100,
"tls-name": "",
"use-alternate-access-address": false,
},
},
Expand Down
4 changes: 2 additions & 2 deletions info/as_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -1148,7 +1148,7 @@ func parseAllXDRConfig(rawMap map[string]string, cmd string) lib.Stats {

if dcNamesRaw == "" {
dcNames = []string{}
xdrConfigMap[ConfigDCContext] = struct{}{}
xdrConfigMap[ConfigDCContext] = make(lib.Stats)
} else {
dcNames = strings.Split(dcNamesRaw, ",")
xdrConfigMap[ConfigDCContext] = make(lib.Stats, len(dcNames))
Expand All @@ -1170,7 +1170,7 @@ func parseAllXDRConfig(rawMap map[string]string, cmd string) lib.Stats {

if nsNamesRaw == "" {
nsNames = []string{}
dcMap[ConfigNamespaceContext] = struct{}{}
dcMap[ConfigNamespaceContext] = make(lib.Stats)
} else {
nsNames = strings.Split(nsNamesRaw, ",")
dcMap[ConfigNamespaceContext] = make(lib.Stats, len(nsNames))
Expand Down

0 comments on commit b2b0505

Please sign in to comment.