Closed petk closed 6 years ago
The PECL archive is a distribution package, which should only be concerned with the files required to install and use the library. Testing is a development concern, so cloning the repository is more appropriate for that.
Ok, I see. When making Linux packages for repositories, usually the release archive gets downloaded in many cases from the PECL site directly and those packaging scripts also include steps to run tests, to ensure that everything will runs smoothly on that distribution (in ideal case scenario of course).
I guess the download of the tgz archive from the GitHub releases page is good also for this case then... Thanks...
Those are actually just the Windows .dll's.
~I'll include the composer files in the distribution. I'm okay with this because we're not actually shipping the tests themselves, only the script to pull them in.~
Actually...
Usually you'd have .phpt tests for extensions but I decided to write the ds ones in PHPUnit, which means we need to do a composer install to run them.
When 2.0 is ready, simple method stubs will take the place of the polyfill, and these would need to be composer installed. So what the user can do is install the extension using the distribution (without the composer files), then run composer require php-ds/php-ds
in their application, which will install the stubs (for IDE meta) and the tests (unless --no-dev). They can then run the tests in vendor/php-ds
.
Would that be a reasonable workaround? The script to run the tests can include composer require php-ds/php-ds
as well, assuming composer is installed.
I think there's enough of a workaround here to avoid adding the composer files to the package, it's just a matter of figuring out the nicest way to do it.
I'll leave this open in the meantime until we get perfectly clear on how this should work. 👍
All tests will be ported to phpt in 2.0, so composer won't be needed at all.
When installing this extension using PECL, the
composer.json
andcomposer.lock
files are missing in the tgz archive file and testing can't be done.Should the test be also possible to install when using the PECL installation way?
Thank you checking this out.