From c38e1da0cedbfa5a18d3fe4e93df1125ec91d276 Mon Sep 17 00:00:00 2001 From: Gus Caplan Date: Sat, 4 Nov 2017 09:10:06 -0500 Subject: [PATCH 1/3] make changes for node core pr #16745 --- lib/node-labels.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node-labels.js b/lib/node-labels.js index 478ed337..67b497df 100644 --- a/lib/node-labels.js +++ b/lib/node-labels.js @@ -91,9 +91,9 @@ const subSystemLabelsMap = new Map([ [/^lib\/internal\/url\.js$/, ['url-whatwg', 'dont-land-on-v4.x', 'dont-land-on-v6.x']], // All other lib/ files map directly - [/^lib\/_(\w+)_\w+\.js?$/, '$1'], // e.g. _(stream)_wrap [/^lib(\/internal)?\/(\w+)\.js?$/, '$2'], // other .js files - [/^lib\/internal\/(\w+)(?:\/|$)/, '$1'] // internal subfolders + [/^lib\/internal\/(\w+)(?:\/|$)/, '$1'], // internal subfolders + [/^lib\/(\w+)\/\w+\.js$/, '$1'] // e.g. (stream)/wrap.js ]) const jsSubsystemList = [ From 9ad4d68caa8b153b715c2fd820c9e4e577f033cb Mon Sep 17 00:00:00 2001 From: Gus Caplan Date: Sat, 4 Nov 2017 12:23:42 -0500 Subject: [PATCH 2/3] add test case --- test/unit/node-labels.test.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/unit/node-labels.test.js b/test/unit/node-labels.test.js index 4c306174..99936c61 100644 --- a/test/unit/node-labels.test.js +++ b/test/unit/node-labels.test.js @@ -29,6 +29,17 @@ tap.test('no labels: when ./test/ and ./lib/ files has been changed', (t) => { t.end() }) +tap.test('label: correct when lib/{not internal}/ files have been changed', (t) => { + const labels = nodeLabels.resolveLabels([ + 'lib/http/common.js', + 'lib/tls/legacy.js' + ]) + + t.same(labels, ['http', 'tls']) + + t.end() +}) + tap.test('label: "doc" when only ./doc/ files has been changed', (t) => { const labels = nodeLabels.resolveLabels([ 'doc/api/fs.md', From d638c7ba1e30572672426e6d91615def542f482e Mon Sep 17 00:00:00 2001 From: Gus Caplan Date: Sun, 5 Nov 2017 12:18:24 -0600 Subject: [PATCH 3/3] update test --- lib/node-labels.js | 1 - test/unit/node-labels.test.js | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/node-labels.js b/lib/node-labels.js index 67b497df..b5530923 100644 --- a/lib/node-labels.js +++ b/lib/node-labels.js @@ -93,7 +93,6 @@ const subSystemLabelsMap = new Map([ // All other lib/ files map directly [/^lib(\/internal)?\/(\w+)\.js?$/, '$2'], // other .js files [/^lib\/internal\/(\w+)(?:\/|$)/, '$1'], // internal subfolders - [/^lib\/(\w+)\/\w+\.js$/, '$1'] // e.g. (stream)/wrap.js ]) const jsSubsystemList = [ diff --git a/test/unit/node-labels.test.js b/test/unit/node-labels.test.js index 99936c61..5fc14188 100644 --- a/test/unit/node-labels.test.js +++ b/test/unit/node-labels.test.js @@ -31,8 +31,8 @@ tap.test('no labels: when ./test/ and ./lib/ files has been changed', (t) => { tap.test('label: correct when lib/{not internal}/ files have been changed', (t) => { const labels = nodeLabels.resolveLabels([ - 'lib/http/common.js', - 'lib/tls/legacy.js' + 'lib/internal/http/common.js', + 'lib/internal/tls/legacy.js' ]) t.same(labels, ['http', 'tls'])