How to get phantomjs running for pull requests in travis ci? - intern

I cannot get intern client tests running for pull requests in travis ci using phantomjs. I can run phantom locally and I can even run the tests using saucelabs in travis ci when the env vars are secure - push against my own fork.Any help would be greatly appreciated.
Error
Gruntfile.js
Intern Config

Moving the selenium start up to the travis before_script property solved the problem.

Related

Cannot build / run test properly in travis. Permission denied

I have a simple node.js code/project. I write some test with jestjs. I run the test on my local machine with the command 'npm run test'. The test is able to pass.
I moved the project onto GitHub and wanted to tinker with Travis CI. But my build on travis ci fails. The error message on travis is shown below.
Below is the state of my Git repo:
I never committed the folder 'node_modules' into Git because I read somewhere that this folder should be excluded as Travis would have its 'own environment to run and build the project'.
Below is my .travis.yml :
Below is my package.json file:
I tried modifying this file as well. I am still stuck, Should I remove the lines that states the "build" ?
Appreciate any help!
Maybe try adding the following to travis.yml
before_script: chmod 0555 ./node_modules/.bin/travis
I resolved the situation by adding the below:
before_script: chmod 0555 ./node_modules/.bin/jest
I think this is trying to tell the machine running to allow the use of the jest library. Therefore the jests unit test is able to run properly.

Run test cases and on Success deploy - React JS App with Jenkins

I am trying to run test cases and deploy React-js app with Jenkins.
I am able run react-js app locally after git push command, but after that second command mocha (command to run test cases) is never executed.
I want to deploy react-app to production if all test cases passes.
Below is my simple build script
cd naviaget/to/package.json/file
npm start
mocha
Any help is appreciated.
Well if npm start is starting the development server, you shouldn't call it before running the scripts, because the server won't finish execution until it's closed. That's the reason mocha is never executed.
Normally in CI you first run your tests, and then if everything goes fine you deploy, run a server, whatever. These are normally two different steps: integration (running your test) and deployment (spinning up your server).
I'm not familiar with Jenkins but I'm pretty sure it should be easy to set it up like that:
Run the tests with mocha
If everything is fine, re-reploy

Attaching Grunt tasks to Git hooks like Git pre-push to deploy to production after tests

I am searching the net for CD of Git repos to production directly using grunt. Has anyone tried attaching tests and deployment to production on passing tests using Grunt in the server?
My previous general question lead me to Jenkins. Just wondering if the above attachment is possible and any Gruntfile examples
SetupAngularJS or Angular2 Projects for Continuous Integration and Continuous Deployment

Run MochaJS tests on Heroku NodeJS server

I have an extensive MochaJS test suite for my ExpressJS / NodeJS API. The test suite includes creation of objects and removal of those same objects from the database.
Currently, all of my regression tests are passing in my development environment. We'd like to be able to run the same test on the staging environment that has data objects that were migrated and not created after the new code was deployed.
How do we run our mocha tests from the server?
Currently, I use the following command to run my tests, locally:
foreman run node node_modules/mocha/bin/mocha
Thanks in advance for any help!
You can probably leverage the package.json scripts:
https://docs.npmjs.com/misc/scripts
If heroku uses a simple npm install to install your package, you can define a prepublish script which runs mocha. It's as simple as defining this in your package.json:
"scripts": {
"prepublish": "mocha"
}
Don't worry about mocha not being installed globally, npm install will add the node_modules/.bin folder to the PATH environment variable during installation.
Our team decided to go the route of using continuous integration as the mechanism for running server side tests. Two birds with one stone!
We're using CircleCI to make that happen.
We're now passing the supertest library the app module rather than a URL. This allows the endpoints to be called at the HTTP layer by supertest.
Hope this helps anyone else looking at similar alternatives!

Build and deploy or deploy to build

My application is based on node.js, and uses bower.js and others task runners to compile assets and build the actual assets (minify, concat, inject...).
Since this is my first application that will be running in a scalable enviroment on Heroku, I was wondering how is the process of deploying.
I mean, my current workflow is:
cd myRepo
git commit [blabla...]
git push heroku
And when running it, it runs npm run wich calls geddy and runs the server.
If I build before pushing, there will be files that are kind of redundant, but if I push the unbuilt project, it should build it on the cloud. Is that the main idea?
Thanks
it should build it on the cloud. Is that the main idea?
Correct; checkout the Dev Center for more Nodejs information:
Heroku Dev Center: Getting Started with Nodejs
Specifically here, it lists information on bower:
Heroku Node.js Support: Customizing the Build Process

Resources