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
20 changes: 20 additions & 0 deletions conformance/core/message_processor_scaling.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,23 @@
- "]"
sizes: [200, 800]
max_ratio: 8

- name: test_scaling_process_single_component_messages_composition_v10
description: Processing n messages of one component each, under a validation config and with a catalog whose components declare allowedParents and allowedChildren, takes about four times as long at 4n. A message that adds a child to a container checks the constraints the child changes, rather than every child of the container.
action: measure_growth
protocolVersion: "v1.0"
catalogPaths:
- "conformance/test_data/catalogs/composition_catalog_v1_0.json"
args:
validation_config: relaxed
operation: process_messages
payload:
- '[{"version": "v1.0", "createSurface": {"surfaceId": "s1", "catalogId": "conformance/composition"}}, {"version": "v1.0", "updateComponents": {"surfaceId": "s1", "components": [{"id": "root", "component": "Column", "children": ['
- repeat: '"item_{i}"'
separator: ", "
- "]}]}}, "
- repeat: '{"version": "v1.0", "updateComponents": {"surfaceId": "s1", "components": [{"id": "item_{i}", "component": "Text", "text": "Item number {i}"}]}}'
separator: ", "
- "]"
sizes: [1000, 4000]
max_ratio: 8
67 changes: 67 additions & 0 deletions conformance/core/validator_v0_8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,73 @@
text:
literalString: Reachable

- name: test_v08_topology_plain_string_property_not_treated_as_child_ref
description: Tests that a plain string property whose value happens to match another component's ID does not make that component reachable in v0.8 strict mode. Text.usageHint is an enum, not a child reference, even when a component has the ID it names.
action: validate
protocolVersion: v0.8
catalogPaths:
- specification/v0_8/json/standard_catalog_definition.json
strictMode: true
steps:
- messages:
- beginRendering:
surfaceId: s1
root: root
- surfaceUpdate:
surfaceId: s1
components:
- id: root
component:
Column:
children:
explicitList: [title]
- id: title
component:
Text:
text:
literalString: Heading
usageHint: h1
- id: h1
component:
Text:
text:
literalString: Still orphaned
expectError:
category: ValidationError
message: h1

- name: test_v08_topology_plain_string_property_does_not_close_cycle
description: Tests that a plain string property whose value happens to match an ancestor's ID is not read as a reference that closes a cycle in v0.8 strict mode. Here root -> h1 -> title is a tree, and title's usageHint names h1.
action: validate
protocolVersion: v0.8
catalogPaths:
- specification/v0_8/json/standard_catalog_definition.json
strictMode: true
steps:
- messages:
- beginRendering:
surfaceId: s1
root: root
- surfaceUpdate:
surfaceId: s1
components:
- id: root
component:
Column:
children:
explicitList: [h1]
- id: h1
component:
Column:
children:
explicitList: [title]
- id: title
component:
Text:
text:
literalString: Heading
usageHint: h1

- name: test_v08_invalid_data_model_path_error
description: Tests that a dataModelUpdate path with an invalid JSON Pointer escape ('~2') fails validation in v0.8.
action: validate
Expand Down
72 changes: 72 additions & 0 deletions conformance/core/validator_v0_9.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1307,6 +1307,78 @@
category: ValidationError
message: orphan_id

- name: test_v09_topology_component_id_array_dangling_reference_error
description: Tests that every item of an array property whose items are ComponentId is a child reference, whatever the property is called, so an item naming no component fails validation in v0.9 strict mode even when no other item names one.
action: validate
protocolVersion: v0.9
catalog:
catalogId: custom
components:
Stack:
type: object
properties:
component: {const: Stack}
slots:
type: array
items:
$ref: "common_types.json#/$defs/ComponentId"
required:
- component
- slots
strictMode: true
steps:
- messages:
- version: v0.9
createSurface:
surfaceId: s1
catalogId: custom
- version: v0.9
updateComponents:
surfaceId: s1
components:
- id: root
component: Stack
slots: [missing_slot]
expectError:
category: ValidationError
message: missing_slot

- name: test_v09_topology_component_id_array_child_reachable
description: Tests that a component named in an array property whose items are ComponentId is reachable from the root in v0.9 strict mode, whatever the property is called.
action: validate
protocolVersion: v0.9
catalog:
catalogId: custom
components:
Stack:
type: object
properties:
component: {const: Stack}
slots:
type: array
items:
$ref: "common_types.json#/$defs/ComponentId"
required:
- component
- slots
strictMode: true
steps:
- messages:
- version: v0.9
createSurface:
surfaceId: s1
catalogId: custom
- version: v0.9
updateComponents:
surfaceId: s1
components:
- id: root
component: Stack
slots: [first]
- id: first
component: Stack
slots: []

