-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1053 from CircleCI-Public/develop
Release
- Loading branch information
Showing
8 changed files
with
84 additions
and
28 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
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,52 @@ | ||
package config | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
"golang.org/x/exp/maps" | ||
) | ||
|
||
func TestLocalPipelineValues(t *testing.T) { | ||
tests := []struct { | ||
name string | ||
parameters Parameters | ||
wantKeys []string | ||
}{ | ||
{ | ||
name: "standard values given nil parameters", | ||
parameters: nil, | ||
wantKeys: []string{ | ||
"pipeline.id", | ||
"pipeline.number", | ||
"pipeline.project.git_url", | ||
"pipeline.project.type", | ||
"pipeline.git.tag", | ||
"pipeline.git.branch", | ||
"pipeline.git.revision", | ||
"pipeline.git.base_revision", | ||
}, | ||
}, | ||
{ | ||
name: "standard and prefixed parameters given map of parameters", | ||
parameters: Parameters{"foo": "bar", "baz": "buzz"}, | ||
wantKeys: []string{ | ||
"pipeline.id", | ||
"pipeline.number", | ||
"pipeline.project.git_url", | ||
"pipeline.project.type", | ||
"pipeline.git.tag", | ||
"pipeline.git.branch", | ||
"pipeline.git.revision", | ||
"pipeline.git.base_revision", | ||
"pipeline.parameters.foo", | ||
"pipeline.parameters.baz", | ||
}, | ||
}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
assert.ElementsMatchf(t, tt.wantKeys, maps.Keys(LocalPipelineValues(tt.parameters)), "LocalPipelineValues(%v)", tt.parameters) | ||
}) | ||
} | ||
} |
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