Repository: denoland/deno_core
Pull request #374 (2023-12-07 01:31:50)

chore: port dyn_import_circular to integration test 
Port another test to checkin


Patch:
diff --git a/Cargo.lock b/Cargo.lock
index 54ad2a1..0f2b11b 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -258,7 +258,7 @@ dependencies = [
 
 [[package]]
 name = "deno_core"
-version = "0.235.0"
+version = "0.236.0"
 dependencies = [
  "anyhow",
  "bencher",
@@ -312,7 +312,7 @@ dependencies = [
 
 [[package]]
 name = "deno_ops"
-version = "0.111.0"
+version = "0.112.0"
 dependencies = [
  "pretty_assertions",
  "prettyplease",
@@ -1205,7 +1205,7 @@ dependencies = [
 
 [[package]]
 name = "serde_v8"
-version = "0.144.0"
+version = "0.145.0"
 dependencies = [
  "bencher",
  "bytes",
diff --git a/Cargo.toml b/Cargo.toml
index 727ff48..73f829f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -18,9 +18,9 @@ repository = "https://github.com/denoland/deno_core"
 
 [workspace.dependencies]
 # Local dependencies
-deno_core = { version = "0.235.0", path = "./core" }
-deno_ops = { version = "0.111.0", path = "./ops" }
-serde_v8 = { version = "0.144.0", path = "./serde_v8" }
+deno_core = { version = "0.236.0", path = "./core" }
+deno_ops = { version = "0.112.0", path = "./ops" }
+serde_v8 = { version = "0.145.0", path = "./serde_v8" }
 
 v8 = { version = "0.82.0", default-features = false }
 deno_ast = { version = "0.31.2", features = ["transpiling"] }
diff --git a/core/Cargo.toml b/core/Cargo.toml
index 02b6559..fd5f781 100644
--- a/core/Cargo.toml
+++ b/core/Cargo.toml
@@ -2,7 +2,7 @@
 
 [package]
 name = "deno_core"
-version = "0.235.0"
+version = "0.236.0"
 authors.workspace = true
 edition.workspace = true
 license.workspace = true
diff --git a/ops/Cargo.toml b/ops/Cargo.toml
index 12b72d3..d919dd9 100644
--- a/ops/Cargo.toml
+++ b/ops/Cargo.toml
@@ -2,7 +2,7 @@
 
 [package]
 name = "deno_ops"
-version = "0.111.0"
+version = "0.112.0"
 authors.workspace = true
 edition.workspace = true
 license.workspace = true
diff --git a/serde_v8/Cargo.toml b/serde_v8/Cargo.toml
index 281a618..a82961b 100644
--- a/serde_v8/Cargo.toml
+++ b/serde_v8/Cargo.toml
@@ -2,7 +2,7 @@
 
 [package]
 name = "serde_v8"
-version = "0.144.0"
+version = "0.145.0"
 authors.workspace = true
 edition.workspace = true
 license.workspace = true


Test patch:
diff --git a/core/modules/tests.rs b/core/modules/tests.rs
index 95cfaf5..b3e2d11 100644
--- a/core/modules/tests.rs
+++ b/core/modules/tests.rs
@@ -820,41 +820,6 @@ async fn dyn_import_borrow_mut_error() {
   .await;
 }
 
-// Regression test for https://github.com/denoland/deno/issues/3736.
-#[test]
-fn dyn_concurrent_circular_import() {
-  let loader = Rc::new(TestingModuleLoader::new(StaticModuleLoader::new([
-    (
-      Url::parse("file:///a.js").unwrap(),
-      ascii_str!("import './b.js';"),
-    ),
-    (
-      Url::parse("file:///b.js").unwrap(),
-      ascii_str!("import './c.js';\nimport './a.js';"),
-    ),
-    (
-      Url::parse("file:///c.js").unwrap(),
-      ascii_str!("import './d.js';"),
-    ),
-    (Url::parse("file:///d.js").unwrap(), ascii_str!("// pass")),
-  ])));
-
-  let mut runtime = JsRuntime::new(RuntimeOptions {
-    module_loader: Some(loader.clone()),
-    ..Default::default()
-  });
-
-  runtime
-    .execute_script_static(
-      "file:///entry.js",
-      "import('./b.js');\nimport('./a.js');",
-    )
-    .unwrap();
-
-  let result = futures::executor::block_on(runtime.run_event_loop(false));
-  assert!(result.is_ok());
-}
-
 #[test]
 fn test_circular_load() {
   let loader = MockLoader::new();
diff --git a/testing/integration/dyn_import_circular/a.js b/testing/integration/dyn_import_circular/a.js
new file mode 100644
index 0000000..2226cd0
--- /dev/null
+++ b/testing/integration/dyn_import_circular/a.js
@@ -0,0 +1,3 @@
+// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
+import "./b.js";
+console.log("a complete");
diff --git a/testing/integration/dyn_import_circular/b.js b/testing/integration/dyn_import_circular/b.js
new file mode 100644
index 0000000..502a49f
--- /dev/null
+++ b/testing/integration/dyn_import_circular/b.js
@@ -0,0 +1,4 @@
+// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
+import "./c.js";
+import "./a.js";
+console.log("b complete");
diff --git a/testing/integration/dyn_import_circular/c.js b/testing/integration/dyn_import_circular/c.js
new file mode 100644
index 0000000..090c61d
--- /dev/null
+++ b/testing/integration/dyn_import_circular/c.js
@@ -0,0 +1,3 @@
+// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
+import "./d.js";
+console.log("c complete");
diff --git a/testing/integration/dyn_import_circular/d.js b/testing/integration/dyn_import_circular/d.js
new file mode 100644
index 0000000..a27473f
--- /dev/null
+++ b/testing/integration/dyn_import_circular/d.js
@@ -0,0 +1,2 @@
+// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
+console.log("d");
diff --git a/testing/integration/dyn_import_circular/dyn_import_circular.out b/testing/integration/dyn_import_circular/dyn_import_circular.out
new file mode 100644
index 0000000..73c2d81
--- /dev/null
+++ b/testing/integration/dyn_import_circular/dyn_import_circular.out
@@ -0,0 +1,4 @@
+d
+c complete
+b complete
+a complete
diff --git a/testing/integration/dyn_import_circular/dyn_import_circular.ts b/testing/integration/dyn_import_circular/dyn_import_circular.ts
new file mode 100644
index 0000000..4ada954
--- /dev/null
+++ b/testing/integration/dyn_import_circular/dyn_import_circular.ts
@@ -0,0 +1,5 @@
+// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
+
+// Regression test for https://github.com/denoland/deno/issues/3736.
+import("./b.js");
+import("./a.js");
diff --git a/testing/lib.rs b/testing/lib.rs
index 1eb4fd1..b75773b 100644
--- a/testing/lib.rs
+++ b/testing/lib.rs
@@ -36,4 +36,4 @@ unit_test!(encode_decode_test, microtask_test, tc39_test, test_test,);
 
 // Test the load and run of an entire file within the `checkin` infrastructure.
 // These files are loaded from the system/ dir.
-integration_test!(smoke_test,);
+integration_test!(dyn_import_circular, smoke_test,);
diff --git a/testing/tsconfig.json b/testing/tsconfig.json
index 3e3599b..20fc973 100644
--- a/testing/tsconfig.json
+++ b/testing/tsconfig.json
@@ -1,9 +1,9 @@
 {
   "compilerOptions": {
-    "baseUrl": "./checkin",
+    "baseUrl": ".",
     "paths": {
-      "checkin:console": ["runtime/console.ts"],
-      "checkin:testing": ["runtime/testing.ts"]
+      "checkin:console": ["checkin/runtime/console.ts"],
+      "checkin:testing": ["checkin/runtime/testing.ts"]
     },
     "lib": ["ESNext", "DOM", "ES2023.Array"]
   }