Skip to content

Conversation

@HamzaShili65
Copy link

Add support for lazy copying to the file resource + acceptance test.
Test results:

    resource_file_test.go:584: Skipping Nomad provider transport apply: ENOS_TRANSPORT_HOST env var not set. Please set it to test this scenario.
--- PASS: TestAccResourceFileLazyCopyMissingSourceFile (3.19s)
    --- PASS: TestAccResourceFileLazyCopyMissingSourceFile/resource_transport_plan_[ssh]_lazy_copy_missing_source (0.33s)
    --- PASS: TestAccResourceFileLazyCopyMissingSourceFile/resource_transport_apply_[ssh]_lazy_copy_missing_source (0.25s)
    --- PASS: TestAccResourceFileLazyCopyMissingSourceFile/provider_transport_plan_[ssh]_lazy_copy_missing_source (0.32s)
    --- PASS: TestAccResourceFileLazyCopyMissingSourceFile/provider_transport_apply_[ssh]_lazy_copy_missing_source (0.25s)
    --- PASS: TestAccResourceFileLazyCopyMissingSourceFile/resource_transport_plan_[k8s]_lazy_copy_missing_source (0.33s)
    --- PASS: TestAccResourceFileLazyCopyMissingSourceFile/resource_transport_apply_[k8s]_lazy_copy_missing_source (0.24s)
    --- PASS: TestAccResourceFileLazyCopyMissingSourceFile/provider_transport_plan_[k8s]_lazy_copy_missing_source (0.33s)
    --- PASS: TestAccResourceFileLazyCopyMissingSourceFile/provider_transport_apply_[k8s]_lazy_copy_missing_source (0.24s)
    --- PASS: TestAccResourceFileLazyCopyMissingSourceFile/resource_transport_plan_[nomad]_lazy_copy_missing_source (0.32s)
    --- PASS: TestAccResourceFileLazyCopyMissingSourceFile/resource_transport_apply_[nomad]_lazy_copy_missing_source (0.24s)
    --- PASS: TestAccResourceFileLazyCopyMissingSourceFile/provider_transport_plan_[nomad]_lazy_copy_missing_source (0.33s)
    --- SKIP: TestAccResourceFileLazyCopyMissingSourceFile/provider_transport_apply_[nomad]_lazy_copy_missing_source (0.00s)

@HamzaShili65 HamzaShili65 requested a review from ryancragun July 24, 2025 18:34
Copy link
Collaborator

@ryancragun ryancragun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After we fix up the test cases we'll also want to increment the VERSION file by a patch. We might also want to revisit the schema docs for enos_file to mention lazy copying being supported.

There is also a make target that we run tfplugindocs or somesuch to generate the new docs.

require.NoError(t, err)
step := resource.TestStep{
Config: buf.String(),
Check: test.check,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll want to ensure that we check that a diagnostic is created during plan for the missing file.

We'll also want to test the inverse case where the file exists and doesn't render a diag.

@ryancragun
Copy link
Collaborator

It would also be nice to throw in a copy for a lazy file in one of the enos scenarios that we run during our CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants