Esempio n. 1
0
 def test_compile_protos(self, shell_run_mock):
     node.compile_protos()
     calls = shell_run_mock.call_args_list
     assert any([
         "npx compileProtos src" in " ".join(call[0][0]) for call in calls
     ])
Esempio n. 2
0
common_templates = gcp.CommonTemplates()
templates = common_templates.node_library(source_location="build/src",
                                          test_project="node-gcloud-ci")

s.copy(templates)

# use the existing proto .js / .d.ts files
s.replace("dev/src/v1/firestore_client.ts", "/protos/protos'",
          "/protos/firestore_v1_proto_api'")
s.replace("dev/test/gapic-firestore-v1.ts", "/protos/protos'",
          "/protos/firestore_v1_proto_api'")
s.replace("dev/src/v1/firestore_admin_client.ts", "/protos/protos'",
          "/protos/firestore_admin_v1_proto_api'")
s.replace("dev/test/gapic-firestore_admin-v1.ts", "/protos/protos'",
          "/protos/firestore_admin_v1_proto_api'")
s.replace("dev/src/v1beta1/firestore_client.ts", "/protos/protos'",
          "/protos/firestore_v1beta1_proto_api'")
s.replace("dev/test/gapic-firestore-v1beta1.ts", "/protos/protos'",
          "/protos/firestore_v1beta1_proto_api'")

# Remove auto-generated packaging tests
os.system('rm -rf dev/system-test/fixtures dev/system-test/install.ts')

node.install()
node.fix()
os.chdir("dev")
node.compile_protos()
os.unlink('protos/protos.js')
os.unlink('protos/protos.d.ts')
os.unlink('.jsdoc.js')