test: migrate from tape to tap - #1795

Closed
rvagg wants to merge 8 commits into
masterfrom
rvagg/tap
Closed

test: migrate from tape to tap#1795
rvagg wants to merge 8 commits into
masterfrom
rvagg/tap

Conversation

@rvagg

Copy link
Copy Markdown
Member

alternative to #1171

Needs to be tested against CI. If we're not using tap output in CI I'd like to remove -Rtap.

@rvagg

Copy link
Copy Markdown
MemberAuthor

@cclauss I probably should have run your Python changes through CI because there are some problems on Windows which may be coming from it? See https://ci.nodejs.org/job/nodegyp-test-commit/nodes=win2016-vs2017/678/console

15:29:52 # Subtest: build simple addon in path with non-ascii characters
15:29:52 1..1
15:29:52 Traceback (most recent call last):
15:29:52 File "fixtures/test-charmap.py", line 23, in <module>
15:29:52 print(main())
15:29:52 File "fixtures/test-charmap.py", line 19, in main
15:29:52 print(textmap[encoding])
15:29:52 File "C:\Python27\lib\encodings\cp1252.py", line 12, in encode
15:29:52 return codecs.charmap_encode(input,errors,encoding_table)
15:29:52 UnicodeEncodeError: 'charmap' codec can't encode character u'\u012b' in position 3: character maps to <undefined>
15:29:52 ok 1 - python console app can't encode non-ascii character. # SKIP
15:29:52 # skip: 1
15:29:52 ok 3 - build simple addon in path with non-ascii characters # time=67.458ms
15:29:52 

Could that be coming from abef93d which did:

- if textmap.has_key(encoding):- print textmap[encoding]+ if encoding in textmap:+ print(textmap[encoding])

@rvagg

Copy link
Copy Markdown
MemberAuthor

CI for this: https://ci.nodejs.org/view/All/job/nodegyp-test-pull-request/133/
Failing on Windows with the python problem above, but not failing on Node 12, I'm not sure what that's about. Some funky unicode difference that's coming down in from the test suite?

