Skip to content

Resolve ros_distro selectors in package tests - #164

Open
Tobias-Fischer wants to merge 5 commits into
RoboStack:masterfrom
Tobias-Fischer:feat/distro-test-selectors
Open

Tobias-Fischer wants to merge 5 commits into
RoboStack:masterfrom
Tobias-Fischer:feat/distro-test-selectors

Conversation

@Tobias-Fischer

Copy link
Copy Markdown
Contributor

Builds on the extends PR (and #162). Its own change is the last commit.

When a test file from tests/ is put into a recipe, if: selectors that test ros_distro are resolved. One test file can then serve several distributions, which matters once they share tests/ through extends. All other selectors (osx, win, …) are left unchanged for rattler-build.

tests:
  - script:
      - if: ros_distro in ["humble", "jazzy"]
        then:
          - if: osx
            then: export ROS_LOCALHOST_ONLY=1 && launch_test smoke_test.py
        else:
          - launch_test smoke_test.py

This replaces the Jinja templating with custom delimiters that RoboStack used to render distribution-specific tests. Its two such tests, converted to these selectors, produce identical recipes.

There's a new test for the resolution, all tests pass, ruff and pyrefly are clean, and the README has a short section.

🤖 Generated with Claude Code

@Tobias-Fischer
Tobias-Fischer force-pushed the feat/distro-test-selectors branch from 649fee9 to 46e8dd0 Compare October 8, 2026 02:15
Tobias-Fischer and others added 5 commits October 10, 2026 14:25
A configuration can extend another one (relative path). Package lists are combined,
mutex_package is merged (run_constraints replaced per package), other keys of the
extending file win. pkg_additional_info.yaml, dependencies.yaml, patches, tests and
conda_index files of every layer are combined, each relative to its configuration.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…a-gha reads the layered configuration

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The recipe refers to patch/<file>; the template copies the patch from its configuration's
patch directory. Before, a path relative to a common root was copied relative to the
working directory, which broke for patches outside it (e.g. with extends).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Selectors that test ros_distro (e.g. if: ros_distro in ["humble", "jazzy"]) are
resolved when a test file is put into a recipe, so one test file serves several
distributions; platform selectors stay for rattler-build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Tobias-Fischer
Tobias-Fischer force-pushed the feat/distro-test-selectors branch from 46e8dd0 to e5b291c Compare October 10, 2026 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant