Skip to content
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

(#106) Introduces Mismatches Matcher to test Matchers #131

Merged
merged 1 commit into from
Jul 20, 2019

Conversation

victornoel
Copy link
Collaborator

This is for #106.

@0crat
Copy link
Collaborator

0crat commented Jun 22, 2019

Job #131 is now in scope, role is REV

@0crat
Copy link
Collaborator

0crat commented Jun 22, 2019

This pull request #131 is assigned to @vzurauskas/z, here is why; the budget is 15 minutes, see §4; please, read §27 and when you decide to accept the changes, inform @llorllale/z (the architect) right in this ticket; if you decide that this PR should not be accepted ever, also inform the architect; this blog post will help you understand what is expected from a code reviewer; there will be no monetary reward for this job

@codecov
Copy link

codecov bot commented Jun 22, 2019

Codecov Report

Merging #131 into master will increase coverage by 0.19%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #131      +/-   ##
============================================
+ Coverage     97.45%   97.65%   +0.19%     
- Complexity      103      108       +5     
============================================
  Files            22       23       +1     
  Lines           236      256      +20     
  Branches          3        3              
============================================
+ Hits            230      250      +20     
  Misses            6        6
Impacted Files Coverage Δ Complexity Δ
...ava/org/llorllale/cactoos/matchers/Mismatches.java 100% <100%> (ø) 5 <5> (?)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 313d2d5...3a33a27. Read the comment docs.

@victornoel
Copy link
Collaborator Author

@vzurauskas ping

@vzurauskas
Copy link
Contributor

@0crat refuse - you're giving me too many PRs in the agenda.

@0crat
Copy link
Collaborator

0crat commented Jun 29, 2019

@0crat refuse - you're giving me too many PRs in the agenda. (here)

@vzurauskas The user @vzurauskas/z resigned from #131, please stop working. Reason for job resignation: Order was cancelled

@0crat
Copy link
Collaborator

0crat commented Jun 29, 2019

Tasks refusal is discouraged, see §6: -15 point(s) just awarded to @vzurauskas/z

@victornoel
Copy link
Collaborator Author

@vzurauskas ping?

@victornoel
Copy link
Collaborator Author

@vzurauskas sorry, didn't see you resigned, ignore me :)

@victornoel
Copy link
Collaborator Author

@llorllale any way to get a review there maybe?

@llorllale
Copy link
Owner

@victornoel please leave a todo for adding a ctor that only accepts the args without the strings

@victornoel
Copy link
Collaborator Author

@llorllale are we sure we want to do that? The point is to test that a matcher is complete in its implementation, descriptions included, if we do this we expose ourselves to undertested matchers then.

@0crat
Copy link
Collaborator

0crat commented Jul 10, 2019

This pull request #131 is assigned to @scristalli/z, here is why; the budget is 15 minutes, see §4; please, read §27 and when you decide to accept the changes, inform @llorllale/z (the architect) right in this ticket; if you decide that this PR should not be accepted ever, also inform the architect; this blog post will help you understand what is expected from a code reviewer; there will be no monetary reward for this job

@llorllale
Copy link
Owner

@victornoel right, disregard my previous comment

@llorllale
Copy link
Owner

@rultor merge

@rultor
Copy link
Collaborator

rultor commented Jul 10, 2019

@rultor merge

@llorllale OK, I'll try to merge now. You can check the progress of the merge here

@rultor
Copy link
Collaborator

rultor commented Jul 10, 2019

@rultor merge

@llorllale @victornoel Oops, I failed. You can see the full log here (spent 3min)

[INFO] artifact org.apache.maven.plugins:maven-clean-plugin: checking for updates from Maven
[INFO] artifact org.apache.maven.plugins:maven-compiler-plugin: checking for updates from Maven
[INFO] artifact org.apache.maven.plugins:maven-dependency-plugin: checking for updates from Maven
[INFO] artifact org.apache.maven.plugins:maven-deploy-plugin: checking for updates from Maven
[INFO] artifact org.apache.maven.plugins:maven-failsafe-plugin: checking for updates from Maven
[INFO] artifact org.apache.maven.plugins:maven-help-plugin: checking for updates from Maven
[INFO] artifact org.apache.maven.plugins:maven-install-plugin: checking for updates from Maven
[INFO] artifact org.apache.maven.plugins:maven-invoker-plugin: checking for updates from Maven
[INFO] artifact org.apache.maven.plugins:maven-jar-plugin: checking for updates from Maven
[INFO] artifact org.apache.maven.plugins:maven-javadoc-plugin: checking for updates from Maven
[INFO] artifact org.apache.maven.plugins:maven-plugin-plugin: checking for updates from Maven
[INFO] artifact org.apache.maven.plugins:maven-release-plugin: checking for updates from Maven
[INFO] artifact org.apache.maven.plugins:maven-resources-plugin: checking for updates from Maven
[INFO] artifact org.apache.maven.plugins:maven-site-plugin: checking for updates from Maven
[INFO] artifact org.apache.maven.plugins:maven-source-plugin: checking for updates from Maven
[INFO] artifact org.apache.maven.plugins:maven-surefire-plugin: checking for updates from Maven
[INFO] artifact org.apache.maven.plugins:maven-war-plugin: checking for updates from Maven
[INFO] artifact org.codehaus.mojo:versions-maven-plugin: checking for updates from Maven
[INFO] artifact org.eluder.coveralls:coveralls-maven-plugin: checking for updates from Maven
[INFO] artifact org.apache.maven.doxia:doxia-module-markdown: checking for updates from Maven
[INFO] artifact org.jacoco:jacoco-maven-plugin: checking for updates from Maven
[INFO] Generating "JavaDocs" report             --- maven-javadoc-plugin:2.10.4:javadoc
[WARNING] Error fetching link: https://github.com/yegor256/cactoos/apidocs/package-list. Ignored it.
[WARNING] Error fetching link: https://github.com/hamcrest/JavaHamcrest/hamcrest-core/apidocs/package-list. Ignored it.
[WARNING] Error fetching link: http://junit.org/apidocs/package-list. Ignored it.
[WARNING] Error fetching link: https://github.com/hamcrest/JavaHamcrest/hamcrest-library/apidocs/package-list. Ignored it.
[WARNING] Error fetching link: https://github.com/mockito/mockito/apidocs/package-list. Ignored it.
[INFO] 
5 warnings
[WARNING] Javadoc Warnings
[WARNING] javadoc: warning - Error fetching URL: http://docs.mockito.googlecode.com/hg/latest/
[WARNING] javadoc: warning - Error fetching URL: http://www.h2database.com/javadoc/
[WARNING] javadoc: warning - Error fetching URL: http://jolbox.com/bonecp/downloads/site/apidocs/
[WARNING] /home/r/repo/src/main/java/org/llorllale/cactoos/matchers/Matches.java:51: warning - Missing closing '}' character for inline tag: "{@code"
[WARNING] /home/r/repo/src/main/java/org/llorllale/cactoos/matchers/Matches.java:51: warning - @Test is an unknown tag.
[INFO] Generating "JaCoCo Aggregate" report     --- jacoco-maven-plugin:0.7.7.201606060606:report-aggregate
[INFO] Generating Sitemap.
[INFO] Rendering 1 generated Doxia document: 1 xdoc
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 22.465 s
[INFO] Finished at: 2019-07-10T22:48:36+00:00
[INFO] Final Memory: 46M/516M
[INFO] ------------------------------------------------------------------------
+ mv /home/r/repo .
++ whoami
+ chown -R root repo
+ '[' -n '' ']'
++ whoami
+ sudo chown -R rultor repo
+ cd repo
+ git push origin master
remote: error: GH006: Protected branch update failed for refs/heads/master.        
remote: error: 2 of 3 required status checks are failing.        
To [email protected]:llorllale/cactoos-matchers.git
 ! [remote rejected] master -> master (protected branch hook declined)
error: failed to push some refs to '[email protected]:llorllale/cactoos-matchers.git'
container 62d2a8545cbd50049dab49001ebcf40193edbf4cc32908d1f1f7f8017ff0e5fe is dead
Thu Jul 11 00:49:32 CEST 2019

@victornoel
Copy link
Collaborator Author

@llorllale is there anyway to bypass the checks? Because there are @todo for adding tests…

Copy link
Contributor

@scristalli scristalli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@victornoel review done, left some comments. I know ARC has already approved and tried to merge, but 0crat assigned REV to me and I thought I'd complete it anyway.

* Assertion is working and throwing errors.
* @checkstyle ProtectedMethodInFinalClassCheck (200 lines)
*/
public final class Mismatches<X> extends TypeSafeDiagnosingMatcher<Matcher<X>> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@victornoel since there is a task for refactoring all matchers to extend MatcherEnvelope, isn't it better to do so from the start here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@scristalli I could, but this would make the Mismatches class very hard to read I believe. When there will be extra code for solving the @todos of the class, it will be even harder. MatcherEnvelope is nice when the 3 implementations of the methods are very simple.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@scristalli see also #135

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@victornoel I see your point, and read the new issue you opened. I still think this creates somewhat of a special case for #129 (and similar) though, should be either clarified or avoided. I think ARC has the final decision here.


// @todo #106:30min Add a description in case the mismatch fails.
// And then introduce some tests to validate that the description
// is properly constructed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@victornoel just a (totally minor) style concern: I always see puzzles with /* */ instead of //. Although this is valid, I think that sticking to the same formatting everywhere can be better for the project.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@scristalli good point, but if I use /* */ I get the following error from qulice:

Checkstyle: src/main/java/org/llorllale/cactoos/matchers/Mismatches.java[145]: Overridden methods should not have Javadoc (NoJavadocForOverriddenMethodsCheck)

@victornoel
Copy link
Collaborator Author

@scristalli thanks for the review, I've answered your comments and pushed some changes that also I hope improve coverage

"does not match lines that do not contain the given strings",
String.format("Tom%nJohn%n"),
new HasLines("Tom", "Mike")
"must not match lines that do not contain the given strings",
Copy link
Contributor

@scristalli scristalli Jul 14, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@victornoel [EDITED] Pardon me, I made a major mistake on one thing I thought had happened (force-pushing messing up review comments, which were only hidden). I guess I shouldn't comment late at night.

[EDITED 2,3] Still, I think force-pushing makes tracking a lot harder. If I just look at the code from the new commit on GitHub, the comment is just gone (because of the line change). If I look at the review (which I must do at this point not to get confused), I have to CTRL+F for "resolved", because I could easily miss the minuscule UI element (see image), even if I wasn't a noob (reason I made a mistake this time). For instance, I could have a lot of REV tasks and not remember making a particular comment.
Not your fault at all, but I just think that with separate commits I'd have less chances to get confused and miss stuff (all comments where I put them even if cropped in UI as "resolved", clean and separate history (see my rant on the "force-pushed" link in cactoos#1154)).

github

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@scristalli yep, I hate the way github works because only the author can resolve comments: in gitlab for example, anybody can mark the comment as resolved and so usually, it is the reviewer that resolve comments, not the PR author. In the future I think I won't resolve any comment anymore to avoid such confusion.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@scristalli I've raised the discussion on telegram if you want to join (https://t.me/zerocracy/7175), I think my position is not as strong as I would think :)

@scristalli
Copy link
Contributor

@llorllale I approve the changes (altough I would point your attention on the discussion on edits on Mismatches.java for a final decision)

@victornoel
Copy link
Collaborator Author

@scristalli @llorllale I've added one more test so that coverage is improved (I was missing the failing case). It's a bit strange because I used mismatch to test mismatch, but I think it's ok for now

@victornoel
Copy link
Collaborator Author

@llorllale ping

@victornoel
Copy link
Collaborator Author

@llorllale could we get this merged please?

@llorllale
Copy link
Owner

@rultor merge

@rultor
Copy link
Collaborator

rultor commented Jul 20, 2019

@rultor merge

@llorllale OK, I'll try to merge now. You can check the progress of the merge here

@rultor rultor merged commit 3a33a27 into llorllale:master Jul 20, 2019
@rultor
Copy link
Collaborator

rultor commented Jul 20, 2019

@rultor merge

@llorllale Done! FYI, the full log is here (took me 3min)

@0crat
Copy link
Collaborator

0crat commented Jul 21, 2019

There is an unrecoverable failure on my side. Please, submit it here:

PID: 4@dddff4c1-9156-49e2-a2d9-cf978c5a9655, thread: pool-11-thread-4
com.zerocracy.farm.sync.SyncProject[76] java.lang.IllegalStateException: Failed to acquire "wbs.xml" in "C63314D6Z" in 2min: java.util.concurrent.locks.ReentrantLock@6d09edc9[Locked by thread pool-470-thread-1]

0.48.2: CID: f7145179-e29c-4c15-8bc7-a38593179a31, Type: "Close job"

@0crat
Copy link
Collaborator

0crat commented Jul 21, 2019

There is an unrecoverable failure on my side. Please, submit it here:

PID: 4@dddff4c1-9156-49e2-a2d9-cf978c5a9655, thread: pool-11-thread-4
com.zerocracy.farm.sync.SyncProject[76] java.lang.IllegalStateException: Failed to acquire "orders.xml" in "C63314D6Z" in 2min: java.util.concurrent.locks.ReentrantLock@6d09edc9[Locked by thread pool-470-thread-1]

0.48.2: CID: f7145179-e29c-4c15-8bc7-a38593179a31, Type: "Close job"

@victornoel victornoel deleted the 106-mismatches branch July 21, 2019 08:15
@scristalli
Copy link
Contributor

@llorllale 0crat is failing here, is it possible to manually issue 0crat out?

@0crat
Copy link
Collaborator

0crat commented Jul 26, 2019

The job #131 is now out of scope

@0crat
Copy link
Collaborator

0crat commented Jul 26, 2019

Code review was too long (15 days), architects (@llorllale) were penalized, see §55

@0crat
Copy link
Collaborator

0crat commented Jul 26, 2019

@sereshqua/z please review this job completed by @scristalli/z, as in §30; the job will be fully closed and all payments will be made when the quality review is completed

@sereshqua
Copy link

@scristalli please make sure that you will find at least three problems in the code during next CR (ones, that will be accepted and fixed)

@0crat
Copy link
Collaborator

0crat commented Jul 26, 2019

Payment to ARC for a closed pull request, as in §28: +10 point(s) just awarded to @llorllale/z

@scristalli
Copy link
Contributor

@sereshqua please double check, I think I challenged DEV on three points here (altough some were minor/open for discussion).

@sereshqua
Copy link

@scristalli how many were actually fixed? :) i discussed with Kirill (architect in zerocracy) and he told that the actual fixed ones should be counted

@scristalli
Copy link
Contributor

@sereshqua I see, I wasn't aware of that. Regarding your first comment: I always try to challenge DEV on at least three points, too bad sometimes I am wrong (like in this case) or the PR is just too small. I know you are supposed to ask me every time, but this is what I will always answer: OK, I'll try even harder :)

@sereshqua
Copy link

@scristalli yeap :) it all makes sense what you are saying, agree with you, but that is the part of the job :)

@sereshqua
Copy link

@0crat quality acceptable

@0crat
Copy link
Collaborator

0crat commented Jul 27, 2019

Order was finished, quality is "acceptable": +15 point(s) just awarded to @scristalli/z

@0crat
Copy link
Collaborator

0crat commented Jul 27, 2019

Quality review completed: +4 point(s) just awarded to @sereshqua/z

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants