Skip to content

Fix main test when run for a PR #56

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

Merged
merged 1 commit into from
May 13, 2022
Merged

Conversation

carolynvs
Copy link
Contributor

The main test relies on the current GitHub event name, and that is populated via the environment variable GITHUB_EVENT_NAME.

When you run locally, that's unset, and the test passes.

When you run the workflow after pushing to main, it's set to "push", which isn't handled by main.ts, so it hits the default case and returns "not yet supported".

But when the workflow is run in a PR, that env var is set to "pull_request" which is an event that main tries to handle. So the test fails in an unexpected way (throwing an error) instead of printing "not yet supported".

I have updated the test to clear out GITHUB_EVENT_NAME so that we get the same test behavior in all cases.

Fixes #54

The main test relies on the current GitHub event name, and that is
populated via the environment variable GITHUB_EVENT_NAME.

When you run locally, that's unset, and the test passes.

When you run the workflow after pushing to main, it's set to "push",
which isn't handled by main.ts, so it hits the default case and returns
"not yet supported".

But when the workflow is run in a PR, that env var is set to
"pull_request" which is an event that main tries to handle. So the test
fails in an unexpected way (throwing an error) instead of printing "not
yet supported".

I have updated the test to clear out GITHUB_EVENT_NAME so that we get
the same test behavior in all cases.

Signed-off-by: Carolyn Van Slyck <[email protected]>
@carolynvs carolynvs marked this pull request as ready for review May 13, 2022 02:39
@carolynvs carolynvs requested a review from jpmcb as a code owner May 13, 2022 02:39
Copy link
Owner

@jpmcb jpmcb left a comment

Choose a reason for hiding this comment

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

Great!!!!! Thanks so much for the investigation on this. This is a huuuuge value add

@jpmcb jpmcb merged commit b67c56f into jpmcb:main May 13, 2022
@carolynvs carolynvs deleted the fix-main-test branch May 13, 2022 16:28
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.

[maintainers] Tests are broken in GitHub actions
2 participants