How do I pass provider information to tests?

OK, I tried your workaround and made some progress.

Here’s my dir structure now

> tree
.
├── locals.tf
├── outputs.tf
├── README.md
├── resource_modules.tf
├── tests
│   ├── database.tftest.hcl
│   ├── setup
│   │   └── main.tf
│   └── wrapper
│       └── main.tf
└── vars.tf

my new run block:

run "resources" {
    module {
        source = "./tests/wrapper"
    }
    variables {
        description              = "Temporary database created for the purpose of unit testing"
        tag                      = run.setup_tests.tag
    }
}

and upon running terraform test

 terraform test
tests/database.tftest.hcl... in progress
  run "setup_tests"... pass
  run "resources"... pass
tests/database.tftest.hcl... tearing down
Terraform encountered an error destroying resources created while executing tests/database.tftest.hcl/resources.
│
│ Error: error deleting database TESTDB-SQUARE-SPIDER: 003001 (42501): SQL access control error:
│ Insufficient privileges to operate on database 'TESTDB-SQUARE-SPIDER'
│ 
│ 
│

Terraform left the following resources in state after executing tests/database.tftest.hcl/resources, and they need to be cleaned up manually:
  - module.resources.module.live_database.snowflake_database.database
tests/database.tftest.hcl... fail

Failure! 2 passed, 0 failed.

clearly I now have a different problem to solve but I’d call that progress. Thank you Liam.

Two more thoughts:

  1. For debugging purposes it would be nice to have the option to see more verbose output from the apply being carried out on my wrapper configuration. I’d at least like to see the plan.
  2. I use the terraform extension for VSCode in order to get syntax highlighting but it doesn’t yet seem to recognise .tftest.hcl files. I’m sure that’s a different team to what you work on Liam but if you could pass that feedback on it would be appreciated.