flyway / flyway-test-extensions

Apache License 2.0
129 stars 35 forks source link

@FlywayTest is superfluous #9

Closed csavory closed 9 years ago

csavory commented 10 years ago

Why do we need to annotate the test with @FlywayTest?? The test is already annotated with FlywayTestExecutionListener, which should let the Listener know that the test needs test data.

Would it be possible to just assume the defaults if @FlywayTest isn't present?

FlorianGWE commented 10 years ago

Hallo,

FlywayTestExecutionListener is the spring helper to interprete the annotation FlywayTest. This was early project decission to make all things explicit.

florian

On Wed, Jun 11, 2014 at 9:53 PM, csavory notifications@github.com wrote:

Why we need to annotate the test with @FlywayTest?? The test is already annotated with FlywayTestExecutionListener, which should let the Listener know that the test needs test data.

— Reply to this email directly or view it on GitHub https://github.com/flyway/flyway-test-extensions/issues/9.

FlorianGWE commented 10 years ago

Some additional notes about the one annotations @FlywayTest and a TestExecutionListeners implementation (FlywayTestExecutionListener) for getting spring things correct configured:

  1. my note before. mark database reset explicit and not implicit.
  2. annotation is also planed to use in a guice environment. (future)
  3. best solution were if the FlywayTestExecutionListener is no longer needed to be configured and it can be used with classpath scanning. But this is not a plan on my roadmap.

I see following problems with your wish

  1. When should be the database reset be done?
    • before test class execution?
    • before each test method?
      From Test point I think the first one will be the best, because a database reset should be done as seldom as possible. But is it correct for everyone?
  2. I know some projects that use the Listener implementation also for test that are do not need a database reset and have not one @FlywayTest annotation in this test class. The change will break a couple off tests. You a right it is a ugly test setup but this is history.

Florian

I do not want close the issue

FlorianGWE commented 9 years ago

No fix for that