You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
On Windows the tests for the cache package currently don't all pass. The tar/gzip related tests have a number of errors.
The errors are due to the following Windows-specific changes:
exec is used to check the GNU tar version (extra call to the stub)
GNU tar gets an extra option --force-local
tar is called without the full absolute path
To Reproduce
On a Windows machine:
Clone actions/toolkit
On main branch, run the following commands:
npm i
npm run bootstrap
npm run build
npm run test -- packages/cache
Expected behavior
All tests pass on Windows
Actual behavior
FAIL packages/cache/__tests__/tar.test.ts
V zstd extract tar (5ms)
× gzip extract tar (3ms)
V gzip extract GNU tar on windows (1ms)
V zstd create tar (5ms)
× gzip create tar (7ms)
V zstd list tar (2ms)
V zstdWithoutLong list tar
× gzip list tar (2ms)
? gzip extract tar
expect(jest.fn()).toHaveBeenCalledTimes(1)
Expected mock function to have been called one time, but it was called two times.
78 | ? `${process.env['windir']}\\System32\\tar.exe`
79 | : defaultTarPath
> 80 | expect(execMock).toHaveBeenCalledTimes(1)
| ^
81 | expect(execMock).toHaveBeenCalledWith(
82 | `"${tarPath}"`,
83 | [
at packages/cache/__tests__/tar.test.ts:80:20
at fulfilled (packages/cache/__tests__/tar.test.ts:24:58)
? gzip create tar
expect(jest.fn()).toHaveBeenCalledWith(expected)
Expected mock function to have been called with:
"\"C:\\Windows\\System32\\tar.exe\""
as argument 1, but it was called with
"\"tar\"".
["--posix", "-z", "-cf", "cache.tgz", "-P", "-C", "[...]/toolkit", "--files-from", "manifest.txt"]
as argument 2, but it was called with
["--posix", "-z", "-cf", "cache.tgz", "-P", "-C", "[...]/toolkit", "--files-from", "manifest.txt", "--force-local"].
Difference:
- Expected
+ Received
Array [
"--posix",
"-z",
"-cf",
"cache.tgz",
"-P",
"-C",
"[...]/toolkit",
"--files-from",
"manifest.txt",
+ "--force-local",
]
174 |
175 | expect(execMock).toHaveBeenCalledTimes(1)
> 176 | expect(execMock).toHaveBeenCalledWith(
| ^
177 | `"${tarPath}"`,
178 | [
179 | '--posix',
at packages/cache/__tests__/tar.test.ts:176:20
at fulfilled (packages/cache/__tests__/tar.test.ts:24:58)
? gzip list tar
expect(jest.fn()).toHaveBeenCalledWith(expected)
Expected mock function to have been called with:
"\"C:\\Windows\\System32\\tar.exe\""
as argument 1, but it was called with
"\"tar\"".
["-z", "-tf", "C:/Windows/fakepath/cache.tar", "-P"]
as argument 2, but it was called with
["-z", "-tf", "C:/Windows/fakepath/cache.tar", "-P", "--force-local"].
Difference:
- Expected
+ Received
Array [
"-z",
"-tf",
"C:/Windows/fakepath/cache.tar",
"-P",
+ "--force-local",
]
255 | : defaultTarPath
256 | expect(execMock).toHaveBeenCalledTimes(1)
> 257 | expect(execMock).toHaveBeenCalledWith(
| ^
258 | `"${tarPath}"`,
259 | [
260 | '-z',
at packages/cache/__tests__/tar.test.ts:257:20
at fulfilled (packages/cache/__tests__/tar.test.ts:24:58)
Desktop:
OS: Windows
The text was updated successfully, but these errors were encountered:
Describe the bug
On Windows the tests for the cache package currently don't all pass. The tar/gzip related tests have a number of errors.
The errors are due to the following Windows-specific changes:
--force-local
To Reproduce
On a Windows machine:
Expected behavior
All tests pass on Windows
Actual behavior
Desktop:
The text was updated successfully, but these errors were encountered: