Add prerelease test with multiple constraints.

Signed-off-by: AYM1607 <u.g.a.mariano@gmail.com>
This commit is contained in:
AYM1607 2024-11-01 02:14:05 +00:00 committed by Martin Atkins
parent 08ad2f5983
commit 03c6700fd2
3 changed files with 23 additions and 0 deletions

View File

@ -276,6 +276,11 @@ func TestModuleInstaller_Prerelease(t *testing.T) {
modulePath: "testdata/prerelease-constraint-v",
expectedVersion: "v0.0.2",
},
{
name: "multiple constraints",
modulePath: "testdata/prerelease-constraint-multiple",
shouldError: true,
},
{
name: "err",
modulePath: "testdata/prerelease-constraint-err",

View File

@ -0,0 +1,13 @@
# We expect this test to error out because multiple constraints are
# ANDed, and a prerelease constraint will not match non-prerelease
# versions.
#
# Registry versions are:
# - 0.0.3-alpha.1
# - 0.0.2
# - 0.0.1
module "acctest" {
source = "hashicorp/module-installer-acctest/aws"
version = "0.0.3-alpha.1, >=0.0.2"
}

View File

@ -1,6 +1,11 @@
# We expect this test to download the version 0.0.2, the one before the
# specified version even with the equality because the specified version is a
# prerelease.
#
# Registry versions are:
# - 0.0.3-alpha.1
# - 0.0.2
# - 0.0.1
module "acctest" {
source = "hashicorp/module-installer-acctest/aws"