Skip to content

Commit e805854

Browse files
committed
Fix incorrect args in rust-sdk
1 parent ec22a56 commit e805854

File tree

3 files changed

+26
-4
lines changed

3 files changed

+26
-4
lines changed

.github/workflows/rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ jobs:
2727
run: cargo fmt --check --all
2828

2929
- name: Run tests
30-
run: cargo test
30+
run: ./run-tests.sh

run-tests.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
set -e
3+
4+
(cd sdk/simulator && ./build.sh)
5+
6+
pushd sdk/simulator
7+
./dstack-simulator &
8+
SIMULATOR_PID=$!
9+
echo "Simulator process (PID: $SIMULATOR_PID) started."
10+
popd
11+
12+
export DSTACK_SIMULATOR_ENDPOINT=$(realpath sdk/simulator/dstack.sock)
13+
14+
echo "DSTACK_SIMULATOR_ENDPOINT: $DSTACK_SIMULATOR_ENDPOINT"
15+
16+
# Run the tests
17+
cargo test
18+
19+
# Kill the simulator after tests finish
20+
kill $SIMULATOR_PID
21+
echo "Simulator process (PID: $SIMULATOR_PID) terminated."

sdk/rust/src/dstack_client.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,10 @@ pub struct EventLog {
5353

5454
#[derive(bon::Builder, Serialize)]
5555
pub struct TlsKeyConfig {
56-
#[builder(into)]
57-
pub subject: Option<String>,
58-
pub alt_names: Option<Vec<String>>,
56+
#[builder(into, default = String::new())]
57+
pub subject: String,
58+
#[builder(default = Vec::new())]
59+
pub alt_names: Vec<String>,
5960
#[builder(default = false)]
6061
pub usage_ra_tls: bool,
6162
#[builder(default = true)]

0 commit comments

Comments
 (0)