feat: Add integration test suite for v1.1.0 commands
Adds WEEVIL_HOME-based test isolation so cargo test never touches the real system. All commands run against a fresh TempDir per test. Environment tests cover doctor, uninstall, new, and setup across every combination of missing/present dependencies. Project lifecycle tests cover creation, config persistence, upgrade, and build scripts. Full round-trip lifecycle test: new → gradlew test → gradlew compileJava → uninstall → doctor (unhealthy) → setup → doctor (healthy). Confirms skeleton projects build and pass tests out of the box, and that uninstall leaves user projects untouched. 34 tests, zero warnings.
This commit is contained in:
@@ -1,8 +1,13 @@
|
||||
use assert_cmd::prelude::*;
|
||||
use predicates::prelude::*;
|
||||
use tempfile::TempDir;
|
||||
use std::process::Command;
|
||||
|
||||
#[path = "integration/environment_tests.rs"]
|
||||
mod environment_tests;
|
||||
|
||||
#[path = "integration/project_lifecycle_tests.rs"]
|
||||
mod project_lifecycle_tests;
|
||||
|
||||
#[test]
|
||||
fn test_help_command() {
|
||||
let mut cmd = Command::new(assert_cmd::cargo::cargo_bin!("weevil"));
|
||||
@@ -31,25 +36,4 @@ fn test_sdk_status_command() {
|
||||
cmd.assert()
|
||||
.success()
|
||||
.stdout(predicate::str::contains("SDK Configuration"));
|
||||
}
|
||||
|
||||
// Project creation test - will need mock SDKs
|
||||
#[test]
|
||||
#[ignore] // Ignore until we have mock SDKs set up
|
||||
fn test_project_creation() {
|
||||
let temp = TempDir::new().unwrap();
|
||||
|
||||
let mut cmd = Command::new(assert_cmd::cargo::cargo_bin!("weevil"));
|
||||
cmd.current_dir(&temp)
|
||||
.arg("new")
|
||||
.arg("test-robot");
|
||||
|
||||
cmd.assert()
|
||||
.success()
|
||||
.stdout(predicate::str::contains("Project Created"));
|
||||
|
||||
// Verify project structure
|
||||
assert!(temp.path().join("test-robot/README.md").exists());
|
||||
assert!(temp.path().join("test-robot/build.gradle.kts").exists());
|
||||
assert!(temp.path().join("test-robot/gradlew").exists());
|
||||
}
|
||||
Reference in New Issue
Block a user