Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion scripts/package_dependencies.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"tfjs-core": [],
"tfjs-converter": ["tfjs-core"],
"tfjs-layers": ["tfjs-core"],
"tfjs-data": ["tfjs-core", "tfjs-layers"]
"tfjs-data": ["tfjs-core", "tfjs-layers"],
"tfjs-backend-wasm": ["tfjs-core"]
}
50 changes: 5 additions & 45 deletions tfjs-backend-wasm/cloudbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,79 +5,39 @@ steps:
entrypoint: 'yarn'
args: ['install']

# Install wasm dependencies.
- name: 'node:10'
dir: 'tfjs-backend-wasm'
id: 'yarn'
entrypoint: 'yarn'
args: ['install']
waitFor: ['yarn-common']

# Build core from master.
- name: 'node:10'
dir: 'tfjs-backend-wasm'
id: 'build-core'
entrypoint: 'yarn'
args: ['build-core']
waitFor: ['yarn-common']

# Run lint.
- name: 'node:10'
dir: 'tfjs-backend-wasm'
entrypoint: 'yarn'
id: 'lint'
args: ['lint']
waitFor: ['build-core']

# Build the project.
- name: 'node:10'
dir: 'tfjs-backend-wasm'
entrypoint: 'yarn'
id: 'build'
args: ['build-ci']
waitFor: ['build-core']

# Run tests in browser.
- name: 'node:10'
dir: 'tfjs-backend-wasm'
entrypoint: 'yarn'
id: 'test-wasm'
args: ['test-browser-ci']
waitFor: ['build']
args: ['test-ci']
waitFor: ['yarn-common']
env: ['BROWSERSTACK_USERNAME=deeplearnjs1']
secretEnv: ['BROWSERSTACK_KEY']

# Run tests in node.
- name: 'node:10'
dir: 'tfjs-backend-wasm'
entrypoint: 'yarn'
id: 'test-node'
args: ['test-node']
waitFor: ['build']

# Run C++ tests.
- name: 'node:10'
dir: 'tfjs-backend-wasm'
entrypoint: 'yarn'
id: 'test-cc'
args: ['test-cc']
waitFor: ['build']
waitFor: ['test-wasm']

# Check bundle size.
- name: 'node:10'
dir: 'tfjs-backend-wasm'
id: 'test-bundle-size'
entrypoint: 'yarn'
args: ['test-bundle-size']
waitFor: ['build']
waitFor: ['test-wasm']

# Lint bazel files.
- name: 'node:10'
dir: 'tfjs-backend-wasm'
id: 'buildifier'
entrypoint: 'yarn'
args: ['buildifier-ci']
waitFor: ['yarn']
waitFor: ['test-wasm']

# General configuration
secrets:
Expand Down
9 changes: 5 additions & 4 deletions tfjs-backend-wasm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,17 @@
"bazel:format-check": "yarn bazel:format --mode=check",
"bazel:lint": "yarn bazel:format --lint=warn",
"bazel:lint-check": "yarn bazel:format --lint=warn --mode=check",
"build-core": "cd ../tfjs-core && yarn && yarn build",
"build": "yarn link-core-master && yarn build-core && rimraf dist/ && tsc && ./scripts/build-wasm.sh",
"build-deps": "cd ../tfjs-core && yarn && yarn build",
"build-deps-ci": "cd ../tfjs-core && yarn && yarn build-ci",
"build": "rimraf dist/ && tsc && ./scripts/build-wasm.sh",
"build-ci": "./scripts/build-ci.sh",
"build-npm": "./scripts/build-npm.sh",
"buildifier-ci": "./scripts/buildifier-ci.sh",
"clean": "rimraf dist/ && bazel clean --expunge",
"cpplint": "./scripts/cpplint.js",
"lint": "tslint -p . -t verbose && yarn cpplint",
"link-core-master": "./scripts/link-core-master.js && yarn",
"test": "yarn link-core-master && yarn build-core && ./scripts/build-wasm.sh && karma start",
"test": "yarn && yarn build-deps && yarn build && karma start",
"test-ci": "./scripts/test-ci.sh",
"test-node": "ts-node src/test_node.ts",
"test-bundle-size": "./scripts/test-bundle-size.js",
"test-cc": "bazel test //src/cc:cc_tests --test_output=all",
Expand Down
27 changes: 0 additions & 27 deletions tfjs-backend-wasm/scripts/link-core-master.js

This file was deleted.

18 changes: 18 additions & 0 deletions tfjs-backend-wasm/scripts/test-ci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

# Copyright 2020 Google LLC
#
# Use of this source code is governed by an MIT-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/MIT.
# =============================================================================

set -e

# Regular testing.
yarn
yarn build-deps-ci
yarn build-ci
yarn lint
yarn test-node
yarn test-browser-ci
10 changes: 6 additions & 4 deletions tfjs-core/scripts/test-integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,31 +28,33 @@ yarn build && yarn build-test-snippets

echo 'Testing layers'
cd ../tfjs-layers
yarn
yarn test-ci
LAYERS_EXIT_CODE=$?

echo 'Testing node'
cd ../tfjs-node
yarn
yarn test-ci
NODE_EXIT_CODE=$?

echo 'Testing wasm'
cd ../tfjs-backend-wasm
yarn test-ci
WASM_EXIT_CODE=$?

echo 'Testing converter'
cd ../tfjs-converter
yarn
yarn test-ci
CONVERTER_EXIT_CODE=$?

echo 'Testing data'
cd ../tfjs-data
yarn
yarn test-ci
DATA_EXIT_CODE=$?

echo '==== INTEGRATION TEST RESULTS ===='
print_status "tfjs-layers" "$LAYERS_EXIT_CODE"
print_status "tfjs-node" "$NODE_EXIT_CODE"
print_status "tfjs-backend-wasm" "$WASM_EXIT_CODE"
print_status "tfjs-converter" "$CONVERTER_EXIT_CODE"
print_status "tfjs-data" "$DATA_EXIT_CODE"
echo '=================================='
Expand Down