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

Test message rendering #9460

Merged
merged 3 commits into from
Dec 19, 2024
Merged

Conversation

pabzm
Copy link
Member

@pabzm pabzm commented May 21, 2024

This adds an integration testing setup to check the rendering of individual emails. The idea is to grow this with a lot of "normal" and "interesting" messages, to have a solid base for fixing new rendering errors without breaking previous fixes (motivated by #9443). It would also help with possible refactoring.

Run ./tests/MessageRendering/run-tests.sh to run all tests in that directory. They are ignored when running the main test suite (for now).

The messages are served by a dovecot container from the Maildir in
tests/MessageRendering/src/maildir and identified by their Message-Id. This way one can drop a raw email into there, and immediately write a test against it.

This is not yet built into the GitHub workflows, and also has only a few messages and tests, because before putting more work into this I'd like to have some feedback.

@roundcube/webmail-developers What do you think about this?

@pabzm pabzm force-pushed the test-message-rendering branch 4 times, most recently from 825c1a3 to 0ceb1e8 Compare May 21, 2024 17:12
@pabzm pabzm marked this pull request as draft May 21, 2024 17:13
@pabzm pabzm force-pushed the test-message-rendering branch from 0ceb1e8 to 8f34373 Compare May 21, 2024 17:17
@pabzm
Copy link
Member Author

pabzm commented May 21, 2024

Sorry, it took me a moment to wrestle with phpstan, the cs-fixer and windows filename problems. It's ready now and I won't force-push anymore.

@pabzm pabzm marked this pull request as ready for review May 21, 2024 17:45
Copy link
Contributor

@miaulalala miaulalala left a comment

Choose a reason for hiding this comment

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

Looks good!

@pabzm
Copy link
Member Author

pabzm commented May 24, 2024

Actually this conflicts with the work I did for #9465 (which only occured to me yesterday), so I'd not push this before that other topic was discussed.

@pabzm pabzm self-assigned this May 29, 2024
program/actions/mail/show.php Outdated Show resolved Hide resolved
tests/MessageRendering/MessageRenderingTestCase.php Outdated Show resolved Hide resolved
tests/MessageRendering/MessageRenderingTestCase.php Outdated Show resolved Hide resolved
tests/MessageRendering/MessageRenderingTestCase.php Outdated Show resolved Hide resolved
tests/MessageRendering/bootstrap.php Show resolved Hide resolved
@pabzm pabzm force-pushed the test-message-rendering branch from 4c0b172 to 0a5f089 Compare June 4, 2024 16:05
@pabzm pabzm force-pushed the test-message-rendering branch from 0a5f089 to 63c90ef Compare June 14, 2024 11:15
Copy link

@pabzm, @alecpl
🛎️ This PR has had no activity in two weeks.

1 similar comment
Copy link

github-actions bot commented Dec 5, 2024

@pabzm, @alecpl
🛎️ This PR has had no activity in two weeks.

@pabzm pabzm force-pushed the test-message-rendering branch from 63c90ef to 2eef5c3 Compare December 18, 2024 13:24
pabzm and others added 3 commits December 18, 2024 16:36
We can't test this code if it exits.
Run ./tests/MessageRendering/run-tests.sh to run all tests in that
directory, which are supposed to check the rendering of concrete
messages.

The messages are served by a dovecot container from the Maildir in
`tests/MessageRendering/src/maildir` and identified by their `Message-Id`.
@pabzm pabzm force-pushed the test-message-rendering branch from 1359579 to 13fefcc Compare December 18, 2024 15:45
@pabzm
Copy link
Member Author

pabzm commented Dec 19, 2024

I cleaned this up, integrated the greenmail IMAP server (containerized) and hooked it into the github workflows. Hope it's agreeable this way.

I want to use this kind of tests to work on #9565 and #9585, thus would like to merge it soon.

I wouldn't integrate the rendering tests in the unit test suite, because they would slow that suite down: Currently 1186 unit tests take roughly as long as 4 message rendering tests (both executed via docker compose). The message rendering tests are also more integration tests than unit tests, so it doesn't fit too well anyway.

@alecpl alecpl merged commit 46d2516 into roundcube:master Dec 19, 2024
17 checks passed
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.

3 participants