Skip to content

[cyclonedx][bugfix] Omitting test_requires - #18873

Merged
franramirez688 merged 4 commits into
conan-io:develop2from
memsharded:test/cyclonedx
Sep 5, 2025
Merged

franramirez688 merged 4 commits into
conan-io:develop2from
memsharded:test/cyclonedx

Conversation

@memsharded

Copy link
Copy Markdown
Member

Changelog: Bugfix: Omit the test_requires when cyclonedx(..., add_test=False)) in all cases, including conan install consumption.
Docs: Omit

Close #18870

Sorry for the extra formatting @ErniGH... 😅 I'll mark the exact fix in a comment

Comment thread conan/tools/sbom/cyclonedx.py Outdated
nodes = [node for node in graph.nodes if (node.context == "host" or add_build) and (not node.test or add_tests)]
name_default += f"/{graph.root.ref.version}" if getattr(graph.root.ref, "version", False) else ""

def should_add_node(n):

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.

This is the fix, making sure no node is added to dependsOn that is not checked against this condition.

Comment thread conan/tools/sbom/cyclonedx.py Outdated

@franramirez688 franramirez688 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👏

@franramirez688 franramirez688 changed the title Test/cyclonedx [cyclonedx][bugfix] Omitting test_requires Sep 4, 2025
@franramirez688
franramirez688 merged commit d9c0ee6 into conan-io:develop2 Sep 5, 2025
26 of 29 checks passed
@memsharded
memsharded deleted the test/cyclonedx branch September 5, 2025 07:35
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.

[question] cyclonedx_1_4 includes test dependencies for special root node

4 participants