Repository navigation
Use setup-codeql logic for finding release assets in start-proxy
#4198
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
base: main
Are you sure you want to change the base?
Changes from all commits
909fda1
cb7acf5
3f57a00
da07d40
35f12de
a4f9f6f
de99f0e
133ffeb
f9a9962
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| import test from "ava"; | ||
|
|
||
| import { joinMessageStrings } from "./logging"; | ||
| import { setupTests } from "./testing-utils"; | ||
|
|
||
| setupTests(test); | ||
|
|
||
| test("joinMessageStrings", async (t) => { | ||
| // For strings and errors, it is the identity function. | ||
| t.deepEqual(joinMessageStrings("Hello"), "Hello"); | ||
|
|
||
| const error = new Error("Some error"); | ||
| t.deepEqual(joinMessageStrings(error), error); | ||
|
|
||
| // For arrays of strings, we get a join-ed string. | ||
| t.deepEqual(joinMessageStrings(["foo", "bar"]), "foo bar"); | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| import * as path from "path"; | ||
|
|
||
| import test from "ava"; | ||
| import * as sinon from "sinon"; | ||
|
|
||
| import * as actionsUtil from "../actions-util"; | ||
| import { ActionsEnvVars } from "../environment"; | ||
| import { callee, setupTests } from "../testing-utils"; | ||
| import { initializeEnvironment } from "../util"; | ||
|
|
||
| import { getCodeQLActionRepository } from "./repository"; | ||
|
|
||
| setupTests(test); | ||
|
|
||
| test.serial("getCodeQLActionRepository", async (t) => { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can this now be run in parallel with other tests?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, I see it can't because
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, it goes via That PR predates
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Sounds good to me. |
||
| initializeEnvironment("1.2.3"); | ||
|
|
||
| const target = callee(getCodeQLActionRepository) | ||
| .withArgs() | ||
| .withEnv((env) => { | ||
| env.set(ActionsEnvVars.RUNNER_TEMP, path.dirname(__dirname)); | ||
| }); | ||
|
|
||
| // isRunningLocalAction() === true | ||
| await target.passes(t.deepEqual, "github/codeql-action"); | ||
|
|
||
| // isRunningLocalAction() === false | ||
| sinon.stub(actionsUtil, "isRunningLocalAction").returns(false); | ||
| await target | ||
| .withEnv((env) => { | ||
| env.set(ActionsEnvVars.GITHUB_ACTION_REPOSITORY, "xxx/yyy"); | ||
| }) | ||
| .passes(t.deepEqual, "xxx/yyy"); | ||
| }); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking back at this after a commit-by-commit review, does anything use this? If not, let's remove it.