Merge pull request #449 from mbilker/travis-linux-testing

Travis Linux Testing
This commit is contained in:
Juan 2015-11-24 12:48:31 -08:00
commit aa27692b03
4 changed files with 29 additions and 10 deletions

View file

@ -10,13 +10,13 @@ matrix:
include:
# Wants a c++11 compiler
- os: linux
env: NODE_VERSION=0.10 CC=gcc-4.8 CXX=g++-4.8
env: NODE_VERSION=0.10 CC=gcc-4.8 CXX=g++-4.8 NYLAS_HOME=/home/travis/.nylas
- os: linux
env: NODE_VERSION=0.12 CC=gcc-4.8 CXX=g++-4.8
env: NODE_VERSION=0.12 CC=gcc-4.8 CXX=g++-4.8 NYLAS_HOME=/home/travis/.nylas
- os: linux
env: NODE_VERSION=4.2 CC=gcc-4.8 CXX=g++-4.8
env: NODE_VERSION=4.2 CC=gcc-4.8 CXX=g++-4.8 NYLAS_HOME=/home/travis/.nylas
- os: linux
env: NODE_VERSION=5 CC=gcc-4.8 CXX=g++-4.8
env: NODE_VERSION=5 CC=gcc-4.8 CXX=g++-4.8 NYLAS_HOME=/home/travis/.nylas
- os: osx
env: NODE_VERSION=0.10
- os: osx
@ -39,6 +39,12 @@ install:
- nvm install $NODE_VERSION
- nvm use --delete-prefix $NODE_VERSION
before_script:
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
export DISPLAY=:99.0;
sh -e /etc/init.d/xvfb start;
fi
script: script/cibuild
addons:
@ -52,3 +58,4 @@ addons:
- g++-4.8
- git
- libgnome-keyring-dev
- xvfb

View file

@ -362,7 +362,7 @@ module.exports = (grunt) ->
ciTasks = ['output-disk-space', 'download-electron', 'build']
ciTasks.push('dump-symbols') if process.platform isnt 'win32'
ciTasks.push('set-version', 'lint', 'generate-asar')
ciTasks.push('test') if process.platform is 'darwin'
ciTasks.push('test') if process.platform isnt 'win32'
unless process.env.TRAVIS
ciTasks.push('codesign')

View file

@ -33,12 +33,16 @@ module.exports = (grunt) ->
grunt.registerTask 'run-spectron-specs', 'Run spectron specs', ->
shellAppDir = grunt.config.get('nylasGruntConfig.shellAppDir')
executablePath = path.join(shellAppDir, 'Contents', 'MacOS', 'Nylas')
if process.platform is 'darwin'
executablePath = path.join(shellAppDir, 'Contents', 'MacOS', 'Nylas')
else
executablePath = path.join(shellAppDir, 'nylas')
done = @async()
npmPath = path.resolve "./build/node_modules/.bin/npm"
if process.platform isnt 'darwin'
if process.platform is 'win32'
grunt.log.error("run-spectron-specs only works on Mac OS X at the moment.")
done(false)

View file

@ -538,7 +538,11 @@ describe "populated composer", ->
@$composer = @composer.refs.composerWrap
it "sends the draft on cmd-enter", ->
NylasTestUtils.keyPress("cmd-enter", React.findDOMNode(@$composer))
if process.platform is "darwin"
cmdctrl = 'cmd'
else
cmdctrl = 'ctrl'
NylasTestUtils.keyPress("#{cmdctrl}-enter", React.findDOMNode(@$composer))
expect(Actions.sendDraft).toHaveBeenCalled()
expect(Actions.sendDraft.calls.length).toBe 1
@ -547,12 +551,16 @@ describe "populated composer", ->
expect(Actions.sendDraft).not.toHaveBeenCalled()
it "doesn't let you send twice", ->
NylasTestUtils.keyPress("cmd-enter", React.findDOMNode(@$composer))
if process.platform is "darwin"
cmdctrl = 'cmd'
else
cmdctrl = 'ctrl'
NylasTestUtils.keyPress("#{cmdctrl}-enter", React.findDOMNode(@$composer))
expect(Actions.sendDraft).toHaveBeenCalled()
expect(Actions.sendDraft.calls.length).toBe 1
@isSending = true
DraftStore.trigger()
NylasTestUtils.keyPress("cmd-enter", React.findDOMNode(@$composer))
NylasTestUtils.keyPress("#{cmdctrl}-enter", React.findDOMNode(@$composer))
expect(Actions.sendDraft).toHaveBeenCalled()
expect(Actions.sendDraft.calls.length).toBe 1