Skip to content
This repository was archived by the owner on Sep 17, 2024. It is now read-only.

Commit ec5686f

Browse files
authored
test(build): add node 19 to build matrix (#87)
* test(build): add node 19 to build matrix * fix(bindings): remove constructor * test(hub): use legacy timers * test(hub): use legacy timers
1 parent 55692c0 commit ec5686f

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
os: [macos-latest, windows-2019, ubuntu-latest]
19-
node-version: [14.x, 16.x, 18.x]
19+
node-version: [14.x, 16.x, 18.x, 19.x]
2020
target: [x64]
2121
host: [x64]
2222
# arm64 is not supported by gh runners yet

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
os: [macos-latest, windows-2019, ubuntu-latest]
21-
node-version: [14.x, 16.x, 18.x]
21+
node-version: [14.x, 16.x, 18.x, 19.x]
2222
runs-on: ${{ matrix.os }}
2323
steps:
2424
- uses: actions/checkout@v3

bindings/cpu_profiler.cc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -279,12 +279,10 @@ static void StartProfiling(const v8::FunctionCallbackInfo<v8::Value>& args) {
279279

280280
v8::Local<v8::String> title = Nan::To<v8::String>(args[0]).ToLocalChecked();
281281

282-
v8::CpuProfilingOptions options = v8::CpuProfilingOptions{
283-
v8::CpuProfilingMode::kCallerLineNumbers, v8::CpuProfilingOptions::kNoSampleLimit,
284-
SAMPLING_INTERVAL_US };
285-
286282
Profiler* profiler = reinterpret_cast<Profiler*>(args.Data().As<v8::External>()->Value());
287-
profiler->cpu_profiler->StartProfiling(title, options);
283+
profiler->cpu_profiler->StartProfiling(title, {
284+
v8::CpuProfilingMode::kCallerLineNumbers, v8::CpuProfilingOptions::kNoSampleLimit,
285+
SAMPLING_INTERVAL_US });
288286
};
289287

290288
// StopProfiling(string title)

src/cpu_profiler.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ interface V8CpuProfilerBindings {
5656
stopProfiling(name: string): RawThreadCpuProfile | null;
5757
}
5858

59-
console.log(projectRootDirectory);
6059
const privateBindings: PrivateV8CpuProfilerBindings = importCppBindingsModule();
6160
const CpuProfilerBindings: V8CpuProfilerBindings = {
6261
startProfiling(name: string) {

src/hubextensions.hub.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ describe('hubextensions', () => {
4747
});
4848

4949
it('respect max profile duration timeout', async () => {
50-
jest.useFakeTimers();
50+
// it seems that in node 19 globals (or least part of them) are a readonly object
51+
// so when useFakeTimers is called it throws an error because it cannot override
52+
// a readonly property of performance on global object. Use legacyFakeTimers for now
53+
jest.useFakeTimers({ legacyFakeTimers: true });
5154
const startProfilingSpy = jest.spyOn(profiler, 'startProfiling');
5255
const stopProfilingSpy = jest.spyOn(profiler, 'stopProfiling');
5356
const transport = Sentry.getCurrentHub().getClient()?.getTransport();

0 commit comments

Comments
 (0)