-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathpython.test.ts
More file actions
43 lines (36 loc) · 1.36 KB
/
Copy pathpython.test.ts
File metadata and controls
43 lines (36 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import ciInfo from "ci-info"
const { GITHUB_ACTIONS } = ciInfo
import { info } from "ci-log"
import { ubuntuVersion } from "../../utils/env/ubuntu_version.js"
import { cleanupTmpDir, setupTmpDir, testBin } from "../../utils/tests/test-helpers.js"
import { getVersion } from "../../versions/versions.js"
import { setupPython } from "../python.js"
jest.setTimeout(300000)
describe("setup-python", () => {
let directory: string
beforeAll(async () => {
directory = await setupTmpDir("python")
})
it("should setup python in GitHub Actions", async () => {
if (GITHUB_ACTIONS) {
info("Installing python in GitHub Actions")
const { setupActionsPython } = await import("../actions_python.js")
await setupActionsPython(getVersion("python", "true", await ubuntuVersion()), directory, process.arch)
await testBin("python", ["--version"])
}
})
it("should setup python via system", async () => {
process.env.CI = "false"
process.env.GITHUB_ACTIONS = "false"
const installInfo = await setupPython({
version: getVersion("python", "true", await ubuntuVersion()),
setupDir: directory,
arch: process.arch,
})
const python = process.platform === "darwin" ? "python3" : "python"
await testBin(python, ["--version"], installInfo.binDir)
})
afterAll(async () => {
await cleanupTmpDir("python")
}, 100000)
})