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
Removes not needed guard #103
Conversation
Current coverage for WeScan is
|
Files changed | - | - |
---|---|---|
Array+Utils.swift | 100.00% |
✅ |
Current coverage for WeScanSampleProject is 42.86%
✅ No files affecting coverage found
Powered by xcov
Generated by 🚫 Danger
Wouldn’t removing the guard make it return nil if there’s only one Quad instead of the current behavior of returning the only Quad? |
No. |
@justjs, added test to make you sure. |
Thanks for the addition of the test, but what I meant by my previous comment is this: On the old implementation, if you had 2 or more rectangles, it would have returned the bigger one. If you had 1 rectangle, it would return the only rectangle. On the new implementation, as per the documentation ( This is also demonstrated by the |
Yes, that test is passing because it is using 10 rectangles. The CI is failing on the |
Ops, I did miss this part! |
That's weird, seems to be incorrect according to the documentation. However, if that's how it works this PR should work, not sure why the Travis is failing. |
No, documentation is correct! |
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.
Thanks for the contribution! Can you verify why CI is failing?
Sure |
I’ve reviewed the CI error and it seems there was some kind of issue with the snapshot tests. If you’ve try run them locally maybe you can see what the issue is clearer. (In your project folder just run “git submodules init; git submodules update” to install the library used for the tests) |
…ture func on CIDetector fails to find anything on 50x image but succeeds on 150x. Failure lead to force unwrap of nil in tests.
…nc with CIRectangleDetectorTests.swift
…sionRectangleDetectorTests.swift
…in tests to avoid FBSnapshotTestCase mistakingly looking for reference images in ReferenceImages_32 instead of ReferenceImages_64
Hey @valeriyvan, while I understand you are trying to fix the tests, Also, I think it would be better to create a new PR for this, especially as it seems these are improvements to the tests rather than fixes (as the tests pass on all other PRs). Hope that helps 🙂 (Edit: Also, changing the size is not a good idea - while it may fix the tests we should aim to fix the underlying code instead!) |
All tests passing locally. On the server one of snapshot tests fails with failure of loading reference image. FBSnapshotTestCase looks for reference image in ReferenceImages_32 when it is in ReferenceImages_64. According to documentation it should look both before failing. |
Anyway, I can't fix failing test at the moment. Snapshot test still looks for reference image in wrong directory. And tests are passing locally. |
You should listen to @AvdLee over me - I don't work for WeTransfer. But I understood it as fixing the PR, which was causing the tests to fail, while it seems like here the tests have been changed to make them pass. |
The reason of tests failing is not related to this PR. |
I don't see this PR as breaking change. It was innocent change on its own. |
Just to make sure, did you merge in the latest changes from develop into your branch? If so, it's our responsibility to fix CI and make it work again. |
Merged up to date develop |
Can't believe my eyes. |
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.
As you were able to resolve the issues by merging develop, could we remove all the changes to the test in this PR to keep it focused? If the issue was merging develop it should all work, but you can try to remove parts of your changes slowly to see if everything still works. 🙂
Merge of develop haven't resolved issue with broken tests. |
Yes, because you changed the settings for the tests so the old reference images were outdated. |
Any reason why this isn't being merged? |
Waiting on @justjs's approval. |
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.
@Boris-Em I see no issue with this - only thing is that we should be careful as we're changing the reference images.
@justjs as long as our tests are succeeding, this shouldn't be a problem. Do you agree? |
Fair enough, I’m ok with that. Let’s make sure to keep this in mind in case was have future issues with the tests 👍 |
max func works consistently on a sequence of any length.
From documentation:
Returns
The sequence’s maximum element if the sequence is not empty; otherwise, nil.