Comments (21)
You can run the testem in mode continues integration. Add parameter "ci" to "Application Parameters" field.
from testem.
Alright, I tried that and I get some new errors.
/usr/local/bin/node ../../../../usr/local/bin/testem ci
/usr/local/lib/node_modules/testem/lib/ci_mode_app.js:67
console.log("# Launching " + launcher.name)
^
TypeError: Cannot read property 'name' of undefined
at App.runAllTheTests (/usr/local/lib/node_modules/testem/lib/ci_mode_app.js:67:50)
at async.forEachSeries.iterate (/usr/local/lib/node_modules/testem/node_modules/async/lib/async.js:118:13)
at Object.async.forEachSeries (/usr/local/lib/node_modules/testem/node_modules/async/lib/async.js:134:9)
at EventEmitter.App.runAllTheTests (/usr/local/lib/node_modules/testem/lib/ci_mode_app.js:66:15)
at App.onServerStart (/usr/local/lib/node_modules/testem/lib/ci_mode_app.js:60:18)
at EventEmitter.BaseApp.runHook (/usr/local/lib/node_modules/testem/lib/base_app.js:49:27)
at EventEmitter.BaseApp.runPreprocessors (/usr/local/lib/node_modules/testem/lib/base_app.js:30:14)
at EventEmitter.App.onServerStart (/usr/local/lib/node_modules/testem/lib/ci_mode_app.js:59:14)
at EventEmitter.emit (events.js:85:17)
at EventEmitter.Server.start (/usr/local/lib/node_modules/testem/lib/server.js:43:18)
Process finished with exit code 1
I should note that I also ran the first line in my project and it worked fine for the ci option (/usr/local/bin/node ../../../../usr/local/bin/testem ci), it just didn't work in my IDE.
from testem.
This is because Testem's dev mode UI requires a ANSI-capable terminal to render, which JetBrains is not. I am not sure there's anything that can be done about that. As @karagodin just pointed out, you can run testem ci
to get around that, but then you don't get the same UI.
@jboesch I think that bug has been fixed. Try re-installing the latest version and see if it persists.
from testem.
I updated to the latest PhantomJS and latest Test'em, still errors. Are there plans to support this? A lot of people rely on these IDE's for CI
from testem.
Hmm, it works from the IDE when I change the launcher to "Chrome" or "Safari" or any browser - it outputs it in TAP format which it's supposed to do because I have the "ci" option set. It only errors when it's PhantomJS. So strange. I did some digging...
in lib/config.js
Config.prototype.getLaunchers = function(app, cb){
var self = this
this.getAvailableLaunchers(app, function(availableLaunchers){
console.log(availableLaunchers);
cb(self.getWantedLaunchers(availableLaunchers))
})
}
PhantomJS isn't in the availableLaunchers.. Hrmmm.
from testem.
Doing testem launchers
will also list the available browsers. For phantomjs, make sure it's in the path. For JetBrains, you might have to configure the path within their UI I am guessing.
from testem.
It shows PhantomJS as an available browser when i run testem launchers... but just won't pick it up in the JetBrains IDE.
I perform a "which phantomjs" and it returns the proper path, but for whatever reason, testem isn't finding it when I run it through the IDE.
from testem.
So I got closer to figuring it out... in lib/browser_launcher.js I added some console.log action
function findableByWhich(cb){
var exe = this.exe;
exec('which ' + this.exe, function(err, exePath){
console.log('which ' + exe + ' | ' + err + ' | ' + exePath);
cb(!!exePath);
})
}
Punching 'testem ci' In terminal outputs the correct info:
which phantomjs | null | /usr/local/bin/phantomjs
When I run it from my IDE, I get
which phantomjs | { [Error: Command failed: ] killed: false, code: 1, signal: null } |
Any ideas?
from testem.
Try
console.log(process.env.PATH)
from testem.
Ahh, interesting. I guess which
is not in the path.
from testem.
Hmm, weird. My IDE is outputting:
/usr/bin:/bin:/usr/sbin:/sbin
which is completely different than when i echo $PATH from terminal. I need to somehow hijack it to include
/usr/local/bin
which is where PhantomJS resides.
from testem.
Got it working! Added
/usr/local/bin:/usr/bin
to my environment variables in the NodeJS runner plugin. Lovely! Thank you :)
from testem.
Oh nice! Would you mind writing this up somewhere? Maybe a gist or a screenshot. Also, let me know how well you like/dislike this setup once you start getting used to it.
from testem.
I will definitely do a gist with a screenshot. The unfortunate part about all this work we went through, is that it only does a single pass "testem ci" and isn't a "watcher" for changes. The watcher is the only thing that's useful in the IDE for this kind of thing (TDD). Although it's cool that we got the "teamem ci" working from the IDE :)
Unfortunately, running "testem" as a watcher from the IDE throws errors, because, as you mentioned above, it requires an ANSI-capable terminal.
Maybe there will be improvements down the road for a watcher that works with the JetBrains IDE's :)
from testem.
Here was my config to get this working with "testem ci"
Then here is me running the tests with the "testem ci" output
from testem.
Unfortunately, running "testem" as a watcher from the IDE throws errors, because, as you mentioned above, it requires an ANSI-capable terminal.
Yeah, that's what I figured. Meh, if you can manage, just tile a terminal next to your IDE. IDE's have a god complex: they try to bring everything inside of them, and for you to depend on them for your every need - I don't like that :)
I won't rule out a your suggestion: make a more basic version of a watcher process that just outputs to stdout and stderr, but that will never be as good as the full text-based UI.
from testem.
I'm trying to launch testem from within a script, dev mode is desired. I'm creating a runner on the fly (so you can run tests against only specific files) and then launching testem.
var testem = execFile(__dirname+'/../../node_modules/testem/testem.js', ['-f', jsPath+'/tests/support/testem.json']);
testem.stdout.on('data', function(data) {
console.log(data.toString());
});
testem.stderr.on('data', function(data) {
console.log(data.toString());
});
testem.on('close', function(code) {
console.log('exited with code', code);
});
and I get
tty.setRawMode: Use `process.stdin.setRawMode()` instead.
Error: can't set raw mode on non-tty
at Object.<anonymous> (tty.js:37:11)
at Object.deprecated (util.js:75:15)
at EventEmitter.exports.Charm (/Users/rpflo/Code/github/ember-tools/node_modules/testem/node_modules/charm/index.js:43:13)
at module.exports (/Users/rpflo/Code/github/ember-tools/node_modules/testem/node_modules/charm/index.js:29:12)
at initCharm (/Users/rpflo/Code/github/ember-tools/node_modules/testem/lib/ui/screen.js:33:21)
at module.exports.View.extend.initialize (/Users/rpflo/Code/github/ember-tools/node_modules/testem/lib/ui/appview.js:36:26)
at Backbone.Model (/Users/rpflo/Code/github/ember-tools/node_modules/testem/node_modules/backbone/backbone.js:258:21)
at child (/Users/rpflo/Code/github/ember-tools/node_modules/testem/node_modules/backbone/backbone.js:1531:41)
at new child (/Users/rpflo/Code/github/ember-tools/node_modules/testem/node_modules/backbone/backbone.js:1531:41)
at EventEmitter.App.initView (/Users/rpflo/Code/github/ember-tools/node_modules/testem/lib/dev_mode_app.js:58:28)
exited with code 1
Anybody have any thoughts?
from testem.
You may have some luck checking out how we integrate Testem into Lineman @rpflorence, check out our "spec" grunt task to see how it's done.
Edit:** Also relevant is our testem-utils file.
from testem.
Thanks @davemo! I was wondering how you guys did it myself. @rpflorence exec or spawn do not work because dev mode requires an ANSI terminal.
from testem.
There is a new 'Terminal' plugin (at least in WebStorm 7 EAP) that has support for ANSI control characters. It basically launches a system terminal inside the IDE. I can run Testem in DEV mode there. But of course no hot-linking in stack-traces which I would really be interested in.
from testem.
@mistaecko that's neat!
from testem.
Related Issues (20)
- Running testem on latest Chrome version results in error HOT 2
- reporter output cruft HOT 2
- A
- ...
- Upgrade xmldom to v0.7.0
- How to have testem make use of browserify's sourcemaps?
- Test
- "Uncaught TypeError: io.connect is not a function" in `testem_connection.js` HOT 1
- fireworm is pollutting logs HOT 3
- Request: add QUnit.todo support to XUnit reporter
- what does "Timeout" in Config mean specifically? is it for 1 test or the entire test suit? HOT 1
- Errors from runtime.js are not picked up
- Returned pending Promise from `QUnit.done` causes browser to prematurely disconnect HOT 4
- Vbb
- Upgrade socket.io to 4.5.4 HOT 2
- Teste 01
- Teste
- remove bluebird? HOT 2
- testem server becoming slower and slower HOT 2
- not ok 1 Chrome - [undefined ms] - error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from testem.