Skip to content

Commit 5e8329e

Browse files
committed
Updates for reliability of CI
* Seeting default driver to poltergeist_errors_ok * Added file to make poltergeist retry * more on the poltergeist trap Errno::EPIPE * add travis to slack integration * Change react-addons-css-transition-group * Update npm version * Update shrinkwrap * set npm to 4.0.2 * add npm install * Update node version 7.2.0 * travis runs poltergeist_errors_ok
1 parent db4febf commit 5e8329e

File tree

15 files changed

+5994
-55
lines changed

15 files changed

+5994
-55
lines changed

Diff for: .nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.0.0
1+
7.2.0

Diff for: .travis.yml

+11-7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ language:
33
rvm:
44
- 2.3.1
55
sudo: false
6+
notifications:
7+
slack: shakacode:YvfXbuFMcFAHt6ZjABIs0KET
68
addons:
79
apt:
810
sources:
@@ -22,16 +24,18 @@ before_install:
2224
- export PATH=$PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64/bin:$PATH
2325
install:
2426
- bundle install
25-
- nvm install 6.9.1
26-
- nvm use 6.9.1
27+
- chromedriver-update
28+
- nvm install stable && nvm alias default stable
29+
- npm install npm@latest -g
30+
- npm --version
2731
- npm install
32+
- npm run build:client && npm run build:server
2833
- rake db:setup
2934
# No need to run xvfb if running headless testing
30-
#before_script:
31-
# - export DISPLAY=:99.0
32-
# - sh -e /etc/init.d/xvfb start
35+
before_script:
36+
- export DISPLAY=:99.0
37+
- sh -e /etc/init.d/xvfb start
3338

3439
script:
3540
- bundle exec rake db:schema:load
36-
# - DRIVER=selenium_firefox bundle exec rake
37-
- bundle exec rake
41+
- DRIVER=poltergeist_errors_ok bundle exec rake

Diff for: README.md

+5
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ See package.json and Gemfile for versions
114114

115115
## Javascript development without Rails: using the Webpack Dev Server
116116

117+
We include a sample setup for developing your JavaScript files without Rails. However, this is no longer recommended as it's best to create your APIs in Rails, and take advantage of the hot reloading of your react components provided by this project.
118+
117119
1. Run the node server with file `server-express.js` with command `npm run` or `cd client && node server-express.js`.
118120
2. Point your browser to [http://localhost:4000](http://localhost:4000)
119121

@@ -141,6 +143,9 @@ Save a change to a JSX file and see it update immediately in the browser! Note,
141143
<%= env_javascript_include_tag(static: 'application_static', hot: 'application_non_webpack', options: { 'data-turbolinks-track' => true }) %>
142144
```
143145

146+
## Testing
147+
148+
+ Be sure to see [Integration Test Notes](./docs/integration-test-notes.md) for advice on running your integration tests.
144149

145150
+ **Testing Mode**: When running tests, it is useful to run `foreman start -f Procfile.spec` in order to have webpack automatically recompile the static bundles. Rspec is configured to automatically check whether or not this process is running. If it is not, it will automatically rebuild the webpack bundle to ensure you are not running tests on stale client code. This is achieved via the `ReactOnRails::TestHelper.configure_rspec_to_compile_assets(config)`
146151
line in the `rails_helper.rb` file. If you are using this project as an example and are not using RSpec, you may want to implement similar logic in your own project.

Diff for: client/app/bundles/comments/components/CommentBox/CommentForm/CommentForm.jsx

+9-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import Button from 'react-bootstrap/lib/Button';
1212
import Nav from 'react-bootstrap/lib/Nav';
1313
import NavItem from 'react-bootstrap/lib/NavItem';
1414
import Alert from 'react-bootstrap/lib/Alert';
15-
import ReactCSSTransitionGroup from 'react/lib/ReactCSSTransitionGroup';
15+
import ReactCSSTransitionGroup from 'react-addons-css-transition-group';
1616
import _ from 'lodash';
1717

1818
import BaseComponent from 'libs/components/BaseComponent';
@@ -180,7 +180,7 @@ export default class CommentForm extends BaseComponent {
180180
return (
181181
<div>
182182
<hr />
183-
<form className="commentForm form" onSubmit={this.handleSubmit}>
183+
<form className="commentForm form form-stacked" onSubmit={this.handleSubmit}>
184184
<FormGroup controlId="formBasicName">
185185
<ControlLabel>Name</ControlLabel>
186186
<FormControl
@@ -227,7 +227,7 @@ export default class CommentForm extends BaseComponent {
227227
return (
228228
<div>
229229
<hr />
230-
<Form inline className="commentForm form-inline" onSubmit={this.handleSubmit}>
230+
<Form inline className="commentForm" onSubmit={this.handleSubmit}>
231231
<FormGroup controlId="formInlineName" >
232232
<ControlLabel>
233233
Name
@@ -311,12 +311,16 @@ export default class CommentForm extends BaseComponent {
311311

312312
const { cssTransitionGroupClassNames } = this.props;
313313

314+
// For animation with ReactCSSTransitionGroup
315+
// https://facebook.github.io/react/docs/animation.html
316+
// The 500 must correspond to the 0.5s in:
317+
// client/app/bundles/comments/components/CommentBox/CommentBox.scss:6
314318
return (
315319
<div>
316320
<ReactCSSTransitionGroup
317321
transitionName={cssTransitionGroupClassNames}
318-
transitionEnterTimeout={300}
319-
transitionLeaveTimeout={300}
322+
transitionEnterTimeout={500}
323+
transitionLeaveTimeout={500}
320324
>
321325
{this.errorWarning()}
322326
</ReactCSSTransitionGroup>

Diff for: client/app/bundles/comments/components/CommentBox/CommentList/CommentList.jsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Alert from 'react-bootstrap/lib/Alert';
22
import BaseComponent from 'libs/components/BaseComponent';
33
import Immutable from 'immutable';
44
import React, { PropTypes } from 'react';
5-
import ReactCSSTransitionGroup from 'react/lib/ReactCSSTransitionGroup';
5+
import ReactCSSTransitionGroup from 'react-addons-css-transition-group';
66
import _ from 'lodash';
77

88
import Comment from './Comment/Comment';
@@ -47,6 +47,10 @@ export default class CommentList extends BaseComponent {
4747
/>,
4848
);
4949

50+
// For animation with ReactCSSTransitionGroup
51+
// https://facebook.github.io/react/docs/animation.html
52+
// The 500 must correspond to the 0.5s in:
53+
// client/app/bundles/comments/components/CommentBox/CommentBox.scss:6
5054
return (
5155
<div>
5256
<ReactCSSTransitionGroup

0 commit comments

Comments
 (0)