1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00

chore: move test_util to tests/util/server (#22444)

As discussed with @mmastrac.

---------

Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
Co-authored-by: Matt Mastracci <matthew@mastracci.com>
This commit is contained in:
Asher Gomez 2024-02-20 00:34:24 +11:00 committed by GitHub
parent eb542bc185
commit 2b279ad630
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
30 changed files with 20 additions and 16 deletions

12
Cargo.lock generated
View file

@ -644,7 +644,7 @@ dependencies = [
"pretty_assertions", "pretty_assertions",
"serde", "serde",
"serde_repr", "serde_repr",
"test_util", "test_server",
"tokio", "tokio",
"tokio-util", "tokio-util",
"tower-lsp", "tower-lsp",
@ -1090,7 +1090,7 @@ dependencies = [
"shell-escape", "shell-escape",
"tar", "tar",
"tempfile", "tempfile",
"test_util", "test_server",
"text-size", "text-size",
"text_lines", "text_lines",
"thiserror", "thiserror",
@ -1758,7 +1758,7 @@ dependencies = [
"rustyline", "rustyline",
"serde", "serde",
"signal-hook-registry", "signal-hook-registry",
"test_util", "test_server",
"tokio", "tokio",
"tokio-metrics", "tokio-metrics",
"uuid", "uuid",
@ -6378,7 +6378,7 @@ name = "test_ffi"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"pretty_assertions", "pretty_assertions",
"test_util", "test_server",
] ]
[[package]] [[package]]
@ -6387,11 +6387,11 @@ version = "0.1.0"
dependencies = [ dependencies = [
"napi-build", "napi-build",
"napi-sys", "napi-sys",
"test_util", "test_server",
] ]
[[package]] [[package]]
name = "test_util" name = "test_server"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",

View file

@ -28,10 +28,10 @@ members = [
"ext/websocket", "ext/websocket",
"ext/webstorage", "ext/webstorage",
"runtime", "runtime",
"test_util",
"tests", "tests",
"tests/ffi", "tests/ffi",
"tests/napi", "tests/napi",
"tests/util/server",
] ]
exclude = ["tests/util/std/hash/_wasm"] exclude = ["tests/util/std/hash/_wasm"]
@ -51,7 +51,7 @@ deno_media_type = { version = "0.1.1", features = ["module_specifier"] }
deno_runtime = { version = "0.146.0", path = "./runtime" } deno_runtime = { version = "0.146.0", path = "./runtime" }
deno_terminal = "0.1.1" deno_terminal = "0.1.1"
napi_sym = { version = "0.68.0", path = "./cli/napi/sym" } napi_sym = { version = "0.68.0", path = "./cli/napi/sym" }
test_util = { path = "./test_util" } test_util = { package = "test_server", path = "./tests/util/server" }
denokv_proto = "0.5.0" denokv_proto = "0.5.0"
denokv_remote = "0.5.0" denokv_remote = "0.5.0"

View file

@ -1001,8 +1001,8 @@ mod tests {
// be used again after the snapshot is taken. We should figure out a mechanism // be used again after the snapshot is taken. We should figure out a mechanism
// to allow removing some of the ops before taking a snapshot. // to allow removing some of the ops before taking a snapshot.
#[ignore] #[ignore]
#[test] #[tokio::test]
fn test_compiler_snapshot() { async fn test_compiler_snapshot() {
let mut js_runtime = JsRuntime::new(RuntimeOptions { let mut js_runtime = JsRuntime::new(RuntimeOptions {
startup_snapshot: Some(compiler_snapshot()), startup_snapshot: Some(compiler_snapshot()),
..Default::default() ..Default::default()
@ -1027,8 +1027,8 @@ mod tests {
assert_eq!(actual, "11905938177474799758"); assert_eq!(actual, "11905938177474799758");
} }
#[test] #[tokio::test]
fn test_hash_url() { async fn test_hash_url() {
let specifier = deno_core::resolve_url( let specifier = deno_core::resolve_url(
"data:application/javascript,console.log(\"Hello%20Deno\");", "data:application/javascript,console.log(\"Hello%20Deno\");",
) )

View file

@ -4,7 +4,7 @@ This folder contains test data for npm specifiers.
## Registry ## Registry
The registry is served by the test server (server in test_util) at The registry is served by the test server (server in `tests/util/server`) at
http://localhost:4545/npm/registry/ via the `./registry` folder. http://localhost:4545/npm/registry/ via the `./registry` folder.
### Updating with real npm packages ### Updating with real npm packages

View file

@ -1,7 +1,7 @@
# Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. # Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
[package] [package]
name = "test_util" name = "test_server"
version = "0.1.0" version = "0.1.0"
authors.workspace = true authors.workspace = true
edition.workspace = true edition.workspace = true

View file

@ -67,6 +67,10 @@ pub fn env_vars_for_jsr_tests() -> Vec<(String, String)> {
pub fn root_path() -> PathRef { pub fn root_path() -> PathRef {
PathRef::new( PathRef::new(
PathBuf::from(concat!(env!("CARGO_MANIFEST_DIR"))) PathBuf::from(concat!(env!("CARGO_MANIFEST_DIR")))
.parent()
.unwrap()
.parent()
.unwrap()
.parent() .parent()
.unwrap(), .unwrap(),
) )

View file

@ -1,5 +1,5 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
fn main() { fn main() {
test_util::servers::run_all_servers(); test_server::servers::run_all_servers();
} }

View file

@ -35,7 +35,7 @@ export class DenoWorkspace {
getCliDependencyCrates() { getCliDependencyCrates() {
return this.getCliCrate() return this.getCliCrate()
.descendantDependenciesInRepo() .descendantDependenciesInRepo()
.filter((c) => c.name !== "test_util"); .filter((c) => c.name !== "test_server");
} }
getCliCrate() { getCliCrate() {