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

Tools - refine support for custom binaries and tools installed with phar #234

Merged
merged 7 commits into from
May 13, 2021

Conversation

zdenekdrahos
Copy link
Member

Related: #233, 300eb60

  • missing binary can't stop analysis - just ignore it, or show it in not installed tools
  • phar support - no internalClass, run phpmetrics v2 from composer and v1 from phar

- it's required only for selecting tool with multiple versions (only phpmetrics at the moment)
- suggested tools should check composer or binary - it will be implemented in following commits, current state for not installed tools:

 [Edge\QA\Task\ParallelExec] Output for  "/phpqa/vendor/bin/security-checker" security:check ./composer.lock
sh: /phpqa/vendor/bin/security-checker: No such file or directory
It only complicates running tools via phar or running both versions of phpqa
It was phpqa error, that phpunit was validated even when phpunit is not used.

$ nano .phpqa.yml # add invalid phpunit binary
$ phpqa --config tests/.ci --tools phpcs
   - Before: Invalid phpunit.binary - 'tests/.ci//../../vendor/phpunit/phpunit/phpunita' does not exist.
   - After: Ok. 1 processes finished running
$ phpqa --config tests/.ci --tools phpunit
   - Before: Invalid phpunit.binary - 'tests/.ci//../../vendor/phpunit/phpunit/phpunita' does not exist.
   - After if phpunit is installed in composer: 1 processes finished running
   - After if phpunit is not installed in composer: vendor/bin/invalidphpunit exited with code 127 (it will be displayed as not installed tool when binary is validated)
It does not matter, if it's installed via composer or custom binary.
- escape path in one place
- use same builder for running analysis and tools (still missing abstraction, but it's good enough)
$ chmod -x phars/phpmetrics.phar
$ phpqa --config tests/.ci --tools phpmetrics -v
   Before: sh: /phpqa/phars/phpmetrics.phar: Permission denied
   After: 1 processes finished running, No failed tools
@zdenekdrahos zdenekdrahos merged commit 30e716e into master May 13, 2021
@zdenekdrahos zdenekdrahos deleted the custom-binary-phar branch May 13, 2021 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant