Skip to content

Commit c19a3f6

Browse files
chore: refactors post rebase
Signed-off-by: Brooks Townsend <brooks@cosmonic.com>
1 parent 4a6f6fd commit c19a3f6

File tree

5 files changed

+13
-10
lines changed

5 files changed

+13
-10
lines changed

src/commands/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ pub struct ScaleActor {
124124
/// The name of the model/manifest that generated this command
125125
pub model_name: String,
126126
/// Additional annotations to attach on this command
127-
pub annotations: HashMap<String, String>,
127+
pub annotations: BTreeMap<String, String>,
128128
}
129129

130130
from_impl!(ScaleActor);

src/scaler/spreadscaler/link.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,10 @@ impl<S: ReadStore + Send + Sync, L: LinkSource> LinkScaler<S, L> {
287287

288288
#[cfg(test)]
289289
mod test {
290-
use std::{collections::HashSet, sync::Arc};
290+
use std::{
291+
collections::{BTreeMap, HashSet},
292+
sync::Arc,
293+
};
291294

292295
use chrono::Utc;
293296
use wasmcloud_control_interface::LinkDefinition;
@@ -453,12 +456,12 @@ mod test {
453456
("cloud".to_string(), "fake".to_string()),
454457
("region".to_string(), "us-brooks-1".to_string()),
455458
]),
456-
annotations: HashMap::new(),
459+
annotations: BTreeMap::new(),
457460
providers: HashSet::from_iter([ProviderInfo {
458461
contract_id: "wasmcloud:httpserver".to_string(),
459462
link_name: "default".to_string(),
460463
public_key: "VASDASD".to_string(),
461-
annotations: HashMap::from_iter([(
464+
annotations: BTreeMap::from_iter([(
462465
APP_SPEC_ANNOTATION.to_string(),
463466
"foobar".to_string(),
464467
)]),
@@ -521,7 +524,7 @@ mod test {
521524

522525
let commands = link_scaler
523526
.handle_event(&Event::ActorsStarted(ActorsStarted {
524-
annotations: HashMap::from_iter([(
527+
annotations: BTreeMap::from_iter([(
525528
APP_SPEC_ANNOTATION.to_string(),
526529
"foobar".to_string(),
527530
)]),

src/scaler/spreadscaler/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1502,7 +1502,7 @@ mod test {
15021502
.await
15031503
.expect("should be able to handle an event");
15041504

1505-
let cmds = blobby_spreadscaler
1505+
let mut cmds = blobby_spreadscaler
15061506
.handle_event(&Event::ActorsStopped(modifying_event))
15071507
.await?;
15081508
assert_eq!(cmds.len(), 2);

src/workers/command.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl Worker for CommandWorker {
4646
.map(|s| s.as_str())
4747
.unwrap_or_default(),
4848
actor.count as u16,
49-
Some(annotations),
49+
Some(annotations.into_iter().collect()),
5050
)
5151
.await
5252
}

tests/command_worker_integration.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::collections::{BTreeMap, HashMap};
1+
use std::collections::BTreeMap;
22

33
use futures::StreamExt;
44
use serial_test::serial;
@@ -331,7 +331,7 @@ async fn test_annotation_stop() {
331331
host_id: host_id.clone(),
332332
count: 2,
333333
model_name: "fake".into(),
334-
annotations: HashMap::from_iter([("fake".to_string(), "wake".to_string())]),
334+
annotations: BTreeMap::from_iter([("fake".to_string(), "wake".to_string())]),
335335
})
336336
.await;
337337

@@ -385,7 +385,7 @@ async fn test_annotation_stop() {
385385
count: 0,
386386
host_id: host_id.clone(),
387387
model_name: "fake".into(),
388-
annotations: HashMap::from_iter([("fake".to_string(), "wake".to_string())]),
388+
annotations: BTreeMap::from_iter([("fake".to_string(), "wake".to_string())]),
389389
})
390390
.await;
391391

0 commit comments

Comments
 (0)