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

[MAINT]: Add GitHub Actions workflow for integration testing #2425

Open
1 task done
stevehipwell opened this issue Oct 14, 2024 · 7 comments · May be fixed by #2476
Open
1 task done

[MAINT]: Add GitHub Actions workflow for integration testing #2425

stevehipwell opened this issue Oct 14, 2024 · 7 comments · May be fixed by #2476
Labels
Status: Up for grabs Issues that are ready to be worked on by anyone Type: Feature New feature or request Type: Maintenance Any dependency, housekeeping, and clean up Issue or PR

Comments

@stevehipwell
Copy link
Contributor

Describe the need

When pushing a change to the code I'd like the integration tests to be able to be run. This doesn't have to be automatic as there are a number of models which could be applied to stop integration credentials being abused.

  • Auto-run all actions (DON'T DO THIS)
  • Auto-run actions from repeat contributors (DON'T DO THIS)
  • Auto-run actions from organisation members
    • Put integration test credentials behind an environment and require approval to run

I'd be happy to contribute the code to do this.

SDK Version

No response

API Version

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@stevehipwell stevehipwell added Status: Triage This is being looked at and prioritized Type: Maintenance Any dependency, housekeeping, and clean up Issue or PR labels Oct 14, 2024
@nickfloyd nickfloyd added Type: Feature New feature or request Status: Up for grabs Issues that are ready to be worked on by anyone and removed Status: Triage This is being looked at and prioritized labels Oct 17, 2024
@nickfloyd
Copy link
Contributor

@stevehipwell Thanks for the thoughts and input here! ❤

If you're up for it, this idea would be really great to see in code so that we can get a more clear picture of your thoughts here. I've also added the up for grabs label just incase others are up for working on this as well.

@nickfloyd nickfloyd moved this from 🆕 Triage to 🔥 Backlog in 🧰 Octokit Active Oct 17, 2024
@stevehipwell
Copy link
Contributor Author

@nickfloyd I was working from a memory that there weren't automated tests in GH Actions and from the fact that my PRs never get automated tests. However I just checked out what's there and I can see automated tests for branches with a test/ prefix and for PRs labeled in a specific way; but they seem to be broken? Do you have more context on this?

@stevehipwell
Copy link
Contributor Author

OK, I can see what the issue is. I'll have a go at fixing this.

@stevehipwell stevehipwell linked a pull request Nov 25, 2024 that will close this issue
33 tasks
@stevehipwell
Copy link
Contributor Author

@nickfloyd @kfcampbell I've got #2476 running and would expect the anonamous tests to work as is. Do you have a list of the currently broken acceptance tests as that'll help me figure out what should be working? Based on running some of the tests it looks like there are tests being run in anonymous mode which wont work.

@kfcampbell
Copy link
Member

Do you have a list of the currently broken acceptance tests

We don't have a comprehensive list of broken acceptance tests unfortunately. As the suite hasn't been run front-to-back (maybe ever?), this is not readily available information. Also, it depends heavily on a really organized test setup that we just don't have (or have documented) at the moment: enterprise, organizations, test accounts, GitHub Apps, Enterprise Server instances, EMUs, Actions runners, various GitHub plans, etc., and many of those resources cost money in addition to the overhead in maintaining the test setup. #1414 is an attempt to quantify some of that setup, but hasn't taken off due to a lack of funding.

Based on running some of the tests it looks like there are tests being run in anonymous mode which wont work.

Agreed that we cannot run all tests in anonymous mode. Running any tests with anonymous mode would be a step up.

However, the test setup is stale, as you've noticed in your PR. I just checked and I'm an admin on github.com/terraformtesting, which is cool, but I have no idea where these https://terraformtesting-ghe.eastus.cloudapp.azure.com/ resources are configured (or if indeed they still exist at all).

In order for this to be successful long-term, we'll need organizational buy-in from GitHub to support time and money into testing the provider so that we can get resources deployed and maintained for testing purposes. I unfortunately have been unsuccessful in my quest to sell this as a valid use of company resources thus far; hence my ad-hoc testing before merges with my own testing org/accounts.

@stevehipwell
Copy link
Contributor Author

stevehipwell commented Nov 26, 2024

@kfcampbell could you provide the list of tests that pass locally in your manual testing for each type (anon, user, org) when targeting github.com? Once I have these I'll look at skipping the currently failing tests conditionally based on type. I aim to have the tests where anonymous is valid running in GitHub Actions ASAP.

Could you please add dotcom & ghes environments but don't add protection yet? Could you also add a acctest (or equivalent) label? With these I can finish testing the test triggering logic and any credentials added can be gated.

RE GHES - the cron trigger works for anonymous tests. For now I'll disable automatic tests for GHES but we can revisit later. Ignore that, they're all being skipped.

After the above we will need to work on the authenticated tests. I suspect that as well as a test user we need a free organisation, a team organisation and an enterprise organisation for the testing to be valid, does that ring true? The process here will be to have the credentials stored as environment secrets on the environments created above (dotcom for now) and to add required approvers to the environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Up for grabs Issues that are ready to be worked on by anyone Type: Feature New feature or request Type: Maintenance Any dependency, housekeeping, and clean up Issue or PR
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants