PDE-3951 test(cli): fix failing tests in dependabot's PRs #762
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Mock
ZAPIER_DEPLOY_KEY
for RegisterCommand testscommit ac29aa2
GitHub's dependabot doesn't have access to secrets. This is why dependabot's PRs have been failing. The tests in RegisterCommand don't really need the deploy key because they use nock to mock HTTP requests. But our
callAPI()
function always checks crendentials withreadCredentials()
; it isn't aware that the request may be "nocked" and won't require a deploy key.This commit bypasses the checks in
readCredentials()
by setting a fakeZAPIER_DEPLOY_KEY
before running the tests. Since the requests are "nocked", the fake deploy key won't be sent to Zapier anyway.Replace
DEPLOY_KEY
withZAPIER_DEPLOY_KEY
in CLI smoke testscommit 18b7ebc
It turns out our CI isn't running the smoke test for the
zapier integrations
command becauseDEPLOY_KEY
has been always empty. The correct environment variable to use isZAPIER_DEPLOY_KEY
./api/platform/cli/apps/fields-choices
doesn't need deploy keycommit d60711a
The
fields-choices
endpoint doesn't need a deploy key, so we can enableskipDeployKey
in the request options.