Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git-diff-filter option on MacOS doesn't work #1492

Closed
wolfgangschaefer opened this issue Feb 24, 2021 · 0 comments · Fixed by #1493
Closed

git-diff-filter option on MacOS doesn't work #1492

wolfgangschaefer opened this issue Feb 24, 2021 · 0 comments · Fixed by #1493
Labels
Milestone

Comments

@wolfgangschaefer
Copy link

Question Answer
Infection version 0.21.0 (infection.phar --version)
Test Framework version PHPUnit 7.5.20
PHP version 7.4.15
Platform MacOS
Github Repo -
phpunit.xml
<phpunit
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/7.1/phpunit.xsd"
>
   <testsuites>
       <testsuite name="Api">
           <directory>tests/Api</directory>
       </testsuite>
       <testsuite name="B2b">
           <directory>tests/B2b</directory>
       </testsuite>
       <testsuite name="Basket">
           <directory>tests/Basket</directory>
       </testsuite>
       <testsuite name="Catalog">
           <directory>tests/Catalog</directory>
       </testsuite>
       <testsuite name="I18n">
           <directory>tests/I18n</directory>
       </testsuite>
       <testsuite name="Inventory">
           <directory>tests/Inventory</directory>
       </testsuite>
       <testsuite name="Libraries">
           <directory>tests/Libraries</directory>
       </testsuite>
       <testsuite name="OfferCode">
           <directory>tests/OfferCode</directory>
       </testsuite>
       <testsuite name="Pricing">
           <directory>tests/Pricing</directory>
       </testsuite>
       <testsuite name="Print">
           <directory>tests/Print</directory>
       </testsuite>
       <testsuite name="Sap">
           <directory>tests/Sap</directory>
       </testsuite>
       <testsuite name="Security">
           <directory>tests/Security</directory>
       </testsuite>
       <testsuite name="Seo">
           <directory>tests/Seo</directory>
       </testsuite>
       <testsuite name="Shipping">
           <directory>tests/Shipping</directory>
       </testsuite>
   </testsuites>
   <filter>
       <whitelist>
           <directory>src</directory>
           <exclude>
               <directory>src/Api/Token/Test</directory>
               <directory>src/Inventory/SiteWarehouse/Test</directory>
               <directory>src/Catalog/Product/Attribute/Test</directory>
               <directory>src/Catalog/Product/Name/Test</directory>
               <directory>src/Catalog/Product/Image/Test</directory>
               <directory>src/Catalog/Product/Slug/Test</directory>
               <directory>src/Catalog/Product/SortOrder/Test</directory>
               <directory>src/Catalog/Repository/Test</directory>
               <directory>src/Catalog/Search/Test</directory>
               <directory>src/Inventory/Cache/Test</directory>
               <directory>src/Inventory/SiteWarehouse/Test</directory>
               <directory>src/Inventory/StockEditor/Test</directory>
               <directory>src/Inventory/Warehouse/Repository/Test</directory>
               <directory>src/Libraries/Cache/Test</directory>
               <directory>src/Libraries/Site/Test</directory>
               <directory>src/Pricing/Cache/Test</directory>
               <directory>src/Print/Test</directory>
               <directory>src/Shipping/Shipment/Repository/Test</directory>
           </exclude>
       </whitelist>
   </filter>
</phpunit>

When I use the command infection --git-diff-base=origin/master --git-diff-filter=A infection runs without reduced mutations.

@maks-rafalko helped me to debug this issue: When I try the underlying command git diff origin/master --diff-filter=AM --name-only | grep src/ | paste -sd "," I get following output:

usage: paste [-s] [-d delimiters] file …

I have pasted the man page below. I was not able to find the correct syntax, but maybe anyone else can help:

Man page for paste
     paste -- merge corresponding or subsequent lines of files

SYNOPSIS
     paste [-s] [-d list] file ...

DESCRIPTION
     The paste utility concatenates the corresponding lines of the given input files, replacing all but the last file's newline characters with a single tab character, and writes the
     resulting lines to standard output.  If end-of-file is reached on an input file while other input files still contain data, the file is treated as if it were an endless source of
     empty lines.

     The options are as follows:

     -d list     Use one or more of the provided characters to replace the newline characters instead of the default tab.  The characters in list are used circularly, i.e., when list is
                 exhausted the first character from list is reused.  This continues until a line from the last input file (in default operation) or the last line in each file (using the
                 -s option) is displayed, at which time paste begins selecting characters from the beginning of list again.

                 The following special characters can also be used in list:

                 \n    newline character
                 \t    tab character
                 \\    backslash character
                 \0    Empty string (not a null character).

                 Any other character preceded by a backslash is equivalent to the character itself.

     -s          Concatenate all of the lines of each separate input file in command line order.  The newline character of every line except the last line in each input file is replaced
                 with the tab character, unless otherwise specified by the -d option.

     If '-' is specified for one or more of the input files, the standard input is used; standard input is read one line at a time, circularly, for each instance of '-'.

EXIT STATUS
     The paste utility exits 0 on success, and >0 if an error occurs.

EXAMPLES
     List the files in the current directory in three columns:

           ls | paste - - -

     Combine pairs of lines from a file into single lines:

           paste -s -d '\t\n' myfile

     Number the lines in a file, similar to nl(1):

           sed = myfile | paste -s -d '\t\n' - -

     Create a colon-separated list of directories named bin, suitable for use in the PATH environment variable:

           find / -name bin -type d | paste -s -d : -

SEE ALSO
     cut(1), lam(1)

STANDARDS
     The paste utility is expected to be IEEE Std 1003.2 (``POSIX.2'') compatible.```
</details>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants