and allow to skip missing workflows
Can be used like this:
brew pr-pull --workflows=tests.yml,wheezy_tests.yml --ignore-missing-artifacts=wheezy_tests.yml PRNUMBER
When using `popen_write`, the expectation is to return the
standard output of the child process.
This expectation is evident in how `safe_popen_write` is written:
```
def self.safe_popen_write(*args, **options, &block)
output = popen_write(*args, **options, &block)
return output if $CHILD_STATUS.success?
raise ErrorDuringExecution.new(args, status: $CHILD_STATUS, output: [[:stdout, output]])
end
```
However, no code has been written to actually *obtain* that output
from the child process. The side effects of that are described in
issue #8244. [1]
[1]: https://github.com/Homebrew/brew/issues/8244
The newly-added tests reveal that `popen_write` only returns the
number 4 instead of the expected standard output.
For example, given a file `foo` with the content `Foo\n`, one test
calls `popen_write` with `cat foo -` and an input of `Bar`.
The expected output would be `Foo\nBar\n` but the actual output is
the number 4 (which is what Ruby’s `IO#write` method returns).
- This method, called from `brew extract` in the case of extraction from
third-party taps, was untested. This led to it breaking when we refactored
some of it to appease Sorbet (see PR 7933). If I make the same
(flawed) change here and run these tests, they fail.
- There's a fair bit going on here, but most of it is setup for
committing changes to more files, as we're testing operations on
multiple files in a Homebrew repo.
- I originally tried to write tests for `brew extract`, but that
required _a lot_ of refactoring because those tests (and their helper
methods) aren't designed for third-party taps - they rely on
`CoreTap`. So testing the underlying method is a better solution.