What is the simplest setup for meteor+chimp on circle-ci?


#1

Hi guys,

daaaammmn !!! My chimp-based acceptence tests are slowing me down sooooo much that I thought it might be worth the free tier of CircleCi a try.

I am aware of https://github.com/xolvio/qualityfaster which looks really cool, but it seems like it needs some time to adapt to my testing setup (Blaze, Mocha for unit-tests, Chimp for acceptance tests).

All I need for now is CircleCi to run my Chimp-tests. Does anyone have a really simple circle.yml that does nothing but to run a chimp --mocha --path=tests?


How to make CircleCi save SCREENSHOTS and LOGS of the browsers console?
Run Chimp Headlessly?
#2
machine:
  node:
    version: 6.3.0
dependencies:
  cache_directories:
    - "node_modules"
    - "~/.npm"
  override:
    - npm install chimp
test:
   override:
     - chimp --mocha --path=tests

just a start point … let’s iterate …
reference examples :



#3

OK… to be continued… this here was my first try. It fails, with circle saying that I have no tests:

machine:
  java:
    version: oraclejdk8
  node:
    version: 6.3.0

dependencies:
  cache_directories:
    - "node_modules"
    - "~/.npm"
  override:
    - npm install chimp

test:
  override:
    - chimp --mocha --path=tests

#4

I’ve setup this project : https://github.com/lc3t35/simpliest-chimp-circle

@thebarty Done ?


#5

@lc3t35 Thanks a lot laurent for your help!

Right now I still don’t have it running. I think it might be due to my git-directory. The setup is like this:

/
/docs/...
/src/circle.yml
/src/tests/acceptance-tests.test.js
/src/* (the code)

I have tried your original and also this, BUT I still get a “There were no test commands!” result.

test:
   override:
		- chimp --mocha --path=src/tests

Any suggestions? :slight_smile:


#6

what is the log on circleci.com ?


#7

Hmmm… ok, the first problem was, that the circle.yml was in the wrong place ("/src/circle.yml").

I put it into the root and am starting to see errors (which is great)! :slight_smile: Right now I am getting errors about npm packages missing, so we also need to have a command to load them via src/packages.json.

By the way: Chimp does NOT automatically run a meteor instance to test against. How do we do that? I read something about a parallel-option somewhere?


#8

Yeah finally I am getting a {"code":-32603,"message":"Cannot navigate to invalid URL"}-error within chimp. So now I need to run an meteor-instance parallel.

Any ideas?


#9

I found another great reference (the best so far), which is… guess what?? within the TODOS example: https://github.com/meteor/todos


#10

I can’t remember all the reasons for some of the stuff in there, but the following might help you out.
I do remember that I couldn’t get around the need for that three minute sleep! It took THAT long for Meteor to get ready.

dependencies:
  post:
    - date > ${CIRCLE_ARTIFACTS}/meteor.log
    - ${METEOR_CMD} --settings=settings.json >> ${CIRCLE_ARTIFACTS}/meteor.log 2>&1 & :
        background: true

test:
  post:
    - sleep 3m
    - ${CHIMP_CMD} .e2e_tests/chimp-config.js --ddp=http://localhost:3000 --path=.e2e_tests

#11

Hey, thanks for your tip!! :slight_smile:

Your exerp looks really interesting and might contain the solution.
Do you mind posting the full file? I’d love to see what CIRCLE_ARTIFACTS, METEOR_CMD and CHIMP_CMD is?


#12

#13

Oh thats cool!!!

I now see a slight chance of getting this to work… :sunny:


#14

It’ll work!
… and you’ll like it! :grin:


#15

You guys might also want to check out this file:

I’m using Gulp now to do the orchestration. I’ve not got it starting Meteor yet, but this will be easy.

If you want to start Meteor quicker, then take note of the cache directories here. That should speed things up a bit


#16

@sam: Thanks a lot for this link. I wasn’t aware that the the DEV-branch is so different. I really like the way that you structured it - this looks like the cleanist solution out there.

Do you think you can add a meteor task for the gump? Maybe it might be a good idea to have a simple circle-ci setup that totally follows the meteor guide with 2 test-runners 1) mocha for unit- and integretion-tests 2) chimp for e2e tests?

Thanks a lot for your help so far! :slight_smile:


#17

Indeed that’s next. I’m waiting on my cyber-monday time machine order to come through so I can get back to this :slight_smile:

I will soon so just keep an eye on that repo


#18

Oh yeah! That time-machine is on its way and will soon deliver. :slight_smile:

In the meantime I am getting a timeout error with my improvised circle.yml:


[chimp] Running...


  1) "before all" hook

  0 passing (5m)
  1 failing

  1)  "before all" hook:
     Error: timeout of 300000ms exceeded. Ensure the done() callback is being called in this test.

my current cicle.yml looks like this (dirty)

machine:
  node:
    version: 6.5.0
  java:
    # This is needed by Chimp to run Selenium so we can start Chrome and Firefox
    version: oraclejdk8
  environment:
    _JAVA_OPTIONS: "-Xms512m -Xmx1024m"
    METEOR_CMD: .meteor/meteor
    CIRCLE_ENV: test  # for setting stuff in our .js files depending on environment

dependencies:
  cache_directories:
    - ~/project/src/.meteor
    - ~/projectsrc/.npm
    - ~/project/src/node_modules

  pre:
    - pwd
    - cd src; mkdir -p .meteor
    - if [ ! -e src/.meteor/meteor ]; then cd src; curl https://install.meteor.com | /bin/sh 2>&1 | cat; fi
    - pwd; cd src; pwd; npm install;  # install npm-packages from ./src/packages.json
    - cd src; npm install -g chimp 
    - cd src; chimp --path=noexist # Cache chimp deps by running it without any tests

  # Run meteor in parallel to chimp via ``post``
  post:
    - pwd
    - date > ${CIRCLE_ARTIFACTS}/meteor.log
    - cd src; meteor test --full-app --driver-package tmeasday:acceptance-test-driver --port 3100 >> ${CIRCLE_ARTIFACTS}/meteor.log 2>&1 & :
        background: true

test:
  post:
    - pwd
    - ls -al
    - cd src; ls -al; node --version; npm --version; java -version; meteor --version;
    - sleep 3m
    - cd src; chimp ./tests/_circle-ci-chimp-config.js --ddp=http://localhost:3100 --path=tests --mocha;

I am still in doubt that meteor is actually running, so I will now screw my improvised circle.yml and try to implement @sams DEV-branch… it looks much better and I am really starting to like this CI stuff, although all I am getting are some errors. But I am sure that in the end it will be a HUGE timesaver. :slight_smile:

@sam: Can’t wait to see the meteor-guide-compatible version of your setup! :slight_smile:
Guys: Thanks for your help so far :kissing_heart:


#19

@Sam: just wondering: why are you guys using Karma on the client instead of a plain Mocha setup? I am sure it’s because Karma has some advantages - which are they? :slight_smile:


#20

You are piping meteor’s stdout to ${CIRCLE_ARTIFACTS}/meteor.log

Have you looked at those logs to see if it is logging some sort of failure?