Skip to content

Commit 2f0a50f

Browse files
author
Nitish [C] Dhok
committed
kiro-cli e2e tests: Added test case automation for vscod autostart and refactor the naming for integrations.
1 parent 52551de commit 2f0a50f

File tree

6 files changed

+105
-17
lines changed

6 files changed

+105
-17
lines changed

e2etests/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ regression = [] # Regression Tests
4949
sanity = [] # Sanity Tests - Quick smoke tests for basic functionality
5050
deprecated = [] # Deprecated Tests
5151
kiro_steering = [] # Kiro Steering Tests
52-
integrations = [] # Kiro-Cli integrations subcommand
52+
sub_integrations = [] # Kiro-Cli integrations subcommand

e2etests/tests/all_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ mod tools;
1313
mod todos;
1414
mod experiment;
1515
mod kiro_steering;
16-
mod integrations;
16+
mod sub_integrations;
1717

1818
use q_cli_e2e_tests::q_chat_helper;
1919

e2etests/tests/integrations/mod.rs

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pub mod test_kiro_cli_sub_integrations_subcommand;
2+
pub mod test_kiro_cli_sub_integrations_install_subcommand;

e2etests/tests/integrations/test_kiro_cli_integrations_install_subcommand.rs renamed to e2etests/tests/sub_integrations/test_kiro_cli_sub_integrations_install_subcommand.rs

Lines changed: 99 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
use q_cli_e2e_tests::q_chat_helper;
33

