Skip to content

Commit

Permalink
client: add tests around meta and canarymeta interpolation
Browse files Browse the repository at this point in the history
Expanding on hashicorp#9096, add tests for making sure service.Meta and
service.CanaryMeta are interpolated from environment variables.
  • Loading branch information
shoenig authored and fredrikhgrelland committed Oct 22, 2020
1 parent 78cf0b9 commit cceb185
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions client/taskenv/services_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ func TestInterpolateServices(t *testing.T) {
Name: "${name}",
PortLabel: "${portlabel}",
Tags: []string{"${tags}"},
Meta: map[string]string{
"meta-key": "${meta}",
},
CanaryMeta: map[string]string{
"canarymeta-key": "${canarymeta}",
},
Checks: []*structs.ServiceCheck{
{
Name: "${checkname}",
Expand All @@ -40,6 +46,8 @@ func TestInterpolateServices(t *testing.T) {
"name": "name",
"portlabel": "portlabel",
"tags": "tags",
"meta": "meta-value",
"canarymeta": "canarymeta-value",
"checkname": "checkname",
"checktype": "checktype",
"checkcmd": "checkcmd",
Expand All @@ -62,6 +70,12 @@ func TestInterpolateServices(t *testing.T) {
Name: "name",
PortLabel: "portlabel",
Tags: []string{"tags"},
Meta: map[string]string{
"meta-key": "meta-value",
},
CanaryMeta: map[string]string{
"canarymeta-key": "canarymeta-value",
},
Checks: []*structs.ServiceCheck{
{
Name: "checkname",
Expand Down

0 comments on commit cceb185

Please sign in to comment.