TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: Open-source cypress for back end testing

22 点作者 nirga大约 2 年前
For the past few months we’ve been building a simple jest&#x2F;typescript-based high-level language for writing and running integration tests. We&#x27;re open-sourcing it now and are excited to share it with you: <a href="https:&#x2F;&#x2F;github.com&#x2F;traceloop&#x2F;jest-opentelemetry">https:&#x2F;&#x2F;github.com&#x2F;traceloop&#x2F;jest-opentelemetry</a><p>Why we built this:<p>- There are many solid frameworks for FE &#x2F; browser testing, but none with high-level constructs for testing BE flows<p>- We were missing a way to validate side effects for complex backend systems, especially across async queueing systems<p>Our beta version lets you send an API call to a system and then:<p>- Validate (=assert) calls to any downstream microservice in REST and GRPC<p>- Validate queries&#x2F;writes to DBs<p>Assertions are validated through the use of OpenTelemetry, as we see it as an easy-to-use way to observe how backend systems behave.<p>We’re still early so would love your feedback and opinions.<p>It&#x27;s all open-source with Apache 2.0 license.<p>GitHub: <a href="https:&#x2F;&#x2F;github.com&#x2F;traceloop&#x2F;jest-opentelemetry">https:&#x2F;&#x2F;github.com&#x2F;traceloop&#x2F;jest-opentelemetry</a>

3 条评论

chatmasta大约 2 年前
This is very interesting. I&#x27;ve wanted something like this for a while. When debugging SSR in Next.js, I have a script to spin up mitmproxy and configure Next.js to send requests through it. I also have a script that can dump the logs of all containers while sending some request, but it&#x27;s such a hack I hardly ever use it. I&#x27;ve toyed with the idea of scaling this up to include more services in the stack with some tcpdump or eBPF magic, but it gets complicated really fast.<p>At work we have about two dozen images which spawn about 60+ containers (including replicas) in prod, and 30 in dev. The services run the gamut in terms of role and language, including everything from stock haproxy images to esoteric Python or JS images. In development we use docker-compose and in prod we use Nomad.<p>I&#x27;m not familiar with OpenTelemetry. Does this require adding some instrumentation to every downstream service, or do you&#x2F;OpenTelemetry sidestep that somehow (eg with eBPF on the shared network interfaces)?<p>How easy would it be to add this into our e2e tests within our JS stack? For example, say we want to make assertions that Next.js SSR results in an HTTP request through haproxy (standard), then web-openresty (customized), then auth-service (Python). Can we write the tests in JS, only worrying about the Next.js service, without touching the other services, or do we need to add instrumentation to them as well? Ideally, we could add the instrumentation once in the development stack for docker-compose, and once in &quot;prod&quot; (temporary staging environments where we run e2e tests) for Nomad. (And ideally &quot;adding it once&quot; wouldn&#x27;t mean adding two dozen sidecar services, but rather once per network interface, eg task groups in Nomad and Docker networks in docker-compose.)<p>Also, I see you have a bunch of &quot;coming soon&quot; services - is this just about writing the assertion adapters for their protocols, or do they require some low level adaptation to even work at all?
评论 #35240668 未加载
varunjain99大约 2 年前
Interesting using observability frameworks for testing - sort of a &#x27;shift-left observability&#x27;<p>Are you able to use the same prod monitoring setup as integration test time? Or does it require any differences in setup?
评论 #35241126 未加载
jameshart大约 2 年前
Not sure I see the cypress connection?
评论 #35240661 未加载