Skip to content

Conversation

@gberenice
Copy link
Member

what

  • Added mock_provider blocks to both test files.
  • Mocked aws_ssm_parameter data source to avoid AWS credential requirements.

why

  • Tests were failing with missing provider errors and AWS authentication issues:
│ Error: Invalid provider configuration
│ 
│ Provider "registry.opentofu.org/hashicorp/aws" requires explicit
│ configuration. Add a provider block to the root module and configure the
│ provider's required arguments as described in the provider documentation.
│ 
╵
tests/locals.tftest.hcl... fail
╷
│ Error: No valid credential sources found
│ 
│   with provider["registry.opentofu.org/hashicorp/aws"],
│   on provider["registry.opentofu.org/hashicorp/aws"] with no configuration line 1:
│   (source code not available)
│ 
│ Please see https://registry.terraform.io/providers/hashicorp/aws
│ for more information about providing credentials.
│ 
│ Error: failed to refresh cached credentials, no EC2 IMDS role found,
│ operation error ec2imds: GetMetadata, failed to get API token, operation
│ error ec2imds: getToken, http response error StatusCode: 400, request to
│ EC2 IMDS failed
│ 
╵
  run "test_empty_secret_mapping"... fail
  run "test_multiple_files_and_secrets"... skip
tests/outputs.tftest.hcl... fail
╷
│ Error: Invalid provider configuration
│ 
│ Provider "registry.opentofu.org/hashicorp/aws" requires explicit
│ configuration. Add a provider block to the root module and configure the
│ provider's required arguments as described in the provider documentation.
│ 
╵
╷
│ Error: No valid credential sources found
│ 
│   with provider["registry.opentofu.org/hashicorp/aws"],
│   on provider["registry.opentofu.org/hashicorp/aws"] with no configuration line 1:
│   (source code not available)
│ 
│ Please see https://registry.terraform.io/providers/hashicorp/aws
│ for more information about providing credentials.
│ 
│ Error: failed to refresh cached credentials, no EC2 IMDS role found,
│ operation error ec2imds: GetMetadata, failed to get API token, operation
│ error ec2imds: getToken, http response error StatusCode: 400, request to
│ EC2 IMDS failed
│ 
╵
  run "test_output_structure_and_content"... fail
  run "test_output_empty_secrets"... skip

Failure! 0 passed, 2 failed, 2 skipped.
Error: Process completed with exit code 1.

references

@gberenice gberenice requested a review from a team as a code owner October 21, 2025 13:40
@gberenice gberenice requested a review from Gowiem October 21, 2025 13:40
oycyc
oycyc previously approved these changes Oct 21, 2025
Copy link

@oycyc oycyc left a comment

Choose a reason for hiding this comment

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

Ah that was why!

@gberenice
Copy link
Member Author

@oycyc please ignore this PR for now. I see a weird issue when the workflow file is valid, while the wrong SHA is used during the tests.
I'll make sure to ping you when this is resolved.
Screenshot 2025-10-21 at 19 00 37
Screenshot 2025-10-21 at 19 00 46

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