Skip to content

Commit 7e685db

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

File tree

3 files changed

+11
-24
lines changed

3 files changed

+11
-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: 9 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,13 @@ 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").await?;
155155

156156
let one_sec = time::Duration::from_secs(1);
157157
thread::sleep(one_sec);
@@ -175,7 +175,7 @@ mod test {
175175
}
176176

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

180180
// Publish a message to the emqx broker
181181
let mut mqttoptions = rumqttc::MqttOptions::new("123", "127.0.0.1", forward_port);
@@ -219,20 +219,6 @@ mod test {
219219
Ok(())
220220
}
221221

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-
236222
#[tokio::test]
237223
async fn spin_static_assets_test() -> Result<()> {
238224
let host_port = 8082;
@@ -270,19 +256,20 @@ mod test {
270256
}
271257
}
272258

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

276-
println!(" >>> kubectl portforward redis {}:{} ", port, redis_port);
262+
println!(" >>> kubectl portforward svc {} {}:{} ", svc_name, port, svc_port);
277263

278264
Command::new("kubectl")
279265
.arg("port-forward")
280-
.arg("redis")
281-
.arg(format!("{}:{}", port, redis_port))
266+
.arg(svc_name)
267+
.arg(format!("{}:{}", port, svc_port))
282268
.spawn()?;
283269
tokio::time::sleep(tokio::time::Duration::from_secs(2)).await;
284270
Ok(port)
285271
}
272+
286273

287274
async fn get_logs_by_label(label: &str) -> Result<String> {
288275
let output = tokio::process::Command::new("kubectl")

0 commit comments

Comments
 (0)