testing

A testing reference for Megatron Bridge, covering where unit and functional tests live, what their L0, L1, L2, and flaky labels mean, and how to run or organize them. Unit tests are small isolated checks; functional tests check larger workflows, often on specific GPU hardware.

In plain words
What is it for?
Use it to add, move, disable, name, or run Megatron Bridge tests and to decide which test tier fits a change.
Why use it?
It explains which tests block changes from merging, which run only on certain hardware or schedules, and how moving a test affects CI, the automated build-and-test system.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/nvidia-nemo/megatron-bridge/testing
Any agent
npx skills add NVIDIA-NeMo/Megatron-Bridge --skill testing
Clone the repo
git clone --depth 1 https://github.com/NVIDIA-NeMo/Megatron-Bridge

Made for: Claude Code, Codex.

Per session 45 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,544 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00045 $0.01544
Opus 5 $0.00023 $0.00772
Sonnet 5 $0.00009 $0.00309
Haiku 4.5 $0.00005 $0.00154

Measured 3d ago against content hash 5c2155982b6c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

testing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/testing/SKILL.md · 159 lines

How it starts

The opening of the file, as written. The whole thing — 159 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Testing

Directory Layout

tests/
  unit_tests/          # fast, isolated, no GPU required
  functional_tests/
    launch_scripts/
      h100/
        active/        # H100 tests that run in CI automatically
        flaky/         # H100 tests quarantined from blocking CI
      gb200/
        active/        # GB200 tests that run in CI automatically
        flaky/         # GB200 tests quarantined from blocking CI

Unit tests are independent of the launch script layout. Functional test scripts are named {Tier}_{Description}.sh (e.g., L0_Launch_training.sh).

Tier Semantics

Tier Trigger Blocking
L0 Every PR, every push to main, schedule Yes — PR cannot merge if L0 fails
L1 Push to main, schedule, PRs with needs-more-tests label Yes
L2 Schedule, workflow_dispatch, PRs with full-test-suite label Yes (when triggered)
flaky workflow_dispatch with test_suite=all only No — failures are informational

H100 and GB200 each have independent L0/L1/L2/flaky jobs. Moving a script to flaky/ removes it from blocking CI on that hardware target only.

Tier assignment criteria

Reserve L0 for high-risk shared paths and the smallest current set of representative first-tier gates. L1 holds secondary but still broadly useful coverage that runs on main, on schedules, and for opt-in PRs through the established needs-more-tests label. Place legacy, redundant, niche, specialized, or expensive model-family coverage in L2. Popularity alone does not determine a test's tier; weigh risk, representativeness, cost, and overlap with existing coverage.

Prefer unit tests over functional tests. CI GPU resources are limited; every functional test slot has a real cost.

Running Tests Locally

Unit Tests

No GPU required:

uv run pytest tests/unit_tests/ -x -v

Or inside Docker:

docker run --rm --gpus all -v $(pwd):/workdir/ -w /workdir/ megatron-bridge \
  uv run pytest tests/unit_tests/

Read the full file on GitHub · 159 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 159 lines · 45 tokens per session scan A 5c2155982b6c

Subscribe to this mod's changes

testing is a skill published in the GitHub repository NVIDIA-NeMo/Megatron-Bridge (893 stars, last pushed yesterday), licensed Apache-2.0. It adds 45 tokens to every session and 1,544 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.