@@ -44,6 +44,7 @@ export BUILD_TEAM_NAME='main'
44
44
webhook_url=' https://some.url'
45
45
base_text=" :some_emoji:<https://my-ci.my-org.com/teams/main/pipelines/my-pipeline/jobs/my-job/builds/my-build|Alert!>"
46
46
sample_text=" This text came from sample.txt. It could have been generated by a previous Concourse task.\n\nMultiple lines are allowed.\n"
47
+ env_vars_tail=" BUILD_NAME=my-build\nVERSION=1.0.1\nQUALITY_GATE=B (ERROR)\nWITH_PIPE=<something>\nwith_GLOB=./path/to/*.jar\n"
47
48
missing_text=" _(no notification provided)_"
48
49
49
50
username=" concourse"
@@ -60,6 +61,9 @@ test combined_text_template_and_file | jq -e "
60
61
( .body | keys | contains([\" channel\" ,\" icon_emoji\" ,\" icon_url\" ,\" username\" ,\" link_names\" ,\" text\" ,\" attachments\" ]) ) and
61
62
( .body | keys | length == 7 )"
62
63
64
+ test combined_text_template_and_file_with_vars | jq -e "
65
+ .body.text == \" ${base_text} \n${sample_text} \n${env_vars_tail} \"
66
+ "
63
67
64
68
test combined_text_template_and_file_empty | jq -e "
65
69
.webhook_url == $( echo $webhook_url | jq -R .) and
@@ -110,6 +114,10 @@ test text_file | jq -e "
110
114
( .body | keys | contains([\" channel\" ,\" icon_emoji\" ,\" icon_url\" ,\" username\" ,\" link_names\" ,\" text\" ,\" attachments\" ]) ) and
111
115
( .body | keys | length == 7 )"
112
116
117
+ test text_file_with_env_vars | jq -e "
118
+ .body.text == \" ${sample_text} \n${env_vars_tail} \"
119
+ "
120
+
113
121
test text_file_empty | jq -e "
114
122
.webhook_url == $( echo $webhook_url | jq -R .) and
115
123
.body.channel == null and
@@ -203,4 +211,4 @@ test env_file | jq -e "
203
211
.body.attachments[1].text == \" <something> - ./path/to/*.jar\" and
204
212
( .body.attachments | length == 2 )"
205
213
206
- echo -e ' \e[32;1m' " All tests passed!" ' \e[0m'
214
+ echo -e ' \e[32;1m' " All tests passed!" ' \e[0m'
0 commit comments