Skip to content

Commit

Permalink
chore: fix owlbot configuration and GcTestListener autoloading (#5435)
Browse files Browse the repository at this point in the history
* chore: fix owlbot configuration and GcTestListener autoloading

* Update owlbot.py

* Update owlbot.py
  • Loading branch information
bshaffer authored Aug 4, 2022
1 parent 9c1ac12 commit ee5feef
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 5 deletions.
2 changes: 2 additions & 0 deletions Core/src/Testing/GcTestListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* limitations under the License.
*/

namespace Google\Cloud\Core\Testing;

use PHPUnit\Framework\TestListener;
use Yoast\PHPUnitPolyfills\TestListeners\TestListenerDefaultImplementation;

Expand Down
17 changes: 16 additions & 1 deletion Datastream/owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@
# Added so that we can pass copy_excludes in the owlbot_main() call
_tracked_paths.add(src)

php.owlbot_main(src=src, dest=dest)
php.owlbot_main(
src=src,
dest=dest,
copy_excludes=[
src / "**/[A-Z]*_*.php"
]
)

# document and utilize apiEndpoint instead of serviceAddress
s.replace(
Expand All @@ -50,6 +56,15 @@
r"\$transportConfig, and any \$serviceAddress",
r"$transportConfig, and any `$apiEndpoint`")

# remove class_alias code
s.replace(
"src/V*/**/*.php",
r"^// Adding a class alias for backwards compatibility with the previous class name.$"
+ "\n"
+ r"^class_alias\(.*\);$"
+ "\n",
'')

### [START] protoc backwards compatibility fixes

# roll back to private properties.
Expand Down
19 changes: 17 additions & 2 deletions Optimization/owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@
# Added so that we can pass copy_excludes in the owlbot_main() call
_tracked_paths.add(src)

php.owlbot_main(src=src, dest=dest)
php.owlbot_main(
src=src,
dest=dest,
copy_excludes=[
src / "**/[A-Z]*_*.php"
]
)

# document and utilize apiEndpoint instead of serviceAddress
s.replace(
Expand All @@ -50,6 +56,15 @@
r"\$transportConfig, and any \$serviceAddress",
r"$transportConfig, and any `$apiEndpoint`")

# remove class_alias code
s.replace(
"src/V*/**/*.php",
r"^// Adding a class alias for backwards compatibility with the previous class name.$"
+ "\n"
+ r"^class_alias\(.*\);$"
+ "\n",
'')

### [START] protoc backwards compatibility fixes

# roll back to private properties.
Expand Down Expand Up @@ -94,4 +109,4 @@
'--write',
'--parser=php',
'--single-quote',
'--print-width=80'])
'--print-width=80'])
2 changes: 1 addition & 1 deletion phpunit-php5.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</whitelist>
</filter>
<listeners>
<listener class="GcTestListener" file="Core/src/Testing/GcTestListener.php"/>
<listener class="Google\Cloud\Core\Testing\GcTestListener" file="Core/src/Testing/GcTestListener.php"/>
</listeners>
<php>
<ini name="memory_limit" value="2048M"/>
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
<ini name="memory_limit" value="2048M"/>
</php>
<listeners>
<listener class="GcTestListener" file="Core/src/Testing/GcTestListener.php"/>
<listener class="Google\Cloud\Core\Testing\GcTestListener" file="Core/src/Testing/GcTestListener.php"/>
</listeners>
</phpunit>

0 comments on commit ee5feef

Please sign in to comment.