-
-
Save slorber/83b3b3a672dac9604b6e to your computer and use it in GitHub Desktop.
[stample-web] $ it:testOnly *CategoryService* | |
Extract /home/sebastien/.embedmongo/linux/mongodb-linux-x86_64-2.4.10.tgz START | |
Extract /home/sebastien/.embedmongo/linux/mongodb-linux-x86_64-2.4.10.tgz DONE | |
Oct 16, 2014 10:43:24 AM MongodExecutable start | |
INFO: de.flapdoodle.embed.mongo.config.MongodConfigBuilder$ImmutableMongodConfig@27514bba | |
STARTED EMBEDDED MONGODB | |
[info] service.CategoryServiceTest | |
[info] CategoryServiceTest | |
[info] | |
[info] CategoryService service getSubCategories(user,categoryId) should | |
[info] + get the subcategories for category owner | |
[info] + not get the subcategories for a random user | |
[info] + get the subcategories for an user having category permission, with breadcrumb not including non-shared categories | |
[info] | |
[info] CategoryService moveCategoryV2 should | |
[info] + permit to move a category inside another | |
[info] + permit to move a category inside a deep category | |
[info] + permit to move a deep category to the root | |
[info] + not permit to move a category inside itself | |
[info] + not permit to move a category inside its parent (as it's already there!) | |
[info] + not permit to move a category inside one of its childs | |
[info] + permit to move a shared category's child to another category's child | |
[info] + permit to move a shared category's child in another shared category | |
[info] + permit to move a shared category's child in another shared category's child | |
[info] x not permit to move a shared category in another shared category | |
[error] 'Right([Category=543f8530327c21efa8d458d2 - [Home>Sub Home>Sub Home]])' is not Left (CategoryServiceTest.scala:251) | |
[info] | |
[info] x not permit to move a shared category in another shared category's child | |
[error] 'Right([Category=543f8530327c21efa8d458e8 - [Home>Sub Home>Sub Sub Home>Sub Home]])' is not Left (CategoryServiceTest.scala:263) | |
[info] | |
[info] + not permit to move my category to an unshared category of another user | |
[info] + not permit to another user's unshared category to my category | |
[info] + not permit to move home into another user's shared category with READ permissions | |
[info] + not permit to move home into another user's shared category with WRITE permissions | |
[info] + not permit to move home into another user's shared category with MANAGE permissions | |
[info] + not permit to move home (with shared childs) into another user's shared category with READ permissions | |
[info] + not permit to move home (with shared childs) into another user's shared category with WRITE permissions | |
[info] + not permit to move home (with shared childs) into another user's shared category with MANAGE permissions | |
[info] + not permit to move my category into another user's shared category with READ permissions | |
[info] + permit to move my category into another user's shared category with WRITE permissions | |
[info] + permit to move my category into another user's shared category with MANAGE permissions | |
[info] + not permit to move my shared category into another user's shared category with READ permissions | |
[info] x not permit to move my shared category into another user's shared category with WRITE permissions | |
[error] 'Right([Category=543f8531327c21efa8d45a70 - [Home>Sub Home>Sub Home]])' is not Left (CategoryServiceTest.scala:311) | |
[info] | |
[info] x not permit to move my shared category into another user's shared category with MANAGE permissions | |
[error] 'Right([Category=543f8531327c21efa8d45a90 - [Home>Sub Home>Sub Home]])' is not Left (CategoryServiceTest.scala:311) | |
[info] | |
[info] + not permit to move my shared category's child into another user's shared category with READ permissions | |
[info] + permit to move my shared category's child into another user's shared category with WRITE permissions | |
[info] + permit to move my shared category into another user's shared category with MANAGE permissions | |
[info] + not permit to move my category containing shared childs into another user's shared category with READ permissions | |
[info] x not permit to move my category containing shared childs into another user's shared category with WRITE permissions | |
[error] 'Right([Category=543f8532327c21efa8d45b34 - [Home>Sub Home>Sub Home]])' is not Left (CategoryServiceTest.scala:311) | |
[info] | |
[info] x not permit to move my category containing shared childs into another user's shared category with MANAGE permissions | |
[error] 'Right([Category=543f8532327c21efa8d45b55 - [Home>Sub Home>Sub Home]])' is not Left (CategoryServiceTest.scala:311) | |
[info] | |
[info] + not permit to move a shared category of another user with READ permission | |
[info] x not permit to move a shared category of another user with WRITE permission | |
[error] 'Right([Category=543f8532327c21efa8d45b9e - [Home>Sub Home]])' is not Left (CategoryServiceTest.scala:486) | |
[info] | |
[info] x not permit to move a shared category of another user with MANAGE permission | |
[error] 'Right([Category=543f8532327c21efa8d45bbd - [Home>Sub Home]])' is not Left (CategoryServiceTest.scala:486) | |
[info] | |
[info] + not permit to move a shared category's child of another user that he created, with READ permission | |
[info] + permit to move a shared category's child of another user that he created, with WRITE permission | |
[info] + permit to move a shared category's child of another user that he created, with MANAGE permission | |
[info] + not permit to move a shared category's child of another user I he created, with READ permission | |
[info] + permit to move a shared category's child of another user that I created, with WRITE permission | |
[info] + permit to move a shared category's child of another user that I created, with MANAGE permission | |
[info] | |
[info] Total for specification CategoryServiceTest | |
[info] Finished in 6 seconds, 611 ms | |
[info] 43 examples, 8 failures, 0 error | |
[info] + service.CategoryServiceTest | |
[info] + service.CategoryServiceTest | |
[info] + service.CategoryServiceTest | |
[info] + service.CategoryServiceTest | |
[info] + service.CategoryServiceTest | |
[info] + service.CategoryServiceTest | |
[info] + service.CategoryServiceTest | |
[info] + service.CategoryServiceTest | |
[info] + service.CategoryServiceTest | |
[info] + service.CategoryServiceTest | |
[info] + service.CategoryServiceTest | |
[info] + service.CategoryServiceTest | |
[info] x service.CategoryServiceTest | |
[info] x service.CategoryServiceTest | |
[info] + service.CategoryServiceTest | |
[info] + service.CategoryServiceTest | |
[info] + service.CategoryServiceTest | |
[info] + service.CategoryServiceTest | |
[info] + service.CategoryServiceTest | |
[info] + service.CategoryServiceTest | |
[info] + service.CategoryServiceTest | |
[info] + service.CategoryServiceTest | |
[info] + service.CategoryServiceTest | |
[info] + service.CategoryServiceTest | |
[info] + service.CategoryServiceTest | |
[info] + service.CategoryServiceTest | |
[info] x service.CategoryServiceTest | |
[info] x service.CategoryServiceTest | |
[info] + service.CategoryServiceTest | |
[info] + service.CategoryServiceTest | |
[info] + service.CategoryServiceTest | |
[info] + service.CategoryServiceTest | |
[info] x service.CategoryServiceTest | |
[info] x service.CategoryServiceTest | |
[info] + service.CategoryServiceTest | |
[info] x service.CategoryServiceTest | |
[info] x service.CategoryServiceTest | |
[info] + service.CategoryServiceTest | |
[info] + service.CategoryServiceTest | |
[info] + service.CategoryServiceTest | |
[info] + service.CategoryServiceTest | |
[info] + service.CategoryServiceTest | |
[info] + service.CategoryServiceTest | |
[info] | |
[info] | |
[info] Total for test service.CategoryServiceTest | |
[info] Finished in 7.543 seconds | |
[info] 43 tests, 8 failures, 0 errors | |
SHUTDOWN EMBEDDED MONGODB | |
Oct 16, 2014 10:43:31 AM de.flapdoodle.embed.mongo.AbstractMongoProcess stopInternal | |
INFO: try to stop mongod | |
Oct 16, 2014 10:43:31 AM de.flapdoodle.embed.process.io.file.Files forceDelete | |
INFO: Could delete /tmp/embedmongo-db-86c3cd73-72fb-4f25-9a98-10f68b2c8a79 | |
Oct 16, 2014 10:43:31 AM de.flapdoodle.embed.process.io.file.Files forceDelete | |
INFO: Could delete /tmp/extract-sebastien-mongod.pid | |
[error] Failed: Total 43, Failed 8, Errors 0, Passed 35 | |
[error] Failed tests: | |
[error] service.CategoryServiceTest | |
[error] (stample-web/it:testOnly) sbt.TestsFailedException: Tests unsuccessful | |
[error] Total time: 10 s, completed Oct 16, 2014 10:43:31 AM | |
[stample-web] $ Oct 16, 2014 10:43:32 AM de.flapdoodle.embed.process.io.file.Files forceDelete | |
INFO: Could delete /tmp/extract-sebastien-mongod |
[stample-web] $ it:testOnly *CategoryService* -- -ex ".*" | |
Extract /home/sebastien/.embedmongo/linux/mongodb-linux-x86_64-2.4.10.tgz START | |
Extract /home/sebastien/.embedmongo/linux/mongodb-linux-x86_64-2.4.10.tgz DONE | |
Oct 16, 2014 10:44:40 AM MongodExecutable start | |
INFO: de.flapdoodle.embed.mongo.config.MongodConfigBuilder$ImmutableMongodConfig@467a68f5 | |
STARTED EMBEDDED MONGODB | |
[info] service.CategoryServiceTest | |
[info] CategoryServiceTest | |
[info] | |
[info] | |
[info] CategoryService service getSubCategories(user,categoryId) should | |
[info] | |
[info] | |
[info] | |
[info] | |
[info] CategoryService moveCategoryV2 should | |
[info] | |
[info] | |
[info] | |
[info] | |
[info] | |
[info] | |
[info] | |
[info] | |
[info] | |
[info] | |
[info] | |
[info] | |
[info] | |
[info] | |
[info] | |
[info] | |
[info] | |
[info] | |
[info] | |
[info] | |
[info] | |
[info] | |
[info] | |
[info] | |
[info] | |
[info] | |
[info] | |
[info] | |
[info] | |
[info] | |
[info] | |
[info] | |
[info] | |
[info] | |
[info] | |
[info] | |
[info] | |
[info] | |
[info] | |
[info] | |
[info] | |
[info] Total for specification CategoryServiceTest | |
[info] Finished in 221 ms | |
[info] 0 example, 0 failure, 0 error | |
[info] | |
[info] | |
[info] Total for test service.CategoryServiceTest | |
[info] Finished in 1.042 seconds | |
[info] 0 tests, 0 failures, 0 errors | |
SHUTDOWN EMBEDDED MONGODB | |
Oct 16, 2014 10:44:42 AM de.flapdoodle.embed.mongo.AbstractMongoProcess stopInternal | |
INFO: try to stop mongod | |
Oct 16, 2014 10:44:42 AM de.flapdoodle.embed.process.io.file.Files forceDelete | |
INFO: Could delete /tmp/embedmongo-db-ab3f9072-d17d-4dd6-8a0f-35adaaf719d5 | |
Oct 16, 2014 10:44:42 AM de.flapdoodle.embed.process.io.file.Files forceDelete | |
INFO: Could delete /tmp/extract-sebastien-mongod.pid | |
[info] Passed: Total 0, Failed 0, Errors 0, Passed 0 | |
[success] Total time: 3 s, completed Oct 16, 2014 10:44:42 AM | |
[stample-web] $ Oct 16, 2014 10:44:49 AM de.flapdoodle.embed.process.io.file.Files forceDelete | |
INFO: Could delete /tmp/extract-sebastien-mongod |
Two things here:
1.
you can solve the scalaz-stream issue by either
- just using specs2-core instead of specs2 as your dependency
- add the bintray resolver
lazy val resolversSettings = resolvers ++=
Seq(Resolver.sonatypeRepo("releases"),
Resolver.sonatypeRepo("snapshots"),
Resolver.typesafeIvyRepo("releases"),
"scalaz-bintray" at "http://dl.bintray.com/scalaz/releases")
2.
For the arguments I suggest that you try the following
- no quotes
test-only * -- -ex .*
- no "dash ex"
test-only * -- ex .*
- additional double-dashes
test-only * -- -ex .* --
The third case is something that I observed on another project. When using Tests.Arguments
in the sbt configuration then -ex
arguments fail to be properly parsed. If I remember correctly using --
right after helped.
No quotes: test-only * -- -ex .*diacritics.*
: NOK
No dash: test-only * -- ex .*diacritics.*
: OK
Additional double-dash: test-only * -- -ex .*diacritics.* --
: OK
No quotes: it:test-only *CategoryService* -- -ex .*deep.*
: NOK
No dash: it:test-only *CategoryService* -- ex .*deep.*
: OK
Additional double-dash: test-only *CategoryService* -- -ex .*deep.* --
: OK
So it seems weird but the last solution does not work with my it
config.
The "no dash" solution works fine with both configs, and works with quotes too (however I'm not sure of the behavior I see when using spaces in the regex)
Thanks :)
Good to know that you have a solution. Just a note: arguments passing is a bit ad-hoc and primitive in specs2. Historically only ex
was there but you could not use spaces (I actually think it is a bug now I should look into it). Then I added -ex aaaa bbb ccc
where aaaa bbb ccc
would be caught as the argument for -ex
and if you wanted to add other arguments you would have to add --
: -ex aaaa bbb ccc -- sequential
. I'll put a note for myself to at least document that in the next version.
but it is kind of hard to match exemples with spaces.
it:test-only service.CategoryServiceTest -- ex "not permit to move a category inside itself"
It seems like it matches on .*not.*
, only the first term is taken.
I have to do:
it:test-only service.CategoryServiceTest -- ex "not\\spermit\\sto\\smove\\sa\\scategory\\sinside\\sitself"
So for long strings where many special regex chars, it forces me to add some "key" to my exemples to be able to match them easily.
So I think it may be cool to have some feature, a bit like pendingUntilFixed
but the opposite, something like executeThisExempleButNotOthers
.
This would be cool to easily be able to focus on a given test to debug it.
You have to recompile the test, but at least it would be easier than having to find the appropriate regexp in some cases.
Note that a very low-tech alternative to this is to add on special character to your description, like @
and go test-only -- ex @
.
Note that moving from dependency specs2
to specs2-core
has broken my unit tests (but not my integration tests).
java.lang.NoSuchMethodError: org.specs2.runner.Fingerprints$.fp1()Lorg/specs2/runner/SpecificationFingerprint;
at org.specs2.runner.Specs2Framework.fingerprints(SbtRunner.scala:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
Any idea?
I'm using a multi-project build (using
project stample-web
before the tests) and running the test with theit
sbt config for integration tests, but I reproduced the same problem with regular unit tests.I've tried different versions of specs2 and get the same issue.
Note that I was not able to use specs2 > 2.4.2 as I get this SBT dependency issue:
[error] (stample-web/*:update) sbt.ResolveException: unresolved dependency: org.scalaz.stream#scalaz-stream_2.10;0.5a: not found
Perhaps it's because I already have a version of Scalaz in my classpath?
There seems to be an empty log line for every exemple of my spec, so it seems like Specs2 is swallowing some internal error and not failing fast, with a fallback to empty string or something?
Note that I reproduce this issue on all tests with
testOnly * -- -ex ".*"
, even on this one:So I guess my project "layout" can be responsible of this problem. I have 2 test folders:
test/unit
andtest/integration
with the following SBT config: