-
Notifications
You must be signed in to change notification settings - Fork 685
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
New Rules Must Have a prodtype
#11252
New Rules Must Have a prodtype
#11252
Conversation
Skipping CI for Draft Pull Request. |
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.
It works as expected. I have removed prodtype from 2 random rules and it detected it and failed.
1/2 Test #9: test-rule-dir-json .................... Passed 15.32 sec
test 39
Start 39: test-no-new-global-applicable-rules
39: Test command: /usr/bin/env "PYTHONPATH=/home/jcerny/work/git/scap-security-guide" "/usr/bin/python3" "/home/jcerny/work/git/scap-security-guide/utils/no_new_global_applicable_rules.py" "--root" "/home/jcerny/work/git/scap-security-guide" "--json" "/home/jcerny/work/git/scap-security-guide/build/rule_dirs.json"
39: Working Directory: /home/jcerny/work/git/scap-security-guide/build/tests
39: Test timeout computed to be: 10000000
39: Rule service_timesyncd_root_distance_configured doesn't have a prodtype and it is expected to. You must add one.
39: Rule service_timesyncd_configured doesn't have a prodtype and it is expected to. You must add one.
2/2 Test #39: test-no-new-global-applicable-rules ...***Failed 0.26 sec
The following tests passed:
test-rule-dir-json
50% tests passed, 1 tests failed out of 2
Label Time Summary:
quick = 15.32 sec*proc (1 test)
Total Test time (real) = 15.59 sec
The following tests FAILED:
39 - test-no-new-global-applicable-rules (Failed)
Errors while running CTest
To ensure that people are noticed before CI.
/packit retest-failed |
return expected_set | ||
|
||
|
||
def _get_current_noprodtypes(rule_dirs): |
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.
Code Climate wants you to simplify this function
Code Climate has analyzed commit de666d5 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 58.8%. View more on Code Climate. |
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.
jcerny@fedora ~/work/git/scap-security-guide/build (pr/11252) $ ctest --output-on-failure -R test-no-new-global-applicable-rules
Test project /home/jcerny/work/git/scap-security-guide/build
Start 6: test-rule-dir-json
1/2 Test #6: test-rule-dir-json .................... Passed 15.69 sec
Start 25: test-no-new-global-applicable-rules
2/2 Test #25: test-no-new-global-applicable-rules ...***Failed 0.27 sec
Rule service_timesyncd_configured doesn't have a prodtype and it is expected to. You must add one.
50% tests passed, 1 tests failed out of 2
Label Time Summary:
quick = 15.69 sec*proc (1 test)
Total Test time (real) = 15.97 sec
The following tests FAILED:
25 - test-no-new-global-applicable-rules (Failed)
Errors while running CTest
jcerny@fedora ~/work/git/scap-security-guide/build (pr/11252) $
Thanks for this great improvement!
Description:
This adds a test that checks
Rationale:
This will be helpful in the future when we move prodtypes.
Review Hints:
Remove a prodtype rule and watch the new test fail.