Compare commits

...

4 Commits

Author SHA1 Message Date
Meghan Denny
8971b98f15 address ci 2025-09-27 15:56:23 -07:00
Meghan Denny
37238d33be fixes 2025-09-27 14:13:45 -07:00
Meghan Denny
d764de9e65 fixes 2025-09-27 03:25:42 -07:00
Meghan Denny
8dbe2e7f85 ci: add piscina to vendor test 2025-09-27 00:56:53 -07:00
10 changed files with 86 additions and 32 deletions

View File

@@ -16,6 +16,7 @@ jobs:
matrix:
package:
- elysia
- piscina
steps:
- uses: actions/checkout@v4

View File

@@ -1,5 +1,5 @@
[test]
# Large monorepos (like Bun) may want to specify the test directory more specifically
# Large monorepos (like Bun) may want to specify the test directory more specifically
# By default, `bun test` scans every single folder recursively which, if you
# have a gigantic submodule (like WebKit), requires lots of directory
# traversals
@@ -7,6 +7,3 @@
# Instead, we can only scan the test directory for Bun's runtime tests
root = "test"
preload = "./test/preload.ts"
[install]
linker = "isolated"

View File

@@ -469,6 +469,7 @@ async function runTests() {
const label = `${getAnsi(color)}[${index}/${total}] ${title} - ${error}${getAnsi("reset")}`;
startGroup(label, () => {
if (parallelism > 1) return;
if (!isCI) return;
process.stderr.write(stdoutPreview);
});
@@ -490,7 +491,7 @@ async function runTests() {
if (isBuildkite) {
// Group flaky tests together, regardless of the title
const context = flaky ? "flaky" : title;
const style = flaky || title.startsWith("vendor") ? "warning" : "error";
const style = flaky ? "warning" : "error";
if (!flaky) attempt = 1; // no need to show the retries count on failures, we know it maxed out
if (title.startsWith("vendor")) {
@@ -639,7 +640,7 @@ async function runTests() {
}
if (vendorTests?.length) {
for (const { cwd: vendorPath, packageManager, testRunner, testPaths } of vendorTests) {
for (const { cwd: vendorPath, packageManager, testRunner, testPaths, build, todoTests } of vendorTests) {
if (!testPaths.length) {
continue;
}
@@ -654,17 +655,17 @@ async function runTests() {
throw new Error(`Unsupported package manager: ${packageManager}`);
}
// build
const buildResult = await spawnBun(execPath, {
cwd: vendorPath,
args: ["run", "build"],
timeout: 60_000,
});
if (!buildResult.ok) {
if (build && !buildResult.ok) {
throw new Error(`Failed to build vendor: ${buildResult.error}`);
}
for (const testPath of testPaths) {
if (todoTests.includes(testPath.replaceAll(sep, "/"))) continue;
const title = join(relative(cwd, vendorPath), testPath).replace(/\\/g, "/");
if (testRunner === "bun") {
@@ -1651,6 +1652,8 @@ function getTests(cwd) {
* @property {string} [testRunner]
* @property {string[]} [testExtensions]
* @property {boolean | Record<string, boolean | string>} [skipTests]
* @property {boolean} [build]
* @property {string[]} todoTests
*/
/**
@@ -1659,6 +1662,8 @@ function getTests(cwd) {
* @property {string} packageManager
* @property {string} testRunner
* @property {string[]} testPaths
* @property {boolean} build
* @property {string[]} todoTests
*/
/**
@@ -1693,7 +1698,18 @@ async function getVendorTests(cwd) {
return Promise.all(
relevantVendors.map(
async ({ package: name, repository, tag, testPath, testExtensions, testRunner, packageManager, skipTests }) => {
async ({
package: name,
repository,
tag,
testPath,
testExtensions,
testRunner,
packageManager,
skipTests,
build,
todoTests,
}) => {
const vendorPath = join(cwd, "vendor", name);
if (!existsSync(vendorPath)) {
@@ -1770,6 +1786,8 @@ async function getVendorTests(cwd) {
packageManager: packageManager || "bun",
testRunner: testRunner || "bun",
testPaths,
build: build ?? true,
todoTests: todoTests || [],
};
},
),

View File

@@ -57,7 +57,7 @@ static const DOMException::Description descriptions[] = {
{ "QuotaExceededError"_s, "The quota has been exceeded."_s, 22 },
{ "TimeoutError"_s, "The operation timed out."_s, 23 },
{ "InvalidNodeTypeError"_s, "The supplied node is incorrect or has an incorrect ancestor for this operation."_s, 24 },
{ "DataCloneError"_s, "The object can not be cloned."_s, 25 },
{ "DataCloneError"_s, "The object could not be cloned."_s, 25 },
{ "EncodingError"_s, "The encoding operation (either encoded or decoding) failed."_s, 0 },
{ "NotReadableError"_s, "The I/O read operation failed."_s, 0 },
{ "UnknownError"_s, "The operation failed for an unknown transient reason (e.g. out of memory)."_s, 0 },

View File

@@ -240,51 +240,51 @@ function bunTest() {
let ctx: TestContext | undefined = undefined;
function describe(arg0: unknown, arg1: unknown, arg2: unknown) {
const { name, fn } = createDescribe(arg0, arg1, arg2);
const { name, fn, options } = createDescribe(arg0, arg1, arg2);
const { describe } = bunTest();
if (options.skip) return describe.skip(name, fn);
if (options.todo) return describe.todo(name, fn);
if (options.only) return describe.only(name, fn);
describe(name, fn);
}
describe.skip = function (arg0: unknown, arg1: unknown, arg2: unknown) {
const { name, fn } = createDescribe(arg0, arg1, arg2);
const { describe } = bunTest();
describe.skip(name, fn);
const { name, fn, options } = createDescribe(arg0, arg1, arg2);
describe(name, { ...options, skip: true }, fn);
};
describe.todo = function (arg0: unknown, arg1: unknown, arg2: unknown) {
const { name, fn } = createDescribe(arg0, arg1, arg2);
const { describe } = bunTest();
describe.todo(name, fn);
const { name, fn, options } = createDescribe(arg0, arg1, arg2);
describe(name, { ...options, todo: true }, fn);
};
describe.only = function (arg0: unknown, arg1: unknown, arg2: unknown) {
const { name, fn } = createDescribe(arg0, arg1, arg2);
const { describe } = bunTest();
describe.only(name, fn);
const { name, fn, options } = createDescribe(arg0, arg1, arg2);
describe(name, { ...options, only: true }, fn);
};
function test(arg0: unknown, arg1: unknown, arg2: unknown) {
const { name, fn, options } = createTest(arg0, arg1, arg2);
const { test } = bunTest();
test(name, fn, options);
if (options.skip) return test.skip(name, fn);
if (options.todo) return test.todo(name, fn);
if (options.only) return test.only(name, fn);
test(name, fn);
}
test.skip = function (arg0: unknown, arg1: unknown, arg2: unknown) {
const { name, fn, options } = createTest(arg0, arg1, arg2);
const { test } = bunTest();
test.skip(name, fn, options);
test(name, { ...options, skip: true }, fn);
};
test.todo = function (arg0: unknown, arg1: unknown, arg2: unknown) {
const { name, fn, options } = createTest(arg0, arg1, arg2);
const { test } = bunTest();
test.todo(name, fn, options);
test(name, { ...options, todo: true }, fn);
};
test.only = function (arg0: unknown, arg1: unknown, arg2: unknown) {
const { name, fn, options } = createTest(arg0, arg1, arg2);
const { test } = bunTest();
test.only(name, fn, options);
test(name, { ...options, only: true }, fn);
};
function before(arg0: unknown, arg1: unknown) {

View File

@@ -1,5 +1,2 @@
[test]
preload = "./preload.ts"
[install]
linker = "isolated"

View File

@@ -116,7 +116,7 @@ for (const testType of testTypes) {
if (!testType.isTransferable) {
expect(() =>
structuredCloneAdvanced(original, transferList, !!isForTransfer, isForStorage, context),
).toThrowError("The object can not be cloned.");
).toThrowError("The object could not be cloned.");
} else {
const cloned = structuredCloneAdvanced(original, transferList, !!isForTransfer, isForStorage, context);
testType.expectedAfterClone(original, cloned, isForTransfer, isForStorage);

View File

@@ -23,7 +23,7 @@ test/js/node/test/parallel/test-require-dot.js
test/js/node/test/parallel/test-util-promisify-custom-names.mjs
test/js/node/test/parallel/test-whatwg-readablestream.mjs
test/js/node/test/parallel/test-worker.mjs
test/js/node/test/system-ca/test-native-root-certs.test.mjs
test/js/node/test/system-ca/test-native-root-certs.test.mjs
test/js/node/events/event-emitter.test.ts
test/js/node/module/node-module-module.test.js
test/js/node/process/call-constructor.test.js
@@ -112,6 +112,7 @@ test/napi/node-napi-tests/test/node-api/test_make_callback_recurse/do.test.ts
test/napi/node-napi-tests/test/node-api/test_threadsafe_function/do.test.ts
test/napi/node-napi-tests/test/node-api/test_worker_terminate_finalization/do.test.ts
test/napi/node-napi-tests/test/node-api/test_reference_by_node_api_version/do.test.ts
vendor/piscina/test/nice.test.ts
# normalizeCryptoAlgorithmParameters
test/js/node/test/parallel/test-webcrypto-derivekey.js

View File

@@ -55,6 +55,7 @@ test/js/node/test/parallel/test-worker-terminate-nested.js
test/js/node/test/parallel/test-worker-terminate-null-handler.js
test/js/node/test/parallel/test-worker-terminate-timers.js
test/js/node/test/parallel/test-worker-type-check.js
test/js/node/test/parallel/test-worker-uncaught-exception-async.js
test/js/node/test/parallel/test-worker-unref-from-message-during-exit.js
test/js/node/test/parallel/test-worker-workerdata-sharedarraybuffer.js
test/js/node/test/parallel/test-worker.js
@@ -197,6 +198,27 @@ test/js/bun/util/heap-snapshot.test.ts
test/regression/issue/02499/02499.test.ts
test/js/node/test/parallel/test-http-server-stale-close.js
test/js/third_party/comlink/comlink.test.ts
vendor/piscina/test/abort-task.test.ts
vendor/piscina/test/async-context.test.ts
vendor/piscina/test/atomics-optimization.test.ts
vendor/piscina/test/generics.test.ts
vendor/piscina/test/histogram.test.ts
vendor/piscina/test/idle-timeout.test.ts
vendor/piscina/test/issue-513.test.ts
vendor/piscina/test/messages.test.ts
vendor/piscina/test/move-test.test.ts
vendor/piscina/test/option-validation.test.ts
vendor/piscina/test/pool.test.ts
vendor/piscina/test/pool-close.test.ts
vendor/piscina/test/pool-destroy.test.ts
vendor/piscina/test/post-task.test.ts
vendor/piscina/test/simple-test.test.ts
vendor/piscina/test/task-queue.test.ts
vendor/piscina/test/test-is-buffer-transferred.test.ts
vendor/piscina/test/test-resourcelimits.test.ts
vendor/piscina/test/test-uncaught-exception-from-handler.test.ts
vendor/piscina/test/thread-count.test.ts
vendor/piscina/test/workers.test.ts
# Bun::JSNodeHTTPServerSocket::clearSocketData
@@ -390,6 +412,9 @@ test/v8/v8.test.ts
test/napi/node-napi-tests/test/js-native-api/test_general/do.test.ts
test/napi/node-napi-tests/test/js-native-api/6_object_wrap/do.test.ts
# panic: VM has terminated
test/js/node/test/parallel/test-crypto-op-during-process-exit.js
test/bake/dev/production.test.ts
test/js/third_party/pg-gateway/pglite.test.ts

View File

@@ -3,5 +3,20 @@
"package": "elysia",
"repository": "https://github.com/elysiajs/elysia",
"tag": "1.4.6"
},
{
"package": "piscina",
"repository": "https://github.com/piscinajs/piscina",
"tag": "v5.1.3",
"build": false,
"todoTests": [
"test/simple-test.test.ts",
"test/post-task.test.ts",
"test/nice.test.ts",
"test/histogram.test.ts",
"test/load-with-esm.test.ts",
"test/fixed-queue.test.ts",
"test/option-validation.test.ts"
]
}
]