Skip to content

Commit 6abf126

Browse files
authored
chore: remove std directory (denoland#9361)
This removes the std folder from the tree. Various parts of the tests are pretty tightly dependent on std (47 direct imports and 75 indirect imports, not counting the cli tests that use them as fixtures) so I've added std as a submodule for now.
1 parent a2b5d44 commit 6abf126

File tree

516 files changed

+82
-72877
lines changed

Some content is hidden

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

516 files changed

+82
-72877
lines changed

.dprintrc.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,9 @@
2424
"cli/tests/inline_js_source_map*",
2525
"cli/tests/badly_formatted.md",
2626
"cli/tsc/*typescript.js",
27+
"test_util/std",
2728
"test_util/wpt",
2829
"gh-pages",
29-
"std/**/testdata",
30-
"std/**/vendor",
31-
"std/node_modules",
32-
"std/hash/_wasm",
3330
"target",
3431
"third_party",
3532
"tools/wpt/expectation.json",

.github/workflows/ci.yml

+8-14
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ jobs:
5757
startsWith(matrix.os, 'ubuntu') &&
5858
matrix.kind == 'test_release' &&
5959
github.repository == 'denoland/deno' &&
60-
startsWith(github.ref, 'refs/tags/') &&
61-
!startsWith(github.ref, 'refs/tags/std/')
60+
startsWith(github.ref, 'refs/tags/')
6261
run: |
6362
mkdir -p target/release
6463
tar --exclude=.cargo_home --exclude=".git*" --exclude=target --exclude=third_party/prebuilt -czvf target/release/deno_src.tar.gz -C .. deno
@@ -112,9 +111,8 @@ jobs:
112111
runner.os != 'Windows' &&
113112
matrix.kind == 'test_release' &&
114113
github.repository == 'denoland/deno' &&
115-
(github.ref == 'refs/heads/master' ||
116-
startsWith(github.ref, 'refs/tags/') &&
117-
!startsWith(github.ref, 'refs/tags/std/'))
114+
github.ref == 'refs/heads/master' ||
115+
startsWith(github.ref, 'refs/tags/')
118116
uses: google-github-actions/setup-gcloud@master
119117
with:
120118
project_id: denoland
@@ -126,9 +124,8 @@ jobs:
126124
runner.os == 'Windows' &&
127125
matrix.kind == 'test_release' &&
128126
github.repository == 'denoland/deno' &&
129-
(github.ref == 'refs/heads/master' ||
130-
startsWith(github.ref, 'refs/tags/') &&
131-
!startsWith(github.ref, 'refs/tags/std/'))
127+
github.ref == 'refs/heads/master' ||
128+
startsWith(github.ref, 'refs/tags/')
132129
uses: google-github-actions/setup-gcloud@master
133130
env:
134131
CLOUDSDK_PYTHON: ${{env.pythonLocation}}\python.exe
@@ -288,8 +285,7 @@ jobs:
288285
runner.os != 'Windows' &&
289286
matrix.kind == 'test_release' &&
290287
github.repository == 'denoland/deno' &&
291-
startsWith(github.ref, 'refs/tags/') &&
292-
!startsWith(github.ref, 'refs/tags/std/')
288+
startsWith(github.ref, 'refs/tags/')
293289
run: |
294290
gsutil cp ./target/release/*.zip gs://dl.deno.land/release/${GITHUB_REF#refs/*/}/
295291
echo ${GITHUB_REF#refs/*/} > release-latest.txt
@@ -300,8 +296,7 @@ jobs:
300296
runner.os == 'Windows' &&
301297
matrix.kind == 'test_release' &&
302298
github.repository == 'denoland/deno' &&
303-
startsWith(github.ref, 'refs/tags/') &&
304-
!startsWith(github.ref, 'refs/tags/std/')
299+
startsWith(github.ref, 'refs/tags/')
305300
env:
306301
CLOUDSDK_PYTHON: ${{env.pythonLocation}}\python.exe
307302
shell: bash
@@ -315,8 +310,7 @@ jobs:
315310
if: |
316311
matrix.kind == 'test_release' &&
317312
github.repository == 'denoland/deno' &&
318-
startsWith(github.ref, 'refs/tags/') &&
319-
!startsWith(github.ref, 'refs/tags/std/')
313+
startsWith(github.ref, 'refs/tags/')
320314
env:
321315
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
322316
with:

.gitmodules

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
path = third_party
33
url = https://github.com/denoland/deno_third_party.git
44
shallow = true
5-
[submodule "std/wasi/testdata"]
6-
path = std/wasi/testdata
7-
url = https://github.com/khronosproject/wasi-test-suite.git
8-
shallow = true
95
[submodule "test_util/wpt"]
106
path = test_util/wpt
117
url = https://github.com/denoland/wpt.git
128
shallow = true
9+
[submodule "test_util/std"]
10+
path = test_util/std
11+
url = https://github.com/denoland/deno_std
12+
shallow = true

cli/bench/deno_http_proxy.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
2-
import { serve, ServerRequest } from "../std/http/server.ts";
2+
import { serve, ServerRequest } from "../test_util/std/http/server.ts";
33

44
const addr = Deno.args[0] || "127.0.0.1:4500";
55
const originAddr = Deno.args[1] || "127.0.0.1:4501";

cli/bench/http.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ fn deno_http(deno_exe: &str) -> Result<HttpBenchmarkResult> {
191191
"--allow-net",
192192
"--reload",
193193
"--unstable",
194-
"std/http/bench.ts",
194+
"test_util/std/http/bench.ts",
195195
&server_addr(port),
196196
],
197197
port,

cli/bench/main.rs

+14-6
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@ const EXEC_TIME_BENCHMARKS: &[(&str, &[&str], Option<i32>)] = &[
7979
),
8080
(
8181
"check",
82-
&["cache", "--reload", "std/examples/chat/server_test.ts"],
82+
&[
83+
"cache",
84+
"--reload",
85+
"test_util/std/examples/chat/server_test.ts",
86+
],
8387
None,
8488
),
8589
(
@@ -88,18 +92,22 @@ const EXEC_TIME_BENCHMARKS: &[(&str, &[&str], Option<i32>)] = &[
8892
"cache",
8993
"--reload",
9094
"--no-check",
91-
"std/examples/chat/server_test.ts",
95+
"test_util/std/examples/chat/server_test.ts",
9296
],
9397
None,
9498
),
9599
(
96100
"bundle",
97-
&["bundle", "std/examples/chat/server_test.ts"],
101+
&["bundle", "test_util/std/examples/chat/server_test.ts"],
98102
None,
99103
),
100104
(
101105
"bundle_no_check",
102-
&["bundle", "--no-check", "std/examples/chat/server_test.ts"],
106+
&[
107+
"bundle",
108+
"--no-check",
109+
"test_util/std/examples/chat/server_test.ts",
110+
],
103111
None,
104112
),
105113
];
@@ -254,8 +262,8 @@ fn get_binary_sizes(target_dir: &PathBuf) -> Result<HashMap<String, u64>> {
254262
}
255263

256264
const BUNDLES: &[(&str, &str)] = &[
257-
("file_server", "./std/http/file_server.ts"),
258-
("gist", "./std/examples/gist.ts"),
265+
("file_server", "./test_util/std/http/file_server.ts"),
266+
("gist", "./test_util/std/examples/gist.ts"),
259267
];
260268
fn bundle_benchmark(deno_exe: &PathBuf) -> Result<HashMap<String, u64>> {
261269
let mut sizes = HashMap::<String, u64>::new();

cli/http_util.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ mod tests {
313313
Some(
314314
read(
315315
test_util::root_path()
316-
.join("std/http/testdata/tls/RootCA.pem")
316+
.join("cli/tests/tls/RootCA.pem")
317317
.to_str()
318318
.unwrap(),
319319
)
@@ -345,7 +345,7 @@ mod tests {
345345
Some(
346346
read(
347347
test_util::root_path()
348-
.join("std/http/testdata/tls/RootCA.pem")
348+
.join("cli/tests/tls/RootCA.pem")
349349
.to_str()
350350
.unwrap(),
351351
)
@@ -376,7 +376,7 @@ mod tests {
376376
Some(
377377
read(
378378
test_util::root_path()
379-
.join("std/http/testdata/tls/RootCA.pem")
379+
.join("cli/tests/tls/RootCA.pem")
380380
.to_str()
381381
.unwrap(),
382382
)
@@ -416,7 +416,7 @@ mod tests {
416416
Some(
417417
read(
418418
test_util::root_path()
419-
.join("std/http/testdata/tls/RootCA.pem")
419+
.join("cli/tests/tls/RootCA.pem")
420420
.to_str()
421421
.unwrap(),
422422
)

cli/tests/034_onload/imported.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { assert } from "../../../std/testing/asserts.ts";
1+
import { assert } from "../../../test_util/std/testing/asserts.ts";
22
import "./nest_imported.ts";
33

44
const handler = (e: Event): void => {

cli/tests/034_onload/main.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { assert } from "../../../std/testing/asserts.ts";
1+
import { assert } from "../../../test_util/std/testing/asserts.ts";
22
import "./imported.ts";
33

44
assert(window.hasOwnProperty("onload"));

cli/tests/034_onload/nest_imported.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { assert } from "../../../std/testing/asserts.ts";
1+
import { assert } from "../../../test_util/std/testing/asserts.ts";
22

33
const handler = (e: Event): void => {
44
assert(!e.cancelable);

cli/tests/045_proxy_client.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
2-
const res = await fetch("http://localhost:4545/std/examples/colors.ts");
2+
const res = await fetch(
3+
"http://localhost:4545/test_util/std/examples/colors.ts",
4+
);
35
console.log(`Response http: ${await res.text()}`);

cli/tests/045_proxy_test.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
2-
import { serve, ServerRequest } from "../../std/http/server.ts";
3-
import { assertEquals } from "../../std/testing/asserts.ts";
2+
import { serve, ServerRequest } from "../../test_util/std/http/server.ts";
3+
import { assertEquals } from "../../test_util/std/testing/asserts.ts";
44

55
const addr = Deno.args[1] || "127.0.0.1:4555";
66

@@ -54,7 +54,7 @@ async function testModuleDownload(): Promise<void> {
5454
"cache",
5555
"--reload",
5656
"--quiet",
57-
"http://localhost:4545/std/examples/colors.ts",
57+
"http://localhost:4545/test_util/std/examples/colors.ts",
5858
],
5959
stdout: "piped",
6060
env: {
@@ -96,7 +96,7 @@ async function testModuleDownloadNoProxy(): Promise<void> {
9696
"cache",
9797
"--reload",
9898
"--quiet",
99-
"http://localhost:4545/std/examples/colors.ts",
99+
"http://localhost:4545/test_util/std/examples/colors.ts",
100100
],
101101
stdout: "piped",
102102
env: {

cli/tests/045_proxy_test.ts.out

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Proxy server listening on [WILDCARD]
2-
Proxy request to: http://localhost:4545/std/examples/colors.ts
3-
Proxy request to: http://localhost:4545/std/examples/colors.ts
4-
Proxy request to: http://localhost:4545/std/fmt/colors.ts
2+
Proxy request to: http://localhost:4545/test_util/std/examples/colors.ts
3+
Proxy request to: http://localhost:4545/test_util/std/examples/colors.ts
4+
Proxy request to: http://localhost:4545/test_util/std/fmt/colors.ts

cli/tests/compiler_api_test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
assert,
44
assertEquals,
55
assertThrowsAsync,
6-
} from "../../std/testing/asserts.ts";
6+
} from "../../test_util/std/testing/asserts.ts";
77

88
Deno.test({
99
name: "Deno.emit() - sources provided",

cli/tests/hash.ts

-64
This file was deleted.

cli/tests/integration_tests.rs

+1-37
Original file line numberDiff line numberDiff line change
@@ -10,42 +10,6 @@ use std::process::Command;
1010
use tempfile::TempDir;
1111
use test_util as util;
1212

13-
#[test]
14-
fn std_tests() {
15-
let dir = TempDir::new().expect("tempdir fail");
16-
let status = util::deno_cmd()
17-
.env("DENO_DIR", dir.path())
18-
.current_dir(util::root_path())
19-
.arg("test")
20-
.arg("--unstable")
21-
.arg("--seed=86") // Some tests rely on specific random numbers.
22-
.arg("-A")
23-
// .arg("-Ldebug")
24-
.arg("std/")
25-
.spawn()
26-
.unwrap()
27-
.wait()
28-
.unwrap();
29-
assert!(status.success());
30-
}
31-
32-
#[test]
33-
fn std_lint() {
34-
let status = util::deno_cmd()
35-
.arg("lint")
36-
.arg("--unstable")
37-
.arg(format!(
38-
"--ignore={}",
39-
util::root_path().join("std/node/tests").to_string_lossy()
40-
))
41-
.arg(util::root_path().join("std"))
42-
.spawn()
43-
.unwrap()
44-
.wait()
45-
.unwrap();
46-
assert!(status.success());
47-
}
48-
4913
#[test]
5014
fn js_unit_tests_lint() {
5115
let status = util::deno_cmd()
@@ -4888,7 +4852,7 @@ console.log("finish");
48884852
.arg("--unstable")
48894853
.arg("--output")
48904854
.arg(&exe)
4891-
.arg("./std/examples/welcome.ts")
4855+
.arg("./test_util/std/examples/welcome.ts")
48924856
.stdout(std::process::Stdio::piped())
48934857
.spawn()
48944858
.unwrap()

cli/tests/test_runner_test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
22

3-
import { assert } from "../../std/testing/asserts.ts";
3+
import { assert } from "../../test_util/std/testing/asserts.ts";
44

55
Deno.test("fail1", function () {
66
assert(false, "fail1 assertion");

cli/tests/unit/blob_test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
22
import { assert, assertEquals, unitTest } from "./test_util.ts";
3-
import { concat } from "../../../std/bytes/mod.ts";
4-
import { decode } from "../../../std/encoding/utf8.ts";
3+
import { concat } from "../../../test_util/std/bytes/mod.ts";
4+
import { decode } from "../../../test_util/std/encoding/utf8.ts";
55

66
unitTest(function blobString(): void {
77
const b1 = new Blob(["Hello World"]);

0 commit comments

Comments
 (0)