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

ci: [email protected] cannot be tested with node v8 #1842

Closed
astorm opened this issue Oct 28, 2020 · 3 comments · Fixed by #1843
Closed

ci: [email protected] cannot be tested with node v8 #1842

astorm opened this issue Oct 28, 2020 · 3 comments · Fixed by #1843
Assignees

Comments

@astorm
Copy link
Contributor

astorm commented Oct 28, 2020

Describe the bug

The knex package has dropped support for Node 8 and introduced code that breaks Node 8. This has broken the build. No CI can pass until this is resolved.

/home/travis/build/elastic/apm-agent-nodejs/node_modules/knex/lib/dialects/postgres/schema/columncompiler.js:7
const commentEscapeRegex = /(?<!')'(?!')/g;
SyntaxError: Invalid regular expression: /(?<!')'(?!')/: Invalid group
@trentm
Copy link
Member

trentm commented Oct 28, 2020

For the record the full error in CI looks like this (e.g. from https://travis-ci.org/github/elastic/apm-agent-nodejs/jobs/739313279):

running (cwd: ./): node --require /home/travis/build/elastic/apm-agent-nodejs/test/_promise_rejection.js test/instrumentation/modules/pg/knex.js
TAP version 13
# knex.select().from('test')
/home/travis/build/elastic/apm-agent-nodejs/node_modules/knex/lib/dialects/postgres/schema/columncompiler.js:7
const commentEscapeRegex = /(?<!')'(?!')/g;
                           ^
SyntaxError: Invalid regular expression: /(?<!')'(?!')/: Invalid group
    at Object.<anonymous> (/home/travis/build/elastic/apm-agent-nodejs/node_modules/knex/lib/dialects/postgres/schema/columncompiler.js:7:28)
    at Module._compile (module.js:624:30)
    at Object.Module._extensions..js (module.js:635:10)
    at Module.load (module.js:545:32)
    at tryModuleLoad (module.js:508:12)
    at Function.Module._load (module.js:500:3)
    at Module.require (module.js:568:17)
    at Module.Hook._require.Module.require (/home/travis/build/elastic/apm-agent-nodejs/node_modules/require-in-the-middle/index.js:80:39)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/travis/build/elastic/apm-agent-nodejs/node_modules/knex/lib/dialects/postgres/index.js:9:24)
    at Module._compile (module.js:624:30)
    at Object.Module._extensions..js (module.js:635:10)
    at Module.load (module.js:545:32)
    at tryModuleLoad (module.js:508:12)
    at Function.Module._load (module.js:500:3)
    at Module.require (module.js:568:17)
    at Module.Hook._require.Module.require (/home/travis/build/elastic/apm-agent-nodejs/node_modules/require-in-the-middle/index.js:80:39)
    at require (internal/module.js:11:18)
    at Knex (/home/travis/build/elastic/apm-agent-nodejs/node_modules/knex/lib/knex.js:44:15)
    at Client.<anonymous> (/home/travis/build/elastic/apm-agent-nodejs/test/instrumentation/modules/pg/knex.js:135:12)
    at Object.onceWrapper (events.js:314:30)
    at emitNone (events.js:105:13)
    at Client.emit (events.js:207:7)
    at process.nextTick (/home/travis/build/elastic/apm-agent-nodejs/node_modules/pg/lib/client.js:154:14)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)
/home/travis/build/elastic/apm-agent-nodejs/test/test.js:129
    if (err) throw err
             ^
Error: non-zero error code
    at ChildProcess.<anonymous> (/home/travis/build/elastic/apm-agent-nodejs/test/test.js:37:19)
    at emitTwo (events.js:125:13)
    at ChildProcess.emit (events.js:213:7)
    at maybeClose (internal/child_process.js:927:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
npm ERR! Test failed.  See above for more details.
The command "npm test" exited with 1.

knex dropped node v8 support in 0.21.0. [email protected] (released yesterday) finally broke node v8 syntax.

Alan and I chatted yesterday and have decided for now to add a guard in the knex test file that will effectively result in not testing knex with node v8 (it will still test with node v10 and later versions) -- at least for the "test with the latest version of modules" testing that is done for PRs and commits. The nightly "tav" (test-all-versions) tests will still test [email protected] with node v8 (per

knex-new:
name: knex
node: '>=8.6.0'
versions: '>=0.17 <0.21'
commands: node test/instrumentation/modules/pg/knex.js
knex-gt-nodev8:
name: knex
node: '>=10.22.0'
versions: '>=0.21 <0.22'
commands: node test/instrumentation/modules/pg/knex.js
).

@trentm trentm changed the title ci: ioredis build errors ci: [email protected] cannot be tested with node v8 Oct 28, 2020
@trentm
Copy link
Member

trentm commented Oct 28, 2020

With node v8.6, this shows the tav tests properly skip 0.21.x:

% TAV=knex ./node_modules/.bin/tav --compat
Testing compatibility with knex:
✔ 0.20.15
✔ 0.20.14
✔ 0.20.13
✔ 0.20.12
✔ 0.20.11
✔ 0.20.10
✔ 0.20.9
✔ 0.20.8
✔ 0.20.7
✔ 0.20.6
✔ 0.20.4
✔ 0.20.3
✔ 0.20.2
✔ 0.20.1
✔ 0.20.0
✔ 0.19.5
✔ 0.19.4
✔ 0.19.3
✔ 0.19.2
✔ 0.19.1
✔ 0.19.0
✔ 0.18.4
✔ 0.18.3
✔ 0.18.2
✔ 0.18.1
✔ 0.18.0
✔ 0.17.6
✔ 0.17.5
✔ 0.17.4
✔ 0.17.3
✔ 0.17.2
✔ 0.17.1
✔ 0.17.0
✔ 0.16.5
✔ 0.16.3
...

@trentm
Copy link
Member

trentm commented Oct 28, 2020

Local dev repro, FWIW. (I know I'm being overkill here. I'll get over it. :)

[15:19:19 trentm@pink:~/el/apm-agent-nodejs (n:8.6 git:master rv:1)]
% node --version
v8.6.0
[15:19:21 trentm@pink:~/el/apm-agent-nodejs (n:8.6 git:master)]
% npm ls knex
[email protected] /Users/trentm/el/apm-agent-nodejs
└── [email protected]

[15:19:25 trentm@pink:~/el/apm-agent-nodejs (n:8.6 git:master)]
% node test/instrumentation/modules/pg/knex.js
TAP version 13
# knex.select().from('test')
/Users/trentm/el/apm-agent-nodejs/node_modules/knex/lib/dialects/postgres/schema/columncompiler.js:7
const commentEscapeRegex = /(?<!')'(?!')/g;
                           ^

SyntaxError: Invalid regular expression: /(?<!')'(?!')/: Invalid group
    at Object.<anonymous> (/Users/trentm/el/apm-agent-nodejs/node_modules/knex/lib/dialects/postgres/schema/columncompiler.js:7:28)
    at Module._compile (module.js:624:30)
    at Object.Module._extensions..js (module.js:635:10)
    at Module.load (module.js:545:32)
    at tryModuleLoad (module.js:508:12)
    at Function.Module._load (module.js:500:3)
    at Module.require (module.js:568:17)
    at Module.Hook._require.Module.require (/Users/trentm/el/apm-agent-nodejs/node_modules/require-in-the-middle/index.js:80:39)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/trentm/el/apm-agent-nodejs/node_modules/knex/lib/dialects/postgres/index.js:9:24)
    at Module._compile (module.js:624:30)
    at Object.Module._extensions..js (module.js:635:10)
    at Module.load (module.js:545:32)
    at tryModuleLoad (module.js:508:12)
    at Function.Module._load (module.js:500:3)
    at Module.require (module.js:568:17)
    at Module.Hook._require.Module.require (/Users/trentm/el/apm-agent-nodejs/node_modules/require-in-the-middle/index.js:80:39)
    at require (internal/module.js:11:18)
    at Knex (/Users/trentm/el/apm-agent-nodejs/node_modules/knex/lib/knex.js:44:15)
    at Client.<anonymous> (/Users/trentm/el/apm-agent-nodejs/test/instrumentation/modules/pg/knex.js:135:12)
    at Object.onceWrapper (events.js:314:30)
    at emitNone (events.js:105:13)
    at Client.emit (events.js:207:7)
    at process.nextTick (/Users/trentm/el/apm-agent-nodejs/node_modules/pg/lib/client.js:154:14)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)

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

Successfully merging a pull request may close this issue.

2 participants