1
0
Fork 0
toolkit/packages/artifact/__tests__
Zoran Regvart 7932c147a0
Support upload from named pipes (#748)
Named pipes report file size as 0, which leads to reading the whole
content into memory (0 is less than 64K). This adds additional check to
make sure that the passed in path is not a named pipe, and in that case
opts for the create-temp-file-to-gzip code path.

When running on GitHub Actions infrastructure on `windows` node, named
pipes can be created using `mkfifo` from MSYS2. In that case `fs.Stats`s
`isFIFO()` returns `false`, and not `true` as expected. This case is
detected by `process.platform` being `win32` and the passed file having
length of 0.

As a side note, when MSYS2's `mkfifo` is run, a pipe file is created:

```
prw-rw-rw- 1 User None  0 Mar 31 12:58 pipe
```

If `fs.stat` is invoked at this point `ENOENT` error will be thrown. As
soon as the pipe is written to, this pipe file is replaced by two same-
named files:

```
-rw-r--r-- 1 User None  0 Mar 31 13:00 pipe
-rw-r--r-- 1 User None  0 Mar 31 13:00 pipe
```

And at this point `fs.stat` `isFIFO()` returns `false`. Even though the
file acts as a named pipe.
2021-11-29 17:19:02 -05:00
..
ci-test-action swap to file commands (#587) 2020-09-30 15:46:54 +02:00
download-specification.test.ts @actions/artifact package updates (#408) 2020-04-09 17:14:12 +02:00
download.test.ts Retry artifact uploads on HTTP 500 (#833) 2021-06-04 17:09:30 -04:00
retry.test.ts Retry artifact uploads on HTTP 500 (#833) 2021-06-04 17:09:30 -04:00
test-artifact-file.sh React to feedback 2020-05-15 12:26:42 -04:00
upload-specification.test.ts Updates to @actions/artifact package (#367) 2020-03-12 14:50:27 +01:00
upload.test.ts Support upload from named pipes (#748) 2021-11-29 17:19:02 -05:00
util.test.ts Add an option to specify retention days for artifacts (#575) 2020-09-18 11:30:00 -04:00