Getting Foxx-tests to run?

57 views
Skip to first unread message

Julian May

unread,
Dec 28, 2015, 8:01:31 AM12/28/15
to ArangoDB
Hey

I'm trying (and failing) to get my foxx-tests to run, following the cookbook "Testing Foxx Apps".

The tests cannot be found ( show modal with "Completed 0 tests in 0ms ( 0 / 0 / 0 )  No tests found" ).
In order to identity the problem, I tried to get ANY tests running, but i just get the same result ( "No tests found" ), also when running tests for "official" foxx services, like "The Session Storage

So, I'm guessing something is wrong besides my own code, but can't figure out where to look, and what to look for...

Googling around, I came across a suggestion to write tests outside the arango-environment, but the mocha-tests are still supported right?

I'm running ArangoDB 2.7.2

Thanks

Julian May

unread,
Dec 29, 2015, 6:38:53 AM12/29/15
to ArangoDB
Can anyone else run the test in the Foxx Service "sessions-local" ?
It's there (./test/errors.js) when i install it from the "arango store", and the manifest.json has "tests": "test/**", so it should run... right?

Julian May

unread,
Dec 30, 2015, 7:57:48 AM12/30/15
to ArangoDB
Bump :]

Julian May

unread,
Jan 3, 2016, 12:01:16 PM1/3/16
to ArangoDB
Same behavior in version 2.3.12, 2.7.2 and 2.7.3.... What am i missing here??
Any help is much appreciated. Thanks

/Julian

Den tirsdag den 29. december 2015 kl. 12.38.53 UTC+1 skrev Julian May:

Julian May

unread,
Jan 4, 2016, 5:46:58 AM1/4/16
to ArangoDB

Alan Plum

unread,
Jan 4, 2016, 10:30:02 PM1/4/16
to ArangoDB
Hi Julian,

sorry for the delay. Most of the team was on holiday after Christmas.

You're right, Mocha tests are still supported as of 2.8 (and will continue to be supported in 3.x).

The tests for sessions-local as well as the built-in internal session service (mounted at `_system/sessions`) are found and pass for me on the devel branch but I'll look into it on 2.7.

Could you specify what operating system you are using and where ArangoDB and Foxx apps are installed on your file system?

Cheers,

Alan

Alan Plum

unread,
Jan 4, 2016, 10:40:21 PM1/4/16
to ArangoDB
Hi again,

I can't reproduce the problem in 2.7.4 either.

As a workaround, could you try setting the manifest.json setting to the path of the actual test file (e.g. "test/my-test.js")?

You can also use an array if you want to manually specify multiple file paths.

I'm suspecting an issue with our glob implementation (which deals with expanding wildcards like `**` in paths), so it would be useful to know the operating system you're using.

Cheers,

Alan

Julian May

unread,
Jan 5, 2016, 2:05:58 AM1/5/16
to ArangoDB
Hi Allan

Defining the tests in an array instead of `**` has no effect.

For reference (so you can correct me if I did something wrong), i changed the following in session-local's manifest.json

"tests": "test/**",
changed to
"tests": ["test/errors.js"],

I've not tested this on Windows 10 yet, but it's behaving like this on Windows 7 & Windows 8
I'm currently running Windows 8 with Arango installed at "C:\Code\XpectraDependencies\ArangoDB-2.7.2-win64" , and Foxx-apps in "C:\Code\XpectraDependencies\ArangoDB-2.7.2-win64\var\lib\arangodb-apps"

/Julian

Julian May

unread,
Jan 5, 2016, 2:19:54 AM1/5/16
to ArangoDB
Just noticed the log - seems the manifest parsing is not happy about the array:

