Grails

Paths to web resources are incorrect in apps referencing a plugin in a parent directory

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Fixed
  • Affects Version/s: 1.2-RC1
  • Fix Version/s: 1.2 final
  • Component/s: None
  • Labels:
    None

Description

In a project referencing a plugin in a parent directory (e.g. grails.plugin.location."selenium-rc" = "../../..") web-app resource paths are generated incorrectly with /plugins/${pluginName}-${pluginVersion} prepended.

See this thread for more details.

Activity

Hide
Graeme Rocher added a comment -

Peter are you going to fixing this (i note it is assigned to you)? Otherwise could someone provide steps to reproduce.

Show
Graeme Rocher added a comment - Peter are you going to fixing this (i note it is assigned to you)? Otherwise could someone provide steps to reproduce.
Hide
Robert Fletcher added a comment -

I assigned the bug to Peter as we discussed it on the grails-user list and it turned out to be down to a change he committed (see http://old.nabble.com/Issue-with-web-app-URLs-in-Grails-HEAD-to26494003.html#a26494003)

To recreate you can clone selenium-rc plugin from http://github.com/robfletcher/grails-selenium-rc and run the test app from test/projects/selenium-test against Grails 1.2.0.RC1.

Show
Robert Fletcher added a comment - I assigned the bug to Peter as we discussed it on the grails-user list and it turned out to be down to a change he committed (see http://old.nabble.com/Issue-with-web-app-URLs-in-Grails-HEAD-to26494003.html#a26494003) To recreate you can clone selenium-rc plugin from http://github.com/robfletcher/grails-selenium-rc and run the test app from test/projects/selenium-test against Grails 1.2.0.RC1.
Hide
Peter Ledbrook added a comment -
Show
Peter Ledbrook added a comment - Hack fix: 644e50a14b74cd3193676c0e8eb6b4618ee513b9.
Hide
Robert Fletcher added a comment -

Based on the commit I cannot understand why but this bug still occurs under 1.2.0.RC2 if I do 'grails test run-app' (or run selenium-rc tests). It's working fine in development mode.

Show
Robert Fletcher added a comment - Based on the commit I cannot understand why but this bug still occurs under 1.2.0.RC2 if I do 'grails test run-app' (or run selenium-rc tests). It's working fine in development mode.
Hide
Graeme Rocher added a comment -

Can you outline exactly the steps are to reproduce the bug and I'll get it fixed for final

Show
Graeme Rocher added a comment - Can you outline exactly the steps are to reproduce the bug and I'll get it fixed for final
Hide
Robert Fletcher added a comment - - edited

The quickest way to reproduce is...

git clone git://github.com/robfletcher/grails-selenium-rc.git
cd grails-selenium-rc
grails package-plugin
cd test/projects/selenium-test

At this point you're inside a test app that references the selenium-rc plugin at ../../.. in its BuildConfig.

If you use 'grails run-app' or 'grails dev test-app functional:' you should be able to see that images, css & script files are being loaded correctly. However using 'grails test run-app' or 'grails test-app functional:' the resource paths are prepended with /plugins/selenium-rc-0.2-SNAPSHOT meaning they all get 404s. This causes a number of the tests to fail as they rely on the javascript.

Peter's earlier fix sorted things out in dev mode. If I move that test app to a directory sibling of the plugin and reference the plugin using ../grails-selenium-rc it works ok. I've tried changing the path to ../../../../grails-selenium-rc however, and that doesn't work.

Show
Robert Fletcher added a comment - - edited The quickest way to reproduce is... git clone git://github.com/robfletcher/grails-selenium-rc.git cd grails-selenium-rc grails package-plugin cd test/projects/selenium-test At this point you're inside a test app that references the selenium-rc plugin at ../../.. in its BuildConfig. If you use 'grails run-app' or 'grails dev test-app functional:' you should be able to see that images, css & script files are being loaded correctly. However using 'grails test run-app' or 'grails test-app functional:' the resource paths are prepended with /plugins/selenium-rc-0.2-SNAPSHOT meaning they all get 404s. This causes a number of the tests to fail as they rely on the javascript. Peter's earlier fix sorted things out in dev mode. If I move that test app to a directory sibling of the plugin and reference the plugin using ../grails-selenium-rc it works ok. I've tried changing the path to ../../../../grails-selenium-rc however, and that doesn't work.
Hide
Graeme Rocher added a comment -

I have followed your steps and can't reproduce the issue against Git head personally. Seems it may be platform specific. The selenium tests execute in Safari and all pass without error (very cool plugin btw

Show
Graeme Rocher added a comment - I have followed your steps and can't reproduce the issue against Git head personally. Seems it may be platform specific. The selenium tests execute in Safari and all pass without error (very cool plugin btw
Hide
Robert Fletcher added a comment -

Wow, that's odd. I'm also using Snow Leopard / Safari 4. I'll check again over the weekend maybe I'm doing something stupid.

Show
Robert Fletcher added a comment - Wow, that's odd. I'm also using Snow Leopard / Safari 4. I'll check again over the weekend maybe I'm doing something stupid.
Hide
Robert Fletcher added a comment -

Okay, looks like I had some kind of inconsistency in my project somewhere. It works fine with a clean clone from github. Must be something in an ignored directory as git status shows a clean workspace. Sorry for any wasted time.

Show
Robert Fletcher added a comment - Okay, looks like I had some kind of inconsistency in my project somewhere. It works fine with a clean clone from github. Must be something in an ignored directory as git status shows a clean workspace. Sorry for any wasted time.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: