Skip to content

Commit

Permalink
Add support for Node.js 10 (#314)
Browse files Browse the repository at this point in the history
Until nodejs/node#20516 have been resolved,
we have disabled the hapi tests to make sure we still test as much as
possible on Node.js 10
  • Loading branch information
watson committed May 9, 2018
1 parent 2e5cecb commit 50fa747
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 1 deletion.
24 changes: 24 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ before_script:
- wait-on tcp:9200

node_js:
- '10'
- '9'
- '8'
- '6'
Expand All @@ -34,6 +35,9 @@ jobs:
###########################################

# Disable Async Hooks
-
node_js: '10'
env: ELASTIC_APM_ASYNC_HOOKS=0
-
node_js: '9'
env: ELASTIC_APM_ASYNC_HOOKS=0
Expand All @@ -48,10 +52,12 @@ jobs:

# Commit Messages
-
node_js: 'lts/*'
script: commitlint-travis

# Coverage
-
node_js: 'lts/*'
script:
- npm run coverage
- ./node_modules/.bin/nyc report --reporter=lcov > coverage.lcov
Expand All @@ -62,6 +68,24 @@ jobs:
# DEPENDENCY STAGE #
###########################################

# Node.js 10
- stage: dependencies
node_js: '10'
env: TAV=generic-pool,mysql,redis,koa-router,handlebars,mongodb-core
script: 'if [[ "$TRAVIS_EVENT_TYPE" == "cron" || ("$TRAVIS_EVENT_TYPE" == "pull_request" && "$TRAVIS_BRANCH" != greenkeeper/*) ]]; then tav --quiet; fi'
-
node_js: '10'
env: TAV=ioredis,pg
script: 'if [[ "$TRAVIS_EVENT_TYPE" == "cron" || ("$TRAVIS_EVENT_TYPE" == "pull_request" && "$TRAVIS_BRANCH" != greenkeeper/*) ]]; then tav --quiet; fi'
-
node_js: '10'
env: TAV=bluebird
script: 'if [[ "$TRAVIS_EVENT_TYPE" == "cron" || ("$TRAVIS_EVENT_TYPE" == "pull_request" && "$TRAVIS_BRANCH" != greenkeeper/*) ]]; then tav --quiet; fi'
-
node_js: '10'
env: TAV=knex,ws,graphql,express-graphql,elasticsearch,hapi,express
script: 'if [[ "$TRAVIS_EVENT_TYPE" == "cron" || ("$TRAVIS_EVENT_TYPE" == "pull_request" && "$TRAVIS_BRANCH" != greenkeeper/*) ]]; then tav --quiet; fi'

# Node.js 9
- stage: dependencies
node_js: '9'
Expand Down
3 changes: 2 additions & 1 deletion docs/compatibility.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ image::https://raw.githubusercontent.com/nodejs/Release/master/schedule.png[]
Some versions of Node.js contain bugs or issues that limit our ability to instrument them correctly.
The following versions of Node.js are known to not be fully instrumented:

- v8.0.x - Recommended solution: Upgrade to v8.2.0 or higher to get full support
- v10.x - Async/Await in Node.js 10 is currently buggy and can therefore not be supported (https://github.com/nodejs/node/issues/20516:[nodejs/node#20516])
- v8.1.x - Recommended solution: Upgrade to v8.2.0 or higher to get full support
- v8.0.x - Recommended solution: Upgrade to v8.2.0 or higher to get full support

NOTE: Support for Node.js 8.2.0 and above is experimental as it makes use of the experimental core API https://nodejs.org/api/async_hooks.html[Async Hooks].
If you experience any issues related to using Async Hooks,
Expand Down
1 change: 1 addition & 0 deletions test/.jenkins_nodejs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
NODEJS_VERSION:
- "10"
- "9"
- "8"
- "6"
Expand Down
1 change: 1 addition & 0 deletions test/.jenkins_tav_nodejs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
NODEJS_VERSION:
- "10"
- "9"
- "8"
- "6"
Expand Down
3 changes: 3 additions & 0 deletions test/instrumentation/modules/hapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ var semver = require('semver')
// hapi 17+ requires Node.js 8.9.0 or higher
if (semver.lt(process.version, '8.9.0') && semver.gte(pkg.version, '17.0.0')) process.exit()

// hapi does not work on Node.js 10 because of https://github.com/nodejs/node/issues/20516
if (semver.gte(process.version, '10.0.0')) process.exit()

var http = require('http')

var Hapi = require('hapi')
Expand Down

0 comments on commit 50fa747

Please sign in to comment.