Skip to content

Commit fd3bcf3

Browse files
committed
ref(conformance-tests): address fmt/clippy errs
Signed-off-by: Vaughn Dice <[email protected]>
1 parent 4d1290a commit fd3bcf3

File tree

5 files changed

+21
-33
lines changed

5 files changed

+21
-33
lines changed

conformance-tests/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ impl SpinShim {
162162
ctr_run_id: &str,
163163
) -> anyhow::Result<Self> {
164164
let port = get_available_port().context("no available port")?;
165-
let listen_adress_env = format!("SPIN_HTTP_LISTEN_ADDR=0.0.0.0:{}", port);
165+
let listen_adress_env = format!("SPIN_HTTP_LISTEN_ADDR=0.0.0.0:{port}");
166166
let mut ctr_cmd = std::process::Command::new(ctr_binary_path);
167167
let child = ctr_cmd
168168
.arg("run")

containerd-shim-spin/src/engine.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,11 @@ impl Sandbox for SpinSandbox {
9999
Ok(0)
100100
}
101101
Ok(Err(err)) => {
102-
log::error!("run_wasi ERROR >>> failed: {:?}", err);
102+
log::error!("run_wasi ERROR >>> failed: {err:?}");
103103
Err(err)
104104
}
105105
Err(aborted) => {
106-
info!("Received signal to abort: {:?}", aborted);
106+
info!("Received signal to abort: {aborted:?}");
107107
Ok(0)
108108
}
109109
}

containerd-shim-spin/src/source.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ impl Source {
4343
if name == spin_oci::client::SPIN_APPLICATION_MEDIA_TYPE =>
4444
{
4545
let path = PathBuf::from("/spin.json");
46-
log::info!("writing spin oci config to {:?}", path);
46+
log::info!("writing spin oci config to {path:?}");
4747
File::create(&path)
4848
.context("failed to create spin.json")?
4949
.write_all(&artifact.layer)

containerd-shim-spin/src/trigger.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ where
3838
let builder: TriggerAppBuilder<_, FactorsBuilder> = TriggerAppBuilder::new(trigger);
3939
let builder_args = match std::env::var("SPIN_MAX_INSTANCE_MEMORY") {
4040
Ok(limit) => {
41-
debug!("Setting instance max memory to {} bytes", limit);
41+
debug!("Setting instance max memory to {limit} bytes");
4242
let mut args = TriggerAppArgs::default();
4343
args.max_instance_memory = limit.parse().ok();
4444
args

tests/src/integration_test.rs

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ mod test {
3131
// verify res is ok and not 404
3232
match res {
3333
Ok(_) => {
34-
println!("response_code: {}", response_code);
34+
println!("response_code: {response_code}");
3535
if response_code / 100 == 2 {
3636
break; // 2xx response
3737
}
3838
}
3939
Err(e) => {
40-
println!("res: {}, response_code: {}", e, response_code);
40+
println!("res: {e}, response_code: {response_code}");
4141
}
4242
}
4343
i += 1;
@@ -55,9 +55,9 @@ mod test {
5555
let host_port = 8082;
5656

5757
// curl for hello
58-
println!(" >>> curl http://localhost:{}/spin/hello", host_port);
58+
println!(" >>> curl http://localhost:{host_port}/spin/hello");
5959
let res = retry_get(
60-
&format!("http://localhost:{}/spin/hello", host_port),
60+
&format!("http://localhost:{host_port}/spin/hello"),
6161
RETRY_TIMES,
6262
INTERVAL_IN_SECS,
6363
)
@@ -72,9 +72,9 @@ mod test {
7272
let host_port = 8082;
7373

7474
// curl for hello
75-
println!(" >>> curl http://localhost:{}/keyvalue/keyvalue", host_port);
75+
println!(" >>> curl http://localhost:{host_port}/keyvalue/keyvalue");
7676
let res = retry_get(
77-
&format!("http://localhost:{}/keyvalue/keyvalue", host_port),
77+
&format!("http://localhost:{host_port}/keyvalue/keyvalue"),
7878
RETRY_TIMES,
7979
INTERVAL_IN_SECS,
8080
)
@@ -96,16 +96,13 @@ mod test {
9696

9797
let forward_port = port_forward_svc(redis_port, "redis").await?;
9898

99-
let client = redis::Client::open(format!("redis://localhost:{}", forward_port))?;
99+
let client = redis::Client::open(format!("redis://localhost:{forward_port}"))?;
100100
let mut con = client.get_multiplexed_async_connection().await?;
101101

102102
// curl for hello
103-
println!(
104-
" >>> curl http://localhost:{}/outboundredis/hello",
105-
host_port
106-
);
103+
println!(" >>> curl http://localhost:{host_port}/outboundredis/hello");
107104
let _ = retry_get(
108-
&format!("http://localhost:{}/outboundredis/hello", host_port),
105+
&format!("http://localhost:{host_port}/outboundredis/hello"),
109106
RETRY_TIMES,
110107
INTERVAL_IN_SECS,
111108
)
@@ -126,9 +123,9 @@ mod test {
126123
let host_port = 8082;
127124

128125
// curl for hello
129-
println!(" >>> curl http://localhost:{}/multi-trigger-app", host_port);
126+
println!(" >>> curl http://localhost:{host_port}/multi-trigger-app");
130127
let res = retry_get(
131-
&format!("http://localhost:{}/multi-trigger-app", host_port),
128+
&format!("http://localhost:{host_port}/multi-trigger-app"),
132129
RETRY_TIMES,
133130
INTERVAL_IN_SECS,
134131
)
@@ -147,7 +144,7 @@ mod test {
147144

148145
let forward_port = port_forward_svc(redis_port, "redis").await?;
149146

150-
let client = redis::Client::open(format!("redis://localhost:{}", forward_port))
147+
let client = redis::Client::open(format!("redis://localhost:{forward_port}"))
151148
.context("connecting to redis")?;
152149
let mut con = client.get_multiplexed_async_connection().await?;
153150

@@ -225,15 +222,9 @@ mod test {
225222
let host_port = 8082;
226223

227224
// curl for static asset
228-
println!(
229-
" >>> curl http://localhost:{}/static-assets/jabberwocky.txt",
230-
host_port
231-
);
225+
println!(" >>> curl http://localhost:{host_port}/static-assets/jabberwocky.txt");
232226
let res = retry_get(
233-
&format!(
234-
"http://localhost:{}/static-assets/jabberwocky.txt",
235-
host_port
236-
),
227+
&format!("http://localhost:{host_port}/static-assets/jabberwocky.txt"),
237228
RETRY_TIMES,
238229
INTERVAL_IN_SECS,
239230
)
@@ -260,15 +251,12 @@ mod test {
260251
async fn port_forward_svc(svc_port: u16, svc_name: &str) -> Result<u16> {
261252
let port = get_random_port()?;
262253

263-
println!(
264-
" >>> kubectl portforward svc {} {}:{} ",
265-
svc_name, port, svc_port
266-
);
254+
println!(" >>> kubectl portforward svc {svc_name} {port}:{svc_port} ");
267255

268256
Command::new("kubectl")
269257
.arg("port-forward")
270258
.arg(svc_name)
271-
.arg(format!("{}:{}", port, svc_port))
259+
.arg(format!("{port}:{svc_port}"))
272260
.spawn()?;
273261
tokio::time::sleep(tokio::time::Duration::from_secs(2)).await;
274262
Ok(port)

0 commit comments

Comments
 (0)