Skip to content

Commit 07edbac

Browse files
Copilot0xrinegade
andcommitted
Fix e2e tests by adding missing setup_test_environment calls
Co-authored-by: 0xrinegade <[email protected]>
1 parent 395cbc5 commit 07edbac

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

tests/e2e/examples.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ fn example_test_with_assert_cmd() {
4545
#[test]
4646
#[serial]
4747
fn example_test_with_mock_server() {
48+
setup_test_environment();
49+
4850
// Create a mock server
4951
let mut mock_server = MockServer::new();
5052

@@ -70,6 +72,8 @@ fn example_test_with_mock_server() {
7072
#[test]
7173
#[serial]
7274
fn example_test_with_custom_config() {
75+
setup_test_environment();
76+
7377
// Create a temporary directory and config file
7478
let temp_dir = create_temp_dir();
7579
let config_path = create_mock_config(&temp_dir);

tests/e2e/node_tests.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,13 @@ fn test_nodes_get_invalid() {
8989
);
9090
}
9191

92+
#[test]
93+
#[serial]
9294
#[test]
9395
#[serial]
9496
fn test_examples_command() {
97+
setup_test_environment();
98+
9599
// Test the examples command
96100
let output = run_osvm_command_string(&["examples"]);
97101

@@ -114,6 +118,8 @@ fn test_examples_command() {
114118
#[test]
115119
#[serial]
116120
fn test_verbose_output() {
121+
setup_test_environment();
122+
117123
// Test with normal output (without verbose flag)
118124
let output = run_osvm_command_string(&["node"]);
119125

@@ -133,6 +139,8 @@ fn test_verbose_output() {
133139
#[test]
134140
#[serial]
135141
fn test_no_color_flag() {
142+
setup_test_environment();
143+
136144
// Test with no-color flag
137145
let output = run_osvm_command_string(&["--no-color", "svm", "list"]);
138146

@@ -143,6 +151,8 @@ fn test_no_color_flag() {
143151
#[test]
144152
#[serial]
145153
fn test_with_custom_config() {
154+
setup_test_environment();
155+
146156
// Create a temporary directory and config file
147157
let temp_dir = create_temp_dir();
148158
let config_path = create_mock_config(&temp_dir);
@@ -172,6 +182,8 @@ fn test_help_command() {
172182
#[test]
173183
#[serial]
174184
fn test_new_feature() {
185+
setup_test_environment();
186+
175187
// Test the new feature
176188
let output = run_osvm_command_string(&["new_feature_command"]);
177189

tests/e2e/svm_tests.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,13 @@ fn test_svm_dashboard() {
9090
assert.stderr(predicate::str::contains("Unknown command").not());
9191
}
9292

93+
#[test]
94+
#[serial]
9395
#[test]
9496
#[serial]
9597
fn test_svm_with_config_file() {
98+
setup_test_environment();
99+
96100
// Create a temporary directory and config file
97101
let temp_dir = create_temp_dir();
98102
let config_path = create_mock_config(&temp_dir);
@@ -107,6 +111,8 @@ fn test_svm_with_config_file() {
107111
#[test]
108112
#[serial]
109113
fn test_svm_with_url() {
114+
setup_test_environment();
115+
110116
// Create a mock server
111117
let mut mock_server = MockServer::new();
112118
let _mock = mock_server.mock_svm_list();
@@ -125,6 +131,8 @@ fn test_svm_with_url() {
125131

126132
#[test]
127133
fn test_svm_install() {
134+
setup_test_environment();
135+
128136
let output = run_osvm_command_string(&["svm", "install", "solana", "--host", "user@host"]);
129137

130138
// Verify the output contains expected installation message

0 commit comments

Comments
 (0)