Skip to content
This repository has been archived by the owner on Jun 28, 2022. It is now read-only.

Commit

Permalink
Nodejs generated unit tests (#2251)
Browse files Browse the repository at this point in the history
Build and test nodejs clients as part of gapic-generator dev workflow.
  • Loading branch information
andreamlin authored Aug 30, 2018
1 parent 782c142 commit 27beee1
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
54 changes: 53 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,16 @@ anchor_run_php: &anchor_run_php
name: Test PHP Logging client
<<: *anchor_test_php

# Test a NodeJS client if generation succeeded.
anchor_test_nodejs_client: &anchor_test_nodejs_client
command: |
cd ${NODEJS_GEN_DIR}/${TEST_API}
npm install
# Copy over IAM protos.
cp -r node_modules/google-proto-files/google/iam/ protos/google/
npm test
when: always

# ======================= JOBS =======================

jobs:
Expand Down Expand Up @@ -419,7 +429,46 @@ jobs:
<<: *anchor_auth_vars
docker:
- image: circleci/php:7.2.0-cli-stretch

verify-and-test-nodejs-8:
working_directory: /tmp/
environment:
LANGUAGE: nodejs
NODEJS_GEN_DIR: /tmp/workspace/gapic-generator/artman-genfiles/js
<<: *anchor_artman_vars
docker:
- image: circleci/node:8-stretch-browsers
steps:
- attach_workspace:
at: workspace
- run:
name: Verify all NodeJS generation succeeded
<<: *anchor_check_generation
- run:
name: Prepare to test Pubsub
command: |
echo 'export TEST_API="pubsub-v1"' >> $BASH_ENV
when: always
- run:
name: Test Node Pubsub client
<<: *anchor_test_nodejs_client
- run:
name: Prepare to test Speech
command: |
echo 'export TEST_API="speech-v1"' >> $BASH_ENV
when: always
- run:
name: Test Node Speech client
<<: *anchor_test_nodejs_client
- run:
name: Prepare to test Logging
command: |
echo 'export TEST_API="logging-v2"' >> $BASH_ENV
when: always
- run:
name: Test Node Logging client
<<: *anchor_test_nodejs_client
# Logging client needs common proto refresh before build will work:
# https://github.com/googleapis/gapic-generator/issues/2238
# TODO: test other language clients.

# ======================= WORKFLOWS =======================
Expand Down Expand Up @@ -458,6 +507,9 @@ workflows:
- generate-clients
# TODO: php smoke tests
# TODO: Other php versions
- verify-and-test-nodejs-8:
requires:
- generate-clients

machine:
services:
Expand Down
1 change: 1 addition & 0 deletions generate_clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"python",
"ruby",
"php",
"nodejs"
# TODO: add other languages here.
]

Expand Down

0 comments on commit 27beee1

Please sign in to comment.