Skip to content

Commit

Permalink
deno: reenable Deno CI tests (#414)
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford authored Mar 29, 2024
1 parent 323cd3d commit 7b41c35
Show file tree
Hide file tree
Showing 206 changed files with 2,225 additions and 59 deletions.
Binary file modified tests/gen/api_proxy.component.wasm
Binary file not shown.
Binary file modified tests/gen/api_proxy_streaming.component.wasm
Binary file not shown.
Binary file modified tests/gen/api_reactor.component.wasm
Binary file not shown.
1 change: 1 addition & 0 deletions tests/gen/api_reactor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use std::process::{Command, Stdio};

#[test]
fn api_reactor() -> anyhow::Result<()> {
#[cfg(not(windows))]
{
let wasi_file = "./tests/gen/api_reactor.component.wasm";
let _ = fs::remove_dir_all("./tests/rundir/api_reactor");
Expand Down
Binary file modified tests/gen/api_read_only.component.wasm
Binary file not shown.
Binary file modified tests/gen/api_time.component.wasm
Binary file not shown.
1 change: 1 addition & 0 deletions tests/gen/api_time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use std::process::{Command, Stdio};

#[test]
fn api_time() -> anyhow::Result<()> {
#[cfg(not(windows))]
{
let wasi_file = "./tests/gen/api_time.component.wasm";
let _ = fs::remove_dir_all("./tests/rundir/api_time");
Expand Down
Binary file modified tests/gen/cli_args.component.wasm
Binary file not shown.
1 change: 1 addition & 0 deletions tests/gen/cli_args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use std::process::{Command, Stdio};

#[test]
fn cli_args() -> anyhow::Result<()> {
#[cfg(not(windows))]
{
let wasi_file = "./tests/gen/cli_args.component.wasm";
let _ = fs::remove_dir_all("./tests/rundir/cli_args");
Expand Down
Binary file modified tests/gen/cli_default_clocks.component.wasm
Binary file not shown.
1 change: 1 addition & 0 deletions tests/gen/cli_default_clocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use std::process::{Command, Stdio};

#[test]
fn cli_default_clocks() -> anyhow::Result<()> {
#[cfg(not(windows))]
{
let wasi_file = "./tests/gen/cli_default_clocks.component.wasm";
let _ = fs::remove_dir_all("./tests/rundir/cli_default_clocks");
Expand Down
Binary file modified tests/gen/cli_directory_list.component.wasm
Binary file not shown.
1 change: 1 addition & 0 deletions tests/gen/cli_directory_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use std::process::{Command, Stdio};

#[test]
fn cli_directory_list() -> anyhow::Result<()> {
#[cfg(not(windows))]
{
let wasi_file = "./tests/gen/cli_directory_list.component.wasm";
let _ = fs::remove_dir_all("./tests/rundir/cli_directory_list");
Expand Down
Binary file modified tests/gen/cli_env.component.wasm
Binary file not shown.
1 change: 1 addition & 0 deletions tests/gen/cli_env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use std::process::{Command, Stdio};

#[test]
fn cli_env() -> anyhow::Result<()> {
#[cfg(not(windows))]
{
let wasi_file = "./tests/gen/cli_env.component.wasm";
let _ = fs::remove_dir_all("./tests/rundir/cli_env");
Expand Down
Binary file modified tests/gen/cli_exit_default.component.wasm
Binary file not shown.
1 change: 1 addition & 0 deletions tests/gen/cli_exit_default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use std::process::{Command, Stdio};

#[test]
fn cli_exit_default() -> anyhow::Result<()> {
#[cfg(not(windows))]
{
let wasi_file = "./tests/gen/cli_exit_default.component.wasm";
let _ = fs::remove_dir_all("./tests/rundir/cli_exit_default");
Expand Down
Binary file modified tests/gen/cli_exit_failure.component.wasm
Binary file not shown.
1 change: 1 addition & 0 deletions tests/gen/cli_exit_failure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use std::process::{Command, Stdio};

#[test]
fn cli_exit_failure() -> anyhow::Result<()> {
#[cfg(not(windows))]
{
let wasi_file = "./tests/gen/cli_exit_failure.component.wasm";
let _ = fs::remove_dir_all("./tests/rundir/cli_exit_failure");
Expand Down
Binary file modified tests/gen/cli_exit_panic.component.wasm
Binary file not shown.
1 change: 1 addition & 0 deletions tests/gen/cli_exit_panic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use std::process::{Command, Stdio};

#[test]
fn cli_exit_panic() -> anyhow::Result<()> {
#[cfg(not(windows))]
{
let wasi_file = "./tests/gen/cli_exit_panic.component.wasm";
let _ = fs::remove_dir_all("./tests/rundir/cli_exit_panic");
Expand Down
Binary file modified tests/gen/cli_exit_success.component.wasm
Binary file not shown.
1 change: 1 addition & 0 deletions tests/gen/cli_exit_success.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use std::process::{Command, Stdio};

#[test]
fn cli_exit_success() -> anyhow::Result<()> {
#[cfg(not(windows))]
{
let wasi_file = "./tests/gen/cli_exit_success.component.wasm";
let _ = fs::remove_dir_all("./tests/rundir/cli_exit_success");
Expand Down
Binary file modified tests/gen/cli_export_cabi_realloc.component.wasm
Binary file not shown.
1 change: 1 addition & 0 deletions tests/gen/cli_export_cabi_realloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use std::process::{Command, Stdio};

#[test]
fn cli_export_cabi_realloc() -> anyhow::Result<()> {
#[cfg(not(windows))]
{
let wasi_file = "./tests/gen/cli_export_cabi_realloc.component.wasm";
let _ = fs::remove_dir_all("./tests/rundir/cli_export_cabi_realloc");
Expand Down
Binary file modified tests/gen/cli_file_append.component.wasm
Binary file not shown.
1 change: 1 addition & 0 deletions tests/gen/cli_file_append.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use std::process::{Command, Stdio};

#[test]
fn cli_file_append() -> anyhow::Result<()> {
#[cfg(not(windows))]
{
let wasi_file = "./tests/gen/cli_file_append.component.wasm";
let _ = fs::remove_dir_all("./tests/rundir/cli_file_append");
Expand Down
Binary file modified tests/gen/cli_file_dir_sync.component.wasm
Binary file not shown.
1 change: 1 addition & 0 deletions tests/gen/cli_file_dir_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use std::process::{Command, Stdio};

#[test]
fn cli_file_dir_sync() -> anyhow::Result<()> {
#[cfg(not(windows))]
{
let wasi_file = "./tests/gen/cli_file_dir_sync.component.wasm";
let _ = fs::remove_dir_all("./tests/rundir/cli_file_dir_sync");
Expand Down
Binary file modified tests/gen/cli_file_read.component.wasm
Binary file not shown.
1 change: 1 addition & 0 deletions tests/gen/cli_file_read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use std::process::{Command, Stdio};

#[test]
fn cli_file_read() -> anyhow::Result<()> {
#[cfg(not(windows))]
{
let wasi_file = "./tests/gen/cli_file_read.component.wasm";
let _ = fs::remove_dir_all("./tests/rundir/cli_file_read");
Expand Down
Binary file modified tests/gen/cli_hello_stdout.component.wasm
Binary file not shown.
1 change: 1 addition & 0 deletions tests/gen/cli_hello_stdout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use std::process::{Command, Stdio};

#[test]
fn cli_hello_stdout() -> anyhow::Result<()> {
#[cfg(not(windows))]
{
let wasi_file = "./tests/gen/cli_hello_stdout.component.wasm";
let _ = fs::remove_dir_all("./tests/rundir/cli_hello_stdout");
Expand Down
Binary file modified tests/gen/cli_no_ip_name_lookup.component.wasm
Binary file not shown.
1 change: 1 addition & 0 deletions tests/gen/cli_no_ip_name_lookup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use std::process::{Command, Stdio};

#[test]
fn cli_no_ip_name_lookup() -> anyhow::Result<()> {
#[cfg(not(windows))]
{
let wasi_file = "./tests/gen/cli_no_ip_name_lookup.component.wasm";
let _ = fs::remove_dir_all("./tests/rundir/cli_no_ip_name_lookup");
Expand Down
Binary file modified tests/gen/cli_no_tcp.component.wasm
Binary file not shown.
1 change: 1 addition & 0 deletions tests/gen/cli_no_tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use std::process::{Command, Stdio};

#[test]
fn cli_no_tcp() -> anyhow::Result<()> {
#[cfg(not(windows))]
{
let wasi_file = "./tests/gen/cli_no_tcp.component.wasm";
let _ = fs::remove_dir_all("./tests/rundir/cli_no_tcp");
Expand Down
Binary file modified tests/gen/cli_no_udp.component.wasm
Binary file not shown.
1 change: 1 addition & 0 deletions tests/gen/cli_no_udp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use std::process::{Command, Stdio};

#[test]
fn cli_no_udp() -> anyhow::Result<()> {
#[cfg(not(windows))]
{
let wasi_file = "./tests/gen/cli_no_udp.component.wasm";
let _ = fs::remove_dir_all("./tests/rundir/cli_no_udp");
Expand Down
Binary file modified tests/gen/cli_splice_stdin.component.wasm
Binary file not shown.
1 change: 1 addition & 0 deletions tests/gen/cli_splice_stdin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use std::process::{Command, Stdio};

#[test]
fn cli_splice_stdin() -> anyhow::Result<()> {
#[cfg(not(windows))]
{
let wasi_file = "./tests/gen/cli_splice_stdin.component.wasm";
let _ = fs::remove_dir_all("./tests/rundir/cli_splice_stdin");
Expand Down
Binary file modified tests/gen/cli_stdin.component.wasm
Binary file not shown.
1 change: 1 addition & 0 deletions tests/gen/cli_stdin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use std::process::{Command, Stdio};

#[test]
fn cli_stdin() -> anyhow::Result<()> {
#[cfg(not(windows))]
{
let wasi_file = "./tests/gen/cli_stdin.component.wasm";
let _ = fs::remove_dir_all("./tests/rundir/cli_stdin");
Expand Down
Binary file modified tests/gen/cli_stdio_write_flushes.component.wasm
Binary file not shown.
1 change: 1 addition & 0 deletions tests/gen/cli_stdio_write_flushes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use std::process::{Command, Stdio};

#[test]
fn cli_stdio_write_flushes() -> anyhow::Result<()> {
#[cfg(not(windows))]
{
let wasi_file = "./tests/gen/cli_stdio_write_flushes.component.wasm";
let _ = fs::remove_dir_all("./tests/rundir/cli_stdio_write_flushes");
Expand Down
32 changes: 32 additions & 0 deletions tests/gen/deno_api_reactor.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//! This file has been auto-generated, please do not modify manually
//! To regenerate this file re-run `cargo xtask generate tests` from the project root
use std::fs;
use std::process::{Command, Stdio};

#[test]
fn api_reactor() -> anyhow::Result<()> {
#[cfg(not(windows))]
{
let wasi_file = "./tests/gen/api_reactor.component.wasm";
let _ = fs::remove_dir_all("./tests/rundir/deno_api_reactor");
let mut cmd1 = Command::new("node");
cmd1.arg("./src/jco.js");
cmd1.arg("run");
cmd1.env("JCO_RUN_PATH", "deno")
.env("JCO_RUN_ARGS", "run --importmap ./tests/importmap.json -A");
cmd1.arg("--jco-dir");
cmd1.arg("./tests/rundir/deno_api_reactor");
cmd1.arg("--jco-import");
cmd1.arg("./tests/virtualenvs/base.js");
cmd1.arg("--jco-import-bindings");
cmd1.arg("hybrid");
cmd1.arg(wasi_file);
cmd1.args(&["hello", "this", "", "is an argument", "with 🚩 emoji"]);
cmd1.stdin(Stdio::null());
let mut cmd1_child = cmd1.spawn().expect("failed to spawn test program");
let status = cmd1_child.wait().expect("failed to wait on child");
assert!(status.success(), "test execution failed");
}
Ok(())
}
32 changes: 32 additions & 0 deletions tests/gen/deno_api_time.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//! This file has been auto-generated, please do not modify manually
//! To regenerate this file re-run `cargo xtask generate tests` from the project root
use std::fs;
use std::process::{Command, Stdio};

#[test]
fn api_time() -> anyhow::Result<()> {
#[cfg(not(windows))]
{
let wasi_file = "./tests/gen/api_time.component.wasm";
let _ = fs::remove_dir_all("./tests/rundir/deno_api_time");
let mut cmd1 = Command::new("node");
cmd1.arg("./src/jco.js");
cmd1.arg("run");
cmd1.env("JCO_RUN_PATH", "deno")
.env("JCO_RUN_ARGS", "run --importmap ./tests/importmap.json -A");
cmd1.arg("--jco-dir");
cmd1.arg("./tests/rundir/deno_api_time");
cmd1.arg("--jco-import");
cmd1.arg("./tests/virtualenvs/fakeclocks.js");
cmd1.arg("--jco-import-bindings");
cmd1.arg("hybrid");
cmd1.arg(wasi_file);
cmd1.args(&["hello", "this", "", "is an argument", "with 🚩 emoji"]);
cmd1.stdin(Stdio::null());
let mut cmd1_child = cmd1.spawn().expect("failed to spawn test program");
let status = cmd1_child.wait().expect("failed to wait on child");
assert!(status.success(), "test execution failed");
}
Ok(())
}
32 changes: 32 additions & 0 deletions tests/gen/deno_cli_args.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//! This file has been auto-generated, please do not modify manually
//! To regenerate this file re-run `cargo xtask generate tests` from the project root
use std::fs;
use std::process::{Command, Stdio};

#[test]
fn cli_args() -> anyhow::Result<()> {
#[cfg(not(windows))]
{
let wasi_file = "./tests/gen/cli_args.component.wasm";
let _ = fs::remove_dir_all("./tests/rundir/deno_cli_args");
let mut cmd1 = Command::new("node");
cmd1.arg("./src/jco.js");
cmd1.arg("run");
cmd1.env("JCO_RUN_PATH", "deno")
.env("JCO_RUN_ARGS", "run --importmap ./tests/importmap.json -A");
cmd1.arg("--jco-dir");
cmd1.arg("./tests/rundir/deno_cli_args");
cmd1.arg("--jco-import");
cmd1.arg("./tests/virtualenvs/base.js");
cmd1.arg("--jco-import-bindings");
cmd1.arg("hybrid");
cmd1.arg(wasi_file);
cmd1.args(&["hello", "this", "", "is an argument", "with 🚩 emoji"]);
cmd1.stdin(Stdio::null());
let mut cmd1_child = cmd1.spawn().expect("failed to spawn test program");
let status = cmd1_child.wait().expect("failed to wait on child");
assert!(status.success(), "test execution failed");
}
Ok(())
}
32 changes: 32 additions & 0 deletions tests/gen/deno_cli_default_clocks.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//! This file has been auto-generated, please do not modify manually
//! To regenerate this file re-run `cargo xtask generate tests` from the project root
use std::fs;
use std::process::{Command, Stdio};

#[test]
fn cli_default_clocks() -> anyhow::Result<()> {
#[cfg(not(windows))]
{
let wasi_file = "./tests/gen/cli_default_clocks.component.wasm";
let _ = fs::remove_dir_all("./tests/rundir/deno_cli_default_clocks");
let mut cmd1 = Command::new("node");
cmd1.arg("./src/jco.js");
cmd1.arg("run");
cmd1.env("JCO_RUN_PATH", "deno")
.env("JCO_RUN_ARGS", "run --importmap ./tests/importmap.json -A");
cmd1.arg("--jco-dir");
cmd1.arg("./tests/rundir/deno_cli_default_clocks");
cmd1.arg("--jco-import");
cmd1.arg("./tests/virtualenvs/base.js");
cmd1.arg("--jco-import-bindings");
cmd1.arg("hybrid");
cmd1.arg(wasi_file);
cmd1.args(&["hello", "this", "", "is an argument", "with 🚩 emoji"]);
cmd1.stdin(Stdio::null());
let mut cmd1_child = cmd1.spawn().expect("failed to spawn test program");
let status = cmd1_child.wait().expect("failed to wait on child");
assert!(status.success(), "test execution failed");
}
Ok(())
}
32 changes: 32 additions & 0 deletions tests/gen/deno_cli_env.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//! This file has been auto-generated, please do not modify manually
//! To regenerate this file re-run `cargo xtask generate tests` from the project root
use std::fs;
use std::process::{Command, Stdio};

#[test]
fn cli_env() -> anyhow::Result<()> {
#[cfg(not(windows))]
{
let wasi_file = "./tests/gen/cli_env.component.wasm";
let _ = fs::remove_dir_all("./tests/rundir/deno_cli_env");
let mut cmd1 = Command::new("node");
cmd1.arg("./src/jco.js");
cmd1.arg("run");
cmd1.env("JCO_RUN_PATH", "deno")
.env("JCO_RUN_ARGS", "run --importmap ./tests/importmap.json -A");
cmd1.arg("--jco-dir");
cmd1.arg("./tests/rundir/deno_cli_env");
cmd1.arg("--jco-import");
cmd1.arg("./tests/virtualenvs/envtest.js");
cmd1.arg("--jco-import-bindings");
cmd1.arg("hybrid");
cmd1.arg(wasi_file);
cmd1.args(&["hello", "this", "", "is an argument", "with 🚩 emoji"]);
cmd1.stdin(Stdio::null());
let mut cmd1_child = cmd1.spawn().expect("failed to spawn test program");
let status = cmd1_child.wait().expect("failed to wait on child");
assert!(status.success(), "test execution failed");
}
Ok(())
}
32 changes: 32 additions & 0 deletions tests/gen/deno_cli_exit_default.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//! This file has been auto-generated, please do not modify manually
//! To regenerate this file re-run `cargo xtask generate tests` from the project root
use std::fs;
use std::process::{Command, Stdio};

#[test]
fn cli_exit_default() -> anyhow::Result<()> {
#[cfg(not(windows))]
{
let wasi_file = "./tests/gen/cli_exit_default.component.wasm";
let _ = fs::remove_dir_all("./tests/rundir/deno_cli_exit_default");
let mut cmd1 = Command::new("node");
cmd1.arg("./src/jco.js");
cmd1.arg("run");
cmd1.env("JCO_RUN_PATH", "deno")
.env("JCO_RUN_ARGS", "run --importmap ./tests/importmap.json -A");
cmd1.arg("--jco-dir");
cmd1.arg("./tests/rundir/deno_cli_exit_default");
cmd1.arg("--jco-import");
cmd1.arg("./tests/virtualenvs/base.js");
cmd1.arg("--jco-import-bindings");
cmd1.arg("hybrid");
cmd1.arg(wasi_file);
cmd1.args(&["hello", "this", "", "is an argument", "with 🚩 emoji"]);
cmd1.stdin(Stdio::null());
let mut cmd1_child = cmd1.spawn().expect("failed to spawn test program");
let status = cmd1_child.wait().expect("failed to wait on child");
assert!(status.success(), "test execution failed");
}
Ok(())
}
32 changes: 32 additions & 0 deletions tests/gen/deno_cli_exit_failure.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//! This file has been auto-generated, please do not modify manually
//! To regenerate this file re-run `cargo xtask generate tests` from the project root
use std::fs;
use std::process::{Command, Stdio};

#[test]
fn cli_exit_failure() -> anyhow::Result<()> {
#[cfg(not(windows))]
{
let wasi_file = "./tests/gen/cli_exit_failure.component.wasm";
let _ = fs::remove_dir_all("./tests/rundir/deno_cli_exit_failure");
let mut cmd1 = Command::new("node");
cmd1.arg("./src/jco.js");
cmd1.arg("run");
cmd1.env("JCO_RUN_PATH", "deno")
.env("JCO_RUN_ARGS", "run --importmap ./tests/importmap.json -A");
cmd1.arg("--jco-dir");
cmd1.arg("./tests/rundir/deno_cli_exit_failure");
cmd1.arg("--jco-import");
cmd1.arg("./tests/virtualenvs/base.js");
cmd1.arg("--jco-import-bindings");
cmd1.arg("hybrid");
cmd1.arg(wasi_file);
cmd1.args(&["hello", "this", "", "is an argument", "with 🚩 emoji"]);
cmd1.stdin(Stdio::null());
let mut cmd1_child = cmd1.spawn().expect("failed to spawn test program");
let status = cmd1_child.wait().expect("failed to wait on child");
assert!(!status.success(), "test execution failed");
}
Ok(())
}
Loading

0 comments on commit 7b41c35

Please sign in to comment.