Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added acceptance testcases #74

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open

Conversation

akhilmhdh
Copy link
Member

This PR adds acceptance test to ensure terraform stability. This includes most of the important resources like secret, secret folders, identity, identity auth, project identity, permission etc.

More will be coming soon

@akhilmhdh akhilmhdh self-assigned this Nov 19, 2024
Copy link

gitguardian bot commented Nov 19, 2024

⚠️ GitGuardian has uncovered 2 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

Since your pull request originates from a forked repository, GitGuardian is not able to associate the secrets uncovered with secret incidents on your GitGuardian dashboard.
Skipping this check run and merging your pull request will create secret incidents on your GitGuardian dashboard.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
- - Generic High Entropy Secret e1bb80c examples/resources/infisical_secret/resource.tf View secret
- - Generic High Entropy Secret b109a92 examples/resources/infisical_secret/resource.tf View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Copy link
Collaborator

@DanielHougaard DanielHougaard left a comment

Choose a reason for hiding this comment

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

After tweaking things slightly locally, I was able to get the tests to run, and it works smoothly after that! Good work, I left a few comments for you.

We should defiantly make this a requirement for all future PR's, that the PR's also include covering tests.

@@ -0,0 +1,99 @@
package testAcc
Copy link
Collaborator

Choose a reason for hiding this comment

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

This entire test file is commented out, is this intentional?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes for both environment and imports.

Both are the moment incompatiable to test with terraform. Need modification for both

INFISICAL_UNIVERSAL_AUTH_CLIENT_ID: ${{ secrets.INFISICAL_UNIVERSAL_AUTH_CLIENT_ID }}
INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET: ${{ secrets.INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET }}
INFISICAL_TEST_ORG_ID: ${{ secrets.INFISICAL_TEST_ORG_ID }}
run: go test ./... -v $(TESTARGS) -timeout 120m
Copy link
Collaborator

Choose a reason for hiding this comment

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

All acceptance tests are failing due to TESTARGS command not found

INFISICAL_HOST: ${{ secrets.INFISICAL_HOST }}
INFISICAL_UNIVERSAL_AUTH_CLIENT_ID: ${{ secrets.INFISICAL_UNIVERSAL_AUTH_CLIENT_ID }}
INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET: ${{ secrets.INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET }}
INFISICAL_TEST_ORG_ID: ${{ secrets.INFISICAL_TEST_ORG_ID }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Testing locally:

Makefile:

testacc:
	TF_ACC=1 go test ./... -v $(TESTARGS) -timeout 120m

./... results in no tests being run. If I replace ./... with ./internal/testacc, it works. Are you sure ./... works?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm let me check it out. The makefile has the same command.

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.

2 participants