-
Notifications
You must be signed in to change notification settings - Fork 217
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 #1130, add test case types similar to NA #1131
Fix #1130, add test case types similar to NA #1131
Conversation
As an initial proposal, suggesting the words "SKIP" and "SOFT" for the new test cases. Both are functionally identical to the existing NA, except:
|
769e967
to
c6f6e6b
Compare
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.
Can this also update the OSAL Test that use UtAssert_NA and should be UtAssert_SKIP now.
I reviewed all the uses of |
Jumping into the naming world, what about replacing SOFT with WARN? |
Nope -- not a warning at all! It is really a "don't care" |
Further thought - if anything the "SKIP" should maybe be "WARN" - because a skipped test, in this context, is something the user might be concerned about. For practicality/flexibility reasons we don't consider this a hard failure in the test - as a developer you want to be able to run this without getting nuisance failures - but in the context of a "run for the record" you would definitely want to see the SKIP (or, possibly WARN) count be 0. |
What are some use cases for SOFT? That'll help me think about it. |
In short, this type of log entry can pass a test case, but never fail a test case. The impetus/motivation for this is the CFE cases where there are more than one possible "acceptable" value. The test code checks one at a time via the CFE_Assert_STATUS_MAY_BE macro (also new) which uses the SOFT casetype - at least in the proposal. In this context, if it does match, then great - its a PASS. But if it does not match - that's a don't care, because there are other values it could be that might be acceptable. In fact, we don't even need to see it in the test log by default (it's just clutter if you include it). |
I really like |
I am fine with WARN instead of SKIP. I really don't like FALSE instead of SOFT, I would say changing that to SKIP would make more sense since we are in essence skipping over it if it doesn't give us what we want. HIDE could also work, since we are hiding the fails we don't care about. |
I'd be good with renaming as follows:
I think this conveys the right information to the user (noting that they won't even see item 2 by default, it's hidden, so unlikely to cause any confusion there). |
I vote for the 2nd case to return |
Yes, I was starting to update for this name change and came to the same conclusion. SKIP maybe isn't the best name, the test was not actually skipped, its just that we don't care about the fact that it evaluated false. Ideally, I'd prefer to have named it |
The only thing I don't like about FALSE is that it doesn't seem to convey that its OK that it's false. I would read that in the log similar to "FAIL". That is, if you see things evaluating false, you might think there is something wrong. I would prefer a term that emphasized that its OK to be false here. |
The part I don't like about |
In other words, the fact the result was |
Fair point. I just pushed an update with "DONTCARE" as food for thought, but I'm warming up to the "FALSE" term. |
I also like that it is the actual return of the function call also, so not a "new" term. |
One more thought - this "casetype" is really just documenting the test flow at this point. That is, it is saying that the test checked for this condition, which in turn guides where it goes next. So what about something like "FLOW" or "TRACE", documented as:
|
That's actually part of what I don't like, because it does not necessarily return false. In the case of the MAY_BE macro, if it does match, then it returns true ... |
I was just making a suggestion about what gets logged in the brackets. I prefer a |
I'm not making any sense anymore (I don't think)... with the MAY_BE test for the |
For the most part, I agree, except when it comes down to putting Lines 590 to 606 in ce11e7a
The intent is to provide just a general printf-like utility to log any message. For example, The part that I struggle with is that it would be perfectly valid for a test implementer to document their own internal decision tree via something like:
But you'll see in the log (if you run with verbose, anyway): [FALSE] 48.006 test.c: - Checked condition X, result was Y The key is, there's nothing "FALSE" about that statement - its a flow/trace message. The only reason "FALSE" tag makes sense is specifically for the |
CCB:2021-08-18 APPROVED
|
Latest update just changes the tag/casetype to "FLOW" - again this is the tag assigned to a general-purpose informational line in the file, it is not strictly limited to boolean conditions. The information can be anything related to the control flow of the test. Will update nasa/cFE#1816 with actual examples (see there) |
Add two more test case variants, similar to NA, where failure of the test case does not translate to failure of the overall test: - UTASSERT_CASETYPE_WARN - UTASSERT_CASETYPE_FLOW The additional cases have different levels of default visibility, and may be handled differently by the end user. That is, some tests may be skipped because they are truly NA (and nothing for the user to do to change that) and some tests may be skipped because the system was not set up in a way that allowed them to be run (and the user must fix that and re-run). For the latter case, the WARN type can be used, to more clearly indicate it is an action item for the user. Lastly the "FLOW" message is intended to indicate internal decisions in the test case implementation (not actual test cases).
e58b85a
to
70bb29b
Compare
Updated to reflect latest discussions, and also rebased to latest "main" branch. Hopefully this one is a keeper. NOTE: as part of this exercise I noted that we duplicated the "switch" statement which gets the abbreviated casetype name in CFE. This update also moves this switch statement into a separate function that CFE can call (so it does not need to be repeated there). |
Do we want to make WARN also fail CI? Like TSF/TTF/FAIL? |
Hard NO. WARN is there for when you are doing a final certification check. CI is more to make sure it's not broken. |
I disagree there. CI should put you in the correct configuration for the test, so you shouldn't ever see a WARN. For open source, CI is the cert (or at least that's the point, continuous verification of meeting all the requirements, etc). In other words, if you see a WARN during CI your CI is misconfigured. |
**Combines** nasa/cFE# v6.8.0-rc1+dev933 nasa/osal# v5.1.0-rc1+dev594 **Includes** *osal* nasa/osal#1131, add test case types similar to NA *cFE* nasa/cFE#1803, Add software bus tests nasa/cFE#1756, separate variable for OSAL status nasa/cFE#1809, increase SB pool max size bucket nasa/cFE#1842, Add Null check for CFE_ResourceId_FindNext nasa/cFE#1828, Improve TBL coverage tests nasa/cFE#1833, Clean up Message ID Functional Test #1824, Add missing cases for msg id func tests nasa/cFE#1832, Combine SB Set/Get message characteristics group #1831, Consolidate msg get/set doxygen group nasa/cFE#1836, Adding coverage tests to cFE TIME nasa/cFE#1848, enable strict resource id w/OMIT_DEPRECATED nasa/cFE#1845, HOTFIX IC-20210819, type correction TBL coverage test nasa/cFE#1806, Add test for ES BackgroundWakeup nasa/cFE#1813, Success Test for CFE_ES_RestartApp nasa/cFE#1814, Subscribe to Message Limit Greater Than CFE_PLATFORM_SB_DEFAULT_MSG_LIMIT nasa/cFE#1811, Success Test for CFE_ES_GetMemPoolStats nasa/cFE#1822, Group MSG APIs documentation by header type nasa/cFE#1816, add retroactive CFE status asserts nasa/cFE#1854, remove unused CFE_TBL_ERR_BAD_APP_ID nasa/cFE#1855, correct syslog message in pool create nasa/cFE#1853, remove unused CFE_ES_POOL_BOUNDS_ERROR nasa/cFE#1859, remove unused CFE_TBL_ERR_FILE_NOT_FOUND nasa/cFE#1856, Check error ctr to TransmitMsg test nasa/cFE#1857, End Child Task requirement remove error code nasa/cFE#1782, Add functional tests for resource misc Co-authored-by: Jacob Hageman <[email protected]> Co-authored-by: Joseph Hickey <[email protected]> Co-authored-by: Alex Campbell <[email protected]> Co-authored-by: Niall Mullane <[email protected]> Co-authored-by: Ariel Adams <[email protected]> Co-authored-by: Jose F Martinez Pedraza <[email protected]>
Describe the contribution
Add two more test case variants, similar to NA, where failure of the test case does not translate to failure of the overall
test.
The additional cases have different levels of default visibility, and may be handled differently by the end user. That is, some
tests may be skipped because they are truly NA (and nothing for the user to do to change that) and some tests may be skipped
because the system was not set up in a way that allowed them to be run (and the user must fix that and re-run).
Fixes #1130
Testing performed
Build and run all tests. Also modify CFE test to use new casetype, confirm working as expected.
Expected behavior changes
None
System(s) tested on
Ubuntu
Additional context
Intended to differentiate between the nuances of all tests that are currently marked "N/A". For some cases, its purely informational because the check does not apply, and nothing more needs to be done. For other cases, a test might be skipped because the user did not start the system in a way where the tests could be run, and the user should correct that. Lastly, for some cases, the condition was NA simply because there was more than one acceptable result for that test case.
For the first two, they should remain visible in the log by default, because they add some value to indicate what was (and was not) tested. However the first requires no action of the user, and the second does require the user to correct something, so they should be marked differently. The third is only relevant to software developers, it doesn't add much value to the log, so it can be hidden by default, but can still be seen by increasing the test verbosity to the debug level.
Contributor Info - All information REQUIRED for consideration of pull request
Joseph Hickey, Vantage Systems, Inc.