Skip to content

Commit 40fc72c

Browse files
committed
cov
1 parent 36f66e8 commit 40fc72c

File tree

3 files changed

+29
-13
lines changed

3 files changed

+29
-13
lines changed

internal/compatibility/api_test.go

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -584,9 +584,6 @@ func TestDescribeDomainResponse(t *testing.T) {
584584
}
585585
},
586586
},
587-
ExcludedFields: []string{
588-
"ActiveClusters", // [BUG,NEEDS INVESTIGATION] Appears to be a nil pointer dereference in mapper conversion
589-
},
590587
},
591588
)
592589
}
@@ -2019,11 +2016,6 @@ func TestStartWorkflowExecutionRequest(t *testing.T) {
20192016
c.Fuzz(&req.CronOverlapPolicy)
20202017
},
20212018
},
2022-
ExcludedFields: []string{
2023-
// [BUG,NEEDS INVESTIGATION] ActiveClusterSelectionPolicy appears to be failing the round trip
2024-
// TODO: Investigate the mappers and determine where it is failing fuzz testing
2025-
"ActiveClusterSelectionPolicy",
2026-
},
20272019
},
20282020
)
20292021
}
@@ -2264,10 +2256,9 @@ func TestUpdateDomainRequest(t *testing.T) {
22642256
},
22652257
},
22662258
ExcludedFields: []string{
2267-
"UpdateMask", // [NOT INVESTIGATED] Complex nested structure with protobuf metadata issues - mapper incorrectly populates UpdateMask paths
2268-
"BadBinaries", // [NOT INVESTIGATED] Appears to be a fuzzing issue, tested in TestBadBinaries
2269-
"Clusters", // [NOT INVESTIGATED] Appears to be a fuzzing issue
2270-
"ActiveClusters", // [NOT INVESTIGATED] Appears to be a fuzzing issue
2259+
"UpdateMask", // [NOT INVESTIGATED] Complex nested structure with protobuf metadata issues - mapper incorrectly populates UpdateMask paths
2260+
"BadBinaries", // [NOT INVESTIGATED] Appears to be a fuzzing issue, tested in TestBadBinaries
2261+
"Clusters", // [NOT INVESTIGATED] Appears to be a fuzzing issue
22712262
},
22722263
},
22732264
)
@@ -2304,7 +2295,6 @@ func TestUpdateDomainResponse(t *testing.T) {
23042295
},
23052296
ExcludedFields: []string{
23062297
// Exclude nested fields that have complex issues like in DescribeDomainResponse
2307-
"Domain.ActiveClusters", // [BUG,NEEDS INVESTIGATION] Nil pointer dereference in mapper conversion
23082298
"Domain.Clusters", // [NOT INVESTIGATED] Protobuf metadata issues in nested ClusterReplicationConfiguration
23092299
"Domain.FailoverInfo", // [NOT INVESTIGATED] Protobuf metadata issues in nested structures
23102300
"Domain.IsolationGroups", // [NOT INVESTIGATED] Protobuf metadata issues in nested structures

internal/compatibility/enum_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,3 +347,14 @@ func TestCronOverlapPolicy(t *testing.T) {
347347
}
348348
assert.Equal(t, apiv1.CronOverlapPolicy_CRON_OVERLAP_POLICY_INVALID, proto.CronOverlapPolicy(thrift.CronOverlapPolicy(999)))
349349
}
350+
351+
func TestFailoverType(t *testing.T) {
352+
for _, v := range []apiv1.FailoverType{
353+
apiv1.FailoverType_FAILOVER_TYPE_INVALID,
354+
apiv1.FailoverType_FAILOVER_TYPE_FORCE,
355+
apiv1.FailoverType_FAILOVER_TYPE_GRACEFUL,
356+
} {
357+
assert.Equal(t, v, proto.FailoverType(thrift.FailoverType(v)))
358+
}
359+
assert.Equal(t, apiv1.FailoverType_FAILOVER_TYPE_INVALID, proto.FailoverType(thrift.FailoverType(999)))
360+
}

internal/compatibility/proto/enum.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,3 +408,18 @@ func CronOverlapPolicy(t *shared.CronOverlapPolicy) apiv1.CronOverlapPolicy {
408408
}
409409
return apiv1.CronOverlapPolicy_CRON_OVERLAP_POLICY_INVALID
410410
}
411+
412+
func FailoverType(t *shared.FailoverType) apiv1.FailoverType {
413+
if t == nil {
414+
return apiv1.FailoverType_FAILOVER_TYPE_INVALID
415+
}
416+
switch *t {
417+
case shared.FailoverTypeInvalid:
418+
return apiv1.FailoverType_FAILOVER_TYPE_INVALID
419+
case shared.FailoverTypeForce:
420+
return apiv1.FailoverType_FAILOVER_TYPE_FORCE
421+
case shared.FailoverTypeGraceful:
422+
return apiv1.FailoverType_FAILOVER_TYPE_GRACEFUL
423+
}
424+
return apiv1.FailoverType_FAILOVER_TYPE_INVALID
425+
}

0 commit comments

Comments
 (0)