pub fn integration() {
    info!(
        "Going to execute integration test sequence. Make sure that Irro \
         performs all operations which are logged with [VALIDATE] prefix."
    );

    // Users need time to read the above message and start focusing.
    thread::sleep(Duration::from_secs(10));

    info!("Going to look for Irro on local network...");
    let irro_ip = match discover_irro() {
        Err(error) => panic!("Could not find Irro: {}", error),
        Ok(ip) => ip,
    };
    info!("Irro successfully found at {}.", irro_ip);

    let client = Client::from_ip(irro_ip);

    validate!("Going to turn off all Irro LEDs.");
    client.set_led(0, false).unwrap();

    info!("Going to validate Irro's LED GET endpoint response.");
    let leds = client
        .get_led()
        .expect("Problem when retrieving LED states");
    assert_eq!(leds[0], false);

    thread::sleep(Duration::from_secs(5));
    validate!("Going to turn on onboard LED.");
    client.set_led(0, true).unwrap();

    info!("Going to validate Irro's LED GET endpoint response.");
    let leds = client
        .get_led()
        .expect("Problem when retrieving LED states");
    assert_eq!(leds[0], true);

    thread::sleep(Duration::from_secs(5));
    validate!("Going to turn off onboard LED.");
    client.set_led(0, false).unwrap();

    thread::sleep(Duration::from_secs(5));
    validate!("Going to move forwards at 10% speed.");
    client.set_motor_power_ratio(0.1, 0.1).unwrap();

    thread::sleep(Duration::from_secs(5));
    validate!("Going to move backwards 5% speed.");
    client.set_motor_power_ratio(-0.05, -0.05).unwrap();

    thread::sleep(Duration::from_secs(5));
    validate!("Going to turn left.");
    client.set_motor_power_ratio(0., 0.05).unwrap();

    thread::sleep(Duration::from_secs(5));
    validate!("Going to stop.");
    client.set_motor_power_ratio(0., 0.).unwrap();

    info!("Integration test suit is finished.");
}
/// Go through all available integration tests in sequence and prompt user to
/// validate that Irro behaves according to instructions. This is a long
/// running blocking function.
///
/// # Panics
///
/// This function panics if the Irro's API does respond with an error, doesn't
/// respond at all (i.e. on network errors) or if Irro's misbehavior is
/// detected automatically (i.e. when it gives an inconsistent API response).
Go through all available integration tests in sequence and prompt user to
validate that Irro behaves according to instructions. This is a long
running blocking function.
Go through all available integration tests in sequence and prompt user to validate that Irro behaves according to instructions . This is a long running blocking function .
pub fn integration() {
    info!(
        "Going to execute integration test sequence. Make sure that Irro \
         performs all operations which are logged with [VALIDATE] prefix."
    );
    // Users need time to read the above message and start focusing.
    thread::sleep(Duration::from_secs(10));
    info!("Going to look for Irro on local network...");
    let irro_ip = match discover_irro() {
        Err(error) => panic!("Could not find Irro: {}", error),
        Ok(ip) => ip,
    };
    info!("Irro successfully found at {}.", irro_ip);
    let client = Client::from_ip(irro_ip);
    validate!("Going to turn off all Irro LEDs.");
    client.set_led(0, false).unwrap();
    info!("Going to validate Irro's LED GET endpoint response.");
    let leds = client
        .get_led()
        .expect("Problem when retrieving LED states");
    assert_eq!(leds[0], false);
    thread::sleep(Duration::from_secs(5));
    validate!("Going to turn on onboard LED.");
    client.set_led(0, true).unwrap();
    info!("Going to validate Irro's LED GET endpoint response.");
    let leds = client
        .get_led()
        .expect("Problem when retrieving LED states");
    assert_eq!(leds[0], true);
    thread::sleep(Duration::from_secs(5));
    validate!("Going to turn off onboard LED.");
    client.set_led(0, false).unwrap();
    thread::sleep(Duration::from_secs(5));
    validate!("Going to move forwards at 10% speed.");
    client.set_motor_power_ratio(0.1, 0.1).unwrap();
    thread::sleep(Duration::from_secs(5));
    validate!("Going to move backwards 5% speed.");
    client.set_motor_power_ratio(-0.05, -0.05).unwrap();
    thread::sleep(Duration::from_secs(5));
    validate!("Going to turn left.");
    client.set_motor_power_ratio(0., 0.05).unwrap();
    thread::sleep(Duration::from_secs(5));
    validate!("Going to stop.");
    client.set_motor_power_ratio(0., 0.).unwrap();
    info!("Integration test suit is finished.");
}
pub fn integration ( ) { info ! ( " \
 " ) ; // Users need time to read the above message and start focusing. thread :: sleep ( Duration :: from_secs ( 10 ) ) ; info ! ( " " ) ; let irro_ip = match discover_irro ( ) { Err ( error ) => panic ! ( " " error ) , Ok ( ip ) => ip , } ; info ! ( " " irro_ip ) ; let client = Client :: from_ip ( irro_ip ) ; validate ! ( " " ) ; client . set_led ( 0 , false ) . unwrap ( ) ; info ! ( " " ) ; let leds = client . get_led ( ) . expect ( " " ) ; assert_eq ! ( leds [ 0 ] false ) ; thread :: sleep ( Duration :: from_secs ( 5 ) ) ; validate ! ( " " ) ; client . set_led ( 0 , true ) . unwrap ( ) ; info ! ( " " ) ; let leds = client . get_led ( ) . expect ( " " ) ; assert_eq ! ( leds [ 0 ] true ) ; thread :: sleep ( Duration :: from_secs ( 5 ) ) ; validate ! ( " " ) ; client . set_led ( 0 , false ) . unwrap ( ) ; thread :: sleep ( Duration :: from_secs ( 5 ) ) ; validate ! ( " " ) ; client . set_motor_power_ratio ( 0.1 , 0.1 ) . unwrap ( ) ; thread :: sleep ( Duration :: from_secs ( 5 ) ) ; validate ! ( " " ) ; client . set_motor_power_ratio ( - 0.05 , - 0.05 ) . unwrap ( ) ; thread :: sleep ( Duration :: from_secs ( 5 ) ) ; validate ! ( " " ) ; client . set_motor_power_ratio ( 0. , 0.05 ) . unwrap ( ) ; thread :: sleep ( Duration :: from_secs ( 5 ) ) ; validate ! ( " " ) ; client . set_motor_power_ratio ( 0. , 0. ) . unwrap ( ) ; info ! ( " " ) ; }
Go through all available integration tests in sequence and prompt user to
validate that Irro behaves according to instructions.
Go through all available integration tests in sequence and prompt user to validate that Irro behaves according to instructions .
panics
This function panics if the Irro's API does respond with an error, doesn't
respond at all  or if Irro's misbehavior is
detected automatically .
This function panics if the Irro ' s API does respond with an error doesn ' t respond at all or if Irro ' s misbehavior is detected automatically .