pub async fn run_and_collect_results_for_invocations(
        &self,
        mut sender: mpsc::Sender<TestEvent>,
        invocations: Vec<Invocation>,
        run_options: TestRunOptions,
    ) -> Result<(), anyhow::Error> {
        debug!("running tests");
        let mut successful_completion = true; // will remain true, if there are no tests to run.
        let mut invocations_iter = invocations.into_iter();
        let run_options: fidl_fuchsia_test::RunOptions = run_options.into();
        loop {
            const INVOCATIONS_CHUNK: usize = 50;
            let chunk = invocations_iter.by_ref().take(INVOCATIONS_CHUNK).collect::<Vec<_>>();
            if chunk.is_empty() {
                break;
            }
            let res = match self
                .run_invocations(chunk, run_options.clone(), &mut sender)
                .await
                .context("Error running test cases")
            {
                Ok(success) => success,
                Err(e) => {
                    return Err(e);
                }
            };
            successful_completion &= res;
        }
        if successful_completion {
            sender.send(TestEvent::test_finished()).await.context("sending TestFinished event")?;
        }
        Ok(())
    }
/// Runs the test component using `suite` and collects test stdout logs and results.
Runs the test component using `suite` and collects test stdout logs and results.
Runs the test component using ` suite ` and collects test stdout logs and results .
pub async fn run_and_collect_results_for_invocations(
        &self,
        mut sender: mpsc::Sender<TestEvent>,
        invocations: Vec<Invocation>,
        run_options: TestRunOptions,
    ) -> Result<(), anyhow::Error> {
        debug!("running tests");
        let mut successful_completion = true; // will remain true, if there are no tests to run.
        let mut invocations_iter = invocations.into_iter();
        let run_options: fidl_fuchsia_test::RunOptions = run_options.into();
        loop {
            const INVOCATIONS_CHUNK: usize = 50;
            let chunk = invocations_iter.by_ref().take(INVOCATIONS_CHUNK).collect::<Vec<_>>();
            if chunk.is_empty() {
                break;
            }
            let res = match self
                .run_invocations(chunk, run_options.clone(), &mut sender)
                .await
                .context("Error running test cases")
            {
                Ok(success) => success,
                Err(e) => {
                    return Err(e);
                }
            };
            successful_completion &= res;
        }
        if successful_completion {
            sender.send(TestEvent::test_finished()).await.context("sending TestFinished event")?;
        }
        Ok(())
    }
pub async fn run_and_collect_results_for_invocations ( & self , mut sender : mpsc :: Sender < TestEvent > , invocations : Vec < Invocation > , run_options : TestRunOptions , ) -> Result < ( ) , anyhow :: Error > { debug ! ( " " ) ; let mut successful_completion = true ; // will remain true, if there are no tests to run. let mut invocations_iter = invocations . into_iter ( ) ; let run_options : fidl_fuchsia_test :: RunOptions = run_options . into ( ) ; loop { const INVOCATIONS_CHUNK : usize = 50 ; let chunk = invocations_iter . by_ref ( ) . take ( INVOCATIONS_CHUNK ) . collect :: < Vec < _ > > ( ) ; if chunk . is_empty ( ) { break ; } let res = match self . run_invocations ( chunk , run_options . clone ( ) , & mut sender ) . await . context ( " " ) { Ok ( success ) => success , Err ( e ) => { return Err ( e ) ; } } ; successful_completion &= res ; } if successful_completion { sender . send ( TestEvent :: test_finished ( ) ) . await . context ( " " ) ? ; } Ok ( ( ) ) }
Runs the test component using `suite` and collects test stdout logs and results.
Runs the test component using ` suite ` and collects test stdout logs and results .
&self
sender
mpsc::Sender<TestEvent>
invocations
Vec<Invocation>
run_options
TestRunOptions
&self
sender
mpsc::Sender<TestEvent>
invocations
Vec<Invocation>
run_options
TestRunOptions