-
Notifications
You must be signed in to change notification settings - Fork 24
Fix: Fix rst based tests #537
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,7 +31,7 @@ | |
|
|
||
|
|
||
| .. Positive Test: Child requirement QM. Parent requirement has the correct related safety level. Parent requirement is `QM`. | ||
| #EXPECT-NOT: feat_req__child__1: Parent need `feat_req__parent__QM` does not fulfill condition `safety == QM`. Explanation: An ASIL requirement must link at least one parent/upstream ASIL requirement for correct decomposition. Please ensure the parent’s safety level is QM and its status is valid. | ||
| #EXPECT-NOT: safety | ||
|
|
||
| .. feat_req:: Child requirement 1 | ||
| :id: feat_req__child__1 | ||
|
|
@@ -41,7 +41,7 @@ | |
|
|
||
|
|
||
| .. Positive Test: Child requirement ASIL B. Parent requirement has the correct related safety level. Parent requirement is `QM`. | ||
| #EXPECT-NOT: feat_req__child__2: Parent need `feat_req__parent__ASIL_B` does not fulfill condition `safety == QM`. Explanation: An ASIL requirement must link at least one parent/upstream ASIL requirement for correct decomposition. Please ensure the parent’s safety level is QM and its status is valid. | ||
| #EXPECT-NOT: safety | ||
|
|
||
| .. feat_req:: Child requirement 2 | ||
| :id: feat_req__child__2 | ||
|
|
@@ -62,17 +62,6 @@ | |
|
|
||
|
|
||
|
|
||
| .. Parent requirement does not exist | ||
| #EXPECT: unknown outgoing link | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why remove this test?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a sphinx-needs warning / error. Not one of our own. I do not think we should start testing sphinx-needs functionality. |
||
|
|
||
| .. feat_req:: Child requirement 4 | ||
| :id: feat_req__linking_to_unknown_parent | ||
| :safety: ASIL_B | ||
| :status: valid | ||
| :satisfies: feat_req__parent0__abcd | ||
|
|
||
|
|
||
|
|
||
| .. Mitigation of Safety Analysis (FMEA and DFA) shall be checked. Mitigation shall have the same or higher safety level than the analysed item. | ||
| .. Negative Test: Linked to a mitigation that is lower than the safety level of the analysed item. | ||
| #EXPECT: feat_saf_dfa__child__5: Parent need `feat_req__parent__QM` does not fulfill condition `safety != QM`. Explanation: An ASIL_B safety requirement must link to a ASIL_B requirement. Please ensure that the linked requirements safety level is not QM and it's status is valid. | ||
|
|
@@ -85,7 +74,7 @@ | |
|
|
||
|
|
||
| .. Positive Test: Linked to a mitigation that is equal to the safety level of the analysed item. | ||
| #EXPECT-NOT: feat_saf_dfa__child__6: Parent need `feat_req__parent__ASIL_B` does not fulfill condition `safety != QM`. Explanation: An ASIL_B safety requirement must link to a ASIL_B requirement. Please ensure that the linked requirements safety level is not QM and it's status is valid. | ||
| #EXPECT-NOT: safety | ||
|
|
||
| .. feat_saf_dfa:: Child requirement 6 | ||
| :id: feat_saf_dfa__child__6 | ||
|
|
@@ -106,7 +95,7 @@ | |
|
|
||
|
|
||
| .. Positive Test: Linked to a mitigation that is equal to the safety level of the analysed item. | ||
| #EXPECT-NOT: comp_saf_dfa__child__8: Parent need `feat_req__parent__ASIL_B` does not fulfill condition `safety != QM`. Explanation: An ASIL_B safety requirement must link to a ASIL_B requirement. Please ensure that the linked requirements safety level is not QM and it's status is valid. | ||
| #EXPECT-NOT: safety | ||
|
|
||
| .. comp_saf_dfa:: Child requirement 8 | ||
| :id: comp_saf_dfa__child__8 | ||
|
|
@@ -127,7 +116,7 @@ | |
|
|
||
|
|
||
| .. Positive Test: Linked to a mitigation that is equal to the safety level of the analysed item. | ||
| #EXPECT-NOT: feat_saf_dfa__child__10: Parent need `feat_req__parent__ASIL_B` does not fulfill condition `safety != QM`. Explanation: An ASIL_B safety requirement must link to a ASIL_B requirement. Please ensure that the linked requirements safety level is not QM and it's status is valid. | ||
| #EXPECT-NOT: safety | ||
|
|
||
| .. feat_saf_dfa:: Child requirement 10 | ||
| :id: feat_saf_dfa__child__10 | ||
|
|
@@ -148,7 +137,7 @@ | |
|
|
||
|
|
||
| .. Positive Test: Linked to a mitigation that is equal to the safety level of the analysed item. | ||
| #EXPECT-NOT: feat_saf_fmea__child__12: Parent need `feat_req__parent__ASIL_B` does not fulfill condition `safety != QM`. Explanation: An ASIL_B safety requirement must link to a ASIL_B requirement. Please ensure that the linked requirements safety level is not QM and it's status is valid. | ||
| #EXPECT-NOT: safety | ||
|
|
||
| .. feat_saf_fmea:: Child requirement 12 | ||
| :id: feat_saf_fmea__child__12 | ||
|
|
@@ -159,7 +148,7 @@ | |
|
|
||
|
|
||
| .. Positive Test: Linked to a mitigation that is higher to the safety level of the analysed item. | ||
| #EXPECT-NOT: feat_saf_fmea__child__13: Parent need `feat_req__parent__ASIL_B` does not fulfill condition `safety != QM`. Explanation: An ASIL_B safety requirement must link to a ASIL_B requirement. Please ensure that the linked requirements safety level is not QM and it's status is valid. | ||
| #EXPECT-NOT: safety | ||
|
|
||
| .. feat_saf_fmea:: Child requirement 13 | ||
| :id: feat_saf_fmea__child__13 | ||
|
|
@@ -179,8 +168,7 @@ | |
|
|
||
|
|
||
| .. Positive Test: Linked to a mitigation that is equal to the safety level of the analysed item. | ||
| #EXPECT-NOT: comp_saf_fmea__child__15: Parent need `feat_req__parent__ASIL_B` does not fulfill condition `safety != QM`. Explanation: An ASIL_B safety requirement must link to a ASIL_B requirement. Please ensure that the linked requirements safety level is not QM and it's status is valid. | ||
|
|
||
| #EXPECT-NOT: safety | ||
| .. comp_saf_fmea:: Child requirement 15 | ||
| :id: comp_saf_fmea__child__15 | ||
| :safety: ASIL_B | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,13 +13,6 @@ | |
| # ******************************************************************************* | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AI-assisted review (Claude): Important: This test verified that "feature deeper in path is explicitly allowed" behavior. If the old EXPECT-NOT was a no-op (as claimed), the rule's behavior for this case was never actually verified. Two outcomes are possible:
Please verify by running the test locally with the fix applied. If the rule is correct, restore this test in the new generic style.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I could re-enable this test by renaming the need, or creating more folders. As the current folder structure is not carried onto the error message (it's just '/' it doesn't go deeper than 1 folder). What would be preferred here? |
||
| #CHECK: id_contains_feature | ||
|
|
||
| .. Feature is deeper in the path of the RST file | ||
| .. This is now explicitly allowed | ||
| #EXPECT-NOT: std_wp__test__abcd.id (std_wp__test__abcd): Feature 'test' not in path | ||
|
|
||
| .. std_wp:: This is a test | ||
| :id: std_wp__test__abcd | ||
|
|
||
| .. Feature is in the path of the RST file | ||
| #EXPECT-NOT: Feature 'id_contains_feature' not in path | ||
|
|
||
|
|
||
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.
AI-assisted review (Claude):
Important: This removes a positive test (
#EXPECT) for link validation against a non-existent parent. The prior EXPECT-NOT tests were no-ops — this EXPECT test is different. Removing it drops the assertion that the rule produces a warning for unknown outgoing links entirely.The likely root cause: the warning from sphinx-needs (
unknown outgoing link) doesn't contain"score_metamodel", so it gets filtered out by the new pre-filter on line 208. But the fix should be to handle that at the filter level, not to silently drop test coverage.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.
This is a sphinx-needs warning / error. Not one of our own. I do not think we should start testing sphinx-needs functionality.
This did not work before either (as we filter on just errors coming from score_metamodel).