Skip to content

Commit

Permalink
Revamp Closure JsUnit tests runtime and optimize test/build flows. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
sampajano authored Sep 21, 2021
1 parent d9a6c7a commit 32fe124
Show file tree
Hide file tree
Showing 32 changed files with 688 additions and 608 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/node_modules
packages/grpc-web/generated
14 changes: 5 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
version: '3'
services:
common:
build:
context: ./
dockerfile: ./net/grpc/gateway/docker/common/Dockerfile
image: grpcweb/common
prereqs:
build:
context: ./
dockerfile: ./net/grpc/gateway/docker/prereqs/Dockerfile
depends_on:
- common
image: grpcweb/prereqs
echo-server:
build:
Expand All @@ -34,8 +27,6 @@ services:
build:
context: ./
dockerfile: ./net/grpc/gateway/docker/node_interop_server/Dockerfile
depends_on:
- common
image: grpcweb/node-interop-server
ports:
- "7074:7074"
Expand Down Expand Up @@ -114,3 +105,8 @@ services:
depends_on:
- prereqs
image: grpcweb/protoc-plugin
jsunit-test:
build:
context: ./
dockerfile: ./packages/grpc-web/docker/jsunit-test/Dockerfile
image: grpcweb/jsunit-test
48 changes: 1 addition & 47 deletions javascript/net/grpc/web/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_library", "closure_js_test")
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_library")
load("@rules_cc//cc:defs.bzl", "cc_binary")

cc_binary(
Expand Down Expand Up @@ -239,49 +239,3 @@ closure_js_library(
],
visibility = ["//visibility:public"],
)

closure_js_test(
name = "grpcwebclientbase_test",
srcs = [
"grpcwebclientbase_test.js",
],
entry_points = [
"goog:grpc.web.GrpcWebClientBaseTest",
],
suppress = [
"visibility",
"checkTypes",
"deprecated",
"reportUnknownTypes",
"strictCheckTypes",
],
deps = [
":clientreadablestream",
":grpcwebclientbase",
":interceptor",
"@io_bazel_rules_closure//closure/library/crypt:base64",
"@io_bazel_rules_closure//closure/library/events",
"@io_bazel_rules_closure//closure/library/net:eventtype",
"@io_bazel_rules_closure//closure/library/structs:map",
"@io_bazel_rules_closure//closure/library/testing:jsunit",
"@io_bazel_rules_closure//closure/library/testing:testsuite",
],
)

closure_js_test(
name = "grpcwebstreamparser_test",
srcs = [
"grpcwebstreamparser_test.js",
],
entry_points = [
"goog:grpc.web.GrpcWebStreamParserTest",
],
suppress = [
"reportUnknownTypes",
],
deps = [
":grpcwebstreamparser",
"@io_bazel_rules_closure//closure/library/testing:jsunit",
"@io_bazel_rules_closure//closure/library/testing:testsuite",
],
)
7 changes: 7 additions & 0 deletions javascript/net/grpc/web/grpcwebclientbase_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,13 @@ class MockXhr {
}
}

/**
* @param {number} ms
*/
setTimeoutInterval(ms) {
return;
}

/**
* @param {boolean} withCredentials
*/
Expand Down
Loading

0 comments on commit 32fe124

Please sign in to comment.