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

build: add --skip-tests to test-ci-js target #53105

Merged
merged 1 commit into from
May 29, 2024

Conversation

aduh95
Copy link
Contributor

@aduh95 aduh95 commented May 22, 2024

A target that skips building the addons, which for some reason depend on tools/doc/node_modules to be available, which requires the internet.

@nodejs-github-bot nodejs-github-bot added build Issues and PRs related to build files or the CI. needs-ci PRs that need a full CI run. labels May 22, 2024
@richardlau
Copy link
Member

building the addons, which for some reason depend on tools/doc/node_modules to be available, which requires the internet.

IIRC this is because it extracts from our API documentation the examples and compiles those as addon tests.
e.g,

node/doc/api/addons.md

Lines 279 to 323 in 4a54a80

```cpp
// addon.cc
#include <node.h>
#include <assert.h>
#include <stdlib.h>
using node::AddEnvironmentCleanupHook;
using v8::HandleScope;
using v8::Isolate;
using v8::Local;
using v8::Object;
// Note: In a real-world application, do not rely on static/global data.
static char cookie[] = "yum yum";
static int cleanup_cb1_called = 0;
static int cleanup_cb2_called = 0;
static void cleanup_cb1(void* arg) {
Isolate* isolate = static_cast<Isolate*>(arg);
HandleScope scope(isolate);
Local<Object> obj = Object::New(isolate);
assert(!obj.IsEmpty()); // assert VM is still alive
assert(obj->IsObject());
cleanup_cb1_called++;
}
static void cleanup_cb2(void* arg) {
assert(arg == static_cast<void*>(cookie));
cleanup_cb2_called++;
}
static void sanity_check(void*) {
assert(cleanup_cb1_called == 1);
assert(cleanup_cb2_called == 1);
}
// Initialize this addon to be context-aware.
NODE_MODULE_INIT(/* exports, module, context */) {
Isolate* isolate = context->GetIsolate();
AddEnvironmentCleanupHook(isolate, sanity_check, nullptr);
AddEnvironmentCleanupHook(isolate, cleanup_cb2, cookie);
AddEnvironmentCleanupHook(isolate, cleanup_cb1, isolate);
}
```

ends up in test/addons/01_worker_support.

@aduh95 aduh95 changed the title build: add jstest-only target May 27, 2024
@aduh95
Copy link
Contributor Author

aduh95 commented May 27, 2024

I noticed that the test-ci-js target was already doing what I wanted – with the exception that it lacks the node binary as a prerequisite, and it didn't include --skip-tests flag like jstest has.

@aduh95 aduh95 added the request-ci Add this label to start a Jenkins CI on a PR. label May 27, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label May 27, 2024
@richardlau
Copy link
Member

I noticed that the test-ci-js target was already doing what I wanted – with the exception that it lacks the node binary as a prerequisite,

That's deliberate -- test-ci-js (and corresponding test-ci-native) is used in node-test-binary-armv7l where the node binary is copied from node-cross-compile via our binary temp git repository (all part of node-test-commit-arm-fanned).

@aduh95
Copy link
Contributor Author

aduh95 commented May 28, 2024

I noticed that the test-ci-js target was already doing what I wanted – with the exception that it lacks the node binary as a prerequisite,

That's deliberate -- test-ci-js (and corresponding test-ci-native) is used in node-test-binary-armv7l where the node binary is copied from node-cross-compile via our binary temp git repository (all part of node-test-commit-arm-fanned).

Makes sense, that explains the comment just above the rule 👍

@aduh95 aduh95 added the commit-queue Add this label to land a pull request using GitHub Actions. label May 29, 2024
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels May 29, 2024
@nodejs-github-bot
Copy link
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/53105
✔  Done loading data for nodejs/node/pull/53105
----------------------------------- PR info ------------------------------------
Title      build: add `--skip-tests` to `test-ci-js` target (#53105)
   ⚠  Could not retrieve the email or name of the PR author's from user's GitHub profile!
Branch     aduh95:jstest-only -> nodejs:main
Labels     build, needs-ci
Commits    1
 - build: add `--skip-tests` to `test-ci-js` target
Committers 1
 - Antoine du Hamel 
PR-URL: https://github.com/nodejs/node/pull/53105
Reviewed-By: Richard Lau 
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/53105
Reviewed-By: Richard Lau 
--------------------------------------------------------------------------------
   ℹ  This PR was created on Wed, 22 May 2024 17:05:28 GMT
   ✔  Approvals: 1
   ✔  - Richard Lau (@richardlau) (TSC): https://github.com/nodejs/node/pull/53105#pullrequestreview-2083248397
   ✘  This PR needs to wait 6 more hours to land (or 0 hours if there is one more approval)
   ✔  Last GitHub CI successful
   ℹ  Last Full PR CI on 2024-05-29T08:53:17Z: https://ci.nodejs.org/job/node-test-pull-request/59508/
- Querying data for job/node-test-pull-request/59508/
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  Aborted `git node land` session in /home/runner/work/node/node/.ncu
https://github.com/nodejs/node/actions/runs/9284668581
@aduh95 aduh95 added commit-queue Add this label to land a pull request using GitHub Actions. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels May 29, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label May 29, 2024
@nodejs-github-bot nodejs-github-bot merged commit 534c122 into nodejs:main May 29, 2024
59 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 534c122

@aduh95 aduh95 deleted the jstest-only branch May 29, 2024 17:24
targos pushed a commit that referenced this pull request Jun 1, 2024
PR-URL: #53105
Reviewed-By: Richard Lau <rlau@redhat.com>
@RafaelGSS RafaelGSS mentioned this pull request Jun 7, 2024
ebouye pushed a commit to ebouye/node that referenced this pull request Jun 20, 2024
PR-URL: nodejs#53105
Reviewed-By: Richard Lau <rlau@redhat.com>
bmeck pushed a commit to bmeck/node that referenced this pull request Jun 22, 2024
PR-URL: nodejs#53105
Reviewed-By: Richard Lau <rlau@redhat.com>
marco-ippolito pushed a commit that referenced this pull request Jul 19, 2024
PR-URL: #53105
Reviewed-By: Richard Lau <rlau@redhat.com>
marco-ippolito pushed a commit that referenced this pull request Jul 19, 2024
PR-URL: #53105
Reviewed-By: Richard Lau <rlau@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI. needs-ci PRs that need a full CI run.
3 participants