Skip to content

Commit

Permalink
chore: move test_util to tests/util/server (#22444)
Browse files Browse the repository at this point in the history
As discussed with @mmastrac.

---------

Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
Co-authored-by: Matt Mastracci <matthew@mastracci.com>
  • Loading branch information
iuioiua and mmastrac authored Feb 19, 2024
1 parent eb542bc commit 2b279ad
Show file tree
Hide file tree
Showing 30 changed files with 20 additions and 16 deletions.
12 changes: 6 additions & 6 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand All @@ -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"
Expand Down
8 changes: 4 additions & 4 deletions cli/tsc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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\");",
)
Expand Down
2 changes: 1 addition & 1 deletion tests/testdata/npm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test_util/Cargo.toml → tests/util/server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions test_util/src/lib.rs → tests/util/server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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();
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tools/release/deno_workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 2b279ad

Please sign in to comment.