Skip to content

Commit d4836fc

Browse files
committed
Add test of auto-installing min-required version
1 parent 1eaac2b commit d4836fc

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

test/test_use_minrequired.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,23 @@ echo "terraform {
103103

104104
cleanup || log 'error' 'Cleanup failed?!';
105105

106+
107+
log 'info' '### Install min-required with TFENV_AUTO_INSTALL';
108+
109+
minv='1.0.0';
110+
111+
echo "terraform {
112+
required_version = \">=${minv}\"
113+
}" >> min_required.tf;
114+
echo 'min-required' > .terraform-version;
115+
116+
(
117+
TFENV_AUTO_INSTALL=true terraform version;
118+
check_active_version "${minv}";
119+
) || error_and_proceed 'Min required auto-installed version does not match';
120+
121+
cleanup || log 'error' 'Cleanup failed?!';
122+
106123
if [ "${#errors[@]}" -gt 0 ]; then
107124
log 'warn' '===== The following use_minrequired tests failed =====';
108125
for error in "${errors[@]}"; do

0 commit comments

Comments
 (0)