ICE-NET/docs/guides/testing.md
loki5512344 2e61688eb3
Some checks failed
rust-ci / checks (push) Has been cancelled
Initial import: ICE-NET research docs and Rust workspace (v0.4)
- Rust workspace: 7 library crates, icenetd CLI, icenet-city (Slint GUI)
- Sim: fix false Delivered after a route cut, derive traffic class from
  payload size, per-link airtime slots (link capacity, queueing)
- Docs: single docs/STATUS.md for all figures, remove v0.2/egui leftovers,
  drop unimplemented seed claims, uncheck store-and-forward
- License: LGPL-3.0-or-later (LICENSE, LICENSES/GPL-3.0.txt)
2026-11-13 12:28:48 +01:00

42 lines
1.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Tests / CI
В Rust тесты лежат **только** в отдельной папке каждого крейта:
`crates/<name>/tests/*.rs` и `apps/<name>/tests/*.rs`. Inline `#[cfg(test)]` в `src` запрещён.
```bash
cd workspace
python3 tools/check_layout.py
cargo fmt --all -- --check
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspace
cargo doc --workspace --no-deps
```
## Пирамида
1. `core`: классы и логические ID.
2. `wire`: roundtrip + отказ на malformed frame / oversize.
3. `routing`: slow-only route for Text / forbidden for Bulk / oversized Text treated as Bulk / link-down.
4. `guard`: deny unknown service, cap payload, no fake authentication.
5. `sim`: node failure, in-flight state, queued retry, no false `Delivered` after a cut, link capacity (`tests/capacity/`).
6. `city`: GUI smoke test вручную (позднее snapshot/interaction integration tests).
## Приёмка
- Все новые тесты воспроизводимы без сети/радио.
- Каждый алгоритм не нуждается в реальном `sleep`; используется sim clock.
- При дефекте добавить regression test отдельно от production module.
- Маркеры `TODO`/`unimplemented!()` не прятать в ветки реальных пакетов.
Что проверено и сколько тестов проходит — в [STATUS](../STATUS.md).
## Быстрые и полные проверки
```bash
cd workspace
sh tools/check_all.sh # core routing/simulator, без Slint-сборки
sh tools/check_all.sh --full # также Slint GUI и все integration tests
```
`cargo fmt --all` форматирует в том числе GUI crate; `.slint` не проверяется
`rustfmt` и проверяется компилятором Slint в `build.rs`.