0

On one of our feature branches of our project we have a strange issue with running our grails integration tests. In our application we have the base project and one plugin, which relies on data from the base application. The default data is created in the "Bootstrap" Classes of the project and the plugin.

since yesterday the bootstrap of the plugin is called before the base bootstrap, and fails, because of the missing data from the application. This happens only if we run the integration tests, and only on our buildserver (Windows Server 2012 with Atlassian Bamboo).

test-app -integration --stacktrace -non-interactive

how can we fix this problem?

Siguza
  • 21,155
  • 6
  • 52
  • 89
Alexander Kiefer
  • 546
  • 1
  • 13
  • 30
  • 2
    `BootStrap` is loaded in alphabetical order of file name in an app. Try to rename plugins bootstrap to `BootStrap.groovy` and see if affects. However, the idea of plugin depending on the app tends not to be a good design. :) – dmahapatro Jun 04 '14 at 12:31
  • The Plugin Bootstrap is already called PluginNameBootstrap.groovy.... – Alexander Kiefer Jun 04 '14 at 13:05

1 Answers1

2

Grails makes no guarantees about ordering of BootStrap classes so it isn't something that should be relied about in your application.

If you need to control ordering of logic that is run at startup there are better solutions, for example you could use the platform-core plugin's event model to trigger an event in your application that your plugin listens to once the data it needs is in place. See http://grails-plugins.github.io/grails-platform-core/guide/events.html

Graeme Rocher
  • 7,985
  • 2
  • 26
  • 37