-
Notifications
You must be signed in to change notification settings - Fork 55
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
fix: xccdf to oscal-ar #1336
fix: xccdf to oscal-ar #1336
Conversation
Signed-off-by: degenaro <lou.degenaro@gmail.com>
Signed-off-by: degenaro <lou.degenaro@gmail.com>
Signed-off-by: degenaro <lou.degenaro@gmail.com>
Signed-off-by: degenaro <lou.degenaro@gmail.com>
Signed-off-by: degenaro <lou.degenaro@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The general comment is that test data (especially for xccdf) can be generated on the fly instead of having multiple nearly identical test files. It is always easier to maintain the test data via code rather than hardcoded files
def test_xccdf_print_info(tmp_path): | ||
"""Test print_info call.""" | ||
config = setup_config(cf01) | ||
section = config['task.xccdf-result-to-oscal-ar'] | ||
section['output-dir'] = str(tmp_path) | ||
tgt = xccdf_result_to_oscal_ar.XccdfResultToOscalAR(section) | ||
retval = tgt.print_info() | ||
assert retval is None | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot of test cases here test similar things, I would recommend looking into @pytest.mark.parametrize
to reduce the duplicated tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's the thing: this is a rework of trestle task osco-result-to-oscal-ar
to change its name to xccdf-result-to-oscal-ar
. As much as possible I re-used existing data and code. I could upgrade the test cases here as you suggest, but that seems like a different issue than renaming the task. Eventually osco-result-to-oscal-ar
should be removed, but that can be saved for the next breaking release. If you agree, I can open another issue to improve existing task
test cases, since many already have this same issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, in such case we can leave it until the next time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - please create an issue to remove duplicated data/tests
Issue opened #1362 |
Types of changes
develop
->main
)Quality assurance (all should be covered).
Summary
Both task
osco-result-to-oscal-ar
andxccdf-result-to-oscal-ar
can co-exist. The former can be removed at next major release.Fixes issue #1329
Key links:
Before you merge