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

1343 - replacing static MatcherAssert.assertThat with Assertion object #1344

Merged
merged 5 commits into from
Apr 29, 2020

Conversation

lxpdd
Copy link
Contributor

@lxpdd lxpdd commented Apr 20, 2020

1343

  • Changed calling static method MatcherAssert.assertThat for Assertion object
  • Remove unused imports after that
  • copiesFromCharSequenceToPath method was the duplicates of copiesFromCharSequenceToFile
    and I've changed it, now it calls what it supposed to call.

Copy link
Collaborator

@victornoel victornoel left a comment

Choose a reason for hiding this comment

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

@lxpdd here are two comments. Also I see you fixed this for many packages while the todo was about the io package.

And is there any more MatcherAssert in the cactoos code? If yes please add a new todo for the remaining ones, if no please add MatcherAssert.assertThat to the forbidden api file as explained in the todo.

In any case, you need to remove the todo you fixed too.

@@ -52,7 +52,8 @@ public void copiesFromCharArrayWithCharsetToFile() throws IOException {
final String input =
"Hello, товарищ file #1 äÄ üÜ öÖ and ß";
final File output = this.folder.newFile();
MatcherAssert.assertThat(
new Assertion<>(
Copy link
Collaborator

@victornoel victornoel Apr 22, 2020

Choose a reason for hiding this comment

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

@lxpdd you need to call affirm() on all the Assertion objects for the assertion to be verified. Currently those tests do nothing.

@@ -52,7 +52,8 @@ public void copiesFromCharArrayWithCharsetToFile() throws IOException {
final String input =
"Hello, товарищ file #1 äÄ üÜ öÖ and ß";
final File output = this.folder.newFile();
MatcherAssert.assertThat(
new Assertion<>(
"char array can't be copied to the file with charset UTF_8",
Copy link
Collaborator

@victornoel victornoel Apr 22, 2020

Choose a reason for hiding this comment

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

@lxpdd please use the positive form with must (e.g., "char array must be copied to the file with charset UTF_8") everywhere

@victornoel
Copy link
Collaborator

@0crat status

@0crat
Copy link
Collaborator

0crat commented Apr 23, 2020

@0crat status (here)

@victornoel This is what I know about this job in C63314D6Z, as in §32:

  • The job #1344 is in scope for 2days
  • The role is REV
  • The job is assigned to @victornoel/z for 2days
  • There is no monetary reward attached, it's a free job
  • The job doesn't have any impediments
  • The budget is 15 minutes/points
  • These users are banned and won't be assigned:
    • @iiylll/z: This user reported the ticket
  • Job footprint (restricted area)

@victornoel
Copy link
Collaborator

victornoel commented Apr 25, 2020

@lxpdd ping

2) change message in test to positive form
3) add new TODO
@lxpdd
Copy link
Contributor Author

lxpdd commented Apr 27, 2020

@victornoel I fixed that problem in multiple packages because there was only 3 classes in io packages.

@@ -52,7 +52,8 @@ public void copiesFromCharArrayWithCharsetToFile() throws IOException {
final String input =
"Hello, товарищ file #1 äÄ üÜ öÖ and ß";
final File output = this.folder.newFile();
MatcherAssert.assertThat(
new Assertion<>(
Copy link
Collaborator

@victornoel victornoel Apr 27, 2020

Choose a reason for hiding this comment

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

@lxpdd you are missing affirm() on this one

@@ -25,6 +25,10 @@
/**
* Scalars, tests.
*
* @todo #1350:30min Continue replacing usage of MatcherAssert.assertThat with
Copy link
Collaborator

@victornoel victornoel Apr 27, 2020

Choose a reason for hiding this comment

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

@lxpdd the bug you are fixing is not 1350 but 1343 I believe, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, but how could I add another TODO if I didn't replace all MatcherAssert.assertThat in the project?

Copy link
Collaborator

@victornoel victornoel Apr 27, 2020

Choose a reason for hiding this comment

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

@lxpdd the principle is the following: when you add a todo, you start it with #xxx:30min with xxx being the ticket currently being solved. so that when someone solve your todo, then know where does it come from.

So, currently you are solving the ticket #1343, then because we consider that there is more work to finish the ticket you are doing, you remove the previous todo and you need to add a new todo starting with #1343:30min so that someone else can continue the work until there are no MatcherAssert.assertThat in the project.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

okay, I fixed that, could you check it, please?

@victornoel
Copy link
Collaborator

victornoel commented Apr 27, 2020

@lxpdd see my last two comments

@codecov-io
Copy link

codecov-io commented Apr 27, 2020

Codecov Report

Merging #1344 into master will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1344      +/-   ##
============================================
+ Coverage     89.60%   89.61%   +0.01%     
- Complexity     1653     1654       +1     
============================================
  Files           273      274       +1     
  Lines          3933     3937       +4     
  Branches        211      211              
============================================
+ Hits           3524     3528       +4     
+ Misses          376      375       -1     
- Partials         33       34       +1     
Impacted Files Coverage Δ Complexity Δ
src/main/java/org/cactoos/scalar/Solid.java 90.00% <0.00%> (-10.00%) 3.00% <0.00%> (-1.00%)
src/main/java/org/cactoos/scalar/ScalarOf.java 75.00% <0.00%> (ø) 1.00% <0.00%> (?%)
src/main/java/org/cactoos/io/TeeInput.java 98.64% <0.00%> (+1.35%) 72.00% <0.00%> (+1.00%)

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 ef07ee7...108c749. Read the comment docs.

@victornoel
Copy link
Collaborator

victornoel commented Apr 27, 2020

@lxpdd thanks :)

@paulodamaso good to merge

@victornoel
Copy link
Collaborator

@paulodamaso ping

@paulodamaso
Copy link
Contributor

@iiylll @victornoel Thank you guys

@paulodamaso
Copy link
Contributor

@rultor merge

@rultor
Copy link
Collaborator

rultor commented Apr 29, 2020

@rultor merge

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

@rultor rultor merged commit 98af1ac into yegor256:master Apr 29, 2020
@rultor
Copy link
Collaborator

rultor commented Apr 29, 2020

@rultor merge

@paulodamaso Done! FYI, the full log is here (took me 9min)

@0crat 0crat added the qa label Apr 29, 2020
@0crat
Copy link
Collaborator

0crat commented Apr 29, 2020

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

@0crat
Copy link
Collaborator

0crat commented Apr 29, 2020

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

@0crat 0crat removed the scope label Apr 29, 2020
@sereshqua
Copy link

@victornoel as @iiyll user's acc does not exist already, i still have to put quality acceptable here, because he was not starting his comments with the name of the user, see

@sereshqua
Copy link

@0crat quality acceptable

@0crat
Copy link
Collaborator

0crat commented Apr 30, 2020

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

PID: 4@4ea0ebc5-1e90-4d29-b5a1-8c93eef19bcd, thread: pool-1405-thread-1
java.lang.Thread[-2] java.lang.OutOfMemoryError: unable to create new native thread

0.53.13: Issue: #1344, Comment: 621595801

@victornoel
Copy link
Collaborator

@sereshqua its user account name just changed after the PR was merged :) I updated my comments anyway now.

Can you re-assert quality? it didn't seem to work

@sereshqua
Copy link

@0crat quality acceptable

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

Successfully merging this pull request may close these issues.

7 participants