diff --git a/tests/integration/cli/tests/fixtures/init1.toml b/tests/integration/cli/tests/fixtures/init1.toml index a9bade5da3c..517a1201f9a 100644 --- a/tests/integration/cli/tests/fixtures/init1.toml +++ b/tests/integration/cli/tests/fixtures/init1.toml @@ -5,8 +5,6 @@ description = 'Description for package testfirstproject' # See more keys and definitions at https://docs.wasmer.io/registry/manifest -[dependencies] - [[module]] name = 'testfirstproject' source = 'testfirstproject.wasm' @@ -17,4 +15,4 @@ wasi = '0.1.0-unstable' [[command]] name = 'testfirstproject' -module = 'testfirstproject' \ No newline at end of file +module = 'testfirstproject' diff --git a/tests/integration/cli/tests/fixtures/init4.toml b/tests/integration/cli/tests/fixtures/init4.toml index 8bcc40fe294..a3e5cb93bc8 100644 --- a/tests/integration/cli/tests/fixtures/init4.toml +++ b/tests/integration/cli/tests/fixtures/init4.toml @@ -5,8 +5,6 @@ description = 'Description for package wasmer' # See more keys and definitions at https://docs.wasmer.io/registry/manifest -[dependencies] - [[module]] name = 'wasmer' source = 'target/wasm32-wasi/release/wasmer.wasm' @@ -17,4 +15,4 @@ wasi = '0.1.0-unstable' [[command]] name = 'wasmer' -module = 'wasmer' \ No newline at end of file +module = 'wasmer' diff --git a/tests/integration/cli/tests/init.rs b/tests/integration/cli/tests/init.rs index 3413f5b998d..eb9c14b407b 100644 --- a/tests/integration/cli/tests/init.rs +++ b/tests/integration/cli/tests/init.rs @@ -9,37 +9,15 @@ use wasmer_integration_tests_cli::get_wasmer_path; // Test that wasmer init without arguments works #[test] -fn wasmer_init_works_1() -> anyhow::Result<()> { - let wasmer_dir = TempDir::new()?; - let tempdir = tempfile::tempdir()?; +fn wasmer_init_works_1() { + let wasmer_dir = TempDir::new().unwrap(); + let tempdir = tempfile::tempdir().unwrap(); let path = tempdir.path().join("testfirstproject"); - std::fs::create_dir_all(&path)?; - - if std::env::var("GITHUB_TOKEN").is_err() { - return Ok(()); - } - - let wapm_dev_token = std::env::var("WAPM_DEV_TOKEN").ok(); - println!("wapm dev token ok..."); - - if let Some(token) = wapm_dev_token { - // Special case: GitHub secrets aren't visible to outside collaborators - if token.is_empty() { - return Ok(()); - } - Command::new(get_wasmer_path()) - .arg("login") - .arg("--registry=wapm.dev") - .arg(token) - .env("WASMER_DIR", wasmer_dir.path()) - .assert() - .success(); - } - - println!("wasmer login ok!"); + std::fs::create_dir_all(&path).unwrap(); Command::new(get_wasmer_path()) .arg("init") + .arg("--namespace=ciuser") .current_dir(&path) .env("WASMER_DIR", wasmer_dir.path()) .assert() @@ -49,47 +27,25 @@ fn wasmer_init_works_1() -> anyhow::Result<()> { std::fs::read_to_string(path.join("wasmer.toml")).unwrap(), include_str!("./fixtures/init1.toml"), ); - - Ok(()) } #[test] -fn wasmer_init_works_2() -> anyhow::Result<()> { - let tempdir = tempfile::tempdir()?; +fn wasmer_init_works_2() { + let tempdir = tempfile::tempdir().unwrap(); let path = tempdir.path(); let path = path.join("testfirstproject"); - std::fs::create_dir_all(&path)?; + std::fs::create_dir_all(&path).unwrap(); std::fs::write( path.join("Cargo.toml"), include_bytes!("./fixtures/init2.toml"), - )?; - std::fs::create_dir_all(path.join("src"))?; - std::fs::write(path.join("src").join("main.rs"), b"fn main() { }")?; - - if std::env::var("GITHUB_TOKEN").is_err() { - return Ok(()); - } - - let wapm_dev_token = std::env::var("WAPM_DEV_TOKEN").ok(); - println!("wapm dev token ok..."); - - if let Some(token) = wapm_dev_token.as_ref() { - // Special case: GitHub secrets aren't visible to outside collaborators - if token.is_empty() { - return Ok(()); - } - Command::new(get_wasmer_path()) - .arg("login") - .arg("--registry=wapm.dev") - .arg(token) - .assert() - .success(); - } - - println!("wasmer login ok!"); + ) + .unwrap(); + std::fs::create_dir_all(path.join("src")).unwrap(); + std::fs::write(path.join("src").join("main.rs"), b"fn main() { }").unwrap(); Command::new(get_wasmer_path()) .arg("init") + .arg("--namespace=ciuser") .current_dir(&path) .assert() .success(); @@ -98,13 +54,8 @@ fn wasmer_init_works_2() -> anyhow::Result<()> { std::fs::read_to_string(path.join("Cargo.toml")).unwrap(), include_str!("./fixtures/init2.toml") ); - - println!("ok 1"); - assert_eq!( std::fs::read_to_string(path.join("wasmer.toml")).unwrap(), include_str!("./fixtures/init4.toml") ); - - Ok(()) }