Skip to content

Commit 3234ff8

Browse files
committed
Add tests for failing 0.11.15-oci case
add 0.11.15-oci case to uninstall test Modify list-remote; add oci and make digit optional add belt and braces alpha beta and rc tests
1 parent d7b4d81 commit 3234ff8

File tree

4 files changed

+58
-1
lines changed

4 files changed

+58
-1
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 1.0.2 (October 29, 2019)
2+
3+
* Fix failing 0.11.15-oci version, Add additional tests for 0.11.15-oci and alphas, betas and rcs #145
4+
* Fix to README section link for .terraform-version file #146
5+
16
## 1.0.1 (June 22, 2019)
27

38
* Fix '--version' flag to return version from CHANGELOG.md when not running from a git checkout.

libexec/tfenv-list-remote

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ fi
1010

1111
TFENV_REMOTE="${TFENV_REMOTE:-https://releases.hashicorp.com}"
1212
curlw -sf "${TFENV_REMOTE}/terraform/" \
13-
| grep -o -E "[0-9]+\.[0-9]+\.[0-9]+(-(rc|beta|alpha)[0-9]+)?" \
13+
| grep -o -E "[0-9]+\.[0-9]+\.[0-9]+(-(rc|beta|alpha|oci)[0-9]*)?" \
1414
| uniq

test/test_install_and_use.sh

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,51 @@ v="$(tfenv list-remote | head -n 1)"
3434
check_version "${v}" || exit 1
3535
) || error_and_proceed "Installing latest possibly-unstable version ${v}"
3636

37+
echo "### Install latest alpha"
38+
cleanup || error_and_die "Cleanup failed?!"
39+
40+
v="$(tfenv list-remote | grep 'alpha' | head -n 1)"
41+
(
42+
tfenv install latest:alpha || exit 1
43+
check_version "${v}" || exit 1
44+
) || error_and_proceed "Installing latest alpha ${v}"
45+
46+
echo "### Install latest beta"
47+
cleanup || error_and_die "Cleanup failed?!"
48+
49+
v="$(tfenv list-remote | grep 'beta' | head -n 1)"
50+
(
51+
tfenv install latest:beta || exit 1
52+
check_version "${v}" || exit 1
53+
) || error_and_proceed "Installing latest beta ${v}"
54+
55+
echo "### Install latest rc"
56+
cleanup || error_and_die "Cleanup failed?!"
57+
58+
v="$(tfenv list-remote | grep 'rc' | head -n 1)"
59+
(
60+
tfenv install latest:rc || exit 1
61+
check_version "${v}" || exit 1
62+
) || error_and_proceed "Installing latest rc ${v}"
63+
64+
echo "### Install latest possibly-unstable version from 0.11"
65+
cleanup || error_and_die "Cleanup failed?!"
66+
67+
v="$(tfenv list-remote | grep '^0\.11\.' | head -n 1)"
68+
(
69+
tfenv install latest:^0.11. || exit 1
70+
check_version "${v}" || exit 1
71+
) || error_and_proceed "Installing latest possibly-unstable version from 0.11: ${v}"
72+
73+
echo "### Install 0.11.15-oci"
74+
cleanup || error_and_die "Cleanup failed?!"
75+
76+
v="0.11.15-oci"
77+
(
78+
tfenv install 0.11.15-oci || exit 1
79+
check_version "${v}" || exit 1
80+
) || error_and_proceed "Installing version ${v}"
81+
3782
echo "### Install latest version with Regex"
3883
cleanup || error_and_die "Cleanup failed?!"
3984

test/test_uninstall.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ source "$(dirname "${0}")/helpers.sh" \
1919
echo "### Uninstall local versions"
2020
cleanup || error_and_die "Cleanup failed?!"
2121

22+
v="0.11.15-oci"
23+
(
24+
tfenv install "${v}" || exit 1
25+
tfenv uninstall "${v}" || exit 1
26+
check_version "${v}" && exit 1 || exit 0
27+
) || error_and_proceed "Uninstall of version "${v}" failed"
28+
2229
v="0.9.1"
2330
(
2431
tfenv install "${v}" || exit 1

0 commit comments

Comments
 (0)