News for hackers. Stuff that matters.

kahrensdd

Thank you for sharing this project. I've been a big fan of WireMock for a long time, going to try this out shortly.
I love the idea of instrumenting my clusters with less work. Signed up for the BETA and starting to get data out of one of my GKE clusters right away. Also I like how the cli just interacted with the cluster itself instead of tons of piping the output to other commands. Good luck Pixie team!
It looks like the issue was opened against the tooling project of nodejs, so perhaps the author is trying to start with JavaScript. It is incredible how many of these files you get in a basic Node or React app however.
Yes, I really like goreplay and it was an early inspiration for our sidecar. It uses gopacket (like tcpdump) to collect data, we currently use the TCP proxy route because we can use TLS libraries for HTTP/S support. There are similarities in that both can collect and replay data.

One of the early observations from my co-founder Nate was there are 3 key ingredients to testing in a SOA environment [1]

* Automation

* Dependencies

* Data

While goreplay has a form of automation, it doesn't help you with dependencies (no mocking), and the data is either streamed or locked in a special file format. Of course like any open source project there's pieces of the solution but you have to assemble them. For instance there is no UI, no reports, no pass/fail assertions, no integration with CI system, etc. I'm by no means an expert, there is likely a path to combine with other open source projects to fulfill those.

Our stuff isn't perfect, but we primarily see overlap with the automation capability of Speedscale and the goreplay project.

[1] https://speedscale.com/2020/02/06/triplethreat/

(edited formatting)

Reverse engineering protocols has morphed from a hobby to a full time job. I've spent a lot of time going through logs, looking at data and knowing that I am not looking at the TCP level request and response. So we are trying to solve that problem. :)

Please send a note to [email protected] so we can get the details of your environment and determine if it is a fit for our alpha.

Thank you Billy, we are very excited to be making progress with Speedscale. I miss seeing you and the rest of the crew from the ATL Web Performance meetup.
One of our early inspirations was a video game company that would replay recorded gameplay against new builds of a game server. And our proxy assembles each request and response in the order they were received, even if they go with different user sessions. For the alpha we are focused on API type calls over HTTP/S, but websocket implementation is definitely something we are tracking.
Yes I recently went through a similar use case with one of my alpha users. They wanted to run the reverse proxy and playback as docker containers spread through their environment. Will drop you an email with more info...
For one thing we look at both inbound and outbound traffic and we treat it separately. That use case looks different if we are trying to "test" TODO or if the TODO service is a backend that our app relies upon.

So if you mean that we want to "test" TODO, our analyzer looks for data in subsequent requests that was provided by the system-under-test (SUT) in previous responses. A common example of this is an HTTP cookie. The SUT gives us a session id through the Set-Cookie header response. So in a subsequent request we use the cookie from the app, not the one that was recorded. This has been done in general way to look for tokens.

Of course nobody is perfect so we'd love to see your real world app and test our algorithms against it. :)

You can run it in your own environment. If you're running Kubernetes we provide an operator that orchestrates the test runs. If you are using docker we give you containers that you control with ENV VARs.

Do you have more background on the multi geo use case?

For a little background story on the satellite antenna. I was building a monitoring device driver for an Antenna Control Unit (ACU). It's like a 4 rack-unit computer with special hardware for talking to the antenna motors (azimuth, elevation and polarization). After sending it a command, the device froze up, so we rebooted it. The CMOS battery was dead so when it came back up the date was wrong, but I did not notice. I sent it a command to reposition and it began moving to point below the horizon... The bad date meant that it had the wrong geo location position for itself. Well it turns out "below horizon" is really important because the building was just a structure to hold up the antenna and it was going to crash into the ground. Fortunately someone ran in and hit the STOP button while I was staring at the monitor. That day I learned that monitoring and alerting is important stuff.
Awesome thank you for the note. Fortunately there was a "stop antenna" button which saved the day lol.

We've been down the path of stateful services before and actually reflect the proper state in our responder. Because we control the test that is being played against the system-under-test, we understand the sequence and order of calls that will be made to the downstream system as well.

In addition, the analysis actually captures all outbound services at once. We are able to identify each separate hostname that is invoked and mock them all out as a group. One of our first alphas was stunned that it auto mocked 7 backend systems on the first try.

For sure we see a lot of synergy with the CI systems. One of our alpha customers is using CircleCI (no surprise there). They have an issue where devs deploy services on top of each other in staging and accidentally take it down for their internal users. So Speedscale lets them detect their new build is not a good candidate to deploy to staging.

Thanks for sharing the info about your project, I am checking it out on GitHub right now. :)

Re:Ask HN: Best Way to Mock APIs in 2020? on Sunday June 14, 2020 @08:57AM (#23517346)
There are lots of variations depending upon your use case.

For unit testing and CI you may want mock objects that are implemented in the same language as your code. Google search for "mock object <language>". That's where you'll find Mockito (Java) or Mocha Spy (NodeJS) or Testify (golang). This list never ends.

Specifically for unit testing of a UI, you may want your browser driver to handle this, ex: Cypress has built-in support for mock AJAX endpoints. https://docs.cypress.io/guides/guides/stubs-spies-and-clocks...

If you want an endpoint you can call, Postman has a feature for this, there are several others like this in the comments (JSON Server, mmock, mountebank, etc.). https://learning.postman.com/docs/postman/mock-servers/setti...

If you need to capture traffic, check out goreplay or mitmproxy: https://github.com/buger/goreplay https://docs.mitmproxy.org/stable/

There is a whole class of "VCR" projects for recording traffic, these tend to be language specific (VCR is in Ruby), but there are ports to other languages: https://github.com/vcr/vcr https://github.com/bblimke/webmock

The vendor products tend to be labelled Service Virtualization. I used to work for one of those companies, ITKO, we were acquired by CA Technologies (now Broadcom) in 2011. There are vendor products from Micro Focus, Tricentis, Broadcom, Parasoft, etc.

It's important to think about your use case: local development, unit testing, CI, integration testing, performance testing, recording vs. programming, protocol support, payload support, etc. Many of the tools focus on just a subset of these areas.