44
#[test]
5-
#[cfg(all(feature = "integrations", feature = "sanity"))]
6-
fn test_kiro_cli_integrations_install_help_subcommand() -> Result<(), Box<dyn std::error::Error>> {
5+
#[cfg(all(feature = "sub_integrations", feature = "sanity"))]
6+
fn test_kiro_cli_sub_integrations_install_help_subcommand() -> Result<(), Box<dyn std::error::Error>> {
77
println!("\n🔍 Testing kiro-cli integrations install --help subcommand... | Description: Tests the <code> kiro-cli integrations install --help </code> subcommand to verify different help options.");
88

99
println!("\n🔍 Executing 'kiro-cli integrations install --help' subcommand...");
@@ -42,8 +42,8 @@ fn test_kiro_cli_integrations_install_help_subcommand() -> Result<(), Box<dyn st
4242
}
4343

4444
#[test]
45-
#[cfg(all(feature = "integrations", feature = "sanity"))]
46-
fn test_kiro_cli_integrations_install_dotfiles_subcommand() -> Result<(), Box<dyn std::error::Error>> {
45+
#[cfg(all(feature = "sub_integrations", feature = "sanity"))]
46+
fn test_kiro_cli_sub_integrations_install_dotfiles_subcommand() -> Result<(), Box<dyn std::error::Error>> {
4747
println!("\n🔍 Testing kiro-cli integrations install dotfiles subcommand... | Description: Tests the <code> kiro-cli integrations install dotfiles </code> subcommand to verify installation of dotfiles.");
4848

4949
println!("\n🔍 Executing 'kiro-cli integrations install dotfiles' subcommand...");
@@ -65,8 +65,8 @@ fn test_kiro_cli_integrations_install_dotfiles_subcommand() -> Result<(), Box<dy
6565
}
6666

6767
#[test]
68-
#[cfg(all(feature = "integrations", feature = "sanity"))]
69-
fn test_kiro_cli_integrations_uinstall_dotfiles_subcommand() -> Result<(), Box<dyn std::error::Error>> {
68+
#[cfg(all(feature = "sub_integrations", feature = "sanity"))]
69+
fn test_kiro_cli_sub_integrations_uinstall_dotfiles_subcommand() -> Result<(), Box<dyn std::error::Error>> {
7070
println!("\n🔍 Testing kiro-cli integrations uninstall dotfiles subcommand... | Description: Tests the <code> kiro-cli integrations uninstall dotfiles </code> subcommand to verify uninstallation of dotfiles.");
7171

7272
println!("\n🔍 Executing 'kiro-cli integrations install dotfiles' subcommand...");
@@ -86,10 +86,11 @@ fn test_kiro_cli_integrations_uinstall_dotfiles_subcommand() -> Result<(), Box<d
8686

8787
Ok(())
8888
}
89-
//
89+
90+
9091
#[test]
91-
#[cfg(all(feature = "integrations", feature = "sanity"))]
92-
fn test_kiro_cli_integrations_install_ssh_subcommand() -> Result<(), Box<dyn std::error::Error>> {
92+
#[cfg(all(feature = "sub_integrations", feature = "sanity"))]
93+
fn test_kiro_cli_sub_integrations_install_ssh_subcommand() -> Result<(), Box<dyn std::error::Error>> {
9394
println!("\n🔍 Testing kiro-cli integrations install ssh subcommand... | Description: Tests the <code> kiro-cli integrations install ssh </code> subcommand to verify installation of ssh.");
9495

9596
println!("\n🔍 Executing 'kiro-cli integrations install ssh' subcommand...");
@@ -111,8 +112,8 @@ fn test_kiro_cli_integrations_install_ssh_subcommand() -> Result<(), Box<dyn std
111112
}
112113

113114
#[test]
114-
#[cfg(all(feature = "integrations", feature = "sanity"))]
115-
fn test_kiro_cli_integrations_uninstall_ssh_subcommand() -> Result<(), Box<dyn std::error::Error>> {
115+
#[cfg(all(feature = "sub_integrations", feature = "sanity"))]
116+
fn test_kiro_cli_sub_integrations_uninstall_ssh_subcommand() -> Result<(), Box<dyn std::error::Error>> {
116117
println!("\n🔍 Testing kiro-cli integrations uninstall ssh subcommand... | Description: Tests the <code> kiro-cli integrations uninstall ssh </code> subcommand to verify uninstallation of ssh.");
117118

118119
println!("\n🔍 Executing 'kiro-cli integrations install ssh' subcommand...");
@@ -130,5 +131,92 @@ fn test_kiro_cli_integrations_uninstall_ssh_subcommand() -> Result<(), Box<dyn s
130131

131132
println!("✅ Kiro Cli integrations uninstall ssh subcommand executed successfully!");
132133

134+
Ok(())
135+
}
136+
137+
#[test]
138+
#[cfg(all(feature = "sub_integrations", feature = "sanity"))]
139+
fn test_kiro_cli_sub_integrations_install_vscode_subcommand() -> Result<(), Box<dyn std::error::Error>> {
140+
println!("\n🔍 Testing kiro-cli integrations install vscode subcommand... | Description: Tests the <code> kiro-cli integrations install vscode </code> subcommand to verify installation of vscode.");
141+
142+
println!("\n🔍 Executing 'kiro-cli integrations install ssh' subcommand...");
143+
let response = q_chat_helper::execute_q_subcommand("kiro-cli", &["integrations", "install", "vscode"])?;
144+
145+
println!("📝 FULL OUTPUT:");
146+
println!("{}", response);
147+
println!("📝 END OUTPUT");
148+
149+
if response.contains("Installed!") {
150+
assert!(response.contains("Installed!"),"Expected 'Installed!' in response.");
151+
}
152+
153+
println!("✅ Kiro Cli integrations install vscode subcommand executed successfully!");
154+
155+
Ok(())
156+
}
157+
158+
#[test]
159+
#[cfg(all(feature = "sub_integrations", feature = "sanity"))]
160+
fn test_kiro_cli_sub_integrations_uninstall_vscode_subcommand() -> Result<(), Box<dyn std::error::Error>> {
161+
println!("\n🔍 Testing kiro-cli integrations uninstall vscode subcommand... | Description: Tests the <code> kiro-cli integrations uninstall vscode </code> subcommand to verify uninstallation of vscode.");
162+
163+
println!("\n🔍 Executing 'kiro-cli integrations install vscode' subcommand...");
164+
let response = q_chat_helper::execute_q_subcommand("kiro-cli", &["integrations", "uninstall", "vscode"])?;
165+
166+
println!("📝 FULL OUTPUT:");
167+
println!("{}", response);
168+
println!("📝 END OUTPUT");
169+
170+
assert!(response.contains("Warning"),"Expected 'Warning' in response.");
171+
assert!(response.contains("VSCode"), "Expected 'VSCode' in response.");
172+
assert!(response.contains("automatically"), "Expected 'automatically' in response.");
173+
174+
println!("✅ Kiro Cli integrations install vscode subcommand executed successfully!");
175+
176+
Ok(())
177+
}
178+
179+
#[test]
180+
#[cfg(all(feature = "sub_integrations", feature = "sanity"))]
181+
fn test_kiro_cli_sub_integrations_install_autostart_entry_subcommand() -> Result<(), Box<dyn std::error::Error>> {
182+
println!("\n🔍 Testing kiro-cli integrations install autostart-entry subcommand... | Description: Tests the <code> kiro-cli integrations install autostart-entry </code> subcommand to verify installation of autostart-entry .");
183+
184+
println!("\n🔍 Executing 'kiro-cli integrations install autostart-entry ' subcommand...");
185+
let response = q_chat_helper::execute_q_subcommand("kiro-cli", &["integrations", "install", "autostart-entry"])?;
186+
187+
println!("📝 FULL OUTPUT:");
188+
println!("{}", response);
189+
println!("📝 END OUTPUT");
190+
191+
if response.contains("error") {
192+
assert!(response.contains("error:"), "Expected 'error' in response.");
193+
assert!(response.contains("Installing"), "Expected 'Installing' in response.");
194+
assert!(response.contains("autostart"), "Expected 'autostart' in response.");
195+
assert!(response.contains("not supported"), "Expected 'not supported' in response.");
196+
}
197+
println!("✅ Kiro Cli integrations install autostart-entry subcommand executed successfully!");
198+
199+
Ok(())
200+
}
201+
202+
#[test]
203+
#[cfg(all(feature = "sub_integrations", feature = "sanity"))]
204+
fn test_kiro_cli_sub_integrations_uninstall_autostart_entry_subcommand() -> Result<(), Box<dyn std::error::Error>> {
205+
println!("\n🔍 Testing kiro-cli integrations uninstall autostart-entry subcommand... | Description: Tests the <code> kiro-cli integrations uninstall autostart-entry </code> subcommand to verify uninstallation of autostart-entry .");
206+
207+
println!("\n🔍 Executing 'kiro-cli integrations uninstall autostart-entry' subcommand...");
208+
let response = q_chat_helper::execute_q_subcommand("kiro-cli", &["integrations", "uninstall", "autostart-entry"])?;
209+
210+
println!("📝 FULL OUTPUT:");
211+
println!("{}", response);
212+
println!("📝 END OUTPUT");
213+
214+
if response.contains("error") {
215+
216+
} else if response.contains("error:") {
217+
assert!(response.contains("The autostart integration is only supported on Linux"), "Expected 'The autostart integration is only supported on Linux' in response.");
218+
}
219+
println!("✅ Kiro Cli integrations uninstall autostart-entry subcommand executed successfully!");
220+
133221
Ok(())
134222
}

e2etests/tests/integrations/test_kiro_cli_integrations_subcommand.rs renamed to e2etests/tests/sub_integrations/test_kiro_cli_sub_integrations_subcommand.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
use q_cli_e2e_tests::q_chat_helper;
33

44
#[test]
5-
#[cfg(all(feature = "integrations", feature = "sanity"))]
6-
fn test_kiro_cli_integrations_help_subcommand() -> Result<(), Box<dyn std::error::Error>> {
5+
#[cfg(all(feature = "sub_integrations", feature = "sanity"))]
6+
fn test_kiro_cli_sub_integrations_help_subcommand() -> Result<(), Box<dyn std::error::Error>> {
77
println!("\n🔍 Testing kiro-cli integrations --help subcommand... | Description: Tests the <code> kiro-cli integrations --help </code> subcommand to verify different help commands.");
88

99
println!("\n🔍 Executing 'kiro-cli integrations --help' subcommand...");

0 commit comments

Comments
 (0)