CI isn't using tap output at all for anything automatic, but it is handy for text output. So what I've done is introduce a "test-ci" script that will be run on Travis (and I'll update Jenkins to use it too), otherwise it'll do the normal prettified tap output.

@cclauss

cclauss commented Jun 22, 2019

Copy link
Copy Markdown
Contributor

Our current Travis CI runs on Linux but we can easily add Windows and/or macOS if that would be useful.

@rvagg

Copy link
Copy Markdown
MemberAuthor

very useful, so many of our problems are OS specific here.

@rvagg

Copy link
Copy Markdown
MemberAuthor

A bunch more minor updates to make the standard npm test output nice and clean, so turning off logging output. If you have your loglevel set to something custom it's going to make the tests noisier, but there's also some stuff in there that will log.warn and some console.log too.

There's a new deprecation in Node 12 that spits out to stderr because we're using a self-signed cert with an IP address, so there's a commit in here that replaces that with a self-signed for localhost and the warning goes away.

Test output:

Screenshot 2019-06-22 16 30 04

npm run test-ci is the verbose nested TAP output (but without the stderr mess) plus the coverage at the bottom as well.

@richardlau

Copy link
Copy Markdown
Member

CI isn't using tap output at all for anything automatic, but it is handy for text output. So what I've done is introduce a "test-ci" script that will be run on Travis (and I'll update Jenkins to use it too), otherwise it'll do the normal prettified tap output.

Travis is probably better off with the prettified output. As it is it doesn't display all of it (output is too long):
image

For the CI the only reason I can think of to keep the tap output is if we want to use tap2junit on it (which we don't currently).

Since switching to tap would by default enable coverage we could consider enabling codecov (which we use elsewhere in the org, e.g. citgmhttps://codecov.io/gh/nodejs/citgm, node-core-utilshttps://codecov.io/gh/nodejs/node-core-utils) for this repository.

@rvagg

Copy link
Copy Markdown
MemberAuthor

👍 you're right, it looks pretty good in Travis: https://travis-ci.com/nodejs/node-gyp/jobs/210631751

rvagg added a commit that referenced this pull request Jun 25, 2019
PR-URL: #1795
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
rvagg added a commit that referenced this pull request Jun 25, 2019
PR-URL: #1795
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
@rvaggrvagg closed this Jun 25, 2019
@rvagg
rvagg deleted the rvagg/tap branch June 25, 2019 01:27
@rvagg

Copy link
Copy Markdown
MemberAuthor

landed in 395f843

@rvaggrvagg mentioned this pull request Jun 26, 2019
@joaocgreis

Copy link
Copy Markdown
Member

This broke Node v6. CI failed because of the python issues, and that probably caused the real failures in v6 to go unnoticed.

What should we do here? I don't think we should support unsupported Node versions at all, but for that we need to update the engines field and exclude from CI. Or should we revert this and keep supporting Node v6? It would probably be nicer to drop support on a semver-major version, though I'm not sure we strictly need to.

cc @nodejs/node-gyp

@cclauss

cclauss commented Jul 4, 2019

Copy link
Copy Markdown
Contributor

CI failed because of the python issues

Can you please provide a URL to these failures?

@joaocgreis

Copy link
Copy Markdown
Member

https://ci.nodejs.org/job/nodegyp-test-commit/676/ and https://ci.nodejs.org/job/nodegyp-test-commit/677/

There are two failures. On CI, every run of v6.2.1 and v6.14.4 failed while running npm install:

06:31:49 npm ERR! enoent ENOENT: no such file or directory, rename '/home/iojs/build/workspace/nodegyp-test-commit/nodes/ubuntu1604-64/node_modules/.staging/@types/prop-types-5c4fdf37' -> '/home/iojs/build/workspace/nodegyp-test-commit/nodes/ubuntu1604-64/node_modules/tap/node_modules/@types/prop-types'
06:31:49 npm ERR! enoent ENOENT: no such file or directory, rename '/home/iojs/build/workspace/nodegyp-test-commit/nodes/ubuntu1604-64/node_modules/.staging/@types/prop-types-5c4fdf37' -> '/home/iojs/build/workspace/nodegyp-test-commit/nodes/ubuntu1604-64/node_modules/tap/node_modules/@types/prop-types'

Locally, if I use a newer version of npm, this does not happen. This is probably an issue with npm or the module being installed, I don't know if it is related to this PR. If we're to support Node v6 we should work around this somehow if possible.

However, after using a new npm to install, this error happens when running npm test:

C:\Users\Administrator\Desktop\node-gyp\node_modules\tap\bin\run.js:125
const main = async options => {
^^^^^^^
SyntaxError: Unexpected identifier
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.runMain (module.js:611:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:160:9)
npm ERR! Test failed. See above for more details.

@rvagg

rvagg commented Jul 5, 2019

Copy link
Copy Markdown
MemberAuthor

addressing it in #1808, but maybe we need to extend our travis matrix to include the major Node versions, probably just on Linux (I don't know which version of Python, maybe it doesn't matter).

@richardlaurichardlau mentioned this pull request Jul 12, 2019
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@rvagg@cclauss@richardlau@joaocgreis
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

test: migrate from tape to tap - #1795

Closed
rvagg wants to merge 8 commits into
masterfrom
rvagg/tap
Closed

test: migrate from tape to tap#1795
rvagg wants to merge 8 commits into
masterfrom
rvagg/tap

Conversation

@rvagg

Copy link
Copy Markdown
Member

alternative to #1171

Needs to be tested against CI. If we're not using tap output in CI I'd like to remove -Rtap.

@rvagg

Copy link
Copy Markdown
MemberAuthor

@cclauss I probably should have run your Python changes through CI because there are some problems on Windows which may be coming from it? See https://ci.nodejs.org/job/nodegyp-test-commit/nodes=win2016-vs2017/678/console

15:29:52 # Subtest: build simple addon in path with non-ascii characters
15:29:52 1..1
15:29:52 Traceback (most recent call last):
15:29:52 File "fixtures/test-charmap.py", line 23, in <module>
15:29:52 print(main())
15:29:52 File "fixtures/test-charmap.py", line 19, in main
15:29:52 print(textmap[encoding])
15:29:52 File "C:\Python27\lib\encodings\cp1252.py", line 12, in encode
15:29:52 return codecs.charmap_encode(input,errors,encoding_table)
15:29:52 UnicodeEncodeError: 'charmap' codec can't encode character u'\u012b' in position 3: character maps to <undefined>
15:29:52 ok 1 - python console app can't encode non-ascii character. # SKIP
15:29:52 # skip: 1
15:29:52 ok 3 - build simple addon in path with non-ascii characters # time=67.458ms
15:29:52 

Could that be coming from abef93d which did:

- if textmap.has_key(encoding):- print textmap[encoding]+ if encoding in textmap:+ print(textmap[encoding])

@rvagg

Copy link
Copy Markdown
MemberAuthor

CI for this: https://ci.nodejs.org/view/All/job/nodegyp-test-pull-request/133/
Failing on Windows with the python problem above, but not failing on Node 12, I'm not sure what that's about. Some funky unicode difference that's coming down in from the test suite?

CI isn't using tap output at all for anything automatic, but it is handy for text output. So what I've done is introduce a "test-ci" script that will be run on Travis (and I'll update Jenkins to use it too), otherwise it'll do the normal prettified tap output.

@cclauss

cclauss commented Jun 22, 2019

Copy link
Copy Markdown
Contributor

Our current Travis CI runs on Linux but we can easily add Windows and/or macOS if that would be useful.

@rvagg

Copy link
Copy Markdown
MemberAuthor

very useful, so many of our problems are OS specific here.

@rvagg

Copy link
Copy Markdown
MemberAuthor

A bunch more minor updates to make the standard npm test output nice and clean, so turning off logging output. If you have your loglevel set to something custom it's going to make the tests noisier, but there's also some stuff in there that will log.warn and some console.log too.

There's a new deprecation in Node 12 that spits out to stderr because we're using a self-signed cert with an IP address, so there's a commit in here that replaces that with a self-signed for localhost and the warning goes away.

Test output:

Screenshot 2019-06-22 16 30 04

npm run test-ci is the verbose nested TAP output (but without the stderr mess) plus the coverage at the bottom as well.

@richardlau

Copy link
Copy Markdown
Member

CI isn't using tap output at all for anything automatic, but it is handy for text output. So what I've done is introduce a "test-ci" script that will be run on Travis (and I'll update Jenkins to use it too), otherwise it'll do the normal prettified tap output.

Travis is probably better off with the prettified output. As it is it doesn't display all of it (output is too long):
image

For the CI the only reason I can think of to keep the tap output is if we want to use tap2junit on it (which we don't currently).

Since switching to tap would by default enable coverage we could consider enabling codecov (which we use elsewhere in the org, e.g. citgmhttps://codecov.io/gh/nodejs/citgm, node-core-utilshttps://codecov.io/gh/nodejs/node-core-utils) for this repository.

@rvagg

Copy link
Copy Markdown
MemberAuthor

👍 you're right, it looks pretty good in Travis: https://travis-ci.com/nodejs/node-gyp/jobs/210631751

rvagg added a commit that referenced this pull request Jun 25, 2019
PR-URL: #1795
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
rvagg added a commit that referenced this pull request Jun 25, 2019
PR-URL: #1795
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
@rvaggrvagg closed this Jun 25, 2019
@rvagg
rvagg deleted the rvagg/tap branch June 25, 2019 01:27
@rvagg

Copy link
Copy Markdown
MemberAuthor

landed in 395f843

@rvaggrvagg mentioned this pull request Jun 26, 2019
@joaocgreis

Copy link
Copy Markdown
Member

This broke Node v6. CI failed because of the python issues, and that probably caused the real failures in v6 to go unnoticed.

What should we do here? I don't think we should support unsupported Node versions at all, but for that we need to update the engines field and exclude from CI. Or should we revert this and keep supporting Node v6? It would probably be nicer to drop support on a semver-major version, though I'm not sure we strictly need to.

cc @nodejs/node-gyp

@cclauss

cclauss commented Jul 4, 2019

Copy link
Copy Markdown
Contributor

CI failed because of the python issues

Can you please provide a URL to these failures?

@joaocgreis

Copy link
Copy Markdown
Member

https://ci.nodejs.org/job/nodegyp-test-commit/676/ and https://ci.nodejs.org/job/nodegyp-test-commit/677/

There are two failures. On CI, every run of v6.2.1 and v6.14.4 failed while running npm install:

06:31:49 npm ERR! enoent ENOENT: no such file or directory, rename '/home/iojs/build/workspace/nodegyp-test-commit/nodes/ubuntu1604-64/node_modules/.staging/@types/prop-types-5c4fdf37' -> '/home/iojs/build/workspace/nodegyp-test-commit/nodes/ubuntu1604-64/node_modules/tap/node_modules/@types/prop-types'
06:31:49 npm ERR! enoent ENOENT: no such file or directory, rename '/home/iojs/build/workspace/nodegyp-test-commit/nodes/ubuntu1604-64/node_modules/.staging/@types/prop-types-5c4fdf37' -> '/home/iojs/build/workspace/nodegyp-test-commit/nodes/ubuntu1604-64/node_modules/tap/node_modules/@types/prop-types'

Locally, if I use a newer version of npm, this does not happen. This is probably an issue with npm or the module being installed, I don't know if it is related to this PR. If we're to support Node v6 we should work around this somehow if possible.

However, after using a new npm to install, this error happens when running npm test:

C:\Users\Administrator\Desktop\node-gyp\node_modules\tap\bin\run.js:125
const main = async options => {
^^^^^^^
SyntaxError: Unexpected identifier
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.runMain (module.js:611:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:160:9)
npm ERR! Test failed. See above for more details.

@rvagg

rvagg commented Jul 5, 2019

Copy link
Copy Markdown
MemberAuthor

addressing it in #1808, but maybe we need to extend our travis matrix to include the major Node versions, probably just on Linux (I don't know which version of Python, maybe it doesn't matter).

@richardlaurichardlau mentioned this pull request Jul 12, 2019
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@rvagg@cclauss@richardlau@joaocgreis
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

test: migrate from tape to tap - #1795

Closed
rvagg wants to merge 8 commits into
masterfrom
rvagg/tap
Closed

test: migrate from tape to tap#1795
rvagg wants to merge 8 commits into
masterfrom
rvagg/tap

Conversation

@rvagg

Copy link
Copy Markdown
Member

alternative to #1171

Needs to be tested against CI. If we're not using tap output in CI I'd like to remove -Rtap.

@rvagg

Copy link
Copy Markdown
MemberAuthor

@cclauss I probably should have run your Python changes through CI because there are some problems on Windows which may be coming from it? See https://ci.nodejs.org/job/nodegyp-test-commit/nodes=win2016-vs2017/678/console

15:29:52 # Subtest: build simple addon in path with non-ascii characters
15:29:52 1..1
15:29:52 Traceback (most recent call last):
15:29:52 File "fixtures/test-charmap.py", line 23, in <module>
15:29:52 print(main())
15:29:52 File "fixtures/test-charmap.py", line 19, in main
15:29:52 print(textmap[encoding])
15:29:52 File "C:\Python27\lib\encodings\cp1252.py", line 12, in encode
15:29:52 return codecs.charmap_encode(input,errors,encoding_table)
15:29:52 UnicodeEncodeError: 'charmap' codec can't encode character u'\u012b' in position 3: character maps to <undefined>
15:29:52 ok 1 - python console app can't encode non-ascii character. # SKIP
15:29:52 # skip: 1
15:29:52 ok 3 - build simple addon in path with non-ascii characters # time=67.458ms
15:29:52 

Could that be coming from abef93d which did:

- if textmap.has_key(encoding):- print textmap[encoding]+ if encoding in textmap:+ print(textmap[encoding])

@rvagg

Copy link
Copy Markdown
MemberAuthor

CI for this: https://ci.nodejs.org/view/All/job/nodegyp-test-pull-request/133/
Failing on Windows with the python problem above, but not failing on Node 12, I'm not sure what that's about. Some funky unicode difference that's coming down in from the test suite?

CI isn't using tap output at all for anything automatic, but it is handy for text output. So what I've done is introduce a "test-ci" script that will be run on Travis (and I'll update Jenkins to use it too), otherwise it'll do the normal prettified tap output.

@cclauss

cclauss commented Jun 22, 2019

Copy link
Copy Markdown
Contributor

Our current Travis CI runs on Linux but we can easily add Windows and/or macOS if that would be useful.

@rvagg

Copy link
Copy Markdown
MemberAuthor

very useful, so many of our problems are OS specific here.

@rvagg

Copy link
Copy Markdown
MemberAuthor

A bunch more minor updates to make the standard npm test output nice and clean, so turning off logging output. If you have your loglevel set to something custom it's going to make the tests noisier, but there's also some stuff in there that will log.warn and some console.log too.

There's a new deprecation in Node 12 that spits out to stderr because we're using a self-signed cert with an IP address, so there's a commit in here that replaces that with a self-signed for localhost and the warning goes away.

Test output:

Screenshot 2019-06-22 16 30 04

npm run test-ci is the verbose nested TAP output (but without the stderr mess) plus the coverage at the bottom as well.

@richardlau

Copy link
Copy Markdown
Member

CI isn't using tap output at all for anything automatic, but it is handy for text output. So what I've done is introduce a "test-ci" script that will be run on Travis (and I'll update Jenkins to use it too), otherwise it'll do the normal prettified tap output.

Travis is probably better off with the prettified output. As it is it doesn't display all of it (output is too long):
image

For the CI the only reason I can think of to keep the tap output is if we want to use tap2junit on it (which we don't currently).

Since switching to tap would by default enable coverage we could consider enabling codecov (which we use elsewhere in the org, e.g. citgmhttps://codecov.io/gh/nodejs/citgm, node-core-utilshttps://codecov.io/gh/nodejs/node-core-utils) for this repository.

@rvagg

Copy link
Copy Markdown
MemberAuthor

👍 you're right, it looks pretty good in Travis: https://travis-ci.com/nodejs/node-gyp/jobs/210631751

rvagg added a commit that referenced this pull request Jun 25, 2019
PR-URL: #1795
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
rvagg added a commit that referenced this pull request Jun 25, 2019
PR-URL: #1795
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
@rvaggrvagg closed this Jun 25, 2019
@rvagg
rvagg deleted the rvagg/tap branch June 25, 2019 01:27
@rvagg

Copy link
Copy Markdown
MemberAuthor

landed in 395f843

@rvaggrvagg mentioned this pull request Jun 26, 2019
@joaocgreis

Copy link
Copy Markdown
Member

This broke Node v6. CI failed because of the python issues, and that probably caused the real failures in v6 to go unnoticed.

What should we do here? I don't think we should support unsupported Node versions at all, but for that we need to update the engines field and exclude from CI. Or should we revert this and keep supporting Node v6? It would probably be nicer to drop support on a semver-major version, though I'm not sure we strictly need to.

cc @nodejs/node-gyp

@cclauss

cclauss commented Jul 4, 2019

Copy link
Copy Markdown
Contributor

CI failed because of the python issues

Can you please provide a URL to these failures?

@joaocgreis

Copy link
Copy Markdown
Member

https://ci.nodejs.org/job/nodegyp-test-commit/676/ and https://ci.nodejs.org/job/nodegyp-test-commit/677/

There are two failures. On CI, every run of v6.2.1 and v6.14.4 failed while running npm install:

06:31:49 npm ERR! enoent ENOENT: no such file or directory, rename '/home/iojs/build/workspace/nodegyp-test-commit/nodes/ubuntu1604-64/node_modules/.staging/@types/prop-types-5c4fdf37' -> '/home/iojs/build/workspace/nodegyp-test-commit/nodes/ubuntu1604-64/node_modules/tap/node_modules/@types/prop-types'
06:31:49 npm ERR! enoent ENOENT: no such file or directory, rename '/home/iojs/build/workspace/nodegyp-test-commit/nodes/ubuntu1604-64/node_modules/.staging/@types/prop-types-5c4fdf37' -> '/home/iojs/build/workspace/nodegyp-test-commit/nodes/ubuntu1604-64/node_modules/tap/node_modules/@types/prop-types'

Locally, if I use a newer version of npm, this does not happen. This is probably an issue with npm or the module being installed, I don't know if it is related to this PR. If we're to support Node v6 we should work around this somehow if possible.

However, after using a new npm to install, this error happens when running npm test:

C:\Users\Administrator\Desktop\node-gyp\node_modules\tap\bin\run.js:125
const main = async options => {
^^^^^^^
SyntaxError: Unexpected identifier
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.runMain (module.js:611:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:160:9)
npm ERR! Test failed. See above for more details.

@rvagg

rvagg commented Jul 5, 2019

Copy link
Copy Markdown
MemberAuthor

addressing it in #1808, but maybe we need to extend our travis matrix to include the major Node versions, probably just on Linux (I don't know which version of Python, maybe it doesn't matter).

@richardlaurichardlau mentioned this pull request Jul 12, 2019
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@rvagg@cclauss@richardlau@joaocgreis
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

test: migrate from tape to tap - #1795

Closed
rvagg wants to merge 8 commits into
masterfrom
rvagg/tap
Closed

test: migrate from tape to tap#1795
rvagg wants to merge 8 commits into
masterfrom
rvagg/tap

Conversation

@rvagg

Copy link
Copy Markdown
Member

alternative to #1171

Needs to be tested against CI. If we're not using tap output in CI I'd like to remove -Rtap.

@rvagg

Copy link
Copy Markdown
MemberAuthor

@cclauss I probably should have run your Python changes through CI because there are some problems on Windows which may be coming from it? See https://ci.nodejs.org/job/nodegyp-test-commit/nodes=win2016-vs2017/678/console

15:29:52 # Subtest: build simple addon in path with non-ascii characters
15:29:52 1..1
15:29:52 Traceback (most recent call last):
15:29:52 File "fixtures/test-charmap.py", line 23, in <module>
15:29:52 print(main())
15:29:52 File "fixtures/test-charmap.py", line 19, in main
15:29:52 print(textmap[encoding])
15:29:52 File "C:\Python27\lib\encodings\cp1252.py", line 12, in encode
15:29:52 return codecs.charmap_encode(input,errors,encoding_table)
15:29:52 UnicodeEncodeError: 'charmap' codec can't encode character u'\u012b' in position 3: character maps to <undefined>
15:29:52 ok 1 - python console app can't encode non-ascii character. # SKIP
15:29:52 # skip: 1
15:29:52 ok 3 - build simple addon in path with non-ascii characters # time=67.458ms
15:29:52 

Could that be coming from abef93d which did:

- if textmap.has_key(encoding):- print textmap[encoding]+ if encoding in textmap:+ print(textmap[encoding])

@rvagg

Copy link
Copy Markdown
MemberAuthor

CI for this: https://ci.nodejs.org/view/All/job/nodegyp-test-pull-request/133/
Failing on Windows with the python problem above, but not failing on Node 12, I'm not sure what that's about. Some funky unicode difference that's coming down in from the test suite?

CI isn't using tap output at all for anything automatic, but it is handy for text output. So what I've done is introduce a "test-ci" script that will be run on Travis (and I'll update Jenkins to use it too), otherwise it'll do the normal prettified tap output.

@cclauss

cclauss commented Jun 22, 2019

Copy link
Copy Markdown
Contributor

Our current Travis CI runs on Linux but we can easily add Windows and/or macOS if that would be useful.

@rvagg

Copy link
Copy Markdown
MemberAuthor

very useful, so many of our problems are OS specific here.

@rvagg

Copy link
Copy Markdown
MemberAuthor

A bunch more minor updates to make the standard npm test output nice and clean, so turning off logging output. If you have your loglevel set to something custom it's going to make the tests noisier, but there's also some stuff in there that will log.warn and some console.log too.

There's a new deprecation in Node 12 that spits out to stderr because we're using a self-signed cert with an IP address, so there's a commit in here that replaces that with a self-signed for localhost and the warning goes away.

Test output:

Screenshot 2019-06-22 16 30 04

npm run test-ci is the verbose nested TAP output (but without the stderr mess) plus the coverage at the bottom as well.

@richardlau

Copy link
Copy Markdown
Member

CI isn't using tap output at all for anything automatic, but it is handy for text output. So what I've done is introduce a "test-ci" script that will be run on Travis (and I'll update Jenkins to use it too), otherwise it'll do the normal prettified tap output.

Travis is probably better off with the prettified output. As it is it doesn't display all of it (output is too long):
image

For the CI the only reason I can think of to keep the tap output is if we want to use tap2junit on it (which we don't currently).

Since switching to tap would by default enable coverage we could consider enabling codecov (which we use elsewhere in the org, e.g. citgmhttps://codecov.io/gh/nodejs/citgm, node-core-utilshttps://codecov.io/gh/nodejs/node-core-utils) for this repository.

@rvagg

Copy link
Copy Markdown
MemberAuthor

👍 you're right, it looks pretty good in Travis: https://travis-ci.com/nodejs/node-gyp/jobs/210631751

rvagg added a commit that referenced this pull request Jun 25, 2019
PR-URL: #1795
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
rvagg added a commit that referenced this pull request Jun 25, 2019
PR-URL: #1795
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
@rvaggrvagg closed this Jun 25, 2019
@rvagg
rvagg deleted the rvagg/tap branch June 25, 2019 01:27
@rvagg

Copy link
Copy Markdown
MemberAuthor

landed in 395f843

@rvaggrvagg mentioned this pull request Jun 26, 2019
@joaocgreis

Copy link
Copy Markdown
Member

This broke Node v6. CI failed because of the python issues, and that probably caused the real failures in v6 to go unnoticed.

What should we do here? I don't think we should support unsupported Node versions at all, but for that we need to update the engines field and exclude from CI. Or should we revert this and keep supporting Node v6? It would probably be nicer to drop support on a semver-major version, though I'm not sure we strictly need to.

cc @nodejs/node-gyp

@cclauss

cclauss commented Jul 4, 2019

Copy link
Copy Markdown
Contributor

CI failed because of the python issues

Can you please provide a URL to these failures?

@joaocgreis

Copy link
Copy Markdown
Member

https://ci.nodejs.org/job/nodegyp-test-commit/676/ and https://ci.nodejs.org/job/nodegyp-test-commit/677/

There are two failures. On CI, every run of v6.2.1 and v6.14.4 failed while running npm install:

06:31:49 npm ERR! enoent ENOENT: no such file or directory, rename '/home/iojs/build/workspace/nodegyp-test-commit/nodes/ubuntu1604-64/node_modules/.staging/@types/prop-types-5c4fdf37' -> '/home/iojs/build/workspace/nodegyp-test-commit/nodes/ubuntu1604-64/node_modules/tap/node_modules/@types/prop-types'
06:31:49 npm ERR! enoent ENOENT: no such file or directory, rename '/home/iojs/build/workspace/nodegyp-test-commit/nodes/ubuntu1604-64/node_modules/.staging/@types/prop-types-5c4fdf37' -> '/home/iojs/build/workspace/nodegyp-test-commit/nodes/ubuntu1604-64/node_modules/tap/node_modules/@types/prop-types'

Locally, if I use a newer version of npm, this does not happen. This is probably an issue with npm or the module being installed, I don't know if it is related to this PR. If we're to support Node v6 we should work around this somehow if possible.

However, after using a new npm to install, this error happens when running npm test:

C:\Users\Administrator\Desktop\node-gyp\node_modules\tap\bin\run.js:125
const main = async options => {
^^^^^^^
SyntaxError: Unexpected identifier
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.runMain (module.js:611:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:160:9)
npm ERR! Test failed. See above for more details.

@rvagg

rvagg commented Jul 5, 2019

Copy link
Copy Markdown
MemberAuthor

addressing it in #1808, but maybe we need to extend our travis matrix to include the major Node versions, probably just on Linux (I don't know which version of Python, maybe it doesn't matter).

@richardlaurichardlau mentioned this pull request Jul 12, 2019
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@rvagg@cclauss@richardlau@joaocgreis
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

test: migrate from tape to tap - #1795

Closed
rvagg wants to merge 8 commits into
masterfrom
rvagg/tap
Closed

test: migrate from tape to tap#1795
rvagg wants to merge 8 commits into
masterfrom
rvagg/tap

Conversation

@rvagg

Copy link
Copy Markdown
Member

alternative to #1171

Needs to be tested against CI. If we're not using tap output in CI I'd like to remove -Rtap.

@rvagg

Copy link
Copy Markdown
MemberAuthor

@cclauss I probably should have run your Python changes through CI because there are some problems on Windows which may be coming from it? See https://ci.nodejs.org/job/nodegyp-test-commit/nodes=win2016-vs2017/678/console

15:29:52 # Subtest: build simple addon in path with non-ascii characters
15:29:52 1..1
15:29:52 Traceback (most recent call last):
15:29:52 File "fixtures/test-charmap.py", line 23, in <module>
15:29:52 print(main())
15:29:52 File "fixtures/test-charmap.py", line 19, in main
15:29:52 print(textmap[encoding])
15:29:52 File "C:\Python27\lib\encodings\cp1252.py", line 12, in encode
15:29:52 return codecs.charmap_encode(input,errors,encoding_table)
15:29:52 UnicodeEncodeError: 'charmap' codec can't encode character u'\u012b' in position 3: character maps to <undefined>
15:29:52 ok 1 - python console app can't encode non-ascii character. # SKIP
15:29:52 # skip: 1
15:29:52 ok 3 - build simple addon in path with non-ascii characters # time=67.458ms
15:29:52 

Could that be coming from abef93d which did:

- if textmap.has_key(encoding):- print textmap[encoding]+ if encoding in textmap:+ print(textmap[encoding])

@rvagg

Copy link
Copy Markdown
MemberAuthor

CI for this: https://ci.nodejs.org/view/All/job/nodegyp-test-pull-request/133/
Failing on Windows with the python problem above, but not failing on Node 12, I'm not sure what that's about. Some funky unicode difference that's coming down in from the test suite?

CI isn't using tap output at all for anything automatic, but it is handy for text output. So what I've done is introduce a "test-ci" script that will be run on Travis (and I'll update Jenkins to use it too), otherwise it'll do the normal prettified tap output.

@cclauss

cclauss commented Jun 22, 2019

Copy link
Copy Markdown
Contributor

Our current Travis CI runs on Linux but we can easily add Windows and/or macOS if that would be useful.

@rvagg

Copy link
Copy Markdown
MemberAuthor

very useful, so many of our problems are OS specific here.

@rvagg

Copy link
Copy Markdown
MemberAuthor

A bunch more minor updates to make the standard npm test output nice and clean, so turning off logging output. If you have your loglevel set to something custom it's going to make the tests noisier, but there's also some stuff in there that will log.warn and some console.log too.

There's a new deprecation in Node 12 that spits out to stderr because we're using a self-signed cert with an IP address, so there's a commit in here that replaces that with a self-signed for localhost and the warning goes away.

Test output:

Screenshot 2019-06-22 16 30 04

npm run test-ci is the verbose nested TAP output (but without the stderr mess) plus the coverage at the bottom as well.

@richardlau

Copy link
Copy Markdown
Member

CI isn't using tap output at all for anything automatic, but it is handy for text output. So what I've done is introduce a "test-ci" script that will be run on Travis (and I'll update Jenkins to use it too), otherwise it'll do the normal prettified tap output.

Travis is probably better off with the prettified output. As it is it doesn't display all of it (output is too long):
image

For the CI the only reason I can think of to keep the tap output is if we want to use tap2junit on it (which we don't currently).

Since switching to tap would by default enable coverage we could consider enabling codecov (which we use elsewhere in the org, e.g. citgmhttps://codecov.io/gh/nodejs/citgm, node-core-utilshttps://codecov.io/gh/nodejs/node-core-utils) for this repository.

@rvagg

Copy link
Copy Markdown
MemberAuthor

👍 you're right, it looks pretty good in Travis: https://travis-ci.com/nodejs/node-gyp/jobs/210631751

rvagg added a commit that referenced this pull request Jun 25, 2019
PR-URL: #1795
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
rvagg added a commit that referenced this pull request Jun 25, 2019
PR-URL: #1795
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
@rvaggrvagg closed this Jun 25, 2019
@rvagg
rvagg deleted the rvagg/tap branch June 25, 2019 01:27
@rvagg

Copy link
Copy Markdown
MemberAuthor

landed in 395f843

@rvaggrvagg mentioned this pull request Jun 26, 2019
@joaocgreis

Copy link
Copy Markdown
Member

This broke Node v6. CI failed because of the python issues, and that probably caused the real failures in v6 to go unnoticed.

What should we do here? I don't think we should support unsupported Node versions at all, but for that we need to update the engines field and exclude from CI. Or should we revert this and keep supporting Node v6? It would probably be nicer to drop support on a semver-major version, though I'm not sure we strictly need to.

cc @nodejs/node-gyp

@cclauss

cclauss commented Jul 4, 2019

Copy link
Copy Markdown
Contributor

CI failed because of the python issues

Can you please provide a URL to these failures?

@joaocgreis

Copy link
Copy Markdown
Member

https://ci.nodejs.org/job/nodegyp-test-commit/676/ and https://ci.nodejs.org/job/nodegyp-test-commit/677/

There are two failures. On CI, every run of v6.2.1 and v6.14.4 failed while running npm install:

06:31:49 npm ERR! enoent ENOENT: no such file or directory, rename '/home/iojs/build/workspace/nodegyp-test-commit/nodes/ubuntu1604-64/node_modules/.staging/@types/prop-types-5c4fdf37' -> '/home/iojs/build/workspace/nodegyp-test-commit/nodes/ubuntu1604-64/node_modules/tap/node_modules/@types/prop-types'
06:31:49 npm ERR! enoent ENOENT: no such file or directory, rename '/home/iojs/build/workspace/nodegyp-test-commit/nodes/ubuntu1604-64/node_modules/.staging/@types/prop-types-5c4fdf37' -> '/home/iojs/build/workspace/nodegyp-test-commit/nodes/ubuntu1604-64/node_modules/tap/node_modules/@types/prop-types'

Locally, if I use a newer version of npm, this does not happen. This is probably an issue with npm or the module being installed, I don't know if it is related to this PR. If we're to support Node v6 we should work around this somehow if possible.

However, after using a new npm to install, this error happens when running npm test:

C:\Users\Administrator\Desktop\node-gyp\node_modules\tap\bin\run.js:125
const main = async options => {
^^^^^^^
SyntaxError: Unexpected identifier
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.runMain (module.js:611:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:160:9)
npm ERR! Test failed. See above for more details.

@rvagg

rvagg commented Jul 5, 2019

Copy link
Copy Markdown
MemberAuthor

addressing it in #1808, but maybe we need to extend our travis matrix to include the major Node versions, probably just on Linux (I don't know which version of Python, maybe it doesn't matter).

@richardlaurichardlau mentioned this pull request Jul 12, 2019
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@rvagg@cclauss@richardlau@joaocgreis
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

test: migrate from tape to tap - #1795

Closed
rvagg wants to merge 8 commits into
masterfrom
rvagg/tap
Closed

test: migrate from tape to tap#1795
rvagg wants to merge 8 commits into
masterfrom
rvagg/tap

Conversation

@rvagg

Copy link
Copy Markdown
Member

alternative to #1171

Needs to be tested against CI. If we're not using tap output in CI I'd like to remove -Rtap.

@rvagg

Copy link
Copy Markdown
MemberAuthor

@cclauss I probably should have run your Python changes through CI because there are some problems on Windows which may be coming from it? See https://ci.nodejs.org/job/nodegyp-test-commit/nodes=win2016-vs2017/678/console

15:29:52 # Subtest: build simple addon in path with non-ascii characters
15:29:52 1..1
15:29:52 Traceback (most recent call last):
15:29:52 File "fixtures/test-charmap.py", line 23, in <module>
15:29:52 print(main())
15:29:52 File "fixtures/test-charmap.py", line 19, in main
15:29:52 print(textmap[encoding])
15:29:52 File "C:\Python27\lib\encodings\cp1252.py", line 12, in encode
15:29:52 return codecs.charmap_encode(input,errors,encoding_table)
15:29:52 UnicodeEncodeError: 'charmap' codec can't encode character u'\u012b' in position 3: character maps to <undefined>
15:29:52 ok 1 - python console app can't encode non-ascii character. # SKIP
15:29:52 # skip: 1
15:29:52 ok 3 - build simple addon in path with non-ascii characters # time=67.458ms
15:29:52 

Could that be coming from abef93d which did:

- if textmap.has_key(encoding):- print textmap[encoding]+ if encoding in textmap:+ print(textmap[encoding])

@rvagg

Copy link
Copy Markdown
MemberAuthor

CI for this: https://ci.nodejs.org/view/All/job/nodegyp-test-pull-request/133/
Failing on Windows with the python problem above, but not failing on Node 12, I'm not sure what that's about. Some funky unicode difference that's coming down in from the test suite?

CI isn't using tap output at all for anything automatic, but it is handy for text output. So what I've done is introduce a "test-ci" script that will be run on Travis (and I'll update Jenkins to use it too), otherwise it'll do the normal prettified tap output.

@cclauss

cclauss commented Jun 22, 2019

Copy link
Copy Markdown
Contributor

Our current Travis CI runs on Linux but we can easily add Windows and/or macOS if that would be useful.

@rvagg

Copy link
Copy Markdown
MemberAuthor

very useful, so many of our problems are OS specific here.

@rvagg

Copy link
Copy Markdown
MemberAuthor

A bunch more minor updates to make the standard npm test output nice and clean, so turning off logging output. If you have your loglevel set to something custom it's going to make the tests noisier, but there's also some stuff in there that will log.warn and some console.log too.

There's a new deprecation in Node 12 that spits out to stderr because we're using a self-signed cert with an IP address, so there's a commit in here that replaces that with a self-signed for localhost and the warning goes away.

Test output:

Screenshot 2019-06-22 16 30 04

npm run test-ci is the verbose nested TAP output (but without the stderr mess) plus the coverage at the bottom as well.

@richardlau

Copy link
Copy Markdown
Member

CI isn't using tap output at all for anything automatic, but it is handy for text output. So what I've done is introduce a "test-ci" script that will be run on Travis (and I'll update Jenkins to use it too), otherwise it'll do the normal prettified tap output.

Travis is probably better off with the prettified output. As it is it doesn't display all of it (output is too long):
image

For the CI the only reason I can think of to keep the tap output is if we want to use tap2junit on it (which we don't currently).

Since switching to tap would by default enable coverage we could consider enabling codecov (which we use elsewhere in the org, e.g. citgmhttps://codecov.io/gh/nodejs/citgm, node-core-utilshttps://codecov.io/gh/nodejs/node-core-utils) for this repository.

@rvagg

Copy link
Copy Markdown
MemberAuthor

👍 you're right, it looks pretty good in Travis: https://travis-ci.com/nodejs/node-gyp/jobs/210631751

rvagg added a commit that referenced this pull request Jun 25, 2019
PR-URL: #1795
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
rvagg added a commit that referenced this pull request Jun 25, 2019
PR-URL: #1795
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
@rvaggrvagg closed this Jun 25, 2019
@rvagg
rvagg deleted the rvagg/tap branch June 25, 2019 01:27
@rvagg

Copy link
Copy Markdown
MemberAuthor

landed in 395f843

@rvaggrvagg mentioned this pull request Jun 26, 2019
@joaocgreis

Copy link
Copy Markdown
Member

This broke Node v6. CI failed because of the python issues, and that probably caused the real failures in v6 to go unnoticed.

What should we do here? I don't think we should support unsupported Node versions at all, but for that we need to update the engines field and exclude from CI. Or should we revert this and keep supporting Node v6? It would probably be nicer to drop support on a semver-major version, though I'm not sure we strictly need to.

cc @nodejs/node-gyp

@cclauss

cclauss commented Jul 4, 2019

Copy link
Copy Markdown
Contributor

CI failed because of the python issues

Can you please provide a URL to these failures?

@joaocgreis

Copy link
Copy Markdown
Member

https://ci.nodejs.org/job/nodegyp-test-commit/676/ and https://ci.nodejs.org/job/nodegyp-test-commit/677/

There are two failures. On CI, every run of v6.2.1 and v6.14.4 failed while running npm install:

06:31:49 npm ERR! enoent ENOENT: no such file or directory, rename '/home/iojs/build/workspace/nodegyp-test-commit/nodes/ubuntu1604-64/node_modules/.staging/@types/prop-types-5c4fdf37' -> '/home/iojs/build/workspace/nodegyp-test-commit/nodes/ubuntu1604-64/node_modules/tap/node_modules/@types/prop-types'
06:31:49 npm ERR! enoent ENOENT: no such file or directory, rename '/home/iojs/build/workspace/nodegyp-test-commit/nodes/ubuntu1604-64/node_modules/.staging/@types/prop-types-5c4fdf37' -> '/home/iojs/build/workspace/nodegyp-test-commit/nodes/ubuntu1604-64/node_modules/tap/node_modules/@types/prop-types'

Locally, if I use a newer version of npm, this does not happen. This is probably an issue with npm or the module being installed, I don't know if it is related to this PR. If we're to support Node v6 we should work around this somehow if possible.

However, after using a new npm to install, this error happens when running npm test:

C:\Users\Administrator\Desktop\node-gyp\node_modules\tap\bin\run.js:125
const main = async options => {
^^^^^^^
SyntaxError: Unexpected identifier
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.runMain (module.js:611:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:160:9)
npm ERR! Test failed. See above for more details.

@rvagg

rvagg commented Jul 5, 2019

Copy link
Copy Markdown
MemberAuthor

addressing it in #1808, but maybe we need to extend our travis matrix to include the major Node versions, probably just on Linux (I don't know which version of Python, maybe it doesn't matter).

@richardlaurichardlau mentioned this pull request Jul 12, 2019
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@rvagg@cclauss@richardlau@joaocgreis
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

test: migrate from tape to tap - #1795

Closed
rvagg wants to merge 8 commits into
masterfrom
rvagg/tap
Closed

test: migrate from tape to tap#1795
rvagg wants to merge 8 commits into
masterfrom
rvagg/tap

Conversation

@rvagg

Copy link
Copy Markdown
Member

alternative to #1171

Needs to be tested against CI. If we're not using tap output in CI I'd like to remove -Rtap.

@rvagg

Copy link
Copy Markdown
MemberAuthor

@cclauss I probably should have run your Python changes through CI because there are some problems on Windows which may be coming from it? See https://ci.nodejs.org/job/nodegyp-test-commit/nodes=win2016-vs2017/678/console

15:29:52 # Subtest: build simple addon in path with non-ascii characters
15:29:52 1..1
15:29:52 Traceback (most recent call last):
15:29:52 File "fixtures/test-charmap.py", line 23, in <module>
15:29:52 print(main())
15:29:52 File "fixtures/test-charmap.py", line 19, in main
15:29:52 print(textmap[encoding])
15:29:52 File "C:\Python27\lib\encodings\cp1252.py", line 12, in encode
15:29:52 return codecs.charmap_encode(input,errors,encoding_table)
15:29:52 UnicodeEncodeError: 'charmap' codec can't encode character u'\u012b' in position 3: character maps to <undefined>
15:29:52 ok 1 - python console app can't encode non-ascii character. # SKIP
15:29:52 # skip: 1
15:29:52 ok 3 - build simple addon in path with non-ascii characters # time=67.458ms
15:29:52 

Could that be coming from abef93d which did:

- if textmap.has_key(encoding):- print textmap[encoding]+ if encoding in textmap:+ print(textmap[encoding])

@rvagg

Copy link
Copy Markdown
MemberAuthor

CI for this: https://ci.nodejs.org/view/All/job/nodegyp-test-pull-request/133/
Failing on Windows with the python problem above, but not failing on Node 12, I'm not sure what that's about. Some funky unicode difference that's coming down in from the test suite?

CI isn't using tap output at all for anything automatic, but it is handy for text output. So what I've done is introduce a "test-ci" script that will be run on Travis (and I'll update Jenkins to use it too), otherwise it'll do the normal prettified tap output.

@cclauss

cclauss commented Jun 22, 2019

Copy link
Copy Markdown
Contributor

Our current Travis CI runs on Linux but we can easily add Windows and/or macOS if that would be useful.

@rvagg

Copy link
Copy Markdown
MemberAuthor

very useful, so many of our problems are OS specific here.

@rvagg

Copy link
Copy Markdown
MemberAuthor

A bunch more minor updates to make the standard npm test output nice and clean, so turning off logging output. If you have your loglevel set to something custom it's going to make the tests noisier, but there's also some stuff in there that will log.warn and some console.log too.

There's a new deprecation in Node 12 that spits out to stderr because we're using a self-signed cert with an IP address, so there's a commit in here that replaces that with a self-signed for localhost and the warning goes away.

Test output:

Screenshot 2019-06-22 16 30 04

npm run test-ci is the verbose nested TAP output (but without the stderr mess) plus the coverage at the bottom as well.

@richardlau

Copy link
Copy Markdown
Member

CI isn't using tap output at all for anything automatic, but it is handy for text output. So what I've done is introduce a "test-ci" script that will be run on Travis (and I'll update Jenkins to use it too), otherwise it'll do the normal prettified tap output.

Travis is probably better off with the prettified output. As it is it doesn't display all of it (output is too long):
image

For the CI the only reason I can think of to keep the tap output is if we want to use tap2junit on it (which we don't currently).

Since switching to tap would by default enable coverage we could consider enabling codecov (which we use elsewhere in the org, e.g. citgmhttps://codecov.io/gh/nodejs/citgm, node-core-utilshttps://codecov.io/gh/nodejs/node-core-utils) for this repository.

@rvagg

Copy link
Copy Markdown
MemberAuthor

👍 you're right, it looks pretty good in Travis: https://travis-ci.com/nodejs/node-gyp/jobs/210631751

rvagg added a commit that referenced this pull request Jun 25, 2019
PR-URL: #1795
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
rvagg added a commit that referenced this pull request Jun 25, 2019
PR-URL: #1795
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
@rvaggrvagg closed this Jun 25, 2019
@rvagg
rvagg deleted the rvagg/tap branch June 25, 2019 01:27
@rvagg

Copy link
Copy Markdown
MemberAuthor

landed in 395f843

@rvaggrvagg mentioned this pull request Jun 26, 2019
@joaocgreis

Copy link
Copy Markdown
Member

This broke Node v6. CI failed because of the python issues, and that probably caused the real failures in v6 to go unnoticed.

What should we do here? I don't think we should support unsupported Node versions at all, but for that we need to update the engines field and exclude from CI. Or should we revert this and keep supporting Node v6? It would probably be nicer to drop support on a semver-major version, though I'm not sure we strictly need to.

cc @nodejs/node-gyp

@cclauss

cclauss commented Jul 4, 2019

Copy link
Copy Markdown
Contributor

CI failed because of the python issues

Can you please provide a URL to these failures?

@joaocgreis

Copy link
Copy Markdown
Member

https://ci.nodejs.org/job/nodegyp-test-commit/676/ and https://ci.nodejs.org/job/nodegyp-test-commit/677/

There are two failures. On CI, every run of v6.2.1 and v6.14.4 failed while running npm install:

06:31:49 npm ERR! enoent ENOENT: no such file or directory, rename '/home/iojs/build/workspace/nodegyp-test-commit/nodes/ubuntu1604-64/node_modules/.staging/@types/prop-types-5c4fdf37' -> '/home/iojs/build/workspace/nodegyp-test-commit/nodes/ubuntu1604-64/node_modules/tap/node_modules/@types/prop-types'
06:31:49 npm ERR! enoent ENOENT: no such file or directory, rename '/home/iojs/build/workspace/nodegyp-test-commit/nodes/ubuntu1604-64/node_modules/.staging/@types/prop-types-5c4fdf37' -> '/home/iojs/build/workspace/nodegyp-test-commit/nodes/ubuntu1604-64/node_modules/tap/node_modules/@types/prop-types'

Locally, if I use a newer version of npm, this does not happen. This is probably an issue with npm or the module being installed, I don't know if it is related to this PR. If we're to support Node v6 we should work around this somehow if possible.

However, after using a new npm to install, this error happens when running npm test:

C:\Users\Administrator\Desktop\node-gyp\node_modules\tap\bin\run.js:125
const main = async options => {
^^^^^^^
SyntaxError: Unexpected identifier
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.runMain (module.js:611:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:160:9)
npm ERR! Test failed. See above for more details.

@rvagg

rvagg commented Jul 5, 2019

Copy link
Copy Markdown
MemberAuthor

addressing it in #1808, but maybe we need to extend our travis matrix to include the major Node versions, probably just on Linux (I don't know which version of Python, maybe it doesn't matter).

@richardlaurichardlau mentioned this pull request Jul 12, 2019
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@rvagg@cclauss@richardlau@joaocgreis
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

test: migrate from tape to tap - #1795

Closed
rvagg wants to merge 8 commits into
masterfrom
rvagg/tap
Closed

test: migrate from tape to tap#1795
rvagg wants to merge 8 commits into
masterfrom
rvagg/tap

Conversation

@rvagg

Copy link
Copy Markdown
Member

alternative to #1171

Needs to be tested against CI. If we're not using tap output in CI I'd like to remove -Rtap.

@rvagg

Copy link
Copy Markdown
MemberAuthor

@cclauss I probably should have run your Python changes through CI because there are some problems on Windows which may be coming from it? See https://ci.nodejs.org/job/nodegyp-test-commit/nodes=win2016-vs2017/678/console

15:29:52 # Subtest: build simple addon in path with non-ascii characters
15:29:52 1..1
15:29:52 Traceback (most recent call last):
15:29:52 File "fixtures/test-charmap.py", line 23, in <module>
15:29:52 print(main())
15:29:52 File "fixtures/test-charmap.py", line 19, in main
15:29:52 print(textmap[encoding])
15:29:52 File "C:\Python27\lib\encodings\cp1252.py", line 12, in encode
15:29:52 return codecs.charmap_encode(input,errors,encoding_table)
15:29:52 UnicodeEncodeError: 'charmap' codec can't encode character u'\u012b' in position 3: character maps to <undefined>
15:29:52 ok 1 - python console app can't encode non-ascii character. # SKIP
15:29:52 # skip: 1
15:29:52 ok 3 - build simple addon in path with non-ascii characters # time=67.458ms
15:29:52 

Could that be coming from abef93d which did:

- if textmap.has_key(encoding):- print textmap[encoding]+ if encoding in textmap:+ print(textmap[encoding])

@rvagg

Copy link
Copy Markdown
MemberAuthor

CI for this: https://ci.nodejs.org/view/All/job/nodegyp-test-pull-request/133/
Failing on Windows with the python problem above, but not failing on Node 12, I'm not sure what that's about. Some funky unicode difference that's coming down in from the test suite?

CI isn't using tap output at all for anything automatic, but it is handy for text output. So what I've done is introduce a "test-ci" script that will be run on Travis (and I'll update Jenkins to use it too), otherwise it'll do the normal prettified tap output.

@cclauss

cclauss commented Jun 22, 2019

Copy link
Copy Markdown
Contributor

Our current Travis CI runs on Linux but we can easily add Windows and/or macOS if that would be useful.

@rvagg

Copy link
Copy Markdown
MemberAuthor

very useful, so many of our problems are OS specific here.

@rvagg

Copy link
Copy Markdown
MemberAuthor

A bunch more minor updates to make the standard npm test output nice and clean, so turning off logging output. If you have your loglevel set to something custom it's going to make the tests noisier, but there's also some stuff in there that will log.warn and some console.log too.

There's a new deprecation in Node 12 that spits out to stderr because we're using a self-signed cert with an IP address, so there's a commit in here that replaces that with a self-signed for localhost and the warning goes away.

Test output:

Screenshot 2019-06-22 16 30 04

npm run test-ci is the verbose nested TAP output (but without the stderr mess) plus the coverage at the bottom as well.

@richardlau

Copy link
Copy Markdown
Member

CI isn't using tap output at all for anything automatic, but it is handy for text output. So what I've done is introduce a "test-ci" script that will be run on Travis (and I'll update Jenkins to use it too), otherwise it'll do the normal prettified tap output.

Travis is probably better off with the prettified output. As it is it doesn't display all of it (output is too long):
image

For the CI the only reason I can think of to keep the tap output is if we want to use tap2junit on it (which we don't currently).

Since switching to tap would by default enable coverage we could consider enabling codecov (which we use elsewhere in the org, e.g. citgmhttps://codecov.io/gh/nodejs/citgm, node-core-utilshttps://codecov.io/gh/nodejs/node-core-utils) for this repository.

@rvagg

Copy link
Copy Markdown
MemberAuthor

👍 you're right, it looks pretty good in Travis: https://travis-ci.com/nodejs/node-gyp/jobs/210631751

rvagg added a commit that referenced this pull request Jun 25, 2019
PR-URL: #1795
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
rvagg added a commit that referenced this pull request Jun 25, 2019
PR-URL: #1795
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
@rvaggrvagg closed this Jun 25, 2019
@rvagg
rvagg deleted the rvagg/tap branch June 25, 2019 01:27
@rvagg

Copy link
Copy Markdown
MemberAuthor

landed in 395f843

@rvaggrvagg mentioned this pull request Jun 26, 2019
@joaocgreis

Copy link
Copy Markdown
Member

This broke Node v6. CI failed because of the python issues, and that probably caused the real failures in v6 to go unnoticed.

What should we do here? I don't think we should support unsupported Node versions at all, but for that we need to update the engines field and exclude from CI. Or should we revert this and keep supporting Node v6? It would probably be nicer to drop support on a semver-major version, though I'm not sure we strictly need to.

cc @nodejs/node-gyp

@cclauss

cclauss commented Jul 4, 2019

Copy link
Copy Markdown
Contributor

CI failed because of the python issues

Can you please provide a URL to these failures?

@joaocgreis

Copy link
Copy Markdown
Member

https://ci.nodejs.org/job/nodegyp-test-commit/676/ and https://ci.nodejs.org/job/nodegyp-test-commit/677/

There are two failures. On CI, every run of v6.2.1 and v6.14.4 failed while running npm install:

06:31:49 npm ERR! enoent ENOENT: no such file or directory, rename '/home/iojs/build/workspace/nodegyp-test-commit/nodes/ubuntu1604-64/node_modules/.staging/@types/prop-types-5c4fdf37' -> '/home/iojs/build/workspace/nodegyp-test-commit/nodes/ubuntu1604-64/node_modules/tap/node_modules/@types/prop-types'
06:31:49 npm ERR! enoent ENOENT: no such file or directory, rename '/home/iojs/build/workspace/nodegyp-test-commit/nodes/ubuntu1604-64/node_modules/.staging/@types/prop-types-5c4fdf37' -> '/home/iojs/build/workspace/nodegyp-test-commit/nodes/ubuntu1604-64/node_modules/tap/node_modules/@types/prop-types'

Locally, if I use a newer version of npm, this does not happen. This is probably an issue with npm or the module being installed, I don't know if it is related to this PR. If we're to support Node v6 we should work around this somehow if possible.

However, after using a new npm to install, this error happens when running npm test:

C:\Users\Administrator\Desktop\node-gyp\node_modules\tap\bin\run.js:125
const main = async options => {
^^^^^^^
SyntaxError: Unexpected identifier
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.runMain (module.js:611:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:160:9)
npm ERR! Test failed. See above for more details.

@rvagg

rvagg commented Jul 5, 2019

Copy link
Copy Markdown
MemberAuthor

addressing it in #1808, but maybe we need to extend our travis matrix to include the major Node versions, probably just on Linux (I don't know which version of Python, maybe it doesn't matter).

@richardlaurichardlau mentioned this pull request Jul 12, 2019
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@rvagg@cclauss@richardlau@joaocgreis