-
Notifications
You must be signed in to change notification settings - Fork 595
.tools: Fix redundant r.Pass check when 'fail == 0' #174
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
Conversation
|
i'm not seeing the brokenness? vbatts@valse ~/src/opencontainers/specs (fix-dco-validate-on-merges) $ gr .tools/validate.go -range 92a7451...5a654b9
* 5a654b9 .tools: cleanup the commit entry ... PASS
* 041eb73 travis: fix DCO validation for merges ... PASS
* 3f62423 Merge remote-tracking branch 'origin/pr/159' ... PASS
* 712a746 Merge remote-tracking branch 'origin/pr/163' ... PASS
* b1510a7 Merge pull request #172 from laijs/committer ... PASS
* d3a6069 Change the rlimit type to string instead of int ... PASS
* 339e038 Deduplicate the field of RootfsPropagation ... PASS
vbatts@valse ~/src/opencontainers/specs (fix-dco-validate-on-merges) $ gr .tools/validate.go -v -range 92a7451...5a654b9
* 5a654b9 .tools: cleanup the commit entry ... PASS
- has a valid DCO
* 041eb73 travis: fix DCO validation for merges ... PASS
- has a valid DCO
* 3f62423 Merge remote-tracking branch 'origin/pr/159' ... PASS
- merge commits do not require DCO
* 712a746 Merge remote-tracking branch 'origin/pr/163' ... PASS
- merge commits do not require DCO
* b1510a7 Merge pull request #172 from laijs/committer ... PASS
- merge commits do not require DCO
* d3a6069 Change the rlimit type to string instead of int ... PASS
- has a valid DCO
* 339e038 Deduplicate the field of RootfsPropagation ... PASS
- has a valid DCO |
7280f10 to
5282b96
Compare
|
On Thu, Sep 10, 2015 at 12:02:39PM -0700, Vincent Batts wrote:
Your post-#170 phrasing isn't broken, it's just redundant. Details in if _, fail := vr.PassFail(); fail == 0 { How would the internal if check ever not fire? That's why my if _, fail := vr.PassFail(); fail == 0 { This PR does more than just drop the check, but that's what I was |
|
not. because that |
|
On Fri, Sep 11, 2015 at 07:08:31AM -0700, Vincent Batts wrote:
In general, a set may have failures and passes, but your entire loop |
|
i see. I'm wrong here. If pass count is 0 then there is no need for Let's remove this beginings of TAP output. It makes the layout not logical On Fri, Sep 11, 2015 at 10:35 AM, W. Trevor King [email protected]
|
|
On Fri, Sep 11, 2015 at 08:28:29AM -0700, Vincent Batts wrote:
Do you have a different preference for distinguishing passing checks |
The previous version of this script would always pass this check, because when 'fail == 0' was true, all of the messages had passed. That lead to logic like: a. If all checks passed for the commit and the verbose flag is set, print all the messages (which all passed). b. If all checks passed for the commit and the verbose flag is not set, don't print details about any messages (which all passed). c. If any checks failed, print all the failed messages. That wasn't printing successful checks when the verbose flag was true but some checks failed. This commit shifts the logic around to: A. If the verbose flag is set, print messages for all checks, using TAP's "ok" and "not ok" to distinguish between per-check pass/fail [1]. B. If the verbose flag is not set, only print the failed messages (but still keep the "not ok" prefix). In the non-verbose case, then (b/c) and (B) look the same (modulo my "not ok" prefix adjustment). And in the verbose case, I think (A) is preferable to (a/c), because there's no reason to *not* print successful checks when you've enabled the verbose flag. [1]: http://testanything.org/ Signed-off-by: W. Trevor King <[email protected]>
5282b96 to
2d70cd9
Compare
|
On Fri, Sep 11, 2015 at 08:38:14AM -0700, W. Trevor King wrote:
In the absence of feedback here, I've added a follow-up commit |
2d70cd9 to
6beba35
Compare
Using TAP [1] makes it easy to consume the output of this tool in a variety of existing harnesses [2]. Only the verbose results are TAP compliant, mostly because folks aren't likely to care about verbosity if they're just piping the results into a TAP harness. If we end up wanting the non-verbose output to be TAP compliant, we'll have to switch to the trailing count approach explained in the "Unknown amount and failures" section of the spec [1], and we'll have to keep a running counter of failed checks (instead of the current len(DefaultRules)-based approach). [1]: http://testanything.org/tap-version-13-specification.html [2]: http://testanything.org/consumers.html Signed-off-by: W. Trevor King <[email protected]>
6beba35 to
650828c
Compare
|
This was moved to a separate project out of this repo. |
The previous version of this script would never print the success
messages, because when
fail == 0was true, none of the messageswould satisfy
!r.Pass. This commit shifts the logic around to handlethe following cases:
a. If the verbose flag is set, print messages for all checks, using
TAP's "ok" and "not ok" to distinguish between per-check pass/fail.
b. If the verbose flag is not set, only print the failed messages (but
still keep the "not ok" prefix).
Spun off from #170.