Skip to content

Commit 3d079d1

Browse files
committed
chore: adapt owlbot.py and conformance tests for monorepo, set throw-deprecation to false to not crash test due to deprecated dep (punycode), exclude .mocharc and readme from owlbot
1 parent bdbf594 commit 3d079d1

File tree

5 files changed

+32
-15
lines changed

5 files changed

+32
-15
lines changed

.github/workflows/conformance.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,18 @@ on:
1717
push:
1818
branches:
1919
- main
20+
paths:
21+
- 'handwritten/bigtable/**'
2022
pull_request:
23+
paths:
24+
- 'handwritten/bigtable/**'
2125
name: conformance
2226
jobs:
2327
conformance:
2428
runs-on: ubuntu-latest
29+
defaults:
30+
run:
31+
working-directory: handwritten/bigtable
2532
strategy:
2633
matrix:
2734
node: [ 18, 20 ]
@@ -31,7 +38,7 @@ jobs:
3138
with:
3239
repository: googleapis/cloud-bigtable-clients-test
3340
ref: main
34-
path: cloud-bigtable-clients-test
41+
path: handwritten/bigtable/cloud-bigtable-clients-test
3542
- uses: actions/setup-node@v3
3643
with:
3744
node-version: ${{ matrix.node }}

.github/workflows/mandatory-conformance.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,18 @@ on:
1717
push:
1818
branches:
1919
- main
20+
paths:
21+
- 'handwritten/bigtable/**'
2022
pull_request:
23+
paths:
24+
- 'handwritten/bigtable/**'
2125
name: mandatory-conformance
2226
jobs:
2327
mandatory-conformance:
2428
runs-on: ubuntu-latest
29+
defaults:
30+
run:
31+
working-directory: handwritten/bigtable
2532
strategy:
2633
matrix:
2734
node: [ 18, 20 ]
@@ -31,7 +38,7 @@ jobs:
3138
with:
3239
repository: googleapis/cloud-bigtable-clients-test
3340
ref: v0.0.3
34-
path: cloud-bigtable-clients-test
41+
path: handwritten/bigtable/cloud-bigtable-clients-test
3542
- uses: actions/setup-node@v3
3643
with:
3744
node-version: ${{ matrix.node }}
@@ -41,4 +48,4 @@ jobs:
4148
- run: chmod +x .kokoro/mandatory-conformance.sh
4249
- run: npm install
4350
- run: go version
44-
- run: .kokoro/mandatory-conformance.sh
51+
- run: .kokoro/mandatory-conformance.sh

core/common/.mocharc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414
const config = {
1515
"enable-source-maps": true,
16-
"throw-deprecation": true,
16+
"throw-deprecation": false,
1717
"timeout": 10000,
1818
"recursive": true
1919
}

handwritten/bigtable/.mocharc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414
const config = {
1515
"enable-source-maps": true,
16-
"throw-deprecation": true,
16+
"throw-deprecation": false,
1717
"timeout": 10000,
1818
"recursive": true
1919
}

handwritten/bigtable/owlbot.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
logging.basicConfig(level=logging.DEBUG)
2525

26-
staging = Path("owl-bot-staging")
26+
staging = Path("owl-bot-staging/bigtable")
2727

2828
if staging.is_dir():
2929
versions = ['v2']
@@ -65,14 +65,14 @@
6565
'.kokoro/test.sh',
6666
] + list(admin_files)
6767
logging.info(f"excluding files for non-admin: {excludes}")
68-
s.copy([library], excludes = excludes)
68+
s.copy([library], destination="handwritten/bigtable", excludes = excludes)
6969

7070
# Copy the admin library pieces and knit them in.
7171
# Don't override system-test for admin/v2, just keep the v2 version.
7272
for version in versions:
7373
admin_version = f"admin/{version}"
7474
library = src_paths[admin_version]
75-
inProtoPath = f"protos/google/bigtable/{admin_version}"
75+
inProtoPath = f"handwritten/bigtable/protos/google/bigtable/{admin_version}"
7676
protos = library / inProtoPath
7777
classes = library / 'src' / version
7878
samples = library / 'samples' / 'generated'
@@ -145,14 +145,14 @@
145145
os.system(f"mkdir -p {inProtoPath}")
146146
s.copy([protos / '*'], destination=inProtoPath)
147147
os.system(f"mkdir -p src/{admin_version}")
148-
s.copy([classes / '*'], destination=f"src/{admin_version}")
148+
s.copy([classes / '*'], destination=f"handwritten/bigtable/src/{admin_version}")
149149
os.system(f"mkdir -p samples/generated/{admin_version}")
150-
s.copy([samples / 'v2' / '*admin*'], destination=f"samples/generated/{admin_version}")
150+
s.copy([samples / 'v2' / '*admin*'], destination=f"handwritten/bigtable/samples/generated/{admin_version}")
151151
os.system(f"mkdir -p test/{admin_version}")
152-
s.copy([tests / '*admin*.ts'], destination=f"test/{admin_version}")
152+
s.copy([tests / '*admin*.ts'], destination=f"handwritten/bigtable/test/{admin_version}")
153153

154154
# Replace the client name for generated system-test.
155-
system_test_files=['system-test/fixtures/sample/src/index.ts','system-test/fixtures/sample/src/index.js']
155+
system_test_files=['handwritten/bigtable/system-test/fixtures/sample/src/index.ts','handwritten/bigtable/system-test/fixtures/sample/src/index.js']
156156
for file in system_test_files:
157157
s.replace(file, 'BigtableClient', 'Bigtable')
158158
s.replace(file, 'client.close', '// client.close') # this does not work with the manual layer
@@ -162,16 +162,19 @@
162162
shutil.rmtree(staging)
163163

164164
common_templates = gcp.CommonTemplates()
165-
templates = common_templates.node_library(
165+
templates = common_templates.node_mono_repo_library(
166+
relative_dir="handwritten/bigtable",
166167
source_location='build/src'
167168
)
168-
s.copy(templates,excludes=[
169+
s.copy(templates,destination="handwritten/bigtable", excludes=[
169170
'.github/auto-approve.yml',
170171
'.github/sync-repo-settings.yaml',
171172
'.github/workflows/ci.yaml',
172173
'.kokoro/samples-test.sh', # get to green
173174
'.kokoro/system-test.sh',
174175
'.kokoro/test.sh',
176+
'.mocharc.js',
177+
'README.md'
175178
])
176179

177-
node.postprocess_gapic_library_hermetic()
180+
node.postprocess_gapic_library_hermetic(relative_dir="handwritten/bigtable")

0 commit comments

Comments
 (0)