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

Test that migrations are marked as repeatable #6637

Merged
merged 1 commit into from May 8, 2018

Conversation

mlocati
Copy link
Contributor

@mlocati mlocati commented May 8, 2018

When we create a new migration, 99% of times it is repeatable, so let's add a test case to check this.

This new test case checks that all migrations are marked as repeatable, except the ones explicitly listed in the $allowedNotRepeatableMigrations property of this new RepeatableMigrationsTest test.

This new test case helps a lot avoiding problems like these:

Marking migrations as repeatable is very important, because the --rerun option of the c5:update command can re-execute migrations only if they are repeatable, and all the next migrations are repeatable.
For instance, if we have migrations M1, M2, M3, M4, M5, and M3 is not marked as repeatable, the --rerun option will let you rerun only re-execute migrations M4 and M5.

PS: this PR should fail, since #6636 is not merged yet.

@mlocati mlocati force-pushed the test-repeatable-migrations branch from a7afb2c to 1173f82 Compare May 8, 2018 13:23
@mlocati
Copy link
Contributor Author

mlocati commented May 8, 2018

PS: this PR should fail, since #6636 is not merged yet.

And here's the expected error message shown by this new test:

These migrations should implement the \Concrete\Core\Updater\Migrations\RepeatableMigrationInterface interface (if they are repeatable)
or they should be listed in the $allowedNotRepeatableMigrations variable of the file tests/Update/RepeatableMigrationsTest.php (if they are not repeatable):

  • Concrete\Core\Updater\Migrations\Migrations\Version20180328215345

#6636 will fix this.

@aembler aembler merged commit cca738c into concretecms:develop May 8, 2018
@mlocati mlocati deleted the test-repeatable-migrations branch May 8, 2018 17:16
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.

None yet

2 participants