Skip to content

Commit

Permalink
test: remove usage of --unstable flag (denoland#25549)
Browse files Browse the repository at this point in the history
This commit removes all occurrences of `--unstable` flag
from all the tests that are run in CI.

Turns out none of the tests actually required that flag
anymore.
  • Loading branch information
bartlomieju authored Sep 10, 2024
1 parent 3f6afd1 commit 9a169e3
Show file tree
Hide file tree
Showing 12 changed files with 11 additions and 36 deletions.
1 change: 0 additions & 1 deletion tests/integration/check_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ fn typecheck_declarations_unstable() {
let args = vec![
"test".to_string(),
"--doc".to_string(),
"--unstable".to_string(),
util::root_path()
.join("cli/tsc/dts/lib.deno.unstable.d.ts")
.to_string_lossy()
Expand Down
16 changes: 3 additions & 13 deletions tests/integration/run_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -488,9 +488,8 @@ itest!(_088_dynamic_import_already_evaluating {
output: "run/088_dynamic_import_already_evaluating.ts.out",
});

// TODO(bartlomieju): remove --unstable once Deno.Command is stabilized
itest!(_089_run_allow_list {
args: "run --unstable --allow-run=curl run/089_run_allow_list.ts",
args: "run --allow-run=curl run/089_run_allow_list.ts",
envs: vec![
("LD_LIBRARY_PATH".to_string(), "".to_string()),
("DYLD_FALLBACK_LIBRARY_PATH".to_string(), "".to_string())
Expand Down Expand Up @@ -2540,14 +2539,12 @@ mod permissions {
use test_util::itest;
use util::TestContext;

// TODO(bartlomieju): remove --unstable once Deno.Command is stabilized
#[test]
fn with_allow() {
for permission in &util::PERMISSION_VARIANTS {
let status = util::deno_cmd()
.current_dir(util::testdata_path())
.arg("run")
.arg("--unstable")
.arg(format!("--allow-{permission}"))
.arg("run/permission_test.ts")
.arg(format!("{permission}Required"))
Expand All @@ -2559,13 +2556,12 @@ mod permissions {
}
}

// TODO(bartlomieju): remove --unstable once Deno.Command is stabilized
#[test]
fn without_allow() {
for permission in &util::PERMISSION_VARIANTS {
let (_, err) = util::run_and_collect_output(
false,
&format!("run --unstable run/permission_test.ts {permission}Required"),
&format!("run run/permission_test.ts {permission}Required"),
None,
None,
false,
Expand Down Expand Up @@ -3019,7 +3015,7 @@ mod permissions {
fn _066_prompt() {
TestContext::default()
.new_command()
.args_vec(["run", "--quiet", "--unstable", "run/066_prompt.ts"])
.args_vec(["run", "--quiet", "run/066_prompt.ts"])
.with_pty(|mut console| {
console.expect("What is your name? Jane Doe");
console.write_line_raw("");
Expand Down Expand Up @@ -3575,7 +3571,6 @@ fn deno_no_prompt_environment_variable() {
let output = util::deno_cmd()
.current_dir(util::testdata_path())
.arg("run")
.arg("--unstable")
.arg("run/no_prompt.ts")
.env("DENO_NO_PROMPT", "1")
.spawn()
Expand Down Expand Up @@ -4089,7 +4084,6 @@ async fn http2_request_url() {
let mut child = util::deno_cmd()
.current_dir(util::testdata_path())
.arg("run")
.arg("--unstable")
.arg("--quiet")
.arg("--allow-net")
.arg("--allow-read")
Expand Down Expand Up @@ -4384,7 +4378,6 @@ async fn websocket_server_multi_field_connection_header() {
let root_ca = util::testdata_path().join("tls/RootCA.pem");
let mut child = util::deno_cmd()
.arg("run")
.arg("--unstable")
.arg("--allow-net")
.arg("--cert")
.arg(root_ca)
Expand Down Expand Up @@ -4438,7 +4431,6 @@ async fn websocket_server_idletimeout() {
let root_ca = util::testdata_path().join("tls/RootCA.pem");
let mut child = util::deno_cmd()
.arg("run")
.arg("--unstable")
.arg("--allow-net")
.arg("--cert")
.arg(root_ca)
Expand Down Expand Up @@ -5089,7 +5081,6 @@ async fn listen_tls_alpn() {
let mut child = util::deno_cmd()
.current_dir(util::testdata_path())
.arg("run")
.arg("--unstable")
.arg("--quiet")
.arg("--allow-net")
.arg("--allow-read")
Expand Down Expand Up @@ -5143,7 +5134,6 @@ async fn listen_tls_alpn_fail() {
let mut child = util::deno_cmd()
.current_dir(util::testdata_path())
.arg("run")
.arg("--unstable")
.arg("--quiet")
.arg("--allow-net")
.arg("--allow-read")
Expand Down
7 changes: 0 additions & 7 deletions tests/integration/watcher_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,6 @@ async fn run_watch_no_dynamic() {
.current_dir(t.path())
.arg("run")
.arg("--watch")
.arg("--unstable")
.arg("-L")
.arg("debug")
.arg(&file_to_watch)
Expand Down Expand Up @@ -626,7 +625,6 @@ async fn run_watch_external_watch_files() {
.arg(watch_arg)
.arg("-L")
.arg("debug")
.arg("--unstable")
.arg(&file_to_watch)
.env("NO_COLOR", "1")
.piped_output()
Expand Down Expand Up @@ -671,7 +669,6 @@ async fn run_watch_load_unload_events() {
.current_dir(t.path())
.arg("run")
.arg("--watch")
.arg("--unstable")
.arg("-L")
.arg("debug")
.arg(&file_to_watch)
Expand Down Expand Up @@ -723,7 +720,6 @@ async fn run_watch_not_exit() {
.current_dir(t.path())
.arg("run")
.arg("--watch")
.arg("--unstable")
.arg("-L")
.arg("debug")
.arg(&file_to_watch)
Expand Down Expand Up @@ -873,7 +869,6 @@ async fn test_watch_basic() {
.current_dir(t.path())
.arg("test")
.arg("--watch")
.arg("--unstable")
.arg("--no-check")
.arg(t.path())
.env("NO_COLOR", "1")
Expand Down Expand Up @@ -1029,7 +1024,6 @@ async fn test_watch_doc() {
.arg("test")
.arg("--watch")
.arg("--doc")
.arg("--unstable")
.arg(t.path())
.env("NO_COLOR", "1")
.piped_output()
Expand Down Expand Up @@ -1407,7 +1401,6 @@ async fn run_watch_dynamic_imports() {
.current_dir(t.path())
.arg("run")
.arg("--watch")
.arg("--unstable")
.arg("--allow-read")
.arg("-L")
.arg("debug")
Expand Down
1 change: 0 additions & 1 deletion tests/node_compat/test_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ fn node_compat_tests() {
.arg("--config")
.arg(deno_config_path())
.arg("--no-lock")
.arg("--unstable")
.arg("-A")
.arg(util::tests_path().join("node_compat/test.ts"))
.spawn()
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ There are two ways to run `unit_test_runner.ts`:

```sh
# Run all tests.
cargo run --bin deno -- test --allow-all --unstable --location=http://js-unit-tests/foo/bar cli/tests/unit/
cargo run --bin deno -- test --allow-all --location=http://js-unit-tests/foo/bar cli/tests/unit/

# Run a specific test module
cargo run --bin deno -- test --allow-all --unstable --location=http://js-unit-tests/foo/bar cli/tests/unit/files_test.ts
cargo run --bin deno -- test --allow-all --location=http://js-unit-tests/foo/bar cli/tests/unit/files_test.ts
```

### Http server
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/command_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ Deno.test(
},
async function commandFailedWithSignal() {
const output = await new Deno.Command(Deno.execPath(), {
args: ["eval", "--unstable", "Deno.kill(Deno.pid, 'SIGKILL')"],
args: ["eval", "Deno.kill(Deno.pid, 'SIGKILL')"],
}).output();
assertEquals(output.success, false);
if (Deno.build.os === "windows") {
Expand All @@ -547,7 +547,7 @@ Deno.test(
},
function commandSyncFailedWithSignal() {
const output = new Deno.Command(Deno.execPath(), {
args: ["eval", "--unstable", "Deno.kill(Deno.pid, 'SIGKILL')"],
args: ["eval", "Deno.kill(Deno.pid, 'SIGKILL')"],
}).outputSync();
assertEquals(output.success, false);
if (Deno.build.os === "windows") {
Expand Down Expand Up @@ -835,7 +835,7 @@ Deno.test(
const command = await new Deno.Command(Deno.execPath(), {
cwd: Deno.args[0],
stdout: "piped",
args: ["run", "-A", "--unstable", Deno.args[1]],
args: ["run", "-A", Deno.args[1]],
});
const child = command.spawn();
const readable = child.stdout.pipeThrough(new TextDecoderStream());
Expand Down Expand Up @@ -877,7 +877,7 @@ setInterval(() => {
Deno.execPath(),
{
cwd,
args: ["run", "-A", "--unstable", programFile, cwd, childProgramFile],
args: ["run", "-A", programFile, cwd, childProgramFile],
},
).output();

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/files_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ function runFlockTestProcess(opts: { exclusive: boolean; sync: boolean }) {
`;

const process = new Deno.Command(Deno.execPath(), {
args: ["eval", "--unstable", scriptText],
args: ["eval", scriptText],
stdin: "piped",
stdout: "piped",
stderr: "null",
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/os_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ Deno.test(
async function osPpidIsEqualToPidOfParentProcess() {
const decoder = new TextDecoder();
const { stdout } = await new Deno.Command(Deno.execPath(), {
args: ["eval", "-p", "--unstable", "Deno.ppid"],
args: ["eval", "-p", "Deno.ppid"],
env: { NO_COLOR: "true" },
}).output();

Expand Down
1 change: 0 additions & 1 deletion tests/unit/signal_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ Deno.test(
const { code } = await new Deno.Command(Deno.execPath(), {
args: [
"eval",
"--unstable",
"Deno.addSignalListener('SIGINT', () => {})",
],
}).output();
Expand Down
1 change: 0 additions & 1 deletion tests/unit_node/_test_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export async function assertCallbackErrorUncaught(
const p = new Deno.Command(Deno.execPath(), {
args: [
"eval",
"--unstable",
`${prelude ?? ""}
${invocation}(err) => {
Expand Down
1 change: 0 additions & 1 deletion tests/unit_node/child_process_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,6 @@ Deno.test({
const childProcess = spawn(Deno.execPath(), [
"run",
"-A",
"--unstable",
script,
]);
const deferred = Promise.withResolvers<void>();
Expand Down
3 changes: 0 additions & 3 deletions tests/unit_node/process_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ Deno.test({
args: [
"run",
"--quiet",
"--unstable",
"./testdata/process_exit.ts",
],
cwd,
Expand Down Expand Up @@ -895,7 +894,6 @@ Deno.test({
args: [
"run",
"--quiet",
"--unstable",
"./testdata/process_exit2.ts",
],
cwd: testDir,
Expand All @@ -914,7 +912,6 @@ Deno.test({
args: [
"run",
"--quiet",
"--unstable",
"./testdata/process_really_exit.ts",
],
cwd: testDir,
Expand Down

0 comments on commit 9a169e3

Please sign in to comment.