Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.
 

[Help] get_runs_by_include does not contains


#1
                    $runs = $this->_helper->get_runs_by_include(
                            $project->id,
                            $suite_ids,
                            $options['runs_include'],
                            $options['runs_ids'],
                            $options['runs_filters'],
                            null, // Active and completed
                            $options['runs_limit'],
                            $run_rels,
                            $run_count
                    );

No matter I try null, true, false in the sixth parameter. the completed runs are always not included.

Thanks.


#2

Hi Alston,

Thanks for your posting. Please make sure that the other parameters such as the filters or passed run IDs actually allow completed test runs. Passing null would return active and completed runs, true only completed and false only active test runs.

I hope this helps!

Regards,
Tobias


#3

I found that the reason that I did not get the run might be that all the cases in the run has already been deleted.

Is this the reason? It only returns the runs with cases?
How can I get the test whose cases were deleted if I want to show it?

Thanks.

Alston


#4

Hi Alston,

get_runs_by_include does not look at the tests or cases and the results solely depends on the run attributes and given filters/IDs, project or suite IDs. Please make sure to pass the correct IDs and/or filters to get the result you are looking for.

I hope this helps!

Cheers,
Tobias


#5

I have tried the parameter I post above.

When I select a run with cases exists I will get the run.
When I select a run (completed one)whose cases were all deleted I will get nothing.

Thanks.

Alston


#6

The function itself doesn’t filter based on cases/tests and would return the requested runs. Could you please check if you call another function after that to further limit the runs?

Cheers,
Tobias


#7

No, I check the result directly after the function call.

I got null if the cases of the complete run are all deleted.

Thanks.

Alston


#8

I think I might know the key point now.

The suite id of the completed runs whose cases were all deleted turns into null
So the run is not match any of the suite_ids and then it does not return.

Is this the case?

Thanks.

Alston


#9

Hi Alston,

The suite_id is only set to null if you delete the suite. get_runs_by_include would still return those test runs except if you pass a suite ID filter.

I hope this helps!

Cheers,
Tobias


#10

Yes, the suite were deleted.