mirror of
https://github.com/actions/setup-go.git
synced 2025-04-23 17:40:50 +00:00
Fix unit tests
This commit is contained in:
parent
d4fc9881c5
commit
7eefc6eb21
2 changed files with 8 additions and 3 deletions
2
.github/workflows/windows-validation.yml
vendored
2
.github/workflows/windows-validation.yml
vendored
|
@ -29,7 +29,7 @@ jobs:
|
||||||
- run: |
|
- run: |
|
||||||
du -m -s 'D:\hostedtoolcache\windows\go\${{ matrix.go }}\x64'
|
du -m -s 'D:\hostedtoolcache\windows\go\${{ matrix.go }}\x64'
|
||||||
size=$(du -m -s 'D:\hostedtoolcache\windows\go\${{ matrix.go }}\x64'|cut -f1 -d$'\t')
|
size=$(du -m -s 'D:\hostedtoolcache\windows\go\${{ matrix.go }}\x64'|cut -f1 -d$'\t')
|
||||||
# make sure archive does not take lost of the space
|
# make sure archive does not take lot of space
|
||||||
if [ $size -gt 999 ];then
|
if [ $size -gt 999 ];then
|
||||||
echo 'Size of installed on drive d: go is too big';
|
echo 'Size of installed on drive d: go is too big';
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import * as io from '@actions/io';
|
import * as io from '@actions/io';
|
||||||
import {addExecutablesToCache, IGoVersionInfo} from '../src/installer';
|
import {addExecutablesToCache, IGoVersionInfo} from '../src/installer';
|
||||||
|
import path from 'path';
|
||||||
|
|
||||||
describe('Windows performance workaround', () => {
|
describe('Windows performance workaround', () => {
|
||||||
let mkdirSpy: jest.SpyInstance;
|
let mkdirSpy: jest.SpyInstance;
|
||||||
|
@ -52,10 +53,14 @@ describe('Windows performance workaround', () => {
|
||||||
|
|
||||||
process.env['RUNNER_TOOL_CACHE'] = '/faked-hostedtoolcache1';
|
process.env['RUNNER_TOOL_CACHE'] = '/faked-hostedtoolcache1';
|
||||||
const cacheDir1 = await addExecutablesToCache('/qzx', info, 'arch');
|
const cacheDir1 = await addExecutablesToCache('/qzx', info, 'arch');
|
||||||
expect(cacheDir1).toBe('/faked-hostedtoolcache1/go/1.2.3/arch');
|
expect(cacheDir1).toBe(
|
||||||
|
path.join('/', 'faked-hostedtoolcache1', 'go', '1.2.3', 'arch')
|
||||||
|
);
|
||||||
|
|
||||||
process.env['RUNNER_TOOL_CACHE'] = '/faked-hostedtoolcache2';
|
process.env['RUNNER_TOOL_CACHE'] = '/faked-hostedtoolcache2';
|
||||||
const cacheDir2 = await addExecutablesToCache('/qzx', info, 'arch');
|
const cacheDir2 = await addExecutablesToCache('/qzx', info, 'arch');
|
||||||
expect(cacheDir2).toBe('/faked-hostedtoolcache2/go/1.2.3/arch');
|
expect(cacheDir2).toBe(
|
||||||
|
path.join('/', 'faked-hostedtoolcache2', 'go', '1.2.3', 'arch')
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue