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

Use comment trigger to run acceptance tests for PRs. #929

Merged

Conversation

andrewsomething
Copy link
Member

This PR migrates our acceptance testing strategy from using GitHub environments to a comment trigger. It leverages the peter-evans/slash-command-dispatch action to fire a repository_dispatch. The action handles parsing arguments and checking the required permissions of the reviewer.

To trigger a run of the acceptance tests for a PR, you may use the /testacc in a comment. The pkg and sha arguments are required. This allows us to limit the packages being tested for quick feedback and protect against timing attacks. For example, to run the acceptance tests for the droplet package, the command may look like:

/testacc pkg=digitalocean/droplet sha=d358bd2418b4e30d7bdf2b98b4c151e357814c63

To run the entire suite, use pkg=digitalocean.

You can find an example in my fork: andrewsomething#6

Somethings to note:

  • If multiple packages are to be tested, each command must be posted as a separate comment.
  • Status checks are created for each tested package.
  • Only one workflow run for a specific package and PR can run at the same time. Triggering a second run will abort the first.
  • Only the first line of the comment is evaluated. Anything below that is just a normal comment.

Additionally, this:

  • Re-enables the scheduled workflow and updates it to run the sweeper after the run whether it is successful or not.
  • Creates a CONTRIBUTING.md file and moves the existing README content that is not user-focused into it.

@andrewsomething andrewsomething marked this pull request as ready for review February 14, 2023 19:06
@andrewsomething andrewsomething merged commit f480efc into digitalocean:main Feb 14, 2023
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.

None yet

2 participants