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

locationsForMigrate with missing location does not fail #68

Open
squaregoldfish opened this issue Feb 20, 2019 · 4 comments
Open

locationsForMigrate with missing location does not fail #68

squaregoldfish opened this issue Feb 20, 2019 · 4 comments
Labels
Postpone Currently not possible

Comments

@squaregoldfish
Copy link

When using the locationsForMigrate directive, if any of the supplied locations are missing (i.e. the specified folder doesn't exist) then the tests are run with no complaint. I would expect the test to fail in this instance and report that the specified migrations could not be run.

@FlorianGWE
Copy link
Collaborator

The Test extensions used the Flyway location feature.
This feature will not fail if a missing location is passed to it.

The currently behaviour will not change, because this change will possible break old test.

One solution can be that the @flyway get a flag 'failOnMissingLocations' with a default 'false'.
If 'true' will set a missing location will break the test!

@FlorianGWE
Copy link
Collaborator

The current Flyway implementation for the location scanning support not a enhancement or a notification support, so I see no possibility to get the information about location that not exist.

A detection can only be done by a own implementation. Such a implementation contains the possibility about wrong error detection - detect error for correct location or detect no error for missing location, because it do not use the real Flyway implementation. (See https://github.com/flyway/flyway/blob/master/flyway-core/src/main/java/org/flywaydb/core/internal/scanner/filesystem/FileSystemScanner.java or
https://github.com/flyway/flyway/blob/master/flyway-core/src/main/java/org/flywaydb/core/internal/scanner/classpath/ClassPathScanner.java)

Currently I will postpone this feature

@FlorianGWE FlorianGWE added the Postpone Currently not possible label May 5, 2019
@squaregoldfish
Copy link
Author

If this is Flyway's behaviour, you should certainly stick with their approach. While this behaviour was unexpected to me, I think it would be worse to start doing things differently. Emulating the parent system as closely as possible should be the goal.

It might be worth updating the documentation so it's clear what will happen.

@lrozenblyum
Copy link

Flyway 7.9.0 included a flag to allow fail-fast behavior in case of missing locations flyway.failOnMissingLocations
flyway/flyway#2205

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

No branches or pull requests

3 participants