grpcWebText doesn't work with all backends
Closed this issue · 10 comments
Some of the backends/proxies seem to fail to different degrees with grpc-web-text. Investigate why and open issues upstream for them if it's not our fault.
It seems to have worked in master using grpcwebproxy
: https://circleci.com/gh/johanbrandhorst/grpc-web-compatibility-test/12. I guess we should enable that again?
@public I want to raise an issue with grpc/grpc-web, but frankly, I don't know how to run the tests in a browser to get the console output. Could you give me some pointers? I'd like to develop a minimal reproducible example, ideally with the envoy proxy and the grpcwebtext client.
Here's how you run the browser tests locally for grpcWebText
- Run a text compatible server e.g.
docker-compose up -d grpcwebproxy
. This will give you a server listening on port 8080 locally. - Install node and npm locally.
- Install the test suite locally using
npm install .
from inside the frontend folder. - Run the tests locally with
npx grunt karma:grpcWebText --browsers=Chrome --grpc-host=http://localhost:8080
This will launch a Chrome window and start running the tests in it. Look in the terminal you launched the tests from to see if the tests passed. If you want to debug the tests, you can open the debug tab in the karma page in Chrome and then use your browser devtools to poke around.
If you want to run other browsers it's pretty easy, first install the karma launcher for the browser you want e.g. Firefox is karma-launcher-firefox
and then change the argument to --browsers
to Firefox
.
@public thanks for that, I started writing up a README addition but when testing it I couldn't get alternative browsers to run with --browsers=Chrome
or --browsers=Firefox
. It still runs ChromeHeadless
. I went googling a bit and found karma-runner/grunt-karma#206 which is DenverCoder9 levels of frustration. Any ideas?
Ah right. Just modify the browsers array in karma.conf.js then. I think I have a diff somewhere that makes --browsers work in Grunt too, I'll throw it in a PR soon.
Won't have time to do that today but it's possible to explicitly pass options from grunt through to karma. There's already an example of it in the Gruntfile
Couldn't get it working so I'll just settle for "edit the config, stupid". Thanks!
@public as suggested in grpc/grpc-web#568, lets just move the test to status
to fix this. Do you want to make the change or should I?
I'll make a PR today :)