actions / actions/toolkit

Tool-Cache: .tar.gz tests fail on Windows

Open
#798 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug tool-cache
Dominant language
TypeScript
Stars
5.9k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
On Windows the tests for the tool-cache package currently don't all pass. The .tar.gz tests fail with an error saying tar wasn't found.

To Reproduce
On a Windows machine:

  1. Clone actions/toolkit
  2. On main branch, run the following commands:
    npm i
    npm run bootstrap
    npm run build
    npm run test -- packages/tool-cache
    

Expected behavior
All tests pass on Windows

Actual behavior

 FAIL  packages/tool-cache/__tests__/tool-cache.test.ts
  @actions/tool-cache
    V downloads a 35 byte file (16ms)
    V downloads a 35 byte file (dest) (20ms)
    V downloads a 35 byte file (dest requires mkdirp) (17ms)
    V downloads a 35 byte file after a redirect (18ms)
    V handles error from response message stream (71ms)
    V retries error from response message stream (23ms)
    V has status code in exception dictionary for HTTP error code responses (17ms)
    V works with redirect code 302 (15ms)
    V installs a binary tool and finds it (24ms)
    V installs a 7z and finds it (295ms)
    V extracts a 7z to a directory that does not exist (275ms)
    V extract 7z using custom 7z tool (37ms)
    × extract .tar.gz (20ms)
    × extract .tar.gz to a directory that does not exist (20ms)
    × extract .tar.xz (18ms)
    V installs a zip and finds it (440ms)
    V installs a zip and extracts it to specified directory (440ms)
    V extract zip to a directory that does not exist (433ms)
    V works with a 502 temporary failure (17ms)
    V doesn't retry 502s more than 3 times (18ms)
    V retries 429s (17ms)
    V doesn't retry 404 (13ms)
    V supports authorization headers (13ms)
    V supports custom headers (14ms)
    V supports authorization and custom headers (14ms)

  ? @actions/tool-cache > extract .tar.gz

    Unable to locate executable file: tar. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.

      188 |     if (!result) {
      189 |       if (ioUtil.IS_WINDOWS) {
    > 190 |         throw new Error(
          |               ^
      191 |           `Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`
      192 |         )
      193 |       } else {

      at Object.<anonymous> (packages/io/src/io.ts:190:15)
      at fulfilled (packages/io/lib/io.js:24:58)

  ? @actions/tool-cache > extract .tar.gz to a directory that does not exist

    Unable to locate executable file: tar. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.

      188 |     if (!result) {
      189 |       if (ioUtil.IS_WINDOWS) {
    > 190 |         throw new Error(
          |               ^
      191 |           `Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`
      192 |         )
      193 |       } else {

      at Object.<anonymous> (packages/io/src/io.ts:190:15)
      at fulfilled (packages/io/lib/io.js:24:58)

  ? @actions/tool-cache > extract .tar.xz

    Unable to locate executable file: tar. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.

      188 |     if (!result) {
      189 |       if (ioUtil.IS_WINDOWS) {
    > 190 |         throw new Error(
          |               ^
      191 |           `Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`
      192 |         )
      193 |       } else {

      at Object.<anonymous> (packages/io/src/io.ts:190:15)
      at fulfilled (packages/io/lib/io.js:24:58)

Desktop:

  • OS: Windows

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Run the listed bootstrap, build, and package test commands on Windows, then start with packages/tool-cache/tests/tool-cache.test.ts and the failure at packages/io/src/io.ts:190. Trace the .tar.gz and .tar.xz extraction path and verify that all three failing archive tests pass on Windows without the missing-tar error.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.