Use the API URL from the environment if it is present.

This commit is contained in:
Chris Gavin 2022-08-10 21:11:50 +01:00
parent a6d09016e7
commit bbdc9efa94
No known key found for this signature in database
GPG key ID: 07F950B80C27E4DA
42 changed files with 122 additions and 22 deletions

View file

@ -85,7 +85,11 @@ test("checkoutExternalQueries", async (t) => {
await externalQueries.checkoutExternalRepository(
repoName,
commit1Sha,
{ url: `file://${testRepoBaseDir}`, externalRepoAuth: "" },
{
url: `file://${testRepoBaseDir}`,
externalRepoAuth: "",
apiURL: undefined,
},
tmpDir,
getRunnerLogger(true)
);
@ -99,7 +103,11 @@ test("checkoutExternalQueries", async (t) => {
await externalQueries.checkoutExternalRepository(
repoName,
commit2Sha,
{ url: `file://${testRepoBaseDir}`, externalRepoAuth: "" },
{
url: `file://${testRepoBaseDir}`,
externalRepoAuth: "",
apiURL: undefined,
},
tmpDir,
getRunnerLogger(true)
);
@ -114,6 +122,7 @@ test("buildCheckoutURL", (t) => {
externalQueries.buildCheckoutURL("foo/bar", {
url: "https://github.com",
externalRepoAuth: undefined,
apiURL: undefined,
}),
"https://github.com/foo/bar"
);
@ -121,6 +130,7 @@ test("buildCheckoutURL", (t) => {
externalQueries.buildCheckoutURL("foo/bar", {
url: "https://github.example.com/",
externalRepoAuth: undefined,
apiURL: undefined,
}),
"https://github.example.com/foo/bar"
);
@ -129,6 +139,7 @@ test("buildCheckoutURL", (t) => {
externalQueries.buildCheckoutURL("foo/bar", {
url: "https://github.com",
externalRepoAuth: "abc",
apiURL: undefined,
}),
"https://x-access-token:abc@github.com/foo/bar"
);
@ -136,6 +147,7 @@ test("buildCheckoutURL", (t) => {
externalQueries.buildCheckoutURL("foo/bar", {
url: "https://github.example.com/",
externalRepoAuth: "abc",
apiURL: undefined,
}),
"https://x-access-token:abc@github.example.com/foo/bar"
);