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
6 changes: 3 additions & 3 deletions harness/src/eshost-elide/agent.elide.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ class ElideAgent extends ConsoleAgent {
// test262 fixture files are ES modules by suite convention, but Elide
// (Node-style) treats imported `.js` as CommonJS unless the enclosing
// package declares `type: module`. Mark the temp dir accordingly for
// module-flagged tests (whose entry runs as `.mjs`, unaffected by the
// package type); remove the marker for script tests, whose `.js` entry
// must keep evaluating as a classic global script.
// module-flagged tests, whose `.js` entry then parses as ESM; remove the
// marker for script tests, whose `.js` entry must keep evaluating as a
// classic global script.
const pkg = path.join(path.dirname(args[0]), "package.json");
try {
if (this._elideModule) {
Expand Down
8 changes: 5 additions & 3 deletions harness/src/eshost-elide/agent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ test("_copyFixtures ignores specifiers that do not name real files", () => {
expect(existsSync(join(dst, "missing_FIXTURE.js"))).toBe(false);
});

test("createChildProcess marks the temp dir type:module only for module tests", async () => {
test("createChildProcess marks the temp dir type:module only for module tests and runs the entry in place", async () => {
const dir = mkdtempSync(join(tmpdir(), "elide-agent-tmp-"));
const entry = join(dir, "t.js");
writeFileSync(entry, "// entry");
Expand All @@ -101,8 +101,10 @@ test("createChildProcess marks the temp dir type:module only for module tests",
agent._elideModule = true;
await agent.createChildProcess([entry]);
expect(JSON.parse(readFileSync(join(dir, "package.json"), "utf8"))).toEqual({ type: "module" });
// Module entry runs as a `.mjs` copy.
expect(spawned[0][0]).toBe(join(dir, "t.mjs"));
// The module entry runs under its real `.js` name (parsed as ESM via the marker),
// so self/cyclic imports of that file dedupe to the single entry record.
expect(spawned[0][0]).toBe(entry);
expect(existsSync(join(dir, "t.mjs"))).toBe(false);

agent._elideModule = false;
await agent.createChildProcess([entry]);
Expand Down
12 changes: 9 additions & 3 deletions harness/src/manifest.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { existsSync, mkdtempSync, writeFileSync } from "node:fs";
import { existsSync, mkdtempSync, readdirSync, writeFileSync } from "node:fs";

// A checkout without submodules still has the empty suite directories, so test the
// contents rather than the directory itself.
function populated(dir: string): boolean {
return existsSync(dir) && readdirSync(dir).length > 0;
}
import { join } from "node:path";
import { tmpdir } from "node:os";
import { test, expect } from "bun:test";
Expand Down Expand Up @@ -57,7 +63,7 @@ test("javac langtools manifest enables the full tools/javac tree", () => {

test("cpython manifest entries exist in the checked-out CPython suite", () => {
const suiteRoot = `${import.meta.dir}/../../suites/cpython`;
if (!existsSync(suiteRoot)) return;
if (!populated(suiteRoot)) return;

const manifest = loadManifest(`${import.meta.dir}/../../manifests/cpython-core.toml`);
const groups = new Map(manifest.groups.map((group) => [group.id, group.include]));
Expand All @@ -75,7 +81,7 @@ test("cpython manifest entries exist in the checked-out CPython suite", () => {

test("wintertc WPT manifest includes checked-out paths when the suite exists", () => {
const suiteRoot = `${import.meta.dir}/../../suites/wpt`;
if (!existsSync(suiteRoot)) return;
if (!populated(suiteRoot)) return;

const manifest = loadManifest(`${import.meta.dir}/../../manifests/wintertc-wpt-2025.toml`);
for (const path of manifest.groups.flatMap((group) => group.include)) {
Expand Down
2 changes: 1 addition & 1 deletion harness/src/registry.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ test("loads javac-jtreg workload from registry.toml", () => {
expect(javac!.path).toBe("suites/openjdk");
expect(javac!.settings.manifest).toBe("manifests/javac-langtools.toml");
expect(javac!.settings.timeoutMs).toBe(3600000);
expect(javac!.settings.jtregCaseTimeoutSeconds).toBe(300);
expect(javac!.settings.jtregCaseTimeoutSeconds).toBe(900);
expect(javac!.settings.javaRunner).toBe("java");
});

Expand Down
Loading