Skip to content
cccskills
FreePublished on GitHub

gateway-eunit

Run the Yuzu Erlang gateway eunit test suite correctly. Sources the Erlang toolchain, uses --dir to work around rebar3 auto-discovery bug (#337), and explains how to interpret the output. Use when the user asks to run gateway unit tests, verify a gateway change, check for regressions in eunit, or chase an eunit flake.

The English summary is being prepared. Showing the original description.

See how to install

Files included (1)

  • SKILL.md4.1 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

gateway-eunit

Runbook for exercising the Yuzu Erlang gateway eunit suite.

Command

From the repo root:

source scripts/ensure-erlang.sh >/dev/null && \
  command -v erl >/dev/null || { echo "Erlang missing — check scripts/ensure-erlang.sh output"; exit 1; }
cd gateway && rebar3 eunit --dir apps/yuzu_gw/test

Extra args (e.g. --module yuzu_gw_agent_tests) go on the end. If the user names a specific module, still pass --dir apps/yuzu_gw/test — it is required, not optional.

To capture output without burning tokens, redirect to /tmp/ and tail the result:

rebar3 eunit --dir apps/yuzu_gw/test > /tmp/eunit_run.txt 2>&1; tail -30 /tmp/eunit_run.txt

Why --dir is mandatory

rebar3 3.27 decides "is this test module in the project" by intersecting against the application's compiled modules list in yuzu_gw.app, which only contains src/ modules. Test modules whose name has no 1:1 src/ counterpart (yuzu_gw_circuit_breaker_tests, yuzu_gw_env_override_tests, yuzu_gw_scale_tests, every *_SUITE file, helpers like yuzu_gw_perf_helpers) get rejected before any test runs:

===> Error Running EUnit Tests:
  Module `yuzu_gw_circuit_breaker_nf_tests' not found in project.
  ...

With --dir apps/yuzu_gw/test, rebar3 scans the directory directly and accepts every module. This is tracked as issue #337; the workaround is in tree in scripts/run-tests.sh already.

Interpreting output

  • All N tests passed. — clean pass. Current expected total: 148.
  • Passed: N. One or more tests were cancelled. — at least one test timed out at the eunit 5-second default. The cancellation usually cancels the entire enclosing {setup, ...} group, so the real impact is larger than "one test". Search for *timed out* in the full output to find the culprit.
  • Module X not found in project. — you forgot --dir. See #337 above.
  • Stray connection_refused / Failed to notify stream status log lines — fixture leak from a prior test module. Don't ignore; they have caused real test flakes (#336).

--module does NOT give isolation

A common trap: running rebar3 eunit --dir apps/yuzu_gw/test --module yuzu_gw_agent_tests to "isolate" a single module. It does not. rebar3 runs the full suite FIRST (the --dir phase), then the filtered module SECOND, in the same BEAM VM. The second run inherits polluted state (meck mocks, registered names, leaked processes) from the first — so a passing filtered run does not prove the test is order-independent, and a failing one may be failing because of pollution rather than the test itself.

To get real isolation, either:

  1. Delete _build/test between runs (rm -rf gateway/_build/test), which forces a fresh BEAM.
  2. Spin up erl directly on the compiled beams (erl -pa _build/test/lib/yuzu_gw/ebin -pa _build/test/lib/*/ebin) and run test functions manually — useful for reproducer scripts when bisecting a leak source.

Debugging a hang

If a test times out and fixture state at setup time looks clean, the problem is often a mock process registered under a canonical gen_server name (e.g. yuzu_gw_registry) that silently discards gen_server:call messages. The diagnostic that finds these fast: process_info(Pid, [message_queue_len, status, current_function, current_stacktrace]) on the target pid. Spawn the probe from inside the hanging init/1 via a sleeping helper process so it fires while the call is stuck. This technique found the root cause of #336 when the issue's original hypothesis was wrong.

After any change

Always follow up with rebar3 dialyzer (see the gateway-dialyzer skill). CLAUDE.md mandates dialyzer runs after every Erlang change — compilation succeeding is not enough because warnings_as_errors only catches compile warnings, not dialyzer warnings.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Run an adversarial two-phase code review of a change with TWO independent reviewers — Claude and Codex — who review alone, then cross-examine each other's findings, then Claude synthesizes a single weighted verdict. Use when the user says "/adversarial-review", "adversarial review", "review this with Codex", "get Codex to review", "two-reviewer review", "cross-examine this PR", or wants a second independent model to grade a change before merge.

The English summary is being prepared. Showing the original description.

DevNullLtd/Yuzu19Updated Oct 19, 2026

Authentication & Authorisation control plane for Yuzu — the canonical entry point for any work on RBAC, OIDC SSO, SAML, SCIM, MFA/TOTP, AD/Entra integration, API tokens, session lifecycle, enrollment, and the audit/evidence chain. Use when the user says "/auth-and-authz", "/auth", "/iam", asks to plan or implement an enterprise A&A feature, asks "what's our auth gap to enterprise readiness", asks to audit current auth state against SOC 2 CC6.x / Workstream B, or starts work that touches `auth_*`, `rbac_*`, `oidc_*`, `api_token_*`, `enrollment_*`, or `cert_store.*`. The skill bundles current-state inventory, required-features inventory, gap matrix, the canonical workflow for adding a new A&A feature, and the load order for the routed reference docs.

The English summary is being prepared. Showing the original description.

DevNullLtd/Yuzu19Updated Oct 19, 2026

Canonical patterns for caching in Yuzu CI workflows. Two snippets — one for ephemeral GHA-hosted runners (split actions/cache/restore + actions/cache/save, never `save-always: true`) and one for self-hosted runners (local filesystem cache under `runner.tool_cache`, no GHA cache round-trip). Use when adding a new vcpkg/ccache/dependency cache step to any workflow under `.github/workflows/`, or when reviewing a PR that touches `actions/cache@`.

The English summary is being prepared. Showing the original description.

DevNullLtd/Yuzu19Updated Oct 19, 2026

Review Yuzu C++ source changes for C++23 correctness, idiomatic standard-library use, ABI boundaries, threading primitives, and cross-compiler portability across GCC, Clang, MSVC, and Apple Clang. Use for any governance Gate 3 review when `.cpp`, `.hpp`, or `.h` files change.

The English summary is being prepared. Showing the original description.

DevNullLtd/Yuzu19Updated Oct 19, 2026

Review Yuzu C++ source changes for resource ownership, RAII, borrowed lifetimes, C ABI contexts, casts, process/syscall boundaries, callbacks, threads, and sanitizer coverage. Use for any governance Gate 3 review when C++ files change, paired with cpp-expert.

The English summary is being prepared. Showing the original description.

DevNullLtd/Yuzu19Updated Oct 19, 2026

Run the current session as a senior developer (Opus) leading a configurable junior fleet. Decomposes requests into scoped tasks, dispatches junior-developer subagents in parallel, optionally runs an architect plan-review gate before dispatch, autonomously resolves escalations, optionally dispatches a doc-writer second wave after juniors complete, then integrates and gates with /test + /governance. Use when the user says "/dev-team", "run the dev team", "delegate this to the juniors", "act as the senior dev", or wants a task built by a senior-led fleet.

The English summary is being prepared. Showing the original description.

DevNullLtd/Yuzu19Updated Oct 19, 2026

See all skills by DevNullLtd

Report a problem with this skill