- name: test_v09_child_list_template_missing_path_error
description: Tests that a ChildList template object missing its required 'path' property fails schema validation in v0.9.
action: validate
Expand Down
74 changes: 74 additions & 0 deletions conformance/core/validator_v1_0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1425,6 +1425,80 @@
category: ValidationError
message: orphan_id

- name: test_v10_topology_component_id_array_dangling_reference_error
description: Tests that every item of an array property whose items are ComponentId is a child reference, whatever the property is called, so an item naming no component fails validation in v1.0 strict mode even when no other item names one.
action: validate
protocolVersion: v1.0
catalog:
catalogId: custom
components:
Stack:
type: object
properties:
id: {type: string}
component: {const: Stack}
slots:
type: array
items:
$ref: "common_types.json#/$defs/ComponentId"
required:
- component
- slots
strictMode: true
steps:
- messages:
- version: v1.0
createSurface:
surfaceId: s1
catalogId: custom
- version: v1.0
updateComponents:
surfaceId: s1
components:
- id: root
component: Stack
slots: [missing_slot]
expectError:
category: ValidationError
message: missing_slot

- name: test_v10_topology_component_id_array_child_reachable
description: Tests that a component named in an array property whose items are ComponentId is reachable from the root in v1.0 strict mode, whatever the property is called.
action: validate
protocolVersion: v1.0
catalog:
catalogId: custom
components:
Stack:
type: object
properties:
id: {type: string}
component: {const: Stack}
slots:
type: array
items:
$ref: "common_types.json#/$defs/ComponentId"
required:
- component
- slots
strictMode: true
steps:
- messages:
- version: v1.0
createSurface:
surfaceId: s1
catalogId: custom
- version: v1.0
updateComponents:
surfaceId: s1
components:
- id: root
component: Stack
slots: [first]
- id: first
component: Stack
slots: []

- name: test_v10_child_list_template_missing_path_error
description: Tests that a ChildList template object missing its required 'path' property fails schema validation in v1.0.
action: validate
Expand Down
40 changes: 40 additions & 0 deletions conformance/test_data/catalogs/composition_catalog_v1_0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://a2ui.org/conformance/test_data/catalogs/composition_catalog_v1_0.json",
"protocolVersion": "1.0",
"title": "Conformance Composition Catalog (v1.0)",
"description": "A two component catalog whose components declare allowedParents and allowedChildren, for the timing cases of core/message_processor_scaling.yaml.",
"catalogId": "conformance/composition",
"components": {
"Text": {
"type": "object",
"description": "Displays a run of text.",
"allowedParents": ["Column"],
"properties": {
"component": { "const": "Text" },
"text": { "$ref": "common_types.json#/$defs/DynamicString" }
},
"required": ["component", "text"]
},
"Column": {
"type": "object",
"description": "A layout that stacks its children vertically.",
"allowedParents": ["Surface", "Column"],
"allowedChildren": ["Text", "Column"],
"properties": {
"component": { "const": "Column" },
"children": { "$ref": "common_types.json#/$defs/ChildList" }
},
"required": ["component", "children"]
}
},
"$defs": {
"anyComponent": {
"oneOf": [
{ "$ref": "#/components/Text" },
{ "$ref": "#/components/Column" }
],
"discriminator": { "propertyName": "component" }
}
}
}
11 changes: 10 additions & 1 deletion python/a2ui_core/tests/test_conformance.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,16 @@
"1.0",
}

SKIP_TEST_NAMES: set[str] = set()
SKIP_TEST_NAMES: set[str] = {
# The topology checks read a v0.8 string property as a child reference
# when it names a component the surface holds, and an array property whose
# items are ComponentId as a reference only when one of its items names a
# held component. #3326 reads both from the catalog alone.
"test_v08_topology_plain_string_property_not_treated_as_child_ref",
"test_v08_topology_plain_string_property_does_not_close_cycle",
"test_v09_topology_component_id_array_dangling_reference_error",
"test_v10_topology_component_id_array_dangling_reference_error",
}

# Transition skip list containing specific test suite files or basenames to skip entirely.
SKIP_TEST_SUITES: set[str] = set()
Expand Down
Loading