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

Move kernel booting and container set up into _initialize() method #2491

Merged
merged 1 commit into from Nov 24, 2015

Conversation

Projects
None yet
5 participants
@franua

franua commented Oct 27, 2015

I faced a situation when I needed to load and use some of my Symfony2 project's services in _beforeSuite() to prepare some needed data, obviously, before suit is running. I couldn't do that because current implementation loads kernel and set up container only before a test (in the _beforeTest() method).
I also created an issue about that (according to https://github.com/Codeception/Codeception/wiki/Git-workflow-for-Codeception-contributors) - #2490
Tests passed with my changes.

Andrii Frolikov
Move kernel booting and container set up into _initialize() method
I faced a situation when I needed to load and use some of my Symfony2 project's services in _beforeSuite() to prepare some needed data, obviously, before suit is running. I couldn't do that because current implementation loads kernel set up container only before a test (in the _beforeTest() method).
@tiger-seo

This comment has been minimized.

Show comment
Hide comment
@tiger-seo

tiger-seo Oct 27, 2015

Member

Afaiu, with beforeTest kernel is a brand new for each test, so tests doesn't influence each other, but with beforeSuite there will be only one kernel for all tests, so it might lead to potential issues

Member

tiger-seo commented Oct 27, 2015

Afaiu, with beforeTest kernel is a brand new for each test, so tests doesn't influence each other, but with beforeSuite there will be only one kernel for all tests, so it might lead to potential issues

@tiger-seo

This comment has been minimized.

Show comment
Hide comment
@tiger-seo

tiger-seo Oct 27, 2015

Member

Ok, it's not about kernel, but client, nonetheless, the idea is the same

Member

tiger-seo commented Oct 27, 2015

Ok, it's not about kernel, but client, nonetheless, the idea is the same

@franua

This comment has been minimized.

Show comment
Hide comment
@franua

franua Oct 27, 2015

Client's initialization remains in _before(). I moved only kernel loading and container's initialization into __initialize().

franua commented Oct 27, 2015

Client's initialization remains in _before(). I moved only kernel loading and container's initialization into __initialize().

@franua

This comment has been minimized.

Show comment
Hide comment
@franua

franua Oct 27, 2015

Kernel loading is based (dependent) on config. I don't think config is being changed during suit execution.

franua commented Oct 27, 2015

Kernel loading is based (dependent) on config. I don't think config is being changed during suit execution.

@Naktibalda

This comment has been minimized.

Show comment
Hide comment
@Naktibalda

Naktibalda Nov 8, 2015

Member

The tests pass, so this change is not breaking them.

Laravel modules instantiate app and client in _initialize.

Member

Naktibalda commented Nov 8, 2015

The tests pass, so this change is not breaking them.

Laravel modules instantiate app and client in _initialize.

@Naktibalda

This comment has been minimized.

Show comment
Hide comment
@Naktibalda

Naktibalda Nov 8, 2015

Member

All tests are using the same instance of kernel already,
bootKernel only creates a new instance if $this->kernel is null.

Member

Naktibalda commented Nov 8, 2015

All tests are using the same instance of kernel already,
bootKernel only creates a new instance if $this->kernel is null.

Naktibalda added a commit that referenced this pull request Nov 24, 2015

Merge pull request #2491 from Franua/load-symfony2-kernel-and-set-up-…
…container-in-initialize

Move kernel booting and container set up into _initialize() method

@Naktibalda Naktibalda merged commit 977c270 into Codeception:2.1 Nov 24, 2015

2 checks passed

continuous-integration/appveyor AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment