Skip to content

Commit 57610ec

Browse files
authored
use template from v2.0 branch of spin-python-sdk in test (#2421)
We're currently in the process of preparing a v3.0.0 release of the Python SDK, and have made breaking changes to the API, but are not yet ready to publish the release, so we should stick with a known-good version for Spin tests. Signed-off-by: Joel Dice <[email protected]>
1 parent d377a61 commit 57610ec

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

tests/integration.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ Caused by:
362362
http_smoke_test_template(
363363
"http-rust",
364364
None,
365+
None,
365366
&[],
366367
|_| Ok(()),
367368
HashMap::default(),
@@ -500,6 +501,7 @@ Caused by:
500501
http_smoke_test_template(
501502
"http-py",
502503
Some("https://github.com/fermyon/spin-python-sdk"),
504+
Some("v2.0"),
503505
&[],
504506
prebuild,
505507
env_vars,
@@ -513,6 +515,7 @@ Caused by:
513515
http_smoke_test_template(
514516
"http-c",
515517
None,
518+
None,
516519
&[],
517520
|_| Ok(()),
518521
HashMap::default(),
@@ -532,6 +535,7 @@ Caused by:
532535
http_smoke_test_template(
533536
"http-go",
534537
None,
538+
None,
535539
&[],
536540
prebuild,
537541
HashMap::default(),
@@ -551,6 +555,7 @@ Caused by:
551555
http_smoke_test_template(
552556
"http-js",
553557
Some("https://github.com/fermyon/spin-js-sdk"),
558+
None,
554559
&["js2wasm"],
555560
prebuild,
556561
HashMap::default(),
@@ -570,6 +575,7 @@ Caused by:
570575
http_smoke_test_template(
571576
"http-ts",
572577
Some("https://github.com/fermyon/spin-js-sdk"),
578+
None,
573579
&["js2wasm"],
574580
prebuild,
575581
HashMap::default(),
@@ -584,6 +590,7 @@ Caused by:
584590
http_smoke_test_template(
585591
"http-grain",
586592
None,
593+
None,
587594
&[],
588595
|_| Ok(()),
589596
HashMap::default(),
@@ -597,6 +604,7 @@ Caused by:
597604
http_smoke_test_template(
598605
"http-zig",
599606
None,
607+
None,
600608
&[],
601609
|_| Ok(()),
602610
HashMap::default(),
@@ -610,6 +618,7 @@ Caused by:
610618
http_smoke_test_template(
611619
"http-swift",
612620
None,
621+
None,
613622
&[],
614623
|_| Ok(()),
615624
HashMap::default(),
@@ -623,6 +632,7 @@ Caused by:
623632
super::testcases::http_smoke_test_template_with_route(
624633
"http-php",
625634
None,
635+
None,
626636
&[],
627637
|_| Ok(()),
628638
HashMap::default(),
@@ -637,6 +647,7 @@ Caused by:
637647
super::testcases::redis_smoke_test_template(
638648
"redis-go",
639649
None,
650+
None,
640651
&[],
641652
|port| {
642653
vec![
@@ -661,6 +672,7 @@ Caused by:
661672
super::testcases::redis_smoke_test_template(
662673
"redis-rust",
663674
None,
675+
None,
664676
&[],
665677
|port| {
666678
vec![
@@ -696,6 +708,7 @@ Caused by:
696708
let mut env = super::testcases::bootstrap_smoke_test(
697709
&services,
698710
None,
711+
None,
699712
&[],
700713
"http-rust",
701714
|_| Ok(Vec::new()),

tests/testcases/mod.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ fn preboot(
159159
pub fn http_smoke_test_template(
160160
template_name: &str,
161161
template_url: Option<&str>,
162+
template_branch: Option<&str>,
162163
plugins: &[&str],
163164
prebuild_hook: impl FnOnce(&mut testing_framework::TestEnvironment<()>) -> anyhow::Result<()>,
164165
build_env_vars: HashMap<String, String>,
@@ -167,6 +168,7 @@ pub fn http_smoke_test_template(
167168
http_smoke_test_template_with_route(
168169
template_name,
169170
template_url,
171+
template_branch,
170172
plugins,
171173
prebuild_hook,
172174
build_env_vars,
@@ -176,9 +178,12 @@ pub fn http_smoke_test_template(
176178
}
177179

178180
/// Run a smoke test against a given http route for a `spin new` http template
181+
// TODO: refactor this function to not take so many arguments
182+
#[allow(clippy::too_many_arguments)]
179183
pub fn http_smoke_test_template_with_route(
180184
template_name: &str,
181185
template_url: Option<&str>,
186+
template_branch: Option<&str>,
182187
plugins: &[&str],
183188
prebuild_hook: impl FnOnce(&mut testing_framework::TestEnvironment<()>) -> anyhow::Result<()>,
184189
build_env_vars: HashMap<String, String>,
@@ -188,6 +193,7 @@ pub fn http_smoke_test_template_with_route(
188193
let mut env = bootstrap_smoke_test(
189194
&testing_framework::ServicesConfig::none(),
190195
template_url,
196+
template_branch,
191197
plugins,
192198
template_name,
193199
|_| Ok(Vec::new()),
@@ -211,6 +217,7 @@ pub fn http_smoke_test_template_with_route(
211217
pub fn redis_smoke_test_template(
212218
template_name: &str,
213219
template_url: Option<&str>,
220+
template_branch: Option<&str>,
214221
plugins: &[&str],
215222
new_app_args: impl FnOnce(u16) -> Vec<String>,
216223
prebuild_hook: impl FnOnce(&mut testing_framework::TestEnvironment<()>) -> anyhow::Result<()>,
@@ -219,6 +226,7 @@ pub fn redis_smoke_test_template(
219226
let mut env = bootstrap_smoke_test(
220227
&testing_framework::ServicesConfig::new(vec!["redis".into()])?,
221228
template_url,
229+
template_branch,
222230
plugins,
223231
template_name,
224232
|env| {
@@ -261,6 +269,7 @@ static TEMPLATE_MUTEX: std::sync::Mutex<()> = std::sync::Mutex::new(());
261269
pub fn bootstrap_smoke_test(
262270
services: &testing_framework::ServicesConfig,
263271
template_url: Option<&str>,
272+
template_branch: Option<&str>,
264273
plugins: &[&str],
265274
template_name: &str,
266275
new_app_args: impl FnOnce(
@@ -281,6 +290,9 @@ pub fn bootstrap_smoke_test(
281290
let template_url = template_url.unwrap_or("https://github.com/fermyon/spin");
282291
let mut template_install = std::process::Command::new(spin_binary());
283292
template_install.args(["templates", "install", "--git", template_url, "--update"]);
293+
if let Some(branch) = template_branch {
294+
template_install.args(["--branch", branch]);
295+
}
284296
// We need to serialize template installs since they can't be run in parallel
285297
{
286298
let _guard = TEMPLATE_MUTEX.lock().unwrap();

0 commit comments

Comments
 (0)