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

Storage\Maildir fixes + enable unit tests #82

Merged
merged 27 commits into from
Apr 1, 2020
Merged

Storage\Maildir fixes + enable unit tests #82

merged 27 commits into from
Apr 1, 2020

Conversation

fredden
Copy link
Contributor

@fredden fredden commented Mar 21, 2020

Q A
Documentation no
Bugfix yes
BC Break no
New Feature no
RFC no
QA yes

Description

Increase test coverage. While test coverage is low, the GitHub status check from coverage is reporting failure on every pull request. While this change alone is unlikely to bring coverage above the threshold, it'll help.

Copy link
Member

@michalbundyra michalbundyra left a comment

Choose a reason for hiding this comment

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

@fredden Thanks for your PR.

Please see information about DCO and signoff:
https://github.com/laminas/.github/blob/master/CONTRIBUTING.md#about-the--s-flag
We need it in order to accept your patch. Sorry for inconvenience.

Here you will see instruction how you can change it in your PR:
https://github.com/laminas/laminas-mail/pull/82/checks?check_run_id=524109291

General note to your changes, without looking into details:
you are using arguments in assertions in wrong order - the first is the expected value, and the second actual, so we should have usually something like that:

$this->assertSame(12, $class->something());

not:

$this->assertSame($class->someting(), 12);

The result is of course the same, but error message in case of failure will be misleading.

Signed-off-by: Dan Wallis <mrdanwallis@gmail.com>
@fredden fredden requested a review from michalbundyra March 21, 2020 15:56
fredden added 4 commits March 21, 2020 16:15
Signed-off-by: Dan Wallis <mrdanwallis@gmail.com>
Signed-off-by: Dan Wallis <mrdanwallis@gmail.com>
Signed-off-by: Dan Wallis <mrdanwallis@gmail.com>
Signed-off-by: Dan Wallis <mrdanwallis@gmail.com>
Copy link
Member

@michalbundyra michalbundyra left a comment

Choose a reason for hiding this comment

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

@fredden Thanks for you effort! 👍 In general it's great, but I do not understand some changes. I've added also couple suggestions, so please have a look when you have time and let me know what you think. Thanks :)

src/Storage/Folder/Maildir.php Show resolved Hide resolved
src/Storage/Folder/Maildir.php Show resolved Hide resolved
@@ -133,7 +133,7 @@ public function getSize($id = null)
public function getMessage($id)
{
// TODO that's ugly, would be better to let the message class decide
if ($this->messageClass === Message\File::class
if (\trim($this->messageClass, '\\') === Message\File::class
Copy link
Member

Choose a reason for hiding this comment

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

Can you explain this change, please? Do we have any tests for that? It looks like a bugfix as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we have tests: yes. They're disabled by default at present. I'm working on these separately. I'll move this bugfix to that branch.

Copy link
Member

Choose a reason for hiding this comment

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

@fredden before I start reviewing it again just a quick question: you were saying about extracting bugfixes into separate PR - is it still a plan? I can still see all changes here. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was going to move all the maildir test fixes to a separate pull request, but decided to leave here. If I move the bugfixes to a separate pull request then the testsuite will fail here until that lands. (The tests were being skipped by default, but run now.)

I'm happy to go with your recommendation. (Moving to a separate pull request isn't a lot of work.)

test/AddressListTest.php Show resolved Hide resolved
test/Header/ContentTransferEncodingTest.php Outdated Show resolved Hide resolved
test/Header/MessageIdTest.php Outdated Show resolved Hide resolved
test/MessageTest.php Outdated Show resolved Hide resolved
test/Storage/MaildirFolderTest.php Show resolved Hide resolved
test/Storage/MaildirMessageOldTest.php Show resolved Hide resolved
test/Storage/MaildirTest.php Show resolved Hide resolved
fredden added 5 commits March 24, 2020 11:02
Signed-off-by: Dan Wallis <mrdanwallis@gmail.com>
Signed-off-by: Dan Wallis <mrdanwallis@gmail.com>
Signed-off-by: Dan Wallis <mrdanwallis@gmail.com>
Signed-off-by: Dan Wallis <mrdanwallis@gmail.com>
Signed-off-by: Dan Wallis <mrdanwallis@gmail.com>
test/Header/ContentTypeTest.php Outdated Show resolved Hide resolved
test/Header/GenericHeaderTest.php Outdated Show resolved Hide resolved
test/Header/ReceivedTest.php Show resolved Hide resolved
fredden added 2 commits March 26, 2020 22:46
Signed-off-by: Dan Wallis <mrdanwallis@gmail.com>
These tests do not work properly and will be fixed separately to this
changeset.

Signed-off-by: Dan Wallis <mrdanwallis@gmail.com>
@fredden
Copy link
Contributor Author

fredden commented Mar 26, 2020

Thanks for all the feedback. I've a few points to work through and will then request another review.

fredden added 13 commits March 28, 2020 20:57
Signed-off-by: Dan Wallis <mrdanwallis@gmail.com>
Signed-off-by: Dan Wallis <mrdanwallis@gmail.com>
Signed-off-by: Dan Wallis <mrdanwallis@gmail.com>
Signed-off-by: Dan Wallis <mrdanwallis@gmail.com>
Signed-off-by: Dan Wallis <mrdanwallis@gmail.com>
Signed-off-by: Dan Wallis <mrdanwallis@gmail.com>
Signed-off-by: Dan Wallis <mrdanwallis@gmail.com>
Signed-off-by: Dan Wallis <mrdanwallis@gmail.com>
Signed-off-by: Dan Wallis <mrdanwallis@gmail.com>
Signed-off-by: Dan Wallis <mrdanwallis@gmail.com>
Signed-off-by: Dan Wallis <mrdanwallis@gmail.com>
Signed-off-by: Dan Wallis <mrdanwallis@gmail.com>
Signed-off-by: Dan Wallis <mrdanwallis@gmail.com>
Signed-off-by: Dan Wallis <mrdanwallis@gmail.com>
@fredden fredden requested a review from michalbundyra March 28, 2020 22:04
Signed-off-by: Dan Wallis <mrdanwallis@gmail.com>
@michalbundyra michalbundyra changed the title Increase test coverage Storage\Maildir fixes + enable unit tests Mar 31, 2020
@michalbundyra michalbundyra added the Bug Something isn't working label Mar 31, 2020
@michalbundyra michalbundyra added this to the 2.10.1 milestone Mar 31, 2020
michalbundyra added a commit that referenced this pull request Apr 1, 2020
Signed-off-by: Michał Bundyra <contact@webimpress.com>
@michalbundyra
Copy link
Member

Thanks, @fredden!

@michalbundyra michalbundyra merged commit 40d0612 into laminas:master Apr 1, 2020
michalbundyra added a commit that referenced this pull request Apr 1, 2020
@fredden fredden deleted the test-coverage branch April 1, 2020 16:09
artemii-karkusha pushed a commit to artemii-karkusha/laminas-mail that referenced this pull request May 24, 2023
Storage\Maildir fixes + enable unit tests
artemii-karkusha pushed a commit to artemii-karkusha/laminas-mail that referenced this pull request May 24, 2023
Signed-off-by: Michał Bundyra <contact@webimpress.com>
artemii-karkusha pushed a commit to artemii-karkusha/laminas-mail that referenced this pull request May 24, 2023
artemii-karkusha pushed a commit to artemii-karkusha/laminas-mail that referenced this pull request May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants