diff --git a/.github/workflows/test-integration.yml b/.github/workflows/test-integration.yml index 80d5c623..c3ad506f 100644 --- a/.github/workflows/test-integration.yml +++ b/.github/workflows/test-integration.yml @@ -54,10 +54,18 @@ jobs: version: - input: 2.x expected: "Task version: 2.8.1" - - input: 2.8.x - expected: "Task version: 2.8.1" - - input: 3.4.1 - expected: "Task version: 3.4.1" + - input: 3.36.x + expected: "Task version: v3.36.0 (h1:XVJ5hQ5hdzTAulHpAGzbUMUuYr9MUOEQFOFazI3hUsY=)" + - input: 3.37.2 + expected: "Task version: v3.37.2 (h1:Jwgvo+2vX79Fu+44xPxVKC5DIkUE89QeDjN2tmYaQzA=)" + + exclude: + # The macos-latest runner is an Apple Silicon machine, but Task 2.x is only available for x86 on macOS, which + # would cause a spurious test failure: "Unexpected HTTP response: 404" + - runs-on: macos-latest + version: + input: 2.x + expected: "Task version: 2.8.1" steps: - name: Checkout repository diff --git a/__tests__/main.test.ts b/__tests__/main.test.ts index 267533e2..094a4538 100644 --- a/__tests__/main.test.ts +++ b/__tests__/main.test.ts @@ -43,8 +43,8 @@ describe("installer tests", () => { }); it("Downloads version of Task if no matching version is installed", async () => { - await installer.getTask("2.6.0", ""); - const taskDir = path.join(toolDir, "task", "2.6.0", os.arch()); + await installer.getTask("3.37.1", ""); + const taskDir = path.join(toolDir, "task", "3.37.1", os.arch()); expect(fs.existsSync(`${taskDir}.complete`)).toBe(true); @@ -67,9 +67,9 @@ describe("installer tests", () => { nock.enableNetConnect(); }); - it("Gets the latest version of Task 2.5 using 2.5 and no matching version is installed", async () => { - await installer.getTask("2.5", ""); - const taskDir = path.join(toolDir, "task", "2.5.2", os.arch()); + it("Gets the latest version of Task 3.36 using 3.36 and no matching version is installed", async () => { + await installer.getTask("3.36", ""); + const taskDir = path.join(toolDir, "task", "3.36.0", os.arch()); expect(fs.existsSync(`${taskDir}.complete`)).toBe(true); if (IS_WINDOWS) { @@ -79,21 +79,9 @@ describe("installer tests", () => { } }); - it("Gets latest version of Task using 2.x and no matching version is installed", async () => { - await installer.getTask("2.x", ""); - const taskdir = path.join(toolDir, "task", "2.6.0", os.arch()); - - expect(fs.existsSync(`${taskdir}.complete`)).toBe(true); - if (IS_WINDOWS) { - expect(fs.existsSync(path.join(taskdir, "bin", "task.exe"))).toBe(true); - } else { - expect(fs.existsSync(path.join(taskdir, "bin", "task"))).toBe(true); - } - }); - - it("Gets preview version of Task using 3.x and no matching version is installed", async () => { + it("Gets latest version of Task using 3.x and no matching version is installed", async () => { await installer.getTask("3.x", ""); - const taskdir = path.join(toolDir, "task", "3.0.0-preview1", os.arch()); + const taskdir = path.join(toolDir, "task", "3.37.2", os.arch()); expect(fs.existsSync(`${taskdir}.complete`)).toBe(true); if (IS_WINDOWS) { @@ -104,8 +92,8 @@ describe("installer tests", () => { }); it("Skips version computing when a valid semver is provided", async () => { - await installer.getTask("3.0.0", ""); - const taskdir = path.join(toolDir, "task", "3.0.0", os.arch()); + await installer.getTask("3.37.0", ""); + const taskdir = path.join(toolDir, "task", "3.37.0", os.arch()); expect(fs.existsSync(`${taskdir}.complete`)).toBe(true); if (IS_WINDOWS) { diff --git a/__tests__/testdata/tags.json b/__tests__/testdata/tags.json index dc128c07..fbd1a376 100644 --- a/__tests__/testdata/tags.json +++ b/__tests__/testdata/tags.json @@ -248,5 +248,35 @@ "type": "tag", "url": "https://api.github.com/repos/go-task/task/git/tags/b637b3f832f28ce254377e507170c62cce3c20da" } + }, + { + "ref": "refs/tags/v3.36.0", + "node_id": "MDM6UmVmODMyNTI5ODM6cmVmcy90YWdzL3YzLjM2LjA=", + "url": "https://api.github.com/repos/go-task/task/git/refs/tags/v3.36.0", + "object": { + "sha": "cc6d0979c6584edc68623aa67ffe29742baeaefe", + "type": "tag", + "url": "https://api.github.com/repos/go-task/task/git/tags/cc6d0979c6584edc68623aa67ffe29742baeaefe" + } + }, + { + "ref": "refs/tags/v3.37.1", + "node_id": "MDM6UmVmODMyNTI5ODM6cmVmcy90YWdzL3YzLjM3LjE=", + "url": "https://api.github.com/repos/go-task/task/git/refs/tags/v3.37.1", + "object": { + "sha": "e48824e99dbccf39dc7d376c2684560945123b30", + "type": "tag", + "url": "https://api.github.com/repos/go-task/task/git/tags/e48824e99dbccf39dc7d376c2684560945123b30" + } + }, + { + "ref": "refs/tags/v3.37.2", + "node_id": "MDM6UmVmODMyNTI5ODM6cmVmcy90YWdzL3YzLjM3LjI=", + "url": "https://api.github.com/repos/go-task/task/git/refs/tags/v3.37.2", + "object": { + "sha": "7aa90b1511c05da43f415d3e6b27aa9866cb40cb", + "type": "tag", + "url": "https://api.github.com/repos/go-task/task/git/tags/7aa90b1511c05da43f415d3e6b27aa9866cb40cb" + } } ]