Fix tests

This commit is contained in:
Kirill Chernyshov 2021-12-01 17:52:09 +01:00
parent 3ac60757ef
commit 0c3aaf47fb
No known key found for this signature in database
GPG Key ID: 83C196363AF97C4C
3 changed files with 30 additions and 7 deletions

View File

@ -9,6 +9,7 @@ const tempDir = path.join(__dirname, 'runner', 'temp', 'boot')
process.env['RUNNER_TOOL_CACHE'] = toolDir
process.env['RUNNER_TEMP'] = tempDir
import * as boot from '../src/boot'
import {getCacheVersionString} from '../src/utils'
describe('boot tests', () => {
beforeAll(async () => {
@ -37,7 +38,12 @@ describe('boot tests', () => {
it('Install boot with normal version', async () => {
await boot.setup('2.8.3')
const clojureDir = path.join(toolDir, 'Boot', '2.8.3', os.arch())
const clojureDir = path.join(
toolDir,
'Boot',
getCacheVersionString('2.8.3'),
os.arch()
)
expect(fs.existsSync(`${clojureDir}.complete`)).toBe(true)
expect(fs.existsSync(path.join(clojureDir, 'bin', 'boot'))).toBe(true)
@ -45,7 +51,12 @@ describe('boot tests', () => {
it('Install latest boot', async () => {
await boot.setup('latest')
const clojureDir = path.join(toolDir, 'Boot', 'latest.0.0', os.arch())
const clojureDir = path.join(
toolDir,
'Boot',
getCacheVersionString('latest'),
os.arch()
)
expect(fs.existsSync(`${clojureDir}.complete`)).toBe(true)
expect(fs.existsSync(path.join(clojureDir, 'bin', 'boot'))).toBe(true)

View File

@ -9,6 +9,7 @@ const tempDir = path.join(__dirname, 'runner', 'temp', 'leiningen')
process.env['RUNNER_TOOL_CACHE'] = toolDir
process.env['RUNNER_TEMP'] = tempDir
import * as leiningen from '../src/leiningen'
import {getCacheVersionString} from '../src/utils'
describe('leiningen tests', () => {
beforeAll(async () => {
@ -37,7 +38,12 @@ describe('leiningen tests', () => {
it('Install leiningen with normal version', async () => {
await leiningen.setup('2.9.1')
const clojureDir = path.join(toolDir, 'Leiningen', '2.9.1', os.arch())
const clojureDir = path.join(
toolDir,
'Leiningen',
getCacheVersionString('2.9.1'),
os.arch()
)
expect(fs.existsSync(`${clojureDir}.complete`)).toBe(true)
expect(fs.existsSync(path.join(clojureDir, 'bin', 'lein'))).toBe(true)
@ -45,7 +51,12 @@ describe('leiningen tests', () => {
it('Install latest leiningen', async () => {
await leiningen.setup('latest')
const clojureDir = path.join(toolDir, 'Leiningen', 'latest.0.0', os.arch())
const clojureDir = path.join(
toolDir,
'Leiningen',
getCacheVersionString('latest'),
os.arch()
)
expect(fs.existsSync(`${clojureDir}.complete`)).toBe(true)
expect(fs.existsSync(path.join(clojureDir, 'bin', 'lein'))).toBe(true)

View File

@ -10,6 +10,7 @@ const tempDir = path.join(__dirname, 'runner', 'temp', 'tdeps')
process.env['RUNNER_TOOL_CACHE'] = toolDir
process.env['RUNNER_TEMP'] = tempDir
import * as tdeps from '../src/cli'
import {getCacheVersionString} from '../src/utils'
describe('tdeps tests', () => {
beforeAll(async () => {
@ -41,7 +42,7 @@ describe('tdeps tests', () => {
const clojureDir = path.join(
toolDir,
'ClojureToolsDeps',
'1.10.1-469',
getCacheVersionString('1.10.1.469'),
os.arch()
)
@ -54,7 +55,7 @@ describe('tdeps tests', () => {
const clojureDir = path.join(
toolDir,
'ClojureToolsDeps',
'latest.0.0',
getCacheVersionString('latest'),
os.arch()
)
@ -66,7 +67,7 @@ describe('tdeps tests', () => {
const clojureDir: string = path.join(
toolDir,
'ClojureToolsDeps',
'1.10.1-469',
getCacheVersionString('1.10.1.469'),
os.arch()
)
await io.mkdirP(clojureDir)