You don't need a staging environment to integration-test microservices
If your final integrated product consists of multiple components maintained by different teams, in the form of services, packages or platform, it's a pain to run end-to-end and integration tests. Some problems are
- Every team depends on a shared staging environment where people are pushing latest changes, typically these environments are stateful, and not isolated.
- Container based solutions like a
docker-compose.ymlworks only for 1 of these teams and has duplication across the organization, it's also bloated and often requires the images to be built by CI which comes with some delay. The same problems exist with tilt.dev, garden.io
In my workplace, there's a hardware product that runs microservices in a Kubernetes cluster on the edge. Most of the services are in a mono-repo, while some live outside. A staging environment is a highly contentious resource, and a local docker-compose.yml gets out of date very quickly.
The Nix based solution we adopted involved creating a flake.nix for every microservice that lived closer to its source code. And an integration-tests flake that treated these microservices as inputs. So with a single command, at build time the integration-tests flake fetches correct versions of each dependency microservice, spawn some essential sidecars with process-compose and presented a developer with an environment looking much like the staging environment. It runs the same way locally as in the CI, backed up by a binary cache. The hot setup ran such tests in 4-5 seconds when a docker backed command would take 35, and since the flakes lived closer to the source code, they wouldn't run out-of-sync easily.
Shivashis is a Software Engineer currently working on the automation software stack and some developer experience things at Orbem GmbH.
I'm interested in systems/software engineering, self-hosting software, DIY electronics and maps.
I'd love to talk to you about Nix, Python, Go and learn more about software distribution at NixCon'26.