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

View file

@ -28,10 +28,10 @@ members = [
"ext/websocket",
"ext/webstorage",
"runtime",
"test_util",
"tests",
"tests/ffi",
"tests/napi",
"tests/util/server",
]
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_terminal = "0.1.1"
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_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
// to allow removing some of the ops before taking a snapshot.
#[ignore]
#[test]
fn test_compiler_snapshot() {
#[tokio::test]
async fn test_compiler_snapshot() {
let mut js_runtime = JsRuntime::new(RuntimeOptions {
startup_snapshot: Some(compiler_snapshot()),
..Default::default()
@ -1027,8 +1027,8 @@ mod tests {
assert_eq!(actual, "11905938177474799758");
}
#[test]
fn test_hash_url() {
#[tokio::test]
async fn test_hash_url() {
let specifier = deno_core::resolve_url(
"data:application/javascript,console.log(\"Hello%20Deno\");",
)

View file

@ -4,7 +4,7 @@ This folder contains test data for npm specifiers.
## 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.
### Updating with real npm packages

View file

@ -1,7 +1,7 @@
# Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
[package]
name = "test_util"
name = "test_server"
version = "0.1.0"
authors.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 {
PathRef::new(
PathBuf::from(concat!(env!("CARGO_MANIFEST_DIR")))
.parent()
.unwrap()
.parent()
.unwrap()
.parent()
.unwrap(),
)

View file

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

View file

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