Skip to content

Commit b90a557

Browse files
committed
test: add conformance test suite for CLI visibility with external spec repo integration
1 parent 5e9946c commit b90a557

8 files changed

Lines changed: 333 additions & 81 deletions

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ jobs:
2323
steps:
2424
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2525

26+
- name: Checkout apcore-cli spec repo (conformance fixtures)
27+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28+
with:
29+
repository: aiperceivable/apcore-cli
30+
path: .apcore-cli-spec
31+
2632
- name: Set up Python
2733
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
2834
with:
@@ -50,5 +56,7 @@ jobs:
5056
uv run pre-commit run --all-files
5157
5258
- name: Run tests
59+
env:
60+
APCORE_CLI_SPEC_REPO: ${{ github.workspace }}/.apcore-cli-spec
5361
run: |
5462
uv run pytest

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ venv/
1616
env/
1717
.env
1818
.forge
19+
.mypy_cache/

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,20 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88

9-
## [0.7.0] - 2026-04-15
9+
## [0.7.0] - 2026-04-23
1010

1111
### Changed
1212

1313
- **Dependency bump**: requires `apcore >= 0.18.0` (was `>= 0.17.1`). Aligns with upstream `apcore 0.18.0` and `apcore-toolkit 0.4.2` breaking changes.
1414
- **`MAX_MODULE_ID_LENGTH` 128 → 192**: `validate_module_id()` and all references updated to the new 192-character limit introduced in `apcore 0.18.0` (`apcore.registry.registry.MAX_MODULE_ID_LENGTH`).
1515
- **`describe-pipeline` renders `StrategyInfo`**: `executor.describe_pipeline(strategy)` now returns a `StrategyInfo` dataclass (`name`, `step_count`, `step_names`, `description`). `strategy.py` updated to use `StrategyInfo` fields; header line is `Pipeline: {info.name} ({info.step_count} steps)`. Falls back gracefully to the legacy `_resolve_strategy_name` path when `describe_pipeline` is unavailable.
16+
- **CI — spec-repo checkout**: `.github/workflows/ci.yml` now checks out `aiperceivable/apcore-cli` into `.apcore-cli-spec/` and exposes it to `pytest` via `APCORE_CLI_SPEC_REPO`. Mirrors the pattern established in `apcore-python` / `apcore-cli-typescript`.
1617

1718
### Added
1819

1920
- **`create_cli(app=...)` parameter**: `create_cli()` accepts an optional `app: APCore` unified client (introduced in `apcore 0.18.0`). `app` is mutually exclusive with `registry`/`executor` (raises `ValueError`). When `app` is provided, `registry` and `executor` are extracted from `app.registry` and `app.executor`. Filesystem discovery is skipped if `app.registry` already contains registered modules; otherwise normal discovery proceeds into `app.registry`.
21+
- **Cross-language conformance test harness** (`tests/conformance/`) consuming the shared apcli-visibility fixtures from the `aiperceivable/apcore-cli` spec repo (`conformance/fixtures/apcli-visibility/`). Behavioral assertions (apcli group visibility, registered subcommand set for `include`/`exclude` modes, always-registered `exec`) run today across all five canonical scenarios (`standalone-default`, `embedded-default`, `cli-override`, `env-override`, `yaml-include`). Byte-matching against `expected_help.txt` is marked `xfail` until Click's `HelpFormatter` is replaced with a canonical clap v4 / GNU-style emitter, tracked for parity with `apcore-cli-typescript/src/canonical-help.ts`.
22+
- **`APCORE_CLI_SPEC_REPO` env var** — overrides the spec-repo lookup path for conformance fixtures. Defaults to a sibling checkout (`../apcore-cli/`). Tests are skipped (not failed) when the spec repo is absent.
2023
- **FE-12: Module Exposure Filtering** — Declarative control over which discovered modules are exposed as CLI commands.
2124
- `ExposureFilter` class in `exposure.py` with `is_exposed(module_id)` and `filter_modules(ids)` methods.
2225
- Three modes: `all` (default), `include` (whitelist), `exclude` (blacklist) with glob-pattern matching.

README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,15 +520,33 @@ apcore-cli --extensions-dir ./extensions greet.hello --name Alice --greeting Hi
520520

521521
## Development
522522

523+
The conformance suite under `tests/conformance/` reads shared fixtures
524+
from the **spec repo** (`aiperceivable/apcore-cli`). Clone it as a sibling
525+
of this repo, or point `APCORE_CLI_SPEC_REPO` at an existing checkout:
526+
523527
```bash
528+
# One-time: clone both repos side by side
529+
git clone https://github.com/aiperceivable/apcore-cli.git
524530
git clone https://github.com/aiperceivable/apcore-cli-python.git
531+
525532
cd apcore-cli-python
526533
pip install -e ".[dev]"
527-
pytest # 394+ tests
534+
pytest # reads fixtures from ../apcore-cli/conformance/
528535
pytest --cov # with coverage report
529-
bash examples/run_examples.sh # run all examples
536+
bash examples/run_examples.sh # run all examples
530537
```
531538

539+
Alternative layout (spec repo checked out elsewhere):
540+
541+
```bash
542+
export APCORE_CLI_SPEC_REPO=/path/to/apcore-cli
543+
pytest
544+
```
545+
546+
Without the spec repo the conformance tests are skipped (pytest reports
547+
them as `skipped`, not `failed`). CI clones the spec repo automatically —
548+
see `.github/workflows/ci.yml`.
549+
532550
## License
533551

534552
Apache-2.0

resolver.py

Lines changed: 0 additions & 43 deletions
This file was deleted.

resolver2.py

Lines changed: 0 additions & 35 deletions
This file was deleted.

tests/conformance/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)