@@ -7,7 +7,7 @@ mod integration_tests {
77 http:: { Method , Request , Response } ,
88 services:: ServicesConfig ,
99 } ;
10- use testing_framework:: runtimes:: SpinAppType ;
10+ use testing_framework:: runtimes:: { spin_cli :: SpinConfig , SpinAppType } ;
1111
1212 use super :: testcases:: {
1313 assert_spin_request, bootstap_env, http_smoke_test_template, run_test, spin_binary,
@@ -39,8 +39,11 @@ mod integration_tests {
3939 let test_value = uuid:: Uuid :: new_v4 ( ) . to_string ( ) ;
4040 run_test (
4141 "key-value" ,
42- SpinAppType :: Http ,
43- [ "--key-value" . into ( ) , format ! ( "{test_key}={test_value}" ) ] ,
42+ SpinConfig {
43+ binary_path : spin_binary ( ) ,
44+ spin_up_args : vec ! [ "--key-value" . into( ) , format!( "{test_key}={test_value}" ) ] ,
45+ app_type : SpinAppType :: Http ,
46+ } ,
4447 ServicesConfig :: none ( ) ,
4548 move |env| {
4649 let spin = env. runtime_mut ( ) ;
@@ -59,8 +62,11 @@ mod integration_tests {
5962 fn http_smoke_test ( ) -> anyhow:: Result < ( ) > {
6063 run_test (
6164 "http-smoke-test" ,
62- SpinAppType :: Http ,
63- [ ] ,
65+ SpinConfig {
66+ binary_path : spin_binary ( ) ,
67+ spin_up_args : Vec :: new ( ) ,
68+ app_type : SpinAppType :: Http ,
69+ } ,
6470 ServicesConfig :: none ( ) ,
6571 move |env| {
6672 let spin = env. runtime_mut ( ) ;
@@ -98,8 +104,11 @@ mod integration_tests {
98104 use redis:: Commands ;
99105 run_test (
100106 "redis-smoke-test" ,
101- SpinAppType :: Redis ,
102- [ ] ,
107+ SpinConfig {
108+ binary_path : spin_binary ( ) ,
109+ spin_up_args : Vec :: new ( ) ,
110+ app_type : SpinAppType :: Redis ,
111+ } ,
103112 ServicesConfig :: new ( vec ! [ "redis" . into( ) ] ) ?,
104113 move |env| {
105114 let redis_port = env
@@ -153,8 +162,11 @@ mod integration_tests {
153162 use crate :: testcases:: run_test_inited;
154163 run_test_inited (
155164 "otel-smoke-test" ,
156- SpinAppType :: Http ,
157- [ ] ,
165+ SpinConfig {
166+ binary_path : spin_binary ( ) ,
167+ spin_up_args : Vec :: new ( ) ,
168+ app_type : SpinAppType :: Http ,
169+ } ,
158170 ServicesConfig :: new ( vec ! [ "jaeger" . into( ) ] ) ?,
159171 |env| {
160172 let otel_port = env
@@ -212,8 +224,11 @@ mod integration_tests {
212224 fn dynamic_env_test ( ) -> anyhow:: Result < ( ) > {
213225 run_test (
214226 "dynamic-env-test" ,
215- SpinAppType :: Http ,
216- vec ! [ "--env" . to_owned( ) , "foo=bar" . to_owned( ) ] ,
227+ SpinConfig {
228+ binary_path : spin_binary ( ) ,
229+ spin_up_args : vec ! [ "--env" . to_owned( ) , "foo=bar" . to_owned( ) ] ,
230+ app_type : SpinAppType :: Http ,
231+ } ,
217232 ServicesConfig :: none ( ) ,
218233 move |env| {
219234 let spin = env. runtime_mut ( ) ;
@@ -243,8 +258,11 @@ mod integration_tests {
243258 fn assets_routing_test ( ) -> anyhow:: Result < ( ) > {
244259 run_test (
245260 "assets-test" ,
246- SpinAppType :: Http ,
247- [ ] ,
261+ SpinConfig {
262+ binary_path : spin_binary ( ) ,
263+ spin_up_args : Vec :: new ( ) ,
264+ app_type : SpinAppType :: Http ,
265+ } ,
248266 ServicesConfig :: none ( ) ,
249267 move |env| {
250268 let spin = env. runtime_mut ( ) ;
@@ -286,8 +304,11 @@ mod integration_tests {
286304 fn legacy_apps ( ) -> anyhow:: Result < ( ) > {
287305 run_test (
288306 "legacy-apps-test" ,
289- SpinAppType :: Http ,
290- [ ] ,
307+ SpinConfig {
308+ binary_path : spin_binary ( ) ,
309+ spin_up_args : Vec :: new ( ) ,
310+ app_type : SpinAppType :: Http ,
311+ } ,
291312 ServicesConfig :: none ( ) ,
292313 move |env| {
293314 let spin = env. runtime_mut ( ) ;
@@ -314,9 +335,12 @@ mod integration_tests {
314335 fn bad_build_test ( ) -> anyhow:: Result < ( ) > {
315336 let mut env = bootstap_env (
316337 "error" ,
317- [ ] ,
338+ SpinConfig {
339+ binary_path : spin_binary ( ) ,
340+ spin_up_args : Vec :: new ( ) ,
341+ app_type : SpinAppType :: None ,
342+ } ,
318343 ServicesConfig :: none ( ) ,
319- SpinAppType :: None ,
320344 |_| Ok ( ( ) ) ,
321345 ) ?;
322346 let expected = r#"Error: Couldn't find trigger executor for local app "spin.toml"
@@ -334,8 +358,11 @@ Caused by:
334358 fn outbound_http_works ( ) -> anyhow:: Result < ( ) > {
335359 run_test (
336360 "outbound-http-to-same-app" ,
337- SpinAppType :: Http ,
338- [ ] ,
361+ SpinConfig {
362+ binary_path : spin_binary ( ) ,
363+ spin_up_args : Vec :: new ( ) ,
364+ app_type : SpinAppType :: Http ,
365+ } ,
339366 ServicesConfig :: none ( ) ,
340367 move |env| {
341368 let spin = env. runtime_mut ( ) ;
@@ -378,8 +405,11 @@ Caused by:
378405 fn test_simple_rust_local ( ) -> anyhow:: Result < ( ) > {
379406 run_test (
380407 "simple-test" ,
381- SpinAppType :: Http ,
382- [ ] ,
408+ SpinConfig {
409+ binary_path : spin_binary ( ) ,
410+ spin_up_args : Vec :: new ( ) ,
411+ app_type : SpinAppType :: Http ,
412+ } ,
383413 ServicesConfig :: none ( ) ,
384414 |env| {
385415 let spin = env. runtime_mut ( ) ;
@@ -410,8 +440,11 @@ Caused by:
410440 fn test_duplicate_rust_local ( ) -> anyhow:: Result < ( ) > {
411441 run_test (
412442 "simple-double-test" ,
413- SpinAppType :: Http ,
414- [ ] ,
443+ SpinConfig {
444+ binary_path : spin_binary ( ) ,
445+ spin_up_args : Vec :: new ( ) ,
446+ app_type : SpinAppType :: Http ,
447+ } ,
415448 ServicesConfig :: none ( ) ,
416449 |env| {
417450 let spin = env. runtime_mut ( ) ;
@@ -442,8 +475,11 @@ Caused by:
442475 const VAULT_ROOT_TOKEN : & str = "root" ;
443476 run_test_inited (
444477 "vault-variables-test" ,
445- SpinAppType :: Http ,
446- vec ! [ "--runtime-config-file" . into( ) , "runtime_config.toml" . into( ) ] ,
478+ SpinConfig {
479+ binary_path : spin_binary ( ) ,
480+ spin_up_args : vec ! [ "--runtime-config-file" . into( ) , "runtime_config.toml" . into( ) ] ,
481+ app_type : SpinAppType :: Http ,
482+ } ,
447483 ServicesConfig :: new ( vec ! [ "vault" . into( ) ] ) ?,
448484 |env| {
449485 // Vault can take a few moments to be ready
@@ -745,8 +781,11 @@ Caused by:
745781
746782 run_test (
747783 test_name,
748- SpinAppType :: Http ,
749- [ ] ,
784+ SpinConfig {
785+ binary_path : spin_binary ( ) ,
786+ spin_up_args : Vec :: new ( ) ,
787+ app_type : SpinAppType :: Http ,
788+ } ,
750789 ServicesConfig :: new ( vec ! [ "http-echo" . into( ) ] ) ?,
751790 move |env| {
752791 let port = env
@@ -788,10 +827,12 @@ route = "/..."
788827 env. write_file ( "fake.wasm" , [ ] ) ?;
789828
790829 testing_framework:: runtimes:: spin_cli:: SpinCli :: start (
791- & spin_binary ( ) ,
830+ SpinConfig {
831+ binary_path : spin_binary ( ) ,
832+ spin_up_args : Vec :: new ( ) ,
833+ app_type : SpinAppType :: None ,
834+ } ,
792835 & mut env,
793- Vec :: < String > :: new ( ) ,
794- SpinAppType :: None ,
795836 ) ?;
796837
797838 let mut up = std:: process:: Command :: new ( spin_binary ( ) ) ;
@@ -826,10 +867,12 @@ route = "/..."
826867 env. write_file ( "fake.wasm" , [ ] ) ?;
827868
828869 testing_framework:: runtimes:: spin_cli:: SpinCli :: start (
829- & spin_binary ( ) ,
870+ SpinConfig {
871+ binary_path : spin_binary ( ) ,
872+ spin_up_args : Vec :: new ( ) ,
873+ app_type : SpinAppType :: None ,
874+ } ,
830875 & mut env,
831- Vec :: < String > :: new ( ) ,
832- SpinAppType :: None ,
833876 ) ?;
834877
835878 let mut up = std:: process:: Command :: new ( spin_binary ( ) ) ;
@@ -1083,8 +1126,11 @@ route = "/..."
10831126
10841127 run_test (
10851128 "wasi-http-streaming" ,
1086- SpinAppType :: Http ,
1087- [ ] ,
1129+ SpinConfig {
1130+ binary_path : spin_binary ( ) ,
1131+ spin_up_args : Vec :: new ( ) ,
1132+ app_type : SpinAppType :: Http ,
1133+ } ,
10881134 ServicesConfig :: none ( ) ,
10891135 move |env| {
10901136 let spin = env. runtime_mut ( ) ;
@@ -1130,8 +1176,11 @@ route = "/..."
11301176 . collect :: < HashMap < _ , _ > > ( ) ;
11311177 run_test (
11321178 "wasi-http-streaming" ,
1133- SpinAppType :: Http ,
1134- [ ] ,
1179+ SpinConfig {
1180+ binary_path : spin_binary ( ) ,
1181+ spin_up_args : Vec :: new ( ) ,
1182+ app_type : SpinAppType :: Http ,
1183+ } ,
11351184 ServicesConfig :: new ( vec ! [ "http-responses-from-file" . into( ) ] ) ?,
11361185 move |env| {
11371186 let service_url = format ! (
@@ -1200,8 +1249,11 @@ route = "/..."
12001249 fn test_spin_inbound_http ( ) -> anyhow:: Result < ( ) > {
12011250 run_test (
12021251 "spin-inbound-http" ,
1203- SpinAppType :: Http ,
1204- [ ] ,
1252+ SpinConfig {
1253+ binary_path : spin_binary ( ) ,
1254+ spin_up_args : Vec :: new ( ) ,
1255+ app_type : SpinAppType :: Http ,
1256+ } ,
12051257 ServicesConfig :: none ( ) ,
12061258 move |env| {
12071259 let spin = env. runtime_mut ( ) ;
@@ -1230,8 +1282,11 @@ route = "/..."
12301282 fn test_wagi_http ( ) -> anyhow:: Result < ( ) > {
12311283 run_test (
12321284 "wagi-http" ,
1233- SpinAppType :: Http ,
1234- [ ] ,
1285+ SpinConfig {
1286+ binary_path : spin_binary ( ) ,
1287+ spin_up_args : Vec :: new ( ) ,
1288+ app_type : SpinAppType :: Http ,
1289+ } ,
12351290 ServicesConfig :: none ( ) ,
12361291 move |env| {
12371292 let spin = env. runtime_mut ( ) ;
@@ -1271,8 +1326,11 @@ route = "/..."
12711326 fn test_http_routing ( ) -> anyhow:: Result < ( ) > {
12721327 run_test (
12731328 "http-routing" ,
1274- SpinAppType :: Http ,
1275- [ ] ,
1329+ SpinConfig {
1330+ binary_path : spin_binary ( ) ,
1331+ spin_up_args : Vec :: new ( ) ,
1332+ app_type : SpinAppType :: Http ,
1333+ } ,
12761334 ServicesConfig :: none ( ) ,
12771335 move |env| {
12781336 let spin = env. runtime_mut ( ) ;
@@ -1306,8 +1364,11 @@ route = "/..."
13061364 fn test_outbound_post ( ) -> anyhow:: Result < ( ) > {
13071365 run_test (
13081366 "wasi-http-outbound-post" ,
1309- SpinAppType :: Http ,
1310- [ ] ,
1367+ SpinConfig {
1368+ binary_path : spin_binary ( ) ,
1369+ spin_up_args : Vec :: new ( ) ,
1370+ app_type : SpinAppType :: Http ,
1371+ } ,
13111372 ServicesConfig :: new ( vec ! [ "http-echo" . into( ) ] ) ?,
13121373 move |env| {
13131374 let service_url = format ! (
@@ -1395,8 +1456,11 @@ route = "/..."
13951456 fn test_spin_inbound_http_host_header ( ) -> anyhow:: Result < ( ) > {
13961457 run_test (
13971458 "outbound-http-to-same-app" ,
1398- SpinAppType :: Http ,
1399- [ ] ,
1459+ SpinConfig {
1460+ binary_path : spin_binary ( ) ,
1461+ spin_up_args : Vec :: new ( ) ,
1462+ app_type : SpinAppType :: Http ,
1463+ } ,
14001464 ServicesConfig :: none ( ) ,
14011465 move |env| {
14021466 let spin = env. runtime_mut ( ) ;
0 commit comments