-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into VEC-440-Unify-github-actions-for-clean-build…
…-and-release
- Loading branch information
Showing
20 changed files
with
290 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ VERSION.md | |
build-metadata | ||
bin/asvec-linux-amd64 | ||
docker/asvec.docker/meta-info | ||
meta-info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.1.0-pre | ||
3.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
package writers | ||
|
||
import ( | ||
"reflect" | ||
"testing" | ||
|
||
"github.com/aerospike/avs-client-go/protos" | ||
) | ||
|
||
func Test_formatRole(t *testing.T) { | ||
type args struct { | ||
role protos.NodeRole | ||
} | ||
tests := []struct { | ||
name string | ||
args args | ||
want string | ||
}{ | ||
{ | ||
name: "TestRolePrimary", | ||
args: args{role: protos.NodeRole_INDEX_QUERY}, | ||
want: "INDEX_QUERY", | ||
}, | ||
{ | ||
name: "TestRoleSecondary", | ||
args: args{role: protos.NodeRole_INDEX_UPDATE}, | ||
want: "INDEX_UPDATE", | ||
}, | ||
{ | ||
name: "TestRoleUnknown", | ||
args: args{role: protos.NodeRole_KV_READ}, | ||
want: "KV_READ", | ||
}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
if got := formatRole(tt.args.role); got != tt.want { | ||
t.Errorf("formatRole() = %v, want %v", got, tt.want) | ||
} | ||
}) | ||
} | ||
} | ||
|
||
func Test_formatRoles(t *testing.T) { | ||
type args struct { | ||
roles []protos.NodeRole | ||
} | ||
tests := []struct { | ||
name string | ||
args args | ||
want []string | ||
}{ | ||
{ | ||
name: "TestMultipleRoles", | ||
args: args{ | ||
roles: []protos.NodeRole{ | ||
protos.NodeRole_INDEX_QUERY, | ||
protos.NodeRole_INDEX_UPDATE, | ||
protos.NodeRole_KV_READ, | ||
}, | ||
}, | ||
want: []string{"INDEX_QUERY", "INDEX_UPDATE", "KV_READ"}, | ||
}, | ||
{ | ||
name: "TestSingleRole", | ||
args: args{roles: []protos.NodeRole{protos.NodeRole_INDEX_QUERY}}, | ||
want: []string{"INDEX_QUERY"}, | ||
}, | ||
{ | ||
name: "TestNoRoles", | ||
args: args{roles: []protos.NodeRole{}}, | ||
want: []string{}, | ||
}, | ||
{ | ||
name: "TestNilRoles", | ||
args: args{roles: nil}, | ||
want: []string{}, | ||
}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
if got := formatRoles(tt.args.roles); !reflect.DeepEqual(got, tt.want) { | ||
t.Errorf("formatRoles() = %v, want %v", got, tt.want) | ||
} | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.