Skip to content

testing: Consider using CI version matrix instead of hard-coding latest versions #309

Open
@kmoe

Description

@kmoe

Instead of maintaining a list of version numbers in internal/testutil/tfcache.go, use a version matrix in the CircleCI config. The TFEXEC_E2ETEST_VERSIONS env var should then be used for similar behaviour during local development.

Note that if we remove these consts entirely, tests not using the main runTest() helper to run tests against the default list of versions will need to hard-code the relevant versions. However, such tests often make use of latest versions, e.g.:

func TestUpgrade012(t *testing.T) {
runTestVersions(t, []string{testutil.Latest012}, "pre_011_syntax", func(t *testing.T, tfv *version.Version, tf *tfexec.Terraform) {
err := tf.Init(context.Background())

Perhaps the consts should instead be initialised according to values in the CircleCI environment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    citestingthinkingMore thinking or discussion needed before deciding on a course of action.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions