Skip to content

ci: every tests/*.rs file is a module of one test binary, integration (C6) - #732

Merged
DrunkOnJava merged 6 commits into
mainfrom
ci/c6-one-test-binary
Oct 5, 2026
Merged

DrunkOnJava merged 6 commits into
mainfrom
ci/c6-one-test-binary

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

The last C6 item from the CI audit: one test binary instead of 78.

Measured with C2's cache on 6373a2f (scratch runs 37318563451 and 37319682529, never merged):

separate (77 binaries) merged (one)
first run build units summing to 118 s (37 s of wall time) 13.1 s
second run 64.7 s 10.2 s

This pull request's own CI gives the Windows and macOS job times against main.

What changes

  • Cargo.toml: autotests = false and a [[test]] named integration, tests/integration/main.rs, which holds each tests/*.rs file as a #[path] module. The test files themselves are unchanged.
  • A file's tests are named <file>::<test>. Run one file with cargo test --test integration -- <file>::. Every --test <file> in ci.yml, corpus-nightly.yml, the tools and the docs now reads that way.
  • tools/ci/verify-real-files.sh:
    • fails when a file is not a module of main.rs, or main.rs names one that is gone;
    • under nextest, uses the filterset test(/^(a|b|...)::/) with each skip scoped to its module;
    • without nextest, passes exact names from --list, because libtest's substring filters would let type_global_ids:: pick door_type_global_ids:: too.
  • clippy::duplicate_mod is allowed: each file keeps its own mod common;.

Caused by this, and fixed here

  • A test thread's name is now <file>::<test>. rvt_inspect_cli's corrupt-file fixture puts that name in a temp path, and Windows rejects the colons (job 111999344636, os error 123). The test now replaces each : with -, in its own commit (0bbf054), with no assertion changed.
  • The rewrite also dropped tools/ci/verify-real-files.sh's executable bit, and the two workflows' <file>:: run lines needed quoting to be valid YAML. Both are fixed.
  • Windows now reports 231 tests run and 31 skipped: the 24 tests of the five unit-classed files, which are in this binary now, plus the manifest's 7 skips.

Not caused by this


Note

Low Risk
Test-only packaging and CI/script invocation changes; individual test sources are untouched, with extra manifest checks to prevent orphaned or mis-selected tests.

Overview
Merges all tests/*.rs integration targets into a single test binary named integration (C6), cutting reported test build time from ~118s across 77 binaries to ~13s for one compile.

Cargo.toml sets autotests = false and declares [[test]] integration at tests/integration/main.rs, which #[path]-includes every existing tests/*.rs file unchanged. Test names become <module>::<test>; docs, release checklist, corpus tooling, and GitHub workflows now invoke cargo test --test integration -- <module>:: instead of --test <module>.

tools/ci/verify-real-files.sh is updated to require each tests/*.rs file to appear in main.rs, run nextest against --test integration with module-scoped regex filters (and skip rules per module), and without nextest select tests by exact names from --list so substring filters cannot pull in the wrong module (e.g. type_global_ids:: vs door_type_global_ids::).

Reviewed by Cursor Bugbot for commit 84ec9e7. Configure here.

… (C6)

Each tests/*.rs file built and linked as its own binary. Measured with C2's
cache on 6373a2f (scratch runs 37318563451 and 37319682529, never merged):

  77 binaries   build units summing to 118 s (37 s of wall time)
  one binary    13.1 s
  second run    64.7 s against 10.2 s

`autotests = false` and a `[[test]]` named integration whose main.rs holds
each file as a `#[path]` module; the files themselves are unchanged. A
file's tests are named `<file>::<test>`, so a single file runs with
`cargo test --test integration -- <file>::`, and every `--test <file>` in
CI, the tools and the docs now reads that way.

tools/ci/verify-real-files.sh also fails when a tests/*.rs file is not a
module of main.rs, or main.rs names one that is gone. Under nextest the
targets are a filterset, `test(/^(a|b|...)::/)`, with each skip scoped to
its module; without it, libtest's filters match substrings
(`type_global_ids::` would pick `door_type_global_ids::` too), so the
script lists the binary's tests and passes exact names, and refuses to run
when it chooses none, because no names would run the unit targets too.

`clippy::duplicate_mod` is allowed: each file declares its own
`mod common;`, so tests/common compiles once per file that uses it, as it
did when each file was a binary.

Not caused by the merge: the unit-classed ifc_synthetic_project fails as
its own binary on 6373a2f too (scratch run 37346485303, 12 property sets
where it asserts 2); CI runs no unit target, and it is logged in BACKLOG.md.
In a plain YAML scalar `:: --nocapture` reads as a mapping, and GitHub
refused ci.yml and corpus-nightly.yml (run 37366249245: "This run likely
failed because of a workflow file issue"). Quoted, every workflow parses
with yaml.safe_load.
The rewrite copied the script without its mode, so every job that runs it
failed with "tools/ci/verify-real-files.sh: Permission denied" (run
37366709128, exit 126).
…indows path in the merged binary

rvt_inspect_json_reports_corrupt_file_failure_mode names its temp file after
the test thread. As a module of the integration binary the thread is named
`rvt_inspect_cli::rvt_inspect_json_reports_corrupt_file_failure_mode`, and
Windows rejects the colons. CI on 2dc1ed1, Windows job 111999344636:

        FAIL [   0.009s] (185/231) rvt::integration rvt_inspect_cli::rvt_inspect_json_reports_corrupt_file_failure_mode
    thread 'rvt_inspect_cli::rvt_inspect_json_reports_corrupt_file_failure_mode' (7832) panicked at tests\integration\..\rvt_inspect_cli.rs:98:53:
    write corrupt fixture: Os { code: 123, kind: InvalidFilename, message: "The filename, directory name, or volume label syntax is incorrect." }
         Summary [   3.343s] 231 tests run: 230 passed, 1 failed, 31 skipped

The Linux and macOS jobs on the same head passed. Each `:` in the thread name
now becomes `-`. The thread name stays in the path, since it keeps the path
unique when libtest runs tests in one process with one pid. No assertion
changes.

The 31 skipped are the 24 tests of the five unit-classed files, now in the
same binary, plus the manifest's 7 skips.

Decision (advisor, 2026-10-05): this changes how a pre-existing test builds
its input and keeps every assertion. The merge broke it, not the test's
intent, so under the standing guidance it is an engineering call for the
advisor, not the maintainer, and it gets its own commit.
@DrunkOnJava
DrunkOnJava merged commit 120e2f9 into main Oct 5, 2026
27 checks passed
@DrunkOnJava
DrunkOnJava deleted the ci/c6-one-test-binary branch October 5, 2026 22:14
DrunkOnJava added a commit that referenced this pull request Oct 20, 2026
…and rvt-wasm crate (#849)

## Summary

Two contributor-facing docs described a layout that C6 (2026-10-05: #724 split the bindings into `rvt-wasm`, #732 merged every test file into one binary) replaced. `docs/extending-layer-5b.md`'s Step 5 told a contributor to add a check that would never run, and the viewer docs named a bindings file that no longer exists.

## Motivation

A scan of the docs for cited source paths that do not exist found these. The other misses it reported are dated notes about other repositories, historical reports, an ADR and a launch draft that says it was written for 0.1.2.

- **`docs/extending-layer-5b.md`, Step 5.** It said to add a `#[test]` gated on a `corpus` feature to `tests/elements.rs`, opening `_corpus/examples/Autodesk/...` by a hard-coded path. There is no `corpus` feature and no `tests/elements.rs`. Since #732 every `tests/*.rs` file is a module of the one `integration` binary, and CI runs only the files `tools/ci/test-targets.txt` classes. A test written to the guide is neither compiled nor run, and the repository's rule is to resolve the corpus through `tests/common`, never a path.
- **`docs/viewer-build-pipeline.md` and `AGENTS.md`.** Both named `src/wasm.rs` behind a `wasm` feature. #724 moved the bindings to their own crate, `rvt-wasm`, and `rvt` builds as a plain `rlib`. The build commands both docs give were already the `rvt-wasm` ones.

## Changes

- `docs/extending-layer-5b.md`:
  - **Step 3** registers the decoder and lists its class in `elements::MVP_TYPED_CLASSES` before the corpus check, since production uses a typed decoder only for those classes (skipping an instance it rejects). The same change adds the class's arm to `typed_json::mvp_typed_view`, or the CLI and Python give it `typed: null`, and to the list `tests/python/test_decoded_api.py` pins and the class list in `docs/schemas/decoded-elements.schema.json`. It drops the `decoder_class_names_are_unique` tripwire, which no longer exists (`decoder_for_class` takes the first match).
  - **Step 5** says how a real-file check is added now: `tests/<name>.rs`, a line in `tests/integration/main.rs`, and the class `real` in the manifest, which fails CI for a file it does not class. The check uses the files whose oracle holds the class (the family corpus through `tests/common`, or project files through `RVT_PROJECT_CORPUS_DIR`), requires an instance only where the oracle has one, and fails on a missing file when `RVT_REQUIRE_CORPUS` is set, as `tests/elem_table_corpus.rs` does. Its example decodes through the production path (`walker::iter_elements`), keeps the schema rows (`record_kind` `schema_instance`, which typed and generic decodes share and partition records do not), asserts `provenance.decoder == "MyClassDecoder"` on each, and marks where each field is compared with the oracle by ElementId.
  - **The file list, Step 6 and Step 7** no longer put tests in the decoder file or say "unit-tested with synthesized bytes", and the commit scope is `elements`.
- `docs/viewer-build-pipeline.md`: its note on what the snippets predate gains the `rvt-wasm` move (C6, #724) and says #260's per-ref concurrency group happened (it said "is proposed", though #260 merged on 2026-09-19).
- `AGENTS.md`: the WASM package is rebuilt when `rvt-wasm/src/lib.rs` or the library code it reaches changes.

## Testing

N/A: docs only. The example uses `RevitFile::schema`, `SchemaTable::classes`, `ClassEntry::{name, fields}` and `tests/common`'s `ALL_YEARS` and `sample_for_year`, as `tests/samples.rs` does.

## Audit-honesty checklist

- [x] README / docs reflect the current state after this PR
- [x] Commit messages describe what changed and why
- [x] No emojis in code, docs, or commit messages
- [x] No private paths, personal email addresses, or internal jargon in committed files

## Legal and contribution hygiene

- [x] I agree this work is licensable under Apache-2.0 (see `CONTRIBUTING.md`)
- [x] This PR contains no Autodesk proprietary source, decompiled internals, or NDA'd SDK content (see `CLEANROOM.md`)

## Breaking changes

None.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Documentation-only updates with no runtime or CI behavior changes.
> 
> **Overview**
> Updates contributor docs so they match **C6**: WASM bindings live in **`rvt-wasm`**, and corpus checks plug into the single **`integration`** test binary plus **`tools/ci/test-targets.txt`**.
> 
> **`docs/extending-layer-5b.md`** expands the “three-file” checklist to include **`typed_json`**, Python/schema class lists, and the corpus/CI wiring. Step 2’s example now **fails closed** in `decode` (not just `decode_instance`). Step 3 documents **`MVP_TYPED_CLASSES`**, production scoring/provenance, and where to register typed output. Step 5 **replaces** the obsolete `tests/elements.rs` / `corpus`-feature pattern with **`tests/<name>_corpus.rs`**, a module line in **`tests/integration/main.rs`**, and classing the file **`real`** in the CI manifest, including an oracle-driven `iter_elements` example.
> 
> **`AGENTS.md`** and **`docs/viewer-build-pipeline.md`** point rebuild notes at **`rvt-wasm/src/lib.rs`** and record the bindings split and merged **per-ref** deploy concurrency as shipped.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 3873423. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant