Skip to content

Commit f5e46c9

Browse files
authored
chore: move cli/tests/ -> tests/ (denoland#22369)
This looks like a massive PR, but it's only a move from cli/tests -> tests, and updates of relative paths for files. This is the first step towards aggregate all of the integration test files under tests/, which will lead to a set of integration tests that can run without the CLI binary being built. While we could leave these tests under `cli`, it would require us to keep a more complex directory structure for the various test runners. In addition, we have a lot of complexity to ignore various test files in the `cli` project itself (cargo publish exclusion rules, autotests = false, etc). And finally, the `tests/` folder will eventually house the `test_ffi`, `test_napi` and other testing code, reducing the size of the root repo directory. For easier review, the extremely large and noisy "move" is in the first commit (with no changes -- just a move), while the remainder of the changes to actual files is in the second commit.
1 parent d2477f7 commit f5e46c9

File tree

3,449 files changed

+273
-280
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,449 files changed

+273
-280
lines changed

.dprint.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,21 @@
2727
"cli/tsc/dts/lib.es*.d.ts",
2828
"cli/tsc/dts/typescript.d.ts",
2929
"cli/tests/node_compat/test",
30-
"cli/tests/testdata/file_extensions/ts_with_js_extension.js",
31-
"cli/tests/testdata/fmt/badly_formatted.json",
32-
"cli/tests/testdata/fmt/badly_formatted.md",
33-
"cli/tests/testdata/fmt/badly_formatted.ipynb",
34-
"cli/tests/testdata/byte_order_mark.ts",
35-
"cli/tests/testdata/encoding",
36-
"cli/tests/testdata/fmt/",
37-
"cli/tests/testdata/lint/glob/",
38-
"cli/tests/testdata/test/glob/",
39-
"cli/tests/testdata/import_attributes/json_with_shebang.json",
40-
"cli/tests/testdata/run/error_syntax_empty_trailing_line.mjs",
41-
"cli/tests/testdata/run/inline_js_source_map*",
42-
"cli/tests/testdata/malformed_config/",
43-
"cli/tests/testdata/npm/registry/",
44-
"cli/tests/testdata/test/markdown_windows.md",
30+
"tests/testdata/file_extensions/ts_with_js_extension.js",
31+
"tests/testdata/fmt/badly_formatted.json",
32+
"tests/testdata/fmt/badly_formatted.md",
33+
"tests/testdata/fmt/badly_formatted.ipynb",
34+
"tests/testdata/byte_order_mark.ts",
35+
"tests/testdata/encoding",
36+
"tests/testdata/fmt/",
37+
"tests/testdata/lint/glob/",
38+
"tests/testdata/test/glob/",
39+
"tests/testdata/import_attributes/json_with_shebang.json",
40+
"tests/testdata/run/error_syntax_empty_trailing_line.mjs",
41+
"tests/testdata/run/inline_js_source_map*",
42+
"tests/testdata/malformed_config/",
43+
"tests/testdata/npm/registry/",
44+
"tests/testdata/test/markdown_windows.md",
4545
"cli/tsc/*typescript.js",
4646
"gh-pages",
4747
"target",

.gitattributes

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
* text=auto eol=lf
33
*.png -text
44

5-
/cli/tests/testdata/encoding/* -text
5+
/tests/testdata/encoding/* -text
66

77
# Tell git which symlinks point to files, and which ones point to directories.
88
# This is relevant for Windows only, and requires git >= 2.19.2 to work.
9-
/cli/tests/testdata/symlink_to_subdir symlink=dir
9+
/tests/testdata/symlink_to_subdir symlink=dir
1010

1111
# Tell github these are vendored files.
1212
# Doesn't include them in the language statistics.
1313
/cli/tsc/00_typescript.js linguist-vendored
1414
/cli/dts/* linguist-vendored
1515

1616
# Keep Windows line endings in cross-platform doc check test file
17-
/cli/tests/testdata/test/markdown_windows.md eol=crlf
17+
/tests/testdata/test/markdown_windows.md eol=crlf

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ members = [
66
"bench_util",
77
"cli",
88
"cli/napi/sym",
9-
"cli/tests",
109
"ext/broadcast_channel",
1110
"ext/cache",
1211
"ext/canvas",
@@ -32,6 +31,7 @@ members = [
3231
"test_ffi",
3332
"test_napi",
3433
"test_util",
34+
"tests",
3535
]
3636
exclude = ["test_util/std/hash/_wasm"]
3737

cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ doc = false
1919

2020
[[test]]
2121
name = "integration"
22-
path = "tests/integration_tests_runner.rs"
22+
path = "../tests/integration_tests_runner.rs"
2323
harness = false
2424

2525
[[bench]]

cli/bench/main.rs

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -37,31 +37,27 @@ const EXEC_TIME_BENCHMARKS: &[(&str, &[&str], Option<i32>)] = &[
3737
// invalidating that cache.
3838
(
3939
"cold_hello",
40-
&["run", "--reload", "cli/tests/testdata/run/002_hello.ts"],
40+
&["run", "--reload", "tests/testdata/run/002_hello.ts"],
4141
None,
4242
),
4343
(
4444
"cold_relative_import",
4545
&[
4646
"run",
4747
"--reload",
48-
"cli/tests/testdata/run/003_relative_import.ts",
48+
"tests/testdata/run/003_relative_import.ts",
4949
],
5050
None,
5151
),
52-
(
53-
"hello",
54-
&["run", "cli/tests/testdata/run/002_hello.ts"],
55-
None,
56-
),
52+
("hello", &["run", "tests/testdata/run/002_hello.ts"], None),
5753
(
5854
"relative_import",
59-
&["run", "cli/tests/testdata/run/003_relative_import.ts"],
55+
&["run", "tests/testdata/run/003_relative_import.ts"],
6056
None,
6157
),
6258
(
6359
"error_001",
64-
&["run", "cli/tests/testdata/run/error_001.ts"],
60+
&["run", "tests/testdata/run/error_001.ts"],
6561
Some(1),
6662
),
6763
(
@@ -70,7 +66,7 @@ const EXEC_TIME_BENCHMARKS: &[(&str, &[&str], Option<i32>)] = &[
7066
"run",
7167
"--reload",
7268
"--no-check",
73-
"cli/tests/testdata/run/002_hello.ts",
69+
"tests/testdata/run/002_hello.ts",
7470
],
7571
None,
7672
),
@@ -79,7 +75,7 @@ const EXEC_TIME_BENCHMARKS: &[(&str, &[&str], Option<i32>)] = &[
7975
&[
8076
"run",
8177
"--allow-read",
82-
"cli/tests/testdata/workers/bench_startup.ts",
78+
"tests/testdata/workers/bench_startup.ts",
8379
],
8480
None,
8581
),
@@ -88,7 +84,7 @@ const EXEC_TIME_BENCHMARKS: &[(&str, &[&str], Option<i32>)] = &[
8884
&[
8985
"run",
9086
"--allow-read",
91-
"cli/tests/testdata/workers/bench_round_robin.ts",
87+
"tests/testdata/workers/bench_round_robin.ts",
9288
],
9389
None,
9490
),
@@ -97,31 +93,28 @@ const EXEC_TIME_BENCHMARKS: &[(&str, &[&str], Option<i32>)] = &[
9793
&[
9894
"run",
9995
"--allow-read",
100-
"cli/tests/testdata/workers/bench_large_message.ts",
96+
"tests/testdata/workers/bench_large_message.ts",
10197
],
10298
None,
10399
),
104100
(
105101
"text_decoder",
106-
&["run", "cli/tests/testdata/benches/text_decoder_perf.js"],
102+
&["run", "tests/testdata/benches/text_decoder_perf.js"],
107103
None,
108104
),
109105
(
110106
"text_encoder",
111-
&["run", "cli/tests/testdata/benches/text_encoder_perf.js"],
107+
&["run", "tests/testdata/benches/text_encoder_perf.js"],
112108
None,
113109
),
114110
(
115111
"text_encoder_into",
116-
&[
117-
"run",
118-
"cli/tests/testdata/benches/text_encoder_into_perf.js",
119-
],
112+
&["run", "tests/testdata/benches/text_encoder_into_perf.js"],
120113
None,
121114
),
122115
(
123116
"response_string",
124-
&["run", "cli/tests/testdata/benches/response_string_perf.js"],
117+
&["run", "tests/testdata/benches/response_string_perf.js"],
125118
None,
126119
),
127120
(
@@ -314,7 +307,7 @@ fn get_binary_sizes(target_dir: &Path) -> Result<HashMap<String, i64>> {
314307

315308
const BUNDLES: &[(&str, &str)] = &[
316309
("file_server", "./test_util/std/http/file_server.ts"),
317-
("welcome", "./cli/tests/testdata/welcome.ts"),
310+
("welcome", "./tests/testdata/welcome.ts"),
318311
];
319312
fn bundle_benchmark(deno_exe: &Path) -> Result<HashMap<String, i64>> {
320313
let mut sizes = HashMap::<String, i64>::new();

cli/tests/config/deno.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

cli/tests/node_compat/deno.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

cli/tests/testdata/coverage/no_transpiled_lines/index.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

cli/tests/testdata/run/node_prefix_missing/main.ts.out_feature_enabled

Lines changed: 0 additions & 2 deletions
This file was deleted.

test_util/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ pub fn prebuilt_path() -> PathRef {
7676
}
7777

7878
pub fn tests_path() -> PathRef {
79-
root_path().join("cli").join("tests")
79+
root_path().join("tests")
8080
}
8181

8282
pub fn testdata_path() -> PathRef {

0 commit comments

Comments
 (0)