Skip to content

[uss_qualifier/suites] Improve test suite resource input definitions - #1821

Open
BenjaminPelletier wants to merge 2 commits into
interuss:mainfrom
BenjaminPelletier:resource-inputs
Open

BenjaminPelletier wants to merge 2 commits into
interuss:mainfrom
BenjaminPelletier:resource-inputs

Conversation

@BenjaminPelletier

Copy link
Copy Markdown
Member

This PR enhances the information that can be provided about resource inputs to a test suite. Instead of a dict with just resource type as the value, a list of resource inputs is added. In general, lists of items are better than dicts with arbitrary keys because the latter is difficult to deal with in a number of schema-checking activities, as I learned with ResourceCollection.resource_declarations in configuration. The former is also easier to expand with additional pieces of information later. The old resources field remains supported to allow leisurely upgrading to resource_inputs, and indeed this PR only uses the new field in one of the test suites. A description field for the test suite overall is also added and rendered into documentation.

The size of this PR is smaller than it looks initially; only the first commit is substantive, and then the second commit is just make format to rerender the auto-generated test suite documentation.

@BenjaminPelletier
BenjaminPelletier marked this pull request as ready for review October 18, 2026 17:40
@BenjaminPelletier BenjaminPelletier added the P3 Lower priority label Oct 18, 2026
@the-glu

the-glu commented Oct 22, 2026

Copy link
Copy Markdown
Member

The size of this PR is smaller than it looks initially; only the first commit is substantive, and then the second commit is just make format to rerender the auto-generated test suite documentation.

Shouldn't we mark those as generated in gitattributes, so the diff is not shown by default in PR, but still expandable if needed?

(If yes, probably worth and issue since it's shouldn't be fixed there)

resource_inputs: Optional[list[ResourceInput]]
"""Enumeration of the resources used by this test suite. May not be specified together with `resources`."""

local_resources: Optional[dict[ResourceID, ResourceDeclaration]]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't that one be updated?

(At least the doc, but probably the behavior no?)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be an entirely different PR as this PR only deals with what are effectively function arguments to a test suite whereas this line (local_resources) is effectively local variable assignments. A ResourceDeclaration is very different from a resource type name.

raise ValueError(
"May not specify both resources and resource_inputs in the same TestSuiteDefinition"
)
super().__init__(previous_instance, **kwargs)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it was a dict before, it's was (probably) not possible to set the same id twice. Shouldn't we have a check to prevent that?

supplied_fields = (previous_instance or {}).keys() | kwargs.keys()
if "resources" in supplied_fields and "resource_inputs" in supplied_fields:
raise ValueError(
"May not specify both resources and resource_inputs in the same TestSuiteDefinition"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: now it's possible to not define anything since both are optional, witch is probably fine but just to be sure should it be checked?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Lower priority

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants