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
72 changes: 36 additions & 36 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 28 additions & 10 deletions llrt_core/src/modules/js/@llrt/test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type SuiteResult = TestProps & {
tests: TestResult[];
children: SuiteResult[];
parent: SuiteResult | null;
error?: Error | null;
};

type RootSuite = TestProps & {
Expand Down Expand Up @@ -414,6 +415,14 @@ class TestServer {
const test = workerData.currentTest!;
test.ended = ended;
test.success = true;
// A test has completed successfully; clear the reference so a later
// suite-level hook failure (e.g. a child suite's beforeAll) is not
// misattributed to this passing test.
workerData.currentTest = null;
// Clear captured output so stderr/stdout from this passing test does
// not leak into a later failure's report.
workerData.stdErrBuffer.clear();
workerData.stdOutBuffer.clear();
}

workerData.currentPath.pop();
Expand Down Expand Up @@ -495,13 +504,6 @@ class TestServer {
}
handleTestError(workerId: number, error: any, ended: number) {
const workerData = this.workerData[workerId];
const test = workerData.currentTest || {
desc: "",
success: false,
started: 0,
ended: 0,
error,
};
workerData.success = false;
const results = this.results.get(workerData.file!);
if (results) {
Expand All @@ -518,9 +520,22 @@ class TestServer {
workerData.stdOutBuffer.clear();
this.filesFailed.set(workerData.file!, testFailures);
this.totalFailed++;
test.ended = ended;
test.error = error;
test.success = false;

const test = workerData.currentTest;
if (test) {
// The error occurred inside a running test.
test.ended = ended;
test.error = error;
test.success = false;
workerData.currentTest = null;
} else if (workerData.result) {
// No test is running, so the error came from a suite-level hook
// (e.g. beforeAll/afterAll). Mark the currently-open suite as failed
// instead of misattributing it to a previously passing test.
workerData.result.ended = ended;
workerData.result.error = error;
workerData.result.success = false;
}
workerData.currentPath.pop();
}

Expand Down Expand Up @@ -726,6 +741,9 @@ class TestServer {
const results = result.children;
for (let result of results) {
output += `${indent}${Color.BOLD(result.desc)} ${Color.DIM(TestServer.elapsed(result))}\n`;
if (result.error) {
output += this.formattedError(result.error) + "\n";
}
output += this.printSuiteResult(result, depth + 1);
}
return output;
Expand Down
8 changes: 4 additions & 4 deletions modules/llrt_crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ ed25519-dalek = { version = "3.0.0-pre.7", features = [
"pkcs8",
"rand_core",
], default-features = false, optional = true }
elliptic-curve = { version = "0.14.0-rc.30", features = [
elliptic-curve = { version = "0.14.0-rc.33", features = [
"alloc",
"sec1",
], default-features = false, optional = true }
Expand All @@ -98,17 +98,17 @@ rsa = { version = "0.10.0-rc.18", features = [
"sha2",
"encoding",
], default-features = false, optional = true }
p256 = { version = "0.14.0-rc.9", features = [
p256 = { version = "0.14.0-rc.10", features = [
"ecdh",
"ecdsa",
"pkcs8",
], default-features = false, optional = true }
p384 = { version = "0.14.0-rc.9", features = [
p384 = { version = "0.14.0-rc.10", features = [
"ecdh",
"ecdsa",
"pkcs8",
], default-features = false, optional = true }
p521 = { version = "0.14.0-rc.9", features = [
p521 = { version = "0.14.0-rc.10", features = [
"ecdh",
"ecdsa",
"pkcs8",
Expand Down
65 changes: 0 additions & 65 deletions tests/wpt/FileAPI/support/Blob.js

This file was deleted.

Loading
Loading