Refactor CodeQL setup tests and fix GHAE test#1474
Merged
henrymercer merged 6 commits intomainfrom Jan 11, 2023
Merged
Conversation
Contributor
Author
|
Checks are failing on main — merging in main once #1466 is merged should fix. |
angelapwen
previously approved these changes
Jan 10, 2023
Contributor
angelapwen
left a comment
There was a problem hiding this comment.
A couple of small notes and there's a merge conflict with one of the source map files, but overall it looks great and clean! Thanks for doing all this refactoring ✨
| async function mockApiAndSetupCodeQL({ | ||
| apiDetails, | ||
| bypassToolcache, | ||
| async function mockDownloadApi({ |
Contributor
There was a problem hiding this comment.
Nit: it wasn't super clear to me what the Promise this function returned was, could we add a comment indicating it's returning the URL or rename the function?
Contributor
Author
There was a problem hiding this comment.
Good call, I've added some JSDoc.
| const relativeUrl = apiDetails | ||
| ? `/github/codeql-action/releases/download/${version}/codeql-bundle-${platform}.tar.gz` | ||
| : `/download/codeql-bundle-${version}/codeql-bundle.tar.gz`; | ||
| ? `/github/codeql-action/releases/download/${tagName}/codeql-bundle-${platform}.tar.gz` |
Contributor
There was a problem hiding this comment.
To be clear — this is where you're renaming the bundle tag name in the tests from version to tagNamethat includes thecodeql-bundle-` prefix, right?
This was referenced Jan 12, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR refactors the CodeQL setup tests and fixes a GHAE setup test.
Refactoring of CodeQL setup tests
mockApiAndSetupCodeQLintomockDownloadApi,installIntoToolcache, andsetupCodeQLso it's a easier to understand the intent of the tests.versiontotagNameto prepare for the controlled rollout changes, which will involve keeping track of both a CLI version and a bundle tag name.Fix to GHAE setup test
nocknetwork request mocks after each test, just as we clear allsinonmocks.Merge / deployment checklist