Skip to content

Commit

Permalink
add test for default branch
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaspoignant committed Nov 8, 2024
1 parent 11315b8 commit da4437c
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions cmd/relayproxy/service/gofeatureflag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,11 @@ func Test_initRetriever(t *testing.T) {
},
},
{
name: "Convert Bitbucket Retriever",
name: "Convert Bitbucket Retriever default branch",
wantErr: assert.NoError,
conf: &config.RetrieverConf{
Kind: "bitbucket",
RepositorySlug: "gofeatureflag/config-repo",
Branch: "main",
Path: "flags/config.goff.yaml",
AuthToken: "XXX_BITBUCKET_TOKEN",
BaseURL: "https://api.bitbucket.goff.org",
Expand All @@ -205,6 +204,27 @@ func Test_initRetriever(t *testing.T) {
},
wantType: &bitbucketretriever.Retriever{},
},
{
name: "Convert Bitbucket Retriever branch specified",
wantErr: assert.NoError,
conf: &config.RetrieverConf{
Kind: "bitbucket",
Branch: "develop",
RepositorySlug: "gofeatureflag/config-repo",
Path: "flags/config.goff.yaml",
AuthToken: "XXX_BITBUCKET_TOKEN",
BaseURL: "https://api.bitbucket.goff.org",
},
want: &bitbucketretriever.Retriever{
RepositorySlug: "gofeatureflag/config-repo",
Branch: "develop",
FilePath: "flags/config.goff.yaml",
BitBucketToken: "XXX_BITBUCKET_TOKEN",
BaseURL: "https://api.bitbucket.goff.org",
Timeout: 10000000000,
},
wantType: &bitbucketretriever.Retriever{},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down

0 comments on commit da4437c

Please sign in to comment.