Live data from Hacker News

Show HN: Tusk Drift – Open-source tool for automating API tests

github.com

11–18 of 18 posts

Re: Show HN: Tusk Drift – Open-source tool for automating API tests

#13
post #12

How do you handle expiring data, like JWTs?

We instrument JWT libraries directly (jsonwebtoken, jwks-rsa). Both `jwt.sign()` and `jwt.verify()` are captured during recording and replayed with the original results. During replay, you get back the recorded verification result. So if the token was valid during recording, it stays valid during replay, even if it would be expired "now". The test runs in the temporal context of when it was recorded.

Re: Show HN: Tusk Drift – Open-source tool for automating API tests

#14

Cool work, thanks. A bit like https://github.com/kevin1024/vcrpy in python, if you weren't aware OP.

I enjoy vcrpy and use it a lot, but it doesn't seem to be that similar.

Vcrpy is closer to an automock, where you create tests that hit external services, so vcrpy records them and replays for subsequent tests. You write the tests.

Here you don't write tests at all, just use the app. The tests are automatically created.

Similar ideas, but at a different layer.

Re: Show HN: Tusk Drift – Open-source tool for automating API tests

#15
Congratulations on the launch! Is it possible to replay the tests against another URL? My use case is that I have a nodejs backend that I want to rewrite in python. I wonder if I could use your tool to record the API requests to the current server and use them to replay against my rewritten server to check if the responses are the same.

Another useful thing would be if I could create the tests from saved requests exported from my browser's network tab. In this case your tool would work regardless of the backend language.

Re: Show HN: Tusk Drift – Open-source tool for automating API tests

#16

Congratulations on the launch! Is it possible to replay the tests against another URL? My use case is that I have a nodejs backend that I want to rewrite in python. I wonder if I could use your tool to record the API requests to the current server and use them to replay against my rewritten server to check if the responses are the same. Another useful thing would be if I could create the tests from saved requests exp…

Thanks! Good question. Tusk Drift isn't quite designed for these use cases.

Currently, Drift is language specific. You'd need the SDK installed in your backend while recording tests. This is because Drift captures not just the HTTP request/response pairs, but also all underlying dependency calls (DB queries, Redis operations, etc.) to properly mock them during replay.

A use case we do support is refactors within the same language. You'd record traces in your current implementation, refactor your code, then replay those traces to catch regressions.

For cross-language rewrites or browser-exported requests, you might want to look at tools that focus purely on HTTP-level recording/replay like Postman Collections. Hope this helps!

Post reply on HN