Fixes spurious error messages in tests#1400
Conversation
angelapwen
left a comment
There was a problem hiding this comment.
Thanks for finding this!!
Just curious, were the tests passing in CI because GITHUB_SHA, GITHUB_REF, and GITHUB_EVENT_PATH were set by default in CI, just not locally?
henrymercer
left a comment
There was a problem hiding this comment.
Very nice! I checked this out locally and src/analyze-action-input.test.ts is still failing. Thankfully we can just apply the same fix to get that passing. Once we've done that all the tests succeed locally.
The tests are still "passing" locally (ie- the test process doesn't fail and all 333 tests are marked as passing). It's just that there is a subprocess command that gets invoked and fails. The error is swallowed by the action (I think that's the behaviour we want). And most likely, we're not seeing the same messages on CI since all of the associated env vars are in place and the workflow file is where we expect it to be. |
Right...forgot about the second one. Let me get that in, too. |
Previously, `isAnalyzingDefaultBranch` was failing because there are some missing env vars: `GITHUB_SHA`, `GITHUB_REF`, and `GITHUB_EVENT_PATH`. Also, `checkout_path` is missing as an input. Rather than trying to set them to mock values, which would require setting the paths to existing paths in the file system, I chose to stub the entire function. I think this is fine since the point of the test is to check the ram and threads values, not testing the `isAnalyzingDefaultBranch` function.
e7f1de4 to
1384ce4
Compare
angelapwen
left a comment
There was a problem hiding this comment.
Nice, I pulled down the branch and ran to confirm this time as well 👍
Previously,
isAnalyzingDefaultBranchwas failing because there are some missing env vars:GITHUB_SHA,GITHUB_REF, andGITHUB_EVENT_PATH. Also,checkout_pathis missing as an input.Rather than trying to set them to mock values, which would require setting the paths to existing paths in the file system, I chose to stub the entire function. I think this is fine since the point of the test is to check the ram and threads values, not testing the
isAnalyzingDefaultBranchfunction.Merge / deployment checklist