Closed hkollmann closed 4 years ago
If I understand right, this will allow to load the application on a port on localhost without starting a server. This will be good enough for my current use case. However, as I noted on Twitter, a more general solution would be to be able, in addition, to specify the URL from which the app is loaded (using an environment variable plus optionally a command line parameter). This would allow to run tests on deployed apps, too. But this is probably a different PR. What do you think ?
This should be an extension to the testtapper package - not the test command itselfs. The test command did not know anything about the tests - it's just running them
Of course you're right. Thank you.
a bit late, but maybe "no-webserver" is shorter and a more common pattern for CLI params?
This will prevent the start of the webserver as discussed in gitter:
Christian Boulanger @cboulanger Sep. 24 10:03 @hkollmann @oetiker My application's compile.json has an application "name": "testtapper" based on "class": "qxl.testtapper.Application",, which run fine in the browser after being compiled. I now want to run this test on the command line in the GitHub CI environment. There is an apache webserver in a service container which delivers the app on port 8073 (It's a PHP backend). if I do "npx qx test -p 8073", it will try to create an additional server. How do I make it listen to the running server only? Also, if I execute npx qx test --app-name=testtapper, I get Error: TypeError: Cannot read property 'setWriteIndexHtmlToRoot' of undefined at /Users/cboulanger/Code/bibliograph/node_modules/@qooxdoo/compiler/lib/compiler/index.js:51111:47 at Array.qx.lang.normalize.Array.forEach() [as forEach] (/Users/cboulanger/Code/bibliograph/node_modules/@qooxdoo/compiler/lib/compiler/index.js:10109:22) at wrapper.qx.tool.cli.commands.Compile.prototype.createMakersFromConfig() [as createMakersFromConfig] (/Users/cboulanger/Code/bibliograph/node_modules/@qooxdoo/compiler/lib/compiler/index.js:50857:23) at async wrapper.qx.tool.cli.commands.Compile.prototype._loadConfigAndStartMaking() [as _loadConfigAndStartMaking] (/Users/cboulanger/Code/bibliograph/node_modules/@qooxdoo/compiler/lib/compiler/index.js:50579:38) at async wrapper.qx.tool.cli.commands.Compile.prototype.process() [as process] (/Users/cboulanger/Code/bibliograph/node_modules/@qooxdoo/compiler/lib/compiler/index.js:50548:9) at async wrapper.qx.tool.cli.commands.Serve.prototype.process() [as process] (/Users/cboulanger/Code/bibliograph/node_modules/@qooxdoo/compiler/lib/compiler/index.js:66827:9) at async wrapper.qx.tool.cli.commands.Test.prototype.process() [as process] (/Users/cboulanger/Code/bibliograph/node_modules/@qooxdoo/compiler/lib/compiler/index.js:67575:11) at async wrapper.qx.tool.cli.Cli.prototype.processCommand() [as processCommand] (/Users/cboulanger/Code/bibliograph/node_modules/@qooxdoo/compiler/lib/compiler/index.js:39995:18)
Henner Kollmann @hkollmann Sep. 24 10:14 Have you disabled the server start in your compile.js?
Christian Boulanger @cboulanger Sep. 24 11:34 @hkollmann How do I do that - i faintly remember it is a needServer config setting - but where to put it? Do I need a separate compile.js? or can the one shipped with testtapper be configured accordingly? Or do I need a separate node app? It's not clear from the documentation yet: https://qooxdoo.org/documentation/#/development/testing/unit_testing?id=running-the-tests
Henner Kollmann @hkollmann Sep. 24 14:33 This use case is not possible in the moment, Testtapper sets needServer by default. And there is no bubble to prevent this in the moment. What's about adding a parameter to the test command disablewebserver with default false?
Christian Boulanger @cboulanger Sep. 24 14:59