Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide some examples of using matrix-filter #37

Open
taughz opened this issue Dec 4, 2024 · 2 comments · May be fixed by #38
Open

Provide some examples of using matrix-filter #37

taughz opened this issue Dec 4, 2024 · 2 comments · May be fixed by #38

Comments

@taughz
Copy link

taughz commented Dec 4, 2024

I see you can use jq queries to modify the strategy matrix. I would like to only test Python versions 3.10 and later. But I only know basic jq queries, so I'm not sure how to do this. An example would be very helpful. (Anyway, I am reading the jq documentation right now trying to figure it out.)

taughz added a commit to taughz/colcon-ci that referenced this issue Dec 19, 2024
Adds new arguments the `pytest.yaml` reusable workflow, to make it
easier to specify a strategy. To generate the strategy, a small utility
`genstrat.py` has been added. By default, this utility will output a
file identical to the old `strategy.json` (which has been deleted). It
is still possible to use `matrix-filter`, if a user prefers to use that.

Resolves: colcon#37
@taughz taughz linked a pull request Dec 19, 2024 that will close this issue
@taughz
Copy link
Author

taughz commented Dec 19, 2024

I could not figure out how to make jq do what I wanted. (I'm sure it's possible, but I have no interest in learning the jq language just to make trivial modifications.) Instead, I added some more convenient inputs to the workflow in #38. The default behavior is to produce a strategy identical to the current strategy.json, so it is backwards compatible.

@cottsay
Copy link
Member

cottsay commented Jan 27, 2025

This filter does what you want: jq 'del((.matrix.python[] | select(. == "3.8", . == "3.9")), (.matrix.include[] | select(.python == "3.6")))' strategy.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants