Skip to content

Commit d0cb3ef

Browse files
radeksimkokmoe
authored andcommitted
Fix E2E test failures caused by misplaced Core()
1 parent 8f7d6c8 commit d0cb3ef

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

tfexec/internal/e2etest/providers_schema_test.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414

1515
var (
1616
providersSchemaJSONMinVersion = version.Must(version.NewVersion("0.12.0"))
17+
v0_13_0 = version.Must(version.NewVersion("0.13.0"))
1718
v0_15_0 = version.Must(version.NewVersion("0.15.0"))
1819
)
1920

@@ -26,7 +27,7 @@ func TestProvidersSchema(t *testing.T) {
2627
"basic", func(tfv *version.Version) *tfjson.ProviderSchemas {
2728
var providerSchema *tfjson.ProviderSchemas
2829

29-
if tfv.GreaterThanOrEqual(v0_15_0.Core()) {
30+
if tfv.Core().GreaterThanOrEqual(v0_15_0) {
3031
providerSchema = &tfjson.ProviderSchemas{
3132
FormatVersion: "0.2",
3233
Schemas: map[string]*tfjson.ProviderSchema{
@@ -114,7 +115,7 @@ same can now be achieved using [locals](https://www.terraform.io/docs/language/v
114115
},
115116
},
116117
}
117-
} else if tfv.GreaterThanOrEqual(version.Must(version.NewVersion("0.13.0"))) {
118+
} else if tfv.Core().GreaterThanOrEqual(v0_13_0) {
118119
providerSchema = &tfjson.ProviderSchemas{
119120
FormatVersion: "0.1",
120121
Schemas: map[string]*tfjson.ProviderSchema{
@@ -286,7 +287,7 @@ same can now be achieved using [locals](https://www.terraform.io/docs/language/v
286287
},
287288
{
288289
"empty_with_tf_file", func(tfv *version.Version) *tfjson.ProviderSchemas {
289-
if tfv.GreaterThanOrEqual(v0_15_0.Core()) {
290+
if tfv.Core().GreaterThanOrEqual(v0_15_0) {
290291
return &tfjson.ProviderSchemas{
291292
FormatVersion: "0.2",
292293
Schemas: nil,
@@ -303,7 +304,7 @@ same can now be achieved using [locals](https://www.terraform.io/docs/language/v
303304
c := c
304305
t.Run(fmt.Sprintf("%d %s", i, c.fixtureDir), func(t *testing.T) {
305306
runTest(t, c.fixtureDir, func(t *testing.T, tfv *version.Version, tf *tfexec.Terraform) {
306-
if tfv.LessThan(providersSchemaJSONMinVersion) {
307+
if tfv.Core().LessThan(providersSchemaJSONMinVersion) {
307308
t.Skip("providers schema -json was added in 0.12")
308309
}
309310

tfexec/internal/e2etest/validate_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func TestValidate(t *testing.T) {
5757

5858
var expectedDiags []tfjson.Diagnostic
5959

60-
if tfv.GreaterThanOrEqual(v0_15_0.Core()) {
60+
if tfv.Core().GreaterThanOrEqual(v0_15_0) {
6161
expectedDiags = []tfjson.Diagnostic{
6262
{
6363
Severity: "error",

0 commit comments

Comments
 (0)