Skip to content

Commit

Permalink
use regex in string matching
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeWang1127 committed Mar 14, 2024
1 parent 013e69c commit 2d15254
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions java-service-management/owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,27 @@
from synthtool.languages import java

file_name = "owl-bot-staging/v1/google-cloud-service-management/src/test/java/com/google/cloud/api/servicemanagement/v1/ServiceManagerClientHttpJsonTest.java"
ignore_annotation = '@Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839")'

for library in s.get_staging_dirs():
# put any special-case replacements here
s.replace(
file_name,
'import org.junit.Test;',
r'^import org.junit.Test;',
'import org.junit.Ignore;\nimport org.junit.Test;'
)
s.replace(
file_name,
'@Test\npublic void setIamPolicyTest() throws Exception {',
r"\s+@Test\n\s+public void setIamPolicyTest\(\) throws Exception.*",
'@Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839")\n@Test\npublic void setIamPolicyTest() throws Exception {'
)
s.replace(
file_name,
'@Test\npublic void getIamPolicyTest() throws Exception {',
r'\s+@Test\n\s+public void getIamPolicyTest\(\) throws Exception.*',
'@Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839")\n@Test\npublic void getIamPolicyTest() throws Exception {'
)
s.replace(
file_name,
'@Test\npublic void testIamPermissionsTest() throws Exception {',
r'\s+@Test\n\s+public void testIamPermissionsTest\(\) throws Exception.*',
'@Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839")@Test\npublic void testIamPermissionsTest() throws Exception {'
)
s.move(library)
Expand Down

0 comments on commit 2d15254

Please sign in to comment.