I am trying to upgrade a Grails 2.5.1 application to Grails 3.0.5. When I try to run the tests I get a compiler error
/Users/xxx/dev/xxx/src/test/groovy/y/xxx/z/PricingSpec.groovy: 5: unable to resolve class grails.test.mixin.hibernate.HibernateTestMixin
# line 5, column 1.
import grails.test.mixin.hibernate.HibernateTestMixin
It seems that grails-plugin-testing does not include that Mixin. Can anyone tell me what dependency I am missing?
EDIT Same goes for grails.test.mixin.gorm.Domain
Have a look at HibernateTestMixin Basics.
You would need this dependency in build.gradle:
dependencies {
testCompile 'org.grails:grails-datastore-test-support:4.0.4.RELEASE'
}
You might not have noticed it but these mixin were already had been moved to grails-data-mapping in Grails 2.4.* apps
If you look closely in BuildConfig.groovy of a newly created Grails 2.4.* or 2.5.*, one would see the same dependency.
Related
Facing the same issue - https://github.com/miragejs/ember-cli-mirage/issues/1445
Uncaught Error: Could not find module project-name/tests/helpers/push-mirage-into-store imported from project-name/mirage/factories/addon
Initially got this error and tried #makepanic instructions
After that
Uncaught Error: Could not find module #ember/test-helpers imported from project-name/mirage/helpers/push-mirage-into-store
can you pls help here to resolve this.
I bet you are running into the error, which is described in this comment by makepanic in the GitHub issue you linked:
When running the app directly, the browser opens index.html which
isn't loading tests.js. This file contains everything related to
tests.
If you open tests/index.html, that will also load tests.js and add any
modules under tests/* to the loader registry.
This means without the tests file loaded, you can't import anything
from tests/*.
You are affected by that issue if you face it when running ember serve.
The comment also includes a possible solution:
With you moving the helpers to /mirage, they gets registered in both index.html and tests/index.html.
An alternative would be to disable mirage in all enrironments except for test. But that is only a feasible solution if you use mirage only for testing but not for development.
After migrating to AS 3.2 android JUnit test run configuration does not work, all types "All in directory",
"All in package" etc.
I mean it does work, but always claims that:
0 test classes found in package '<default package>'
Process finished with exit code 254
Empty test suite.
using ./gradlew test triggers every test
and every single test can be run by AS using that green play button inside editor (for class or single method)
but not for package, module etc.
How to fix that ?
many thanks
Wojtek
Declare your test classes as public
Fixed in Android Studio 3.2.1
So just update AS to newest version and the problem disappears
I have some trouble writing the most basic unit test for a job. My problem can be recreated by creating a new job by running grails create-job my in the console.
This will create two files
MyJob.goovy (under the default package myApp - resides in test\unit\myApp)
MyJobSpec.groovy (under the default package myApp - resides in grails-app\jobs\myApp)
Now if i try to use the job MyJob in the test, as example
import myApp.MyJob //This is not resolved
#TestMixin(GrailsUnitTestMixin)
class MyJobSpec extends Specification {
def myJob
I get the compiler error Groovy:unable to resolve class MyJob. Everything so far was automatically created by the plugin. What is going on here? Is there something i did wrong / how do i get this to work?
Using grails 2.3.11.
I don't know which IDE are you using or if you are running everything on a terminal, but I had similar problems with Eclipse and what you need to do is to add grails-app/jobs to the classpath as a source folder.
When I run grails war I got the following error
Compiling 30 GSP files for package [appInfo].
| Error GSP Compilation error in file /WEB-INF/plugins/app-info-0.4.3/grails-app/views/appinfo/hibernateEntityInfo.gsp at line 69: Tag [each] missing required attribute [in]
I used
grails 2.2.4
and also I want to know the app-info plugin location in the application
It is the problem with App-info plugin. I also got similar problem . I solved by following way
Clean the application using
grails Clean
then run the application using
grails RunApp
and make sure If you are using sequences in the application do not use mysql because mysql does not support sequences.
I am trying times longer run it has several errors. Someone
has any tutorial or some way to make it work. Tested
several tutorials and I could not.
vlw staff
I already placed the php unittest unit in the directory.
the error is as follows:
Fatal error: main() [function.require]: Failed opening required
'PHPUnit/Util/Filter.php' (include_path='.;C:\php5\pear') in C:\wamp
\www\doeseulixo\branches\module_unittest\modules\unittest\PHPUnit
\Framework.php on line 0
See Installing PHPUnit.
PHPUnit should be installed with the 'pear' utility rather than downloaded manually. Kohana needs access to more than one class of the library.