Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running RTD from Travis #129

Open
AdrienLemaire opened this issue Feb 5, 2014 · 13 comments
Open

Running RTD from Travis #129

AdrienLemaire opened this issue Feb 5, 2014 · 13 comments

Comments

@AdrienLemaire
Copy link
Contributor

When running only a few minimal unit tests, no acceptance tests and no coverage check, the grunt command doesn't fail.

Hence I tried to configure Travis, to run tests after each commit on github, as follow:

.travis.yml:

language: node_js
node_js:
  - "0.10"
before_install:
  - curl https://install.meteor.com | /bin/sh
  - npm -g coffee-script meteorite
  - npm i -g karma phantomjs istanbul grunt-cli selenium-webdriver mocha karma-chai
services:
    - mongodb
notifications:
  email:
    - [email protected]

Makefile

test:
    cd test/rtd && ./rtd --debug

.PHONY: test

.gitmodules (replace git → https)

[submodule "test/rtd"]
    path = test/rtd
    url = https://github.com/xolvio/rtd.git

But there are 2 problems:

  1. From https://travis-ci.org/CoinsManager/CoinsManager/builds/18244442:

    ./rtd: line 5: cd: ./node_modules/.bin: No such file or directory
    
  2. Because rtd is a ci tool in itself and never stops, the travis build will never finish. How can I specify RTD to run a single set of tests and quit ?

Thank you for your help. I'll set up a new module travis-rtd-meteor or something, to make it easier for other rtd users to integrate Travis as well.

@treybean
Copy link

treybean commented Feb 5, 2014

Give grunt runOnce a try.

@AdrienLemaire
Copy link
Contributor Author

Ok. First problem solved at https://travis-ci.org/CoinsManager/CoinsManager/builds/18246964

The problem is that the rtd script is trying to pwd from node_modules/.bin before doing the npm install. So I forced a npm install before running rtd.
New problem is cp: cannot stat with grunt-bgshell

Running grunt with runOnce in local doesn't finish:
test

But at least it doesn't watch for new changes in files. will try it in Travis after I get the first issue solved

@AdrienLemaire
Copy link
Contributor Author

cp: cannot stat issue is because I didn't version the test/acceptance/fixtures/empty.js file.

Bug when running grunt runOnce, jshint is executed even when disabled. Fixing it in a pull request

AdrienLemaire added a commit to AdrienLemaire/rtd that referenced this issue Feb 5, 2014
add conditions to run jshint and coffeelint in grunt runOnce.
Related to issue xolvio#129
AdrienLemaire added a commit to AdrienLemaire/rtd that referenced this issue Feb 5, 2014
add conditions to run jshint and coffeelint in grunt runOnce.
Related to issue xolvio#129
@AdrienLemaire
Copy link
Contributor Author

Finally solved several issues of packages dependencies, and tests are run successfully on Travis. But as I feared before @treybean the build does not finish and is pending.

Build can be seen here: https://travis-ci.org/CoinsManager/CoinsManager/builds/18313136

@samhatoum @Nomeasmo Seems to be a bug from #85

@AdrienLemaire
Copy link
Contributor Author

Temporary solution is to comment tasks.push('closeWebdriverSessions'); from constructRunOnceTasks in the Gruntfile.js from a fork of rtd that I submodule instead of upstream.

the task should be smarter and verify that sessions are open before trying to close them

@samhatoum
Copy link
Member

without the closeWebdriverSessions you would get orphan browsers. Do you experience this with Travis with the line commented out?

@Nomeasmo
Copy link
Contributor

Hi Sam,

I do not use Travis, anyway runOnce now activated.

Refer to the changes here: Nomeasmo@45e8132

Oliver

Am 12.02.2014 um 03:39 schrieb Sam Hatoum [email protected]:

without the closeWebdriverSessions you would get orphan browsers. Do you experience this with Travis with the line commented out?


Reply to this email directly or view it on GitHub.

@AdrienLemaire
Copy link
Contributor Author

@samhatoum travis is smart enough to kill processes itself apparently, not seeing any problem.

But in local, if I run make test, then a bunch of processes keep running and I have to kill them manually, or meteor run would fail. Looking for a solution to fix that.

@Nomeasmo can you do a pull request to RTD with your code ? Just modifying the files manually doesn't work for me (actually there isn't even a webdrivers/webdriver-helper.js file, seems like your repo differs quite a bit from upstream).

AdrienLemaire added a commit to AdrienLemaire/rtd that referenced this issue Feb 24, 2014
add conditions to run jshint and coffeelint in grunt runOnce.
Related to issue xolvio#129
@AdrienLemaire
Copy link
Contributor Author

I rebased my code with rtd upstream (noticing that my PR #130 has been removed), and the problem is still there: When you start grunt runOnce, it will never finish. You need to ctrl-c to get back to the shell.

@Nomeasmo
Copy link
Contributor

Please refer to the pr #143

Let me know what you think about the limitation.

@AdrienLemaire
Copy link
Contributor Author

@Nomeasmo thank you for the PR. I rebased from it, and it finally closed after a while, but on a failure:

Finished in 0.004 seconds
0 tests, 0 assertions, 0 failures, 0 skipped

Fatal error: unknown error: unable to discover open pages
  (Driver info: chromedriver=2.0,platform=Linux 3.13.4-1-ARCH x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 20.83 seconds
Build info: version: '2.32.0', revision: '6c40c18', time: '2013-04-09 17:22:56'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '3.13.4-1-ARCH', java.version: '1.7.0_51'
Driver info: org.openqa.selenium.chrome.ChromeDriver

@Nomeasmo
Copy link
Contributor

@Fandekasp does this happen also in the meteor-rtd-example-project?

When does this happen?
Only with runOnce option?
Before acceptance test, in acceptance test or in the closeWebdriverSessions?
Did you change all your code that acquires a driver to use the getDriverPromise?

@AdrienLemaire
Copy link
Contributor Author

Didn't check with meteor-rtd-example-project.

./rtd --debug runs fine.
Only grunt runOnce fails.

I didn't implement acceptance tests for CoinsManager yet, need to learn how to do them. Focusing on unit testing for the moment.

grunt runOnce fixed by commenting again in Gruntfile.js:

//tasks.push('closeWebdriverSessions');

I don't think I'm using any driver if I don't have any acceptance tests :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants