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

$basePath must be a string #1650

Closed
ricardoboss opened this issue Jan 18, 2022 · 2 comments · Fixed by #1652
Closed

$basePath must be a string #1650

ricardoboss opened this issue Jan 18, 2022 · 2 comments · Fixed by #1652
Assignees
Milestone

Comments

@ricardoboss
Copy link

Question Answer
Infection version 0.26.1
Test Framework version PHPUnit 9.5.11
PHP version 8.1.1
Platform Ubuntu (GitHub actions)
Github Repo https://github.com/elephox-dev/framework

When running a CI pipeline, I want to generate the new HTML report and publish it via Stryker. I set up my account on Stryker and enabled it for the repository linked above. Then, I added the API secret as a secret variable on GitHub and added it to the step running infection.

In case the bug is not obvious: I expected this to work. Can someone explain why it failed (have I configured it wrong?) or if this is an actual bug?

The error says: "In Assert.php line 2060: $basePath must be a string".

GitHub Actions config
- name: 🧟 Run Infection (auto scale)
 if: ${{ matrix.os == 'ubuntu-latest' }}
 run: composer run ci:mutation-test:autoscale
 env:
   STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
composer script
infection --coverage=build/coverage --skip-initial-tests --logger-github --no-interaction -j$(nproc)
Output with issue
Warning:  Sending dashboard report...

In Assert.php line 2060:
                             
 $basePath must be a string  
                             

run [--test-framework TEST-FRAMEWORK] [--test-framework-options TEST-FRAMEWORK-OPTIONS] [-j|--threads THREADS] [--only-covered] [-s|--show-mutations] [--no-progress] [--force-progress] [-c|--configuration CONFIGURATION] [--coverage COVERAGE] [--mutators MUTATORS] [--filter FILTER] [--formatter FORMATTER] [--git-diff-filter GIT-DIFF-FILTER] [--git-diff-lines] [--git-diff-base GIT-DIFF-BASE] [--logger-github] [--logger-html LOGGER-HTML] [--noop] [--only-covering-test-cases] [--min-msi MIN-MSI] [--min-covered-msi MIN-COVERED-MSI] [--log-verbosity LOG-VERBOSITY] [--initial-tests-php-options INITIAL-TESTS-PHP-OPTIONS] [--skip-initial-tests] [--ignore-msi-with-no-mutations] [--debug] [--dry-run]

Script infection --coverage=build/coverage --skip-initial-tests --logger-github --no-interaction -j$(nproc) handling the ci:mutation-test:autoscale event returned with error code 1
Error: Process completed with exit code 1.
@ricardoboss
Copy link
Author

maks-rafalko added a commit that referenced this issue Jan 19, 2022
…mixed

Fixes #1650

Previously, we could have a mix of real paths and relative paths in `MutationExecutionResult` instances. This broke HTML logger, which assumes that all paths are real (absolute), to find the base common path (`Path::getLongestCommonBasePath`).
@maks-rafalko maks-rafalko self-assigned this Jan 19, 2022
@maks-rafalko maks-rafalko added this to the next milestone Jan 19, 2022
@maks-rafalko
Copy link
Member

Thank you @ricardoboss for this bug report.

Released https://github.com/infection/infection/releases/tag/0.26.2

ricardoboss added a commit to elephox-dev/framework that referenced this issue Jan 21, 2022
ricardoboss added a commit to elephox-dev/framework that referenced this issue Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants