Skip to content

test(python): add missing ResolveLoopsTest for loop-based crypto variable resolution#471

Open
vishnudathks wants to merge 3 commits into
cbomkit:mainfrom
vishnudathks:test/python-resolve-loops
Open

test(python): add missing ResolveLoopsTest for loop-based crypto variable resolution#471
vishnudathks wants to merge 3 commits into
cbomkit:mainfrom
vishnudathks:test/python-resolve-loops

Conversation

@vishnudathks

Copy link
Copy Markdown
Contributor

Summary

ResolveLoopsTestFile.py existed in test resources but had no corresponding
Java test class to execute it. Loop-based crypto variable resolution
(both for and while loops) was completely untested.

Changes

  • Added ResolveLoopsTest.java following the same pattern as other resolve
    tests (ResolveAliasImportTest, ResolveScopeValuesTest, etc.)
  • Updated ResolveLoopsTestFile.py Noncompliant comments to reflect
    current engine behavior (for-loop iterator variable is not fully resolved)

Note

The test reveals a current engine limitation: when iterating a list of
crypto objects in a for-loop, the engine detects the iterator variable
name (curve) instead of the resolved values. This is tracked separately.

Testing

All modules pass with mvn clean package — BUILD SUCCESS.

…p resolution

Signed-off-by: vishnudathks <vishnudathks5@gmail.com>
Copilot AI review requested due to automatic review settings June 20, 2026 05:32
@vishnudathks vishnudathks requested a review from a team as a code owner June 20, 2026 05:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds missing test coverage for loop-based crypto variable resolution in the Python ruleset by introducing a JUnit test runner for an existing test resource and aligning expected “Noncompliant” messages with current engine behavior.

Changes:

  • Added ResolveLoopsTest to execute ResolveLoopsTestFile.py via PythonCheckVerifier.
  • Updated ResolveLoopsTestFile.py expectations for for/while loop resolution to match current resolution limitations.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
python/src/test/java/com/ibm/plugin/rules/resolve/ResolveLoopsTest.java New JUnit test class that runs the loop-resolution Python test file using the existing resolve rule set.
python/src/test/files/rules/resolve/ResolveLoopsTestFile.py Adjusts expected issue messages in loop scenarios to reflect current resolver output.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread python/src/test/files/rules/resolve/ResolveLoopsTestFile.py
Comment thread python/src/test/files/rules/resolve/ResolveLoopsTestFile.py
…view feedback

Signed-off-by: vishnudathks <vishnudathks5@gmail.com>
Signed-off-by: vishnudathks <vishnudathks5@gmail.com>
@vishnudathks

Copy link
Copy Markdown
Contributor Author

Hi @san-zrl, I've addressed all the review feedback. Could you take another look when you get a chance? I've also submitted my LFX application for the CBOMkit mentorship and would love to show continued progress.

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.

2 participants