I spend a lot of time testing and debugging APIs, and so do my AI agents. Lately I notice that my agents lose time and tokens on it. They look for the right port, guess at endpoints, fight with a terminal, and try to get the database back into a known state. Every run starts with the same detective work. So for this series of posts I picked one scenario and I’m sticking with it: the API-testing loop . The goal is to adapt Aspire so that I (and my agents) can debug and test easily and efficiently. Note: this post is part of a series about the demos from my session “Bending Aspire to your will” . The app is the aspire-shop sample: a frontend, a catalog service, a basket service, a catalog DB manager, PostgreSQL and Redis. The loop I run by hand looks like this: Get the OpenAPI spec Fire a test call at an endpoint Reset the state for a repeatable run Browse and try the API in one place Out of the box, that means four tools and a handful of terminals. The goal i...
After my Aspire talk I got multiple questions. Two of them deserve some further explanation. How does Testcontainers relate to Aspire? And do Dev Containers solve the same problem? Both involve containers, so the confusion is understandable. They solve different problems, though. How does Testcontainers relate to Aspire? Both tools start containers for your dependencies (a database, a message broker, a cache). The difference is when and for whom . Testcontainers is a library you call from your test code. It starts a container, waits until it’s ready, and throws it away when the test finishes. Aspire is an application model. In the AppHost you describe your services and their dependencies, and Aspire orchestrates them for your local dev loop, including service discovery, connection strings, telemetry and the dashboard. With Testcontainers , the test owns the infrastructure: var postgres = new PostgreSqlBuilder() .WithImage("postgres:16") .Build(); a...