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

fix: skip anonymous tests that can't be done anonymously #1465

Merged
merged 1 commit into from
Jan 6, 2023

Conversation

wwsean08
Copy link
Contributor

@wwsean08 wwsean08 commented Jan 6, 2023

This is in reference to #1414 but does not actually solve it.


Behavior

Before the change?

  • The tests would fail due to the requirement of a token, however you can't have a token with anonymous tests.

After the change?

  • The tests no longer attempt to be run.

Other information

While working on #1414 I found these tests which will never work without a feature change and test rework as well.


Additional info

Pull request checklist

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • Added the appropriate label for the given change

Does this introduce a breaking change?

Please see our docs on breaking changes to help!

  • Yes (Please add the Type: Breaking change label)
  • No

If Yes, what's the impact:

  • N/A

Pull request type

Please add the corresponding label for change this PR introduces:

  • Bugfix: Type: Bug

Justification of Changes

TestAccGithubRepositoryFileDataSource

In this test it tries to create a repo and file which can then be queried, which is not possible with no access token as an anonymous test would have.

My original idea was to create a test with a static file, however that failed as there is no owner attribute on the data source so the owner would get set to an empty string even with GITHUB_OWNER or GITHUB_ORGANIZATION set.

TestAccGithubTreeDataSource

In this test it tries to create a repo which can then be queried, which is not possible with no access token as an anonymous test would have.

My original idea was to create a test with a static repo, however that failed as there is no owner attribute on the data source so the owner would get set to an empty string even with GITHUB_OWNER or GITHUB_ORGANIZATION set.

Copy link
Member

@kfcampbell kfcampbell left a comment

Choose a reason for hiding this comment

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

Thank you!

@kfcampbell kfcampbell merged commit ee6525b into integrations:main Jan 6, 2023
@wwsean08 wwsean08 deleted the fix-anon-tests branch January 6, 2023 19:59
avidspartan1 pushed a commit to avidspartan1/terraform-provider-github that referenced this pull request Feb 5, 2024
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