Skip to content

docs: Add information about how to significantly improve the test suite #1472

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

Merged
merged 2 commits into from
Mar 13, 2022

Conversation

maks-rafalko
Copy link
Contributor

@maks-rafalko maks-rafalko commented Nov 21, 2021

Hi,

this PR adds an information for the page about JWT authentication about how to make the tests fast.

The issue boils down to the very slow password hashers that are used in tests by default.

Each time we start a new project, or make a review of the existing one, we have to do it, because tests are extremely slow.

This is only one of the many optimizations available for the end developer, but let's start here. Other ones are listed in my blog post: https://maks-rafalko.github.io/blog/2021-11-21/symfony-tests-performance/#using-more-simple-password-hasher

In our cases, such change can improve tests speed by 2-5 times, depending on the project.

Hi,

this iPR adds an inromation for the page about `JWT` authentication about how to make the tests fast.

The issue boils down to the very slow password hashers that are used in tests by default.

Each time we start a new project, or review the current one, we have to do it, because tests are extremely slow.

This is only one of the many optimizations available for the end developer, but let's start here. Other ones are listed in by blog post: https://maks-rafalko.github.io/blog/2021-11-21/symfony-tests-performance/#using-more-simple-password-hasher
Copy link
Member

@dunglas dunglas left a comment

Choose a reason for hiding this comment

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

LGTM but IMHO we should even include something like this directly in the Flex recipe for the security component.

@maks-rafalko
Copy link
Contributor Author

IMHO we should even include something like this directly in the Flex recipe for the security component.

Exactly, already made an RFC there symfony/recipes#1024

@soyuka soyuka merged commit dfc88c1 into api-platform:2.6 Mar 13, 2022
@soyuka
Copy link
Member

soyuka commented Mar 13, 2022

Thanks @maks-rafalko !

@maks-rafalko maks-rafalko deleted the patch-5 branch May 20, 2024 08:29
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.

4 participants