classic-testing

Author and debug end-to-end test scenarios and golden trace baselines for the classic-wgl Rust engine.

1|1|Updated Aug 18, 2021
One-click install
npx skills add https://github.com/guilledk/classic-wgl --skill classic-testing-guilledk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: classic-testing
Source: https://github.com/guilledk/classic-wgl/tree/main/.agents/skills/classic-testing
Command: npx skills add https://github.com/guilledk/classic-wgl --skill classic-testing-guilledk

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing and maintaining deterministic end-to-end tests for a Rust game engine is hard: frame timing, mesh rebuild delays, UI layout refresh, and headless CI rendering all introduce nondeterminism. This Skill documents the CLASSIC_TEST framework, golden trace/pixel harness, and headless EGL CI setup so agents can author scenarios, diagnose mismatches, and fix CI failures without reverse-engineering the test runner. ## Core Features & Use Cases - Scenario authoring: Write JSON test scenarios with scheduled TestStep actions (drag, keyPress, setEntityPos, setCameraIso) and assertions (height, tile, cameraAt, entityPos, pixelAtEntity) loaded via CLASSIC_TEST_FILE. - Golden trace management: Capture, compare, and re-baseline frame-by-frame draw-call traces (baseline.trace.jsonl) plus a GPU-free layout map, across four committed baselines including the basetest-lit lighting reference. - Headless CI debugging: Run the EGL surfaceless pipeline locally with LIBGL_ALWAYS_SOFTWARE=1, interpret CI artifacts in target/classic-test/, and distinguish real regressions from entity-ID renumbering. - Use Case: A shadow-mapping change breaks the golden job in CI. Use this Skill to re-baseline basetest-lit, read the layout map to confirm sprite placement, and write a pixelAtEntity assertion that pins the regression. ## Quick Start Ask the agent to write a CLASSIC_TEST JSON scenario that drags the height editor over a tile region and asserts the resulting height values, then run it headless with CLASSIC_GOLDEN=check.

Frequently Asked Questions about classic-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write an end-to-end test scenario for classic-wgl?

Write a JSON array of TestStep objects with frame, actions, assertions, and log fields, then point CLASSIC_TEST_FILE at it and run with CLASSIC_TEST=1. Schedule assertions 2-3 frames after drag actions so the tilemap mesh rebuild completes.

How do I update golden trace baselines after a rendering change?

Run the desktop binary headless with CLASSIC_HEADLESS=1, CLASSIC_FRAMES=60, CLASSIC_TEST=all, and CLASSIC_GOLDEN=update. Regenerate both trace and pixel baselines from the same run, and commit the scenario file and baselines together.

Why does my golden test pass locally but fail in CI?

CI runs Mesa llvmpipe with LIBGL_ALWAYS_SOFTWARE=1 and EGL_PLATFORM=surfaceless, so local GPU output can differ. Flaky failures usually indicate nondeterminism such as uninitialized state in begin_frame or non-deterministic entity spawn order.

Can I run headless golden tests on macOS or Windows?

No. HeadlessPlatform dynamically loads libEGL.so.1 and is Linux-only, so CI golden tests run only on ubuntu-latest. On macOS you must run with a native window by omitting CLASSIC_HEADLESS.

Why does my pixelAtEntity assertion fail under headless rendering?

pixelAtEntity needs a real GL depth-test driver, and Mesa llvmpipe's depth test is broken for the ghost pass, so occlusion assertions cannot be validated headless. Also schedule it after the scene settles since it reads the previous frame's framebuffer.

What are the limitations of the CLASSIC_TEST runner?

The Wait action is a no-op, build_test_scenario ignores its name parameter so only one hardcoded scenario exists, and only one scenario runs per process invocation. Custom scenarios require CLASSIC_TEST_FILE, and pixel goldens are not run in CI due to Mesa version sensitivity.