GoogleCloudPlatform / php-docs-samples

A collection of samples that demonstrate how to call Google Cloud services from PHP.
http://cloud.google.com/php
Apache License 2.0
961 stars 1.03k forks source link

Move processFunctionLogs functions into a library #1240

Open ace-n opened 3 years ago

ace-n commented 3 years ago

I've noticed several (and counting) of our Cloud Functions samples' DeployTests define a processFunctionLogs function.

Since these functions are largely similar (if not the same) across all these files, we should move this logic to a shared library (e.g. php-tools) or a single location within the repo (maybe the root-level testing directory?).

grayside commented 3 years ago

I suggest following the existing pattern and putting this inside the CloudFunctionsDeployTrait or creating a new trait to encapsulate utilities for async testing. When the first example was merged, we discussed that being a useful follow-up as part of the 2nd or 3rd usage to make sure we understood the needed logic.