Aleksei Sviridkin 8d5ab4cfee fix(hack): arm cozytest cluster captures for e2e suites only
The runner's on-failure EXIT trap gates each cluster capture on a binary
being installed rather than on there being a cluster to read. A unit
runner has kubectl and no cluster, so a red unit test walked into those
legs on its way out.

What that cost depends on how kubectl fails. Against an endpoint that
refuses immediately it is a second; against one that hangs, measured
with a stub that never returns, it is ~28s for the previous-logs leg,
which self-bounds its pod list and so never reaches the 300s ceiling
above it, plus the full 600s for the data-plane leg, whose first pod
list carries no bound of its own. Ten minutes of dead waiting for a
failure that should cost seconds. Where crust-gather is installed too
the bill stops being empty and starts being wrong: that leg needs no
reachable cluster to be pointless, only an ambient KUBECONFIG, and it
will spend up to 360s snapshotting whatever cluster the current context
names.

Gate the three legs on the e2e- prefix instead, read from the suite's
own name or from the directory holding it. At the top level that prefix
is what the project already sorts on: the Makefile builds
BATS_UNIT_FILES as $(filter-out hack/e2e-%.bats,$(wildcard hack/*.bats)),
so a top-level e2e-* suite is exactly the one `make unit-tests` refuses
to run and packages/core/testing/Makefile runs against a live cluster.
That wildcard is not recursive, and hack/e2e-apps/ holds live-cluster
suites whose own filenames carry no prefix, so the directory is checked
too: matching the basename alone would take the captures away from
suites that need them, which is the opposite of this change. The e2e
path is otherwise unchanged, every leg, bound and message as it was.

Not a reachability probe, though that would also tell a cluster from a
bare binary. A failing e2e run is frequently one whose apiserver is
degraded, and a probe answering "no" there would skip the snapshot in
precisely the case the snapshot exists for.

The test drives the runner as a subprocess over generated fixtures that
differ only in where they sit, with stub kubectl and crust-gather on
PATH. Stubbing both matters: the runner calls crust-gather directly
rather than through a script that needs kubectl output first, so a
kubectl-only stub would leave that leg reaching for the real binary
against the ambient KUBECONFIG. Each leg is pinned by the artefact it
leaves in the report tree, not only by the one leg that echoes, so no
single leg can be ungated without a test going red; each was checked by
ungating it alone. All three directions are asserted, and the two armed
cases are the positive control for the disarmed one, whose assertion is
negative and would otherwise pass just as well if the harness ran
nothing; that case also pins that the fixture did fail.

Two shell traps are handled rather than left to be rediscovered. The awk
transform rewrites any line beginning `@test "` and any line that is
exactly `}`, and knows nothing of heredocs, so a fixture written as a
heredoc has its own `@test` line harvested into the outer suite as a
phantom test that fails first and ends the run before the real tests;
the fixtures are built with printf instead. And `set -e` ignores a
command whose status is inverted with `!`, so the negative assertion is
spelled as an `if`. Both were checked by building the broken variant,
not reasoned about.

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-08-08 03:43:29 +03:00
2025-10-08 09:43:34 +05:00
2025-04-01 18:48:14 +02:00
2024-02-08 12:04:32 +01:00

Cozystack Cozystack

Open Source Apache-2.0 License Support Active GitHub Release GitHub Commit OpenSSF Best Practices OpenSSF Scorecard

Cozystack

Cozystack is a free platform and framework for building clouds.

Cozystack is a CNCF Sandbox Level Project that was originally built and sponsored by Ænix.

With Cozystack, you can transform a bunch of servers into an intelligent system with a simple REST API for spawning Kubernetes clusters, Database-as-a-Service, virtual machines, load balancers, HTTP caching services, and other services with ease.

Use Cozystack to build your own cloud or provide a cost-effective development environment.

Cozystack user interface

Use-Cases

Documentation

The documentation is located on the cozystack.io website.

Read the Getting Started section for a quick start.

If you encounter any difficulties, start with the troubleshooting guide and work your way through the process that we've outlined.

Versioning

Versioning adheres to the Semantic Versioning principles.
A full list of the available releases is available in the GitHub repository's Release section.

Contributions

Contributions are highly appreciated and very welcomed!

In case of bugs, please check if the issue has already been opened by checking the GitHub Issues section. If it isn't, you can open a new one. A detailed report will help us replicate it, assess it, and work on a fix.

You can express your intention to on the fix on your own. Commits are used to generate the changelog, and their author will be referenced in it.

If you have a concrete feature request, open an issue. For a cross-cutting or architectural change, open a design proposal in the community repo. For questions or early ideas, use GitHub Discussions. See CONTRIBUTING.md for the full routing.

Community

You are welcome to join our Telegram group and come to our weekly community meetings. Add them to your Google Calendar or iCal for convenience.

License

Cozystack is licensed under Apache 2.0.
The code is provided as-is with no warranties.

Commercial Support

A list of companies providing commercial support for this project can be found on official site.

Languages
Go 47.2%
Shell 37.6%
TypeScript 7%
Go Template 5.4%
Makefile 1.4%
Other 1.2%