Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions tests/test_project_action_contracts.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,20 @@
import pytest
import yaml

ROOT = Path(__file__).resolve().parents[2]
from conftest import CONTRACTS_DIR

# WHERE THE CONTRACT FAMILY IS READ (plan 038 T096; CS in T094's map,
# R2-INV-R9). Where the run is composed, `tests/conftest.py` names the family's
# composed farm CONTRACTS_DIR, and the validator is this leg's own, which reads
# that farm. In a lone checkout CONTRACTS_DIR is None, and these are the paths
# openxFactory's tree kept, above the checkout: this file's declared reason,
# `openxfactory-contracts`, as `tests/test_declared_exclusion.py` reads it.
_COMPOSED = CONTRACTS_DIR is not None
ROOT = Path(__file__).resolve().parents[1 if _COMPOSED else 2]
SCRIPT = ROOT / "scripts" / "validate-ideation-dashboard-contracts.py"
SCHEMAS = ROOT / "contracts" / "schemas"
EXAMPLES = ROOT / "examples" / "ideation-dashboard"
CONTRACTS = CONTRACTS_DIR if _COMPOSED else ROOT / "contracts"
SCHEMAS = CONTRACTS / "schemas"
EXAMPLES = CONTRACTS.parent / "examples" / "ideation-dashboard"

INTENT_SCHEMA = SCHEMAS / "gate-intent.schema.yaml"
ACTION_SCHEMA = SCHEMAS / "gate-action-record.schema.yaml"
Expand Down
14 changes: 12 additions & 2 deletions tests/test_project_schema_election.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,19 @@
import pytest
import yaml

ROOT = Path(__file__).resolve().parents[2]
from conftest import CONTRACTS_DIR

# WHERE THE CONTRACT FAMILY IS READ (plan 038 T096; CS in T094's map,
# R2-INV-R9). Where the run is composed, `tests/conftest.py` names the family's
# composed farm CONTRACTS_DIR, and the validator is this leg's own, which reads
# that farm. In a lone checkout CONTRACTS_DIR is None, and these are the paths
# openxFactory's tree kept, above the checkout: this file's declared reason,
# `openxfactory-contracts`, as `tests/test_declared_exclusion.py` reads it.
_COMPOSED = CONTRACTS_DIR is not None
ROOT = Path(__file__).resolve().parents[1 if _COMPOSED else 2]
SCRIPT = ROOT / "scripts" / "validate-ideation-dashboard-contracts.py"
REGISTER_SCHEMA = ROOT / "contracts" / "schemas" / "project-register.schema.yaml"
CONTRACTS = CONTRACTS_DIR if _COMPOSED else ROOT / "contracts"
REGISTER_SCHEMA = CONTRACTS / "schemas" / "project-register.schema.yaml"


def _load_module():
Expand Down
37 changes: 25 additions & 12 deletions tests/test_validate_ideation_dashboard_contracts.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,20 @@
import pytest
import yaml

ROOT = Path(__file__).resolve().parents[2]
from conftest import CONTRACTS_DIR

# WHERE THE CONTRACT FAMILY IS READ (plan 038 T096; CS in T094's map,
# R2-INV-R9). Where the run is composed, `tests/conftest.py` names the family's
# composed farm CONTRACTS_DIR, and the validator is this leg's own, which reads
# that farm. In a lone checkout CONTRACTS_DIR is None, and these are the paths
# openxFactory's tree kept, above the checkout: this file's declared reason,
# `openxfactory-contracts`, as `tests/test_declared_exclusion.py` reads it.
_COMPOSED = CONTRACTS_DIR is not None
ROOT = Path(__file__).resolve().parents[1 if _COMPOSED else 2]
SCRIPT = ROOT / "scripts" / "validate-ideation-dashboard-contracts.py"
SCHEMAS = ROOT / "contracts" / "schemas"
EXAMPLES = ROOT / "examples" / "ideation-dashboard"
CONTRACTS = CONTRACTS_DIR if _COMPOSED else ROOT / "contracts"
SCHEMAS = CONTRACTS / "schemas"
EXAMPLES = CONTRACTS.parent / "examples" / "ideation-dashboard"
NEGATIVE = EXAMPLES / "negative"

CATALOG_SCHEMA = SCHEMAS / "xfactory-workbench-model-catalog.schema.yaml"
Expand Down Expand Up @@ -375,15 +385,18 @@ def test_every_schema_the_consumer_validates_is_on_disk():
schema THIS INSTALL validates is on disk, its own three always, and another
kind's only where the running tree supplies it.

THE VALIDATOR IS THE INSTALLED DISTRIBUTION'S, never this module's own
`SCRIPT`, whose `ROOT` is the carve's `parents[2]`, above the checkout
(V2-10): it is the one `openxdox.snapshot.find_validator` answers, and its
sources are the ones it reports (`schema_sources`). In a lone install its
tree carries no `contracts/`, so the three come from the distribution's
packaged copies, each held to `copies.yaml`'s digest. This module's
fixtures are not used: they read openxFactory's tree, which is why the file
is declared under `openxfactory-contracts`, and F7.1 runs this case by node
id."""
THE VALIDATOR IS THE INSTALLED DISTRIBUTION'S, the one
`openxdox.snapshot.find_validator` answers, and its sources are the ones it
reports (`schema_sources`). Run from this source tree, it is this
checkout's `scripts/validate-ideation-dashboard-contracts.py`. Where the
run is composed that is this module's `SCRIPT` too. In a lone checkout it
is not, because there `SCRIPT` is looked for at the carve's `parents[2]`,
above the checkout (V2-10). Run from an install, it is the packaged
validator. In a lone install its tree carries no `contracts/`, so the three
come from the distribution's packaged copies, each held to `copies.yaml`'s
digest. This module's fixtures are not used: in a lone checkout they read
Comment thread
brettheap marked this conversation as resolved.
openxFactory's tree, which is why the file is declared under
`openxfactory-contracts`, and F7.1 runs this case by node id."""
from openxdox import contracts, snapshot

validator = snapshot.find_validator()
Expand Down
16 changes: 13 additions & 3 deletions tests/test_wheel_action_contracts.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,20 @@
import pytest
import yaml

ROOT = Path(__file__).resolve().parents[2]
from conftest import CONTRACTS_DIR

# WHERE THE CONTRACT FAMILY IS READ (plan 038 T096; CS in T094's map,
# R2-INV-R9). Where the run is composed, `tests/conftest.py` names the family's
# composed farm CONTRACTS_DIR, and the validator is this leg's own, which reads
# that farm. In a lone checkout CONTRACTS_DIR is None, and these are the paths
# openxFactory's tree kept, above the checkout: this file's declared reason,
# `openxfactory-contracts`, as `tests/test_declared_exclusion.py` reads it.
_COMPOSED = CONTRACTS_DIR is not None
ROOT = Path(__file__).resolve().parents[1 if _COMPOSED else 2]
SCRIPT = ROOT / "scripts" / "validate-ideation-dashboard-contracts.py"
SCHEMAS = ROOT / "contracts" / "schemas"
EXAMPLES = ROOT / "examples" / "ideation-dashboard"
CONTRACTS = CONTRACTS_DIR if _COMPOSED else ROOT / "contracts"
SCHEMAS = CONTRACTS / "schemas"
EXAMPLES = CONTRACTS.parent / "examples" / "ideation-dashboard"
NEGATIVE = EXAMPLES / "negative"

INTENT_SCHEMA = SCHEMAS / "gate-intent.schema.yaml"
Expand Down
Loading