Is it a good idea to support loading plugins from ...
# pact-plugins
t
Is it a good idea to support loading plugins from multiple directories? e.g. Support multiple values for
PACT_PLUGIN_DIR
, or introduce new var
PACT_PLUGIN_DIRS
u
Why would you want this?
t
Because (currently it's only me, these reasons doesn't represent the entire pact-php team, because my PRs are not reviewed and merged yet): 1.
pact-php
project only contains "core" features (http + v3 async message), it doesn't include any code that support plugins 2. Instead of supporting all plugins in
pact-php
project like I did before, I split into multiple projects:
pact-php-csv
,
pact-php-protobuf
. The reasons are: a. Not everybody want and use plugins to test their project b. Download binaries need time, and disk storage. c. Support all plugins in
pact-php
only make the code base bigger and bigger overtime 3. Each projects has it own
PACT_PLUGIN_DIR
. For example:
/path/to/pact-php-csv/bin/pact-plugins/csv
and
/another/path/to/pact-php-protobuf/bin/pact-plugins/protobuf
4. While writing consumer test, setting
PACT_PLUGIN_DIR
before each test is enough for running the test. 5. But when verifying provider, currently only set 1 value for
PACT_PLUGIN_DIR
, so only verify pacts for 1 plugin.
Another idea is adding
--filter-plugin=NAME
and
--filter-no-plugin
to pact verifier
I will try creating hooks to copy/symlink plugins into 1 places so pact verifier can use it
The solution above has been implemented. Pact plugin directories has been symlinked into single directory, and the path to that directory will be set as value of
PACT_PLUGIN_DIR