2016-01-05T07:17:29Z [16828] ERROR Cannot parse app manifest "c:\Code\XpectraDependencies\ArangoDB-2.7.2-win64\var\lib\arangodb-apps\_db\_system\sestest\APP\manifest.json": SyntaxError: Unexpected token :
2016-01-05T07:17:29Z [16828] ERROR   at Object.parse (native)
2016-01-05T07:17:29Z [16828] ERROR   at validateManifestFile (c:/Code/XpectraDependencies/ArangoDB-2.7.2-win64/share/arangodb/js/server/modules/org/arangodb/foxx/manager.js:428:15)
2016-01-05T07:17:29Z [16828] ERROR   at appConfig (c:/Code/XpectraDependencies/ArangoDB-2.7.2-win64/share/arangodb/js/server/modules/org/arangodb/foxx/manager.js:557:15)
2016-01-05T07:17:29Z [16828] ERROR   at createApp (c:/Code/XpectraDependencies/ArangoDB-2.7.2-win64/share/arangodb/js/server/modules/org/arangodb/foxx/manager.js:571:16)
2016-01-05T07:17:29Z [16828] ERROR   at _scanFoxx (c:/Code/XpectraDependencies/ArangoDB-2.7.2-win64/share/arangodb/js/server/modules/org/arangodb/foxx/manager.js:887:13)
2016-01-05T07:17:29Z [16828] ERROR   at action (c:/Code/XpectraDependencies/ArangoDB-2.7.2-win64/share/arangodb/js/server/modules/org/arangodb/foxx/manager.js:948:7)
2016-01-05T07:17:29Z [16828] ERROR   at [object ArangoDatabase].ArangoDatabase._executeTransaction (c:/Code/XpectraDependencies/ArangoDB-2.7.2-win64/share/arangodb/js/server/modules/org/arangodb/arango-database.js:147:10)
2016-01-05T07:17:29Z [16828] ERROR   at Object.rescanFoxx (c:/Code/XpectraDependencies/ArangoDB-2.7.2-win64/share/arangodb/js/server/modules/org/arangodb/foxx/manager.js:939:6)
2016-01-05T07:17:29Z [16828] ERROR   at foxxRouting (c:/Code/XpectraDependencies/ArangoDB-2.7.2-win64/share/arangodb/js/server/modules/org/arangodb/actions.js:1046:21)
2016-01-05T07:17:29Z [16828] ERROR   at execute (c:/Code/XpectraDependencies/ArangoDB-2.7.2-win64/share/arangodb/js/server/modules/org/arangodb/actions.js:1309:7)
2016-01-05T07:17:29Z [16828] ERROR   at Object.routeRequest (c:/Code/XpectraDependencies/ArangoDB-2.7.2-win64/share/arangodb/js/server/modules/org/arangodb/actions.js:1330:3)
2016-01-05T07:17:29Z [16828] ERROR   at Function.actions.defineHttp.callback (c:\Code\XpectraDependencies\ArangoDB-2.7.2-win64\share\arangodb\js\actions\api-system.js:58:15)

Julian May

unread,
Jan 5, 2016, 2:24:47 AM1/5/16
to ArangoDB
Hold up! I had a type ( "tests": ["test/errors.js]",) - Fixing this caused the tests to run!

Completed 11 tests in 49ms (11/0/0)
errors
SessionNotFound
  • creates an Error
  • has its name
  • uses its argument in its message
  • uses its message in its stack trace
  • uses its name in its stack trace
SessionExpired
  • creates an Error
  • has its name
  • uses its argument in its message
  • uses its message in its stack trace
  • uses its name in its stack trace
SessionExpired
  • creates a SessionNotFound

Yay!

So - it seems the problem is related to "test/**"?
Anyway, this unblocks what I was trying to do, the array with explicitely defined testfiles is a totally fine alternative :)

/Julian

Alan Plum

unread,
Jan 5, 2016, 5:04:35 AM1/5/16
to ArangoDB
Hi Julian,

that you're using Windows confirms my suspicion: we're probably not applying globs (i.e. wildcards) correctly in paths on non-POSIX (i.e. Windows) filesystems.

I've created a GitHub issue to track this problem: https://github.com/arangodb/arangodb/issues/1647

Until this problem is solved, the workaround will continue to work.
Reply all
Reply to author
Forward
0 new messages