Skip to content

Commit

Permalink
Remove hacks
Browse files Browse the repository at this point in the history
  • Loading branch information
CosminLazar committed Oct 25, 2023
1 parent e2452b2 commit 3866d32
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ jobs:
coverage:
name: Code coverage
runs-on: ubuntu-latest
# temporary wait for test to see if it fixes mqtt errors
needs: test
env:
CARGO_TERM_COLOR: always
steps:
Expand Down
16 changes: 3 additions & 13 deletions tests/full_flow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,16 @@ use ha_mitaffald::{
use hivemq::HiveMQContainer;
use rumqttc::Publish;
use serde_json::Value;
use std::collections::HashMap;
use std::time::Duration;
use std::{collections::HashMap, time::SystemTime};
use testcontainers::{clients, Image, RunnableImage};
use testcontainers::clients;
use url::Url;

#[test]
fn smoke_test() {
let docker = clients::Cli::default();
let image: RunnableImage<HiveMQContainer> = HiveMQContainer::default().into();
let image = image.with_container_name(format!(
"name{:?}",
SystemTime::now()
.duration_since(SystemTime::UNIX_EPOCH)
.unwrap()
));
// let mqtt_server = docker.run(HiveMQContainer::default());
let mqtt_server = docker.run(image);

let mqtt_server = docker.run(HiveMQContainer::default());
let mqtt_server_port = mqtt_server.get_host_port_ipv4(1883);
println!("Running local MQTT server on port {}", mqtt_server_port);

let mut mit_affald_server = mockito::Server::new();
let mit_affald_server_url = Url::parse(&mit_affald_server.url()).unwrap();
Expand Down

0 comments on commit 3866d32

Please sign in to comment.