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

Combine migrations, fixtures and tests... #8190

Closed
bobmulder opened this issue Feb 5, 2016 · 3 comments
Closed

Combine migrations, fixtures and tests... #8190

bobmulder opened this issue Feb 5, 2016 · 3 comments
Labels
Milestone

Comments

@bobmulder
Copy link
Contributor

I have a plugin which has tests which works great. However, people started mention me because the migration failed. So that made me think:

  • should I test my migrations?
  • why aren't my migrations used as fixture, at least to initialize the table?

Please explain me what I am missing because the fact that migrations are not tested doesn't feel good... If I'm missing nothing we should think about a way to integrate migrations into fixtures...

@markstory markstory added this to the 3.3.0 milestone Feb 5, 2016
@markstory
Copy link
Member

why aren't my migrations used as fixture, at least to initialize the table?

Not everyone uses CakePHP's migrations.

should I test my migrations?

I would test backfills, but schema changes should be covered by the application/plugin's tests.

@markstory markstory added the RFC label Feb 5, 2016
@HavokInspiration
Copy link
Member

There's the possibility to test your migrations... in some way.
You can use the Migrations class which will allow you to run migrations in a non-shell environment. You can see the doc for this class here.

This should allow you to test that your migrations are correctly running in the various environments you are testing your plugin with.

@markstory markstory modified the milestones: 3.3.0, 3.4.0 Jul 27, 2016
@dereuromark
Copy link
Member

Closing as a possible solution has been pointed out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants