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

test: change Fixes: to Refs: #34568

Merged
merged 19 commits into from
Aug 2, 2020
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
64 changes: 64 additions & 0 deletions .github/workflows/auto-start-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
name: Auto Start CI

on:
schedule:
# `schedule` event is used instead of `pull_request` because when a
# `pull_requesst` event is triggered on a PR from a fork, GITHUB_TOKEN will
# be read-only, and the Action won't have access to any other repository
# secrets, which it needs to access Jenkins API. Runs every five minutes
# (fastest the scheduler can run). Five minutes is optimistic, it can take
# longer to run.
- cron: "*/5 * * * *"

jobs:
commitQueue:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master

# Install dependencies
- name: Install jq
run: sudo apt-get install jq -y
- name: Install Node.js
uses: actions/setup-node@v2-beta
with:
node-version: '12'
- name: Install node-core-utils
run: npm install -g node-core-utils

- name: Set variables
run: |
echo "::set-env name=REPOSITORY::$(echo ${{ github.repository }} | cut -d/ -f2)"
echo "::set-env name=OWNER::${{ github.repository_owner }}"

# Get Pull Requests
- name: Get Pull Requests
uses: octokit/graphql-action@v2.x
id: get_prs_for_ci
with:
query: |
query prs($owner:String!, $repo:String!) {
repository(owner:$owner, name:$repo) {
pullRequests(labels: ["request-ci"], states: OPEN, last: 100) {
nodes {
number
}
}
}
}
owner: ${{ env.OWNER }}
repo: ${{ env.REPOSITORY }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Setup node-core-utils
run: |
ncu-config set username ${{ secrets.JENKINS_USER }}
ncu-config set token none
ncu-config set jenkins_token ${{ secrets.JENKINS_TOKEN }}
ncu-config set owner ${{ env.OWNER }}
ncu-config set repo ${{ env.REPOSITORY }}

- name: Start CI
run: ./tools/actions/start-ci.sh ${{ secrets.GITHUB_TOKEN }} ${{ env.OWNER }} ${{ env.REPOSITORY }} $(echo '${{ steps.get_prs_for_ci.outputs.data }}' | jq '.repository.pullRequests.nodes | map(.number) | .[]')
9 changes: 5 additions & 4 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,11 @@ Marti Martz <thalamew@q.com>
Martial James Jefferson <martial.jefferson@gmail.com>
Martijn Schrage <martijn@oblomov.com> Oblosys <martijn@oblomov.com>
Masato Ohba <over.rye@gmail.com>
Matheus Marchini <mat@mmarchini.me> <matheusdot@gmail.com>
Matheus Marchini <mat@mmarchini.me> <matheus@sthima.com.br>
Matheus Marchini <mat@mmarchini.me> <matheus@sthima.com>
Matheus Marchini <mat@mmarchini.me> <mmarchini@netflix.com>
Mary Marchini <oss@mmarchini.me> <matheusdot@gmail.com>
Mary Marchini <oss@mmarchini.me> <matheus@sthima.com.br>
Mary Marchini <oss@mmarchini.me> <matheus@sthima.com>
Mary Marchini <oss@mmarchini.me> <mmarchini@netflix.com>
Mary Marchini <oss@mmarchini.me> <mat@mmarchini.me>
Matt Lang <matt@mediasuite.co.nz> matt-in-a-hat <matt@mediasuite.co.nz>
Matt Reed <matthewreed26@gmail.com> matthewreed26 <matthewreed26@gmail.com>
Matteo Collina <matteo.collina@gmail.com> <hello@matteocollina.com>
Expand Down
2 changes: 1 addition & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -1983,7 +1983,7 @@ Pierre-Loic Doulcet <pierre@pld.io>
Fran Herrero <francisco.herrero@axa-groupsolutions.com>
Francois KY <ky.francois.3@gmail.com>
suman-mitra <summitra@in.ibm.com>
Matheus Marchini <mat@mmarchini.me>
Mary Marchini <oss@mmarchini.me>
neta <neta@netush>
Whien <sal95610@gmail.com>
Chiahao Lin <y80811@gmail.com>
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ For information about the governance of the Node.js project, see
* [mhdawson](https://github.com/mhdawson) -
**Michael Dawson** &lt;michael_dawson@ca.ibm.com&gt; (he/him)
* [mmarchini](https://github.com/mmarchini) -
**Matheus Marchini** &lt;mat@mmarchini.me&gt;
**Mary Marchini** &lt;oss@mmarchini.me&gt; (she/her)
* [MylesBorins](https://github.com/MylesBorins) -
**Myles Borins** &lt;myles.borins@gmail.com&gt; (he/him)
* [targos](https://github.com/targos) -
Expand Down Expand Up @@ -360,7 +360,7 @@ For information about the governance of the Node.js project, see
* [misterdjules](https://github.com/misterdjules) -
**Julien Gilli** &lt;jgilli@nodejs.org&gt;
* [mmarchini](https://github.com/mmarchini) -
**Matheus Marchini** &lt;mat@mmarchini.me&gt;
**Mary Marchini** &lt;oss@mmarchini.me&gt; (she/her)
* [mscdex](https://github.com/mscdex) -
**Brian White** &lt;mscdex@mscdex.net&gt;
* [MylesBorins](https://github.com/MylesBorins) -
Expand Down
8 changes: 8 additions & 0 deletions benchmark/napi/type-tag-check/binding.gyp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
'targets': [
{
'target_name': 'binding',
'sources': [ '../type-tag/binding.c' ]
}
]
}
18 changes: 18 additions & 0 deletions benchmark/napi/type-tag-check/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'use strict';
const common = require('../../common.js');

let binding;
try {
binding = require(`./build/${common.buildType}/binding`);
} catch {
console.error(`${__filename}: Binding failed to load`);
process.exit(0);
}

const bench = common.createBenchmark(main, {
n: [1e5, 1e6, 1e7],
});

function main({ n }) {
binding.checkObjectTag(n, bench, bench.start, bench.end);
}
84 changes: 84 additions & 0 deletions benchmark/napi/type-tag/binding.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
#include <assert.h>
#define NAPI_EXPERIMENTAL
#include <node_api.h>

#define NAPI_CALL(call) \
do { \
napi_status status = call; \
assert(status == napi_ok && #call " failed"); \
} while (0);

#define EXPORT_FUNC(env, exports, name, func) \
do { \
napi_value js_func; \
NAPI_CALL(napi_create_function((env), \
(name), \
NAPI_AUTO_LENGTH, \
(func), \
NULL, \
&js_func)); \
NAPI_CALL(napi_set_named_property((env), \
(exports), \
(name), \
js_func)); \
} while (0);

static const napi_type_tag tag = {
0xe7ecbcd5954842f6, 0x9e75161c9bf27282
};

static napi_value TagObject(napi_env env, napi_callback_info info) {
size_t argc = 4;
napi_value argv[4];
uint32_t n;
uint32_t index;
napi_handle_scope scope;

NAPI_CALL(napi_get_cb_info(env, info, &argc, argv, NULL, NULL));
NAPI_CALL(napi_get_value_uint32(env, argv[0], &n));
NAPI_CALL(napi_open_handle_scope(env, &scope));
napi_value objects[n];
for (index = 0; index < n; index++) {
NAPI_CALL(napi_create_object(env, &objects[index]));
}

// Time the object tag creation.
NAPI_CALL(napi_call_function(env, argv[1], argv[2], 0, NULL, NULL));
for (index = 0; index < n; index++) {
NAPI_CALL(napi_type_tag_object(env, objects[index], &tag));
}
NAPI_CALL(napi_call_function(env, argv[1], argv[3], 1, &argv[0], NULL));

NAPI_CALL(napi_close_handle_scope(env, scope));
return NULL;
}

static napi_value CheckObjectTag(napi_env env, napi_callback_info info) {
size_t argc = 4;
napi_value argv[4];
uint32_t n;
uint32_t index;
bool is_of_type;

NAPI_CALL(napi_get_cb_info(env, info, &argc, argv, NULL, NULL));
NAPI_CALL(napi_get_value_uint32(env, argv[0], &n));
napi_value object;
NAPI_CALL(napi_create_object(env, &object));
NAPI_CALL(napi_type_tag_object(env, object, &tag));

// Time the object tag checking.
NAPI_CALL(napi_call_function(env, argv[1], argv[2], 0, NULL, NULL));
for (index = 0; index < n; index++) {
NAPI_CALL(napi_check_object_type_tag(env, object, &tag, &is_of_type));
assert(is_of_type && " type mismatch");
}
NAPI_CALL(napi_call_function(env, argv[1], argv[3], 1, &argv[0], NULL));

return NULL;
}

NAPI_MODULE_INIT() {
EXPORT_FUNC(env, exports, "tagObject", TagObject);
EXPORT_FUNC(env, exports, "checkObjectTag", CheckObjectTag);
return exports;
}
8 changes: 8 additions & 0 deletions benchmark/napi/type-tag/binding.gyp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
'targets': [
{
'target_name': 'binding',
'sources': [ 'binding.c' ]
}
]
}
18 changes: 18 additions & 0 deletions benchmark/napi/type-tag/check-object-tag.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'use strict';
const common = require('../../common.js');

let binding;
try {
binding = require(`./build/${common.buildType}/binding`);
} catch {
console.error(`${__filename}: Binding failed to load`);
process.exit(0);
}

const bench = common.createBenchmark(main, {
n: [1e5, 1e6, 1e7],
});

function main({ n }) {
binding.checkObjectTag(n, bench, bench.start, bench.end);
}
18 changes: 18 additions & 0 deletions benchmark/napi/type-tag/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'use strict';
const common = require('../../common.js');

let binding;
try {
binding = require(`./build/${common.buildType}/binding`);
} catch {
console.error(`${__filename}: Binding failed to load`);
process.exit(0);
}

const bench = common.createBenchmark(main, {
n: [1e3, 1e4, 1e5],
});

function main({ n }) {
binding.tagObject(n, bench, bench.start, bench.end);
}
Loading