8000 Use typed properties in tests as much as possible by nicolas-grekas · Pull Request #51067 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Use typed properties in tests as much as possible #51067

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 1 commit into from
Jul 25, 2023

Conversation

nicolas-grekas
Copy link
Member
Q A
Branch? 6.4
Bug fix? no
New feature? no
Deprecations? no
Tickets -
License MIT
Doc PR -

@xabbuh
Copy link
Member
xabbuh commented Jul 21, 2023

The failures look related.

Copy link
Member Author
@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

PR green 🎉
Let's enforce typed properties as much as possible while reviewing PRs as of now!

8000
$this->collection = null;
$this->dispatcher = null;
$this->factory = null;
$this->form = null;
}
Copy link
Member Author

Choose a reason for hiding this comment

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

let's stop adding those useless tearDown methods

Copy link
Member
@lyrixx lyrixx Jul 25, 2023

Choose a reason for hiding this comment

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

I check if the memory consumption was the same => 🎉 it's the same! 👏🏼


But there is something a bit strange. about Framework bundle (I looked at this one because it fails)

  • On Github, it consumes more than 500Mb
  • locally, it consumes 244.00Mb

And locally, I have less skipped tests!

For the form component, it's almost the same

@lyrixx
Copy link
Member
lyrixx commented Jul 25, 2023

the following failure looks related this PR:


1) Symfony\Bundle\FrameworkBundle\Tests\Functional\DebugAutowiringCommandTest::testBasicFunctionality
Failed asserting that '\n
In ArrayInput.php line 191:\n
                                                                  \n
  [Symfony\Component\Console\Exception\InvalidArgumentException]  \n
  The "decorated" argument does not exist.                        \n
                                                                  \n
\n

I have the same error locally, I also tried to rebase your PR (not pushed), and got the same error

On 6.4 (up to date), I don't get the error

@nicolas-grekas nicolas-grekas merged commit 8ec0d08 into symfony:6.4 Jul 25, 2023
@nicolas-grekas nicolas-grekas deleted the typed-props-tests branch July 25, 2023 15:45
nicolas-grekas added a commit that referenced this pull request Jul 28, 2023
…grekas)

This PR was merged into the 7.0 branch.

Discussion
----------

Add types to public and protected properties

| Q             | A
| ------------- | ---
| Branch?       | 7.0
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

:hot_face:

Allowed by #45360

Follows #51068 and #51067

Commits
-------

7ea2461 Add types to public and protected properties
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.

5 participants
0