Repository: etcd-io/etcd
File: tests/robustness/coverage/coverage_test.go (Go)

Code before:
			"rangeEnd":  isRangeEndSet,
			"rev":       isRevisionSet,
		},
		wantArgs: map[string]struct{}{
			"countOnly=false,keysOnly=false,limit=false,limit=1=false,rangeEnd=true,rev=false": {},
			"countOnly=false,keysOnly=false,limit=true,limit=1=false,rangeEnd=true,rev=false":  {},
			"countOnly=false,keysOnly=false,limit=true,limit=1=false,rangeEnd=true,rev=true":   {},
			"countOnly=false,keysOnly=false,limit=true,limit=1=true,rangeEnd=false,rev=false":  {},
			"countOnly=false,keysOnly=false,limit=true,limit=1=true,rangeEnd=true,rev=true":    {},
			"countOnly=true,keysOnly=false,limit=false,limit=1=false,rangeEnd=true,rev=false":  {},
		},
		methods: map[string]Matched{
			"Get": andMatcher(
				keyIsEqualInt("limit", 1),
				notMatcher(isRangeEndSet),
			),
			"Count": andMatcher(
				isCountOnly,
				isRangeEndSet,
				notMatcher(orMatcher(isKeysOnly, isLimitSet, isRevisionSet)),
			),
			"List": andMatcher(
				isRangeEndSet,
				notMatcher(orMatcher(isKeysOnly, isCountOnly, keyIsEqualInt("limit", 1))),
			),
			"List(ConsistentRead)": andMatcher(
				keyIsEqualInt("limit", 1),
				isRangeEndSet,
				isRevisionSet,
			),
		},
		knownBypasses: map[string]Matched{
			"Healthcheck": keyIsEqualStr("range_begin", "/registry/health"),
			"Compaction":  keyIsEqualStr("range_begin", "compact_rev_key"),
		},
	},
	"etcdserverpb.KV/Txn": {
		// All calls should go through etcd-k8s interface
		args: map[string]Matched{
			"getOnFailure": keyIsEqualInt("failure_len", 1),
			"readOnly":     isReadOnly,
		},
		wantArgs: map[string]struct{}{
			"getOnFailure=false,readOnly=false": {},
			"getOnFailure=true,readOnly=false":  {},
		},
		methods: map[string]Matched{
			"OptimisticPutOrDelete": andMatcher(keyIsEqualInt("compare_len", 1), keyIsEqualInt("success_len", 1), notMatcher(isReadOnly)),
		},
		knownBypasses: map[string]Matched{
			"Compaction": keyIsEqualStr("compare_first_key", "compact_rev_key"),

Review comment (suggestion):
```suggestion
			"GetCurrentRevision": andMatcher(
```

To match name in https://github.com/kubernetes/kubernetes/blob/8e6d788887034b799f6c2a86991a68a080bb0576/staging/src/k8s.io/apiserver/pkg/storage/interfaces.go#L269

Code after:

type row struct {
	method, pattern, args string
}

const notMatched byte = ' '

var referenceUsageOfEtcdAPI = map[string]refOp{
	"etcdserverpb.KV/Range": {
		// All calls should go through etcd-k8s interface
		args: []column{
			{name: "limit", matcher: isLimitSet},
			{name: "rangeEnd", matcher: isRangeEndSet},
			{name: "rev", matcher: isRevisionSet},
			{name: "countOnly", matcher: isCountOnly},
			{name: "keysOnly", matcher: isKeysOnly},
		},
		keyAttrName: "range_begin",
		methods: []method{
			{
				name:    "Healthcheck",
				matcher: keyIsEqualStr("range_begin", "/registry/health"),
			},
			{
				name:    "Compaction",
				matcher: keyIsEqualStr("range_begin", "compact_rev_key"),
			},
			{
				name: "Get",
				matcher: andMatcher(
					keyIsEqualInt("limit", 1),
					notMatcher(isRangeEndSet),
				),
			},
			{
				name: "Count",
				matcher: andMatcher(
					isCountOnly,
					isRangeEndSet,
					notMatcher(orMatcher(isKeysOnly, isLimitSet, isRevisionSet)),
				),
			},
			{
				name: "List",
				matcher: andMatcher(
					isRangeEndSet,
					notMatcher(orMatcher(isKeysOnly, isCountOnly)),
				),
			},
			{
				name: "GetCurrentRevision",