Testing the core on Ubuntu 14.10


What is the proper way of testing Atom core?
There are at least three ways of doing it, though they all fail.

Running script/test

This is the most intuitive way. But the script stops before running tests:

Node: v0.10.33
npm: v1.4.28
Installing build modules...
Installing apm...
Installing modules ✓
Deduping modules ✓
/bin/sh: 1: node_modules/.bin/grunt: not found

Running npm run test

I have found the existence of this script in package.json. Unfortunately, the result is almost the same:

> atom@0.159.0 test /home/jharai/Documents/workspaces/atom/atom
> node script/test

Node: v0.10.33
npm: v1.4.28
Installing build modules...
Installing apm...
Installing modules ✓
Deduping modules ✓
/bin/sh: 1: node_modules/.bin/grunt: not found

npm ERR! atom@0.159.0 test: `node script/test`
npm ERR! Exit status 127

Running script/grunt test

In contrast to them, this command actually runs tests! The problem is, there are some error messages and failed tests:

Running "shell:kill-atom" (shell) task

Running "run-specs" task
>> [32153:1214/115945:ERROR:browser_main_loop.cc(162)] Running without the SUID sandbox! See https://code.google.com/
p/chromium/wiki/LinuxSUIDSandboxDevelopment for more information on developing with the sandbox on.
>> ATTENTION: default value of option force_s3tc_enable overridden by environment.
>> [32222:1214/115945:INFO:renderer_main.cc(204)] Renderer process started
>> [32153:1214/115947:INFO:CONSOLE(92)] "Download the React DevTools for a better development experience: http://fb.m
e/react-devtools", source: /home/jharai/Documents/workspaces/atom/atom/node_modules/react-atom-fork/lib/React.js (92)
>> [32153:1214/115947:INFO:CONSOLE(64)] "Window load time: 1838ms", source: file:///home/jharai/Documents/workspaces/
atom/atom/static/index.js (64)
>> ...........[32153:1214/115948:INFO:CONSOLE(100)] "Uncaught BufferedProcessError: Failed to spawn command `bad-comm
and-nope`. Make sure `bad-command-nope` is installed and on your PATH", source: /home/jharai/Documents/workspaces/ato
m/atom/src/buffered-process.coffee (100)
>> ...-.............................................................................................[32153:1214/11595
0:INFO:CONSOLE(853)] "Error setting item in object: Validation failed at foo.bar.anInt, null cannot be coerced into a
n int", source: /home/jharai/Documents/workspaces/atom/atom/src/config.coffee (853)
>> ....[32153:1214/115950:INFO:CONSOLE(874)] "Error setting item in array: Validation failed at foo.bar.arr, "five" i
s not one of ["one","two","three"]", source: /home/jharai/Documents/workspaces/atom/atom/src/config.coffee (874)

and finally the execution stops abruptly due to failed spec:

>> [Error] find-and-replace, release-notes, tree-view, atom core spec(s) failed
Aborted due to warnings.

So, how can I run tests on Ubuntu 14.10?
Without testing, it is almost impossible to hack the core.


This might be super obvious and the wrong answer but did you install the apm install tools via the menu in atom?

I think these things are usually these things are pathing related, maybe some part of the install went wrong or well just against the grain (not the usual expected installation).


Mostly following the instructions, I built it myself. No error occurred while building.


I’m also hitting errors when trying to run the Atom Core tests.

I tried running script/test.
The first error message I got from running script/test was the same as above (node_modules/.bin/grunt: not found), so I edited the script to point to what looks to be the right location, build/node_modules/.bin/grunt. After that I got the error “A valid Gruntfile could not be found.”. Before I dig further, @nathansobo, am I doing something obviously wrong, or is this something that you’re aware of being broken?
(I’m on OSX, not Ubuntu, not sure if that matters.)

EDIT: Looks like the Gruntfile is in the ‘build’ folder. I got script/grunt tests to run by editing the path in script/grunt to point to the build folder.
Running the tests does produce a ton of errors though.


Try apm test. That should work from the command line. Though I usually run specs directly in atom via ctrl-alt-cmd-p (the “Window: Run Package Specs” command).