Laravel Seeds #3948

Closed
DavertMik opened this Issue Jan 24, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@DavertMik
Member

DavertMik commented Jan 24, 2017

I received a report that seeds in Laravel5 module behave in a strange way. They are always created before each test but never reverted. And yes:

https://github.com/codeception/codeception/blob/2.2/src/Codeception/Module/Laravel5.php#L173

Here the options I see:

  • run seeds at the beginning of a test, reset them in the end of a test
  • run seeds inside a transaction at the beginning of a test, transaction will revert them
  • run seeds before suite and reuse them across tests...

Or maybe I don't understand something about Laravel seeders...

@janhenkgerritsen

This comment has been minimized.

Show comment
Hide comment
@janhenkgerritsen

janhenkgerritsen Jan 24, 2017

Contributor

The default value for the config variable in the line you reference is false, so the database seed command will only run when the user explicitly sets this config variable to true.

I'll try to look at this issue this week, but it is highly likely that the report you received is wrong. From the top of my head I don't believe there is any other code related to the database seeds in the Laravel5 module than the line you referenced.

If the person that reported the issue to you is sure there is a problem with the Laravel5 module I'd like to have some more information.

Contributor

janhenkgerritsen commented Jan 24, 2017

The default value for the config variable in the line you reference is false, so the database seed command will only run when the user explicitly sets this config variable to true.

I'll try to look at this issue this week, but it is highly likely that the report you received is wrong. From the top of my head I don't believe there is any other code related to the database seeds in the Laravel5 module than the line you referenced.

If the person that reported the issue to you is sure there is a problem with the Laravel5 module I'd like to have some more information.

@DavertMik

This comment has been minimized.

Show comment
Hide comment
@DavertMik

DavertMik Jan 24, 2017

Member

Yes, it's about that seeder option in config only. It's not a critical bug but I don't understand how the seeds are expected to be used in this implementation. As I said, it has no meaning, running seeds before each test without reverting them

Member

DavertMik commented Jan 24, 2017

Yes, it's about that seeder option in config only. It's not a critical bug but I don't understand how the seeds are expected to be used in this implementation. As I said, it has no meaning, running seeds before each test without reverting them

@janhenkgerritsen

This comment has been minimized.

Show comment
Hide comment
@janhenkgerritsen

janhenkgerritsen Jan 25, 2017

Contributor

This issue should be fixed by the referenced commit.

Contributor

janhenkgerritsen commented Jan 25, 2017

This issue should be fixed by the referenced commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment