Open ZhouyihaiDing opened 6 years ago
How do existing PHP packages not ship tests? Do all PHP packages distributed via composer take this dual repo approach?
I thought this repo is used for the cloud API end2end tests at the beginning. Currently it doesn't matter because we only have firestore end2end tests so far, but later if we all many tests for different APIs, it just sounds strange we ship them to the user. There can be one workaround: manually exclude end2end tests files for each release, because the user mostly downloads the release version.
Based on my understanding, for the google cloud users, they can download all APIs by running composer install google/cloud
, which will download repo: https://github.com/GoogleCloudPlatform/google-cloud-php.
However, the user can download each API like composer install google/cloud-spanner(google/cloud-storage, google/cloud-vision...)
, which are split into each individual repo. (eg: https://github.com/GoogleCloudPlatform/google-cloud-php-spanner)
For protobuf, when the users run composer require protobuf
, they will install the whole google/protobuf repository.
This is what google/cloud
does for excluding tests files from the every release: https://github.com/GoogleCloudPlatform/google-cloud-php/blob/master/.gitattributes.
We can do it this way.
We can move the file from firestore/examples/end2end
to end2end/examples/firestore
, and exclude end2end/
directory from every release. So the user will only download the library from the release.
Yes, I think we should follow the approach taken by google/cloud for PHP.
Re: pkg structure, let's move the firestore tests to "cloud-apis/firestore/examples/end2end" for now.
@WeiranFang
Due to the limitation of the PHP, when the user run "composer install grpc-gcp", it will download the whole github repository, while part of the codes (gcp unit tests + firestore tests) are not needed.
We should create another repository for splitting the test codes and the gcp library. The name can be
grpc-gcp-php-library
or something.