Skip to content

Commit d23f485

Browse files
Bump minimal rust version
Signed-off-by: Kate Goldenring <[email protected]>
1 parent ae86afa commit d23f485

File tree

3 files changed

+14
-24
lines changed

3 files changed

+14
-24
lines changed

images/spin/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM --platform=${BUILDPLATFORM} rust:1.79 AS build
1+
FROM --platform=${BUILDPLATFORM} rust:1.81 AS build
22
WORKDIR /opt/build
33
COPY . .
44
RUN rustup target add wasm32-wasi && cargo build --target wasm32-wasi --release

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[toolchain]
2-
channel = "1.79.0"
2+
channel = "1.81.0"
33
components = ["clippy", "rustfmt"]
44
targets = ["wasm32-wasi", "wasm32-unknown-unknown"]
55
profile = "default"

tests/src/integration_test.rs

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ mod test {
9494
anyhow::bail!("kubectl is not installed");
9595
}
9696

97-
let forward_port = port_forward_redis(redis_port).await?;
97+
let forward_port = port_forward_svc(redis_port, "redis").await?;
9898

9999
let client = redis::Client::open(format!("redis://localhost:{}", forward_port))?;
100100
let mut con = client.get_multiplexed_async_connection().await?;
@@ -145,13 +145,14 @@ mod test {
145145
anyhow::bail!("kubectl is not installed");
146146
}
147147

148-
let forward_port = port_forward_redis(redis_port).await?;
148+
let forward_port = port_forward_svc(redis_port, "redis").await?;
149149

150150
let client = redis::Client::open(format!("redis://localhost:{}", forward_port))
151151
.context("connecting to redis")?;
152152
let mut con = client.get_multiplexed_async_connection().await?;
153153

154-
con.publish("testchannel", "some-payload").await?;
154+
con.publish::<_, _, ()>("testchannel", "some-payload")
155+
.await?;
155156

156157
let one_sec = time::Duration::from_secs(1);
157158
thread::sleep(one_sec);
@@ -175,7 +176,7 @@ mod test {
175176
}
176177

177178
// Port forward the emqx mqtt broker
178-
let forward_port = port_forward_emqx(mqtt_port).await?;
179+
let forward_port = port_forward_svc(mqtt_port, "emqx").await?;
179180

180181
// Publish a message to the emqx broker
181182
let mut mqttoptions = rumqttc::MqttOptions::new("123", "127.0.0.1", forward_port);
@@ -219,20 +220,6 @@ mod test {
219220
Ok(())
220221
}
221222

222-
async fn port_forward_emqx(emqx_port: u16) -> Result<u16> {
223-
let port = get_random_port()?;
224-
225-
println!(" >>> kubectl portforward emqx {}:{} ", port, emqx_port);
226-
227-
Command::new("kubectl")
228-
.arg("port-forward")
229-
.arg("emqx")
230-
.arg(format!("{}:{}", port, emqx_port))
231-
.spawn()?;
232-
tokio::time::sleep(tokio::time::Duration::from_secs(2)).await;
233-
Ok(port)
234-
}
235-
236223
#[tokio::test]
237224
async fn spin_static_assets_test() -> Result<()> {
238225
let host_port = 8082;
@@ -270,15 +257,18 @@ mod test {
270257
}
271258
}
272259

273-
async fn port_forward_redis(redis_port: u16) -> Result<u16> {
260+
async fn port_forward_svc(svc_port: u16, svc_name: &str) -> Result<u16> {
274261
let port = get_random_port()?;
275262

276-
println!(" >>> kubectl portforward redis {}:{} ", port, redis_port);
263+
println!(
264+
" >>> kubectl portforward svc {} {}:{} ",
265+
svc_name, port, svc_port
266+
);
277267

278268
Command::new("kubectl")
279269
.arg("port-forward")
280-
.arg("redis")
281-
.arg(format!("{}:{}", port, redis_port))
270+
.arg(svc_name)
271+
.arg(format!("{}:{}", port, svc_port))
282272
.spawn()?;
283273
tokio::time::sleep(tokio::time::Duration::from_secs(2)).await;
284274
Ok(port)

0 commit comments

Comments
 (0)