Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gRPC web client base test does not work expectedly #661

Closed
dtaniwaki opened this issue Oct 20, 2019 · 0 comments · Fixed by #804
Closed

gRPC web client base test does not work expectedly #661

dtaniwaki opened this issue Oct 20, 2019 · 0 comments · Fixed by #804

Comments

@dtaniwaki
Copy link

I was trying to add gRPC metadata to the response and made some modifications, however, I realized the unit tests don't work expectedly.

I tried the following patch to reproduce this issue.

diff --git a/javascript/net/grpc/web/grpcwebclientbase_test.js b/javascript/net/grpc/web/grpcwebclientbase_test.js
index 62457f5..dc7744a 100644
--- a/javascript/net/grpc/web/grpcwebclientbase_test.js
+++ b/javascript/net/grpc/web/grpcwebclientbase_test.js
@@ -75,6 +75,7 @@ testSuite({
     }, function(error, response) {
       assertNull(error);
       assertEquals(PROTO_FIELD_VALUE, response.field1);
+      assertNull("not null");
     });
     dataCallback();
   },
@@ -101,6 +102,7 @@ testSuite({
     }, function(error, response) {
       assertNull(response);
       assertEquals(3, error.code);
+      assertNull("not null");
     });
     dataCallback();
   }

I got the following log. It looks all the tests passed although it should not.

INFO: Writing tracer profile to '/private/var/tmp/_bazel_dtaniwaki/b115065b9ad59cf1e9848a79508ec574/command.profile.gz'
WARNING: Download from https://mirror.bazel.build/github.com/google/closure-library/archive/v20190415.tar.gz failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException GET returned 404 Not Found
WARNING: Download from https://mirror.bazel.build/repo1.maven.org/maven2/com/google/javascript/closure-compiler-unshaded/v20190528/closure-compiler-unshaded-v20190528.jar failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException GET returned 404 Not Found
INFO: Analyzed target //javascript/net/grpc/web:grpcwebclientbase_test (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //javascript/net/grpc/web:grpcwebclientbase_test up-to-date:
  bazel-bin/javascript/net/grpc/web/grpcwebclientbase_test
INFO: Elapsed time: 3.427s, Critical Path: 3.28s
INFO: 2 processes: 2 worker.
INFO: Build completed successfully, 3 total actions
INFO: Running command line: external/bazel_tools/tools/test/test-setup.sh javascript/netINFO: Build completed successfully, 3 total actions
exec ${PAGER:-/usr/bin/less} "$0" || exit 1
Executing tests from //javascript/net/grpc/web:grpcwebclientbase_test
-----------------------------------------------------------------------------
Listening http://localhost:54245/index.html
Serving /index.html
Serving /filez/io_bazel_rules_closure/closure/testing/phantomjs_jsunit_runner.js
Serving /filez/com_github_grpc_grpc_web/javascript/net/grpc/web/grpcwebclientbase_test_bin.js
-> 14:29:47.672 : Starting tests: Untitled Test Case
-> 14:29:47.673 : Running test: testRpcError
-> 14:29:47.677 : testRpcError : PASSED
-> 14:29:47.677 : Running test: testRpcResponse
-> 14:29:47.678 : testRpcResponse : PASSED
-> 14:29:47.678 : 2 of 2 tests run in 6.008315000000014ms.
-> 2 passed, 0 failed.
3 ms/test. 2 files loaded.
-> 14:29:47.678 : Tests complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant