question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Get JSON report via websocket API

See original GitHub issue

Currently I can only know the status of a test result be connecting to /getCaseStatus?casetuple=$case, but I have no more information about what’s wrong.

Is there any way to fetch the actual JSON report via the web socket client as well? (or even HTTP?)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
joffrey-bioncommented, Oct 11, 2021

the testsuite has a builtin webserver: just add the webport option

Awesome, I didn’t know that, thanks!

the report files are generated, stored and served from within the docker container, so that should be good (independent of your test env)?

Yes definitely, if the container can serve those files via HTTP, this is just perfect. I was talking about the absence of such HTTP API, in which case I would have to read the files manually.

this is one of the HTTP endpoint that are indeed used to control the fuzzing server - but that is HTTP not WebSocket

Oh. It did look like a websocket API though here: https://github.com/crossbario/autobahn-testsuite/blob/master/autobahntestsuite/autobahntestsuite/fuzzing.py#L309

the problem with putting the control onto the same WebSocket connection that is being fuzzed is obvious. So the only sane way would be to run a 2nd WebSocket connection only for the control. Possible, sure. But that is not implemented right now …

Totally agreed, and I actually used additional websocket connections for those endpoints (which seemed to work fine on most client implementations I’m testing right now). So now I’m confused as to this HTTP vs websocket controls, it really did look like it worked as a websocket connection 😆 In any case, I will try with the HTTP server, thanks!

0reactions
oberstetcommented, Oct 12, 2021

I also tested the endpoints mentioned above (/getCaseStatus, /updateReports etc.),

yes, those the URLs used when opening the websocket connection, and since every websocket connection starts as HTTP, this is where the confusion comes from. those URLs cannot be used to continue with HTTP/GET after the initial HTTP open.

By contrast, with the HTTP server giving me the JSON files, I need to run updateReports after each test to then be able to fetch the JSON file for the test and read detailed results.

yes, unfort. that’s how it works (results are just collected in a server class and only updateReports will process that, and process all collected results).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Read JSON array from websocket data feed - Stack Overflow
first time json without tbox.data comes, tbox.data is undefined, so you have the error "Cannot read property '0' of undefined".
Read more >
Writing WebSocket client applications - Web APIs | MDN
Let's consider the chat client application first alluded to in Using JSON to transmit objects. There are assorted types of data packets the ......
Read more >
Get Started Using HTTP / WebSocket APIs - XRPL.org
JSON -RPC uses individual HTTP requests and responses for each call, similar to a RESTful API. You can use any common HTTP client...
Read more >
WebSocket & JSON - ESP32 Remote Control with WebSocket
This tutorial details the use of WebSocket to remotely interact with an ESP32 that exposes a web application through an HTTP server.
Read more >
How to implement WebSocket API JavaScript application with ...
This article shows how developers may use the JavaScrip Web Workers to implement the WebSocket API web application. It allows the Web Workers...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found