Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/node-labels.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const subSystemLabelsMap = new Map([
[/^src\/.*win32.*/, ['c++', 'windows']],
[/^src\/node_zlib/, ['c++', 'zlib']],
[/^src\/tracing/, ['c++', 'tracing']],
[/^src\/node_api/, ['c++', 'n-api']],

// don't label python files as c++
[/^src\/.+\.py$/, 'lib / src'],
Expand Down Expand Up @@ -107,6 +108,7 @@ const exclusiveLabelsMap = new Map([
[/^test\/cctest\/test_inspector/, ['test', 'inspector', 'dont-land-on-v4.x']],
[/^test\/cctest\/test_url/, ['test', 'url-whatwg',
'dont-land-on-v4.x', 'dont-land-on-v6.x']],
[/^test\/addons-napi\//, ['test', 'n-api']],

[/^test\//, 'test'],

Expand Down
18 changes: 18 additions & 0 deletions test/unit/node-labels.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -530,3 +530,21 @@ for (const info of specificTools) {
})
}
}

[
[ ['c++', 'n-api'],
['src/node_api.cc', 'src/node_api.h', 'src/node_api_types.h'] ],
[ ['test', 'n-api'], ['test/addons-napi/foo'] ]
].forEach((info) => {
const labels = info[0]
const files = info[1]

This comment was marked as off-topic.

for (const file of files) {
tap.test(`label: "${labels.join('","')}" when ./${file} has been changed`, (t) => {
const resolved = nodeLabels.resolveLabels([file])

t.same(resolved, labels)

t.end()
})
}
})