twister: Fix quarantine filtering simulations

Quarantine filter was not correctly identifying the simulator name.
Now it uses the simulator name from the Platform object,
ensuring that quarantined tests are properly excluded or verified

Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
This commit is contained in:
Grzegorz Chwierut 2025-03-20 15:42:22 +01:00 committed by Benjamin Cabé
commit 5d049b6451

View file

@ -595,12 +595,14 @@ class TestPlan:
def handle_quarantined_tests(self, instance: TestInstance, plat: Platform): def handle_quarantined_tests(self, instance: TestInstance, plat: Platform):
if self.quarantine: if self.quarantine:
simulator = plat.simulator_by_name(self.options) sim_name = plat.simulation
if sim_name != "na" and (simulator := plat.simulator_by_name(self.options.sim_name)):
sim_name = simulator.name
matched_quarantine = self.quarantine.get_matched_quarantine( matched_quarantine = self.quarantine.get_matched_quarantine(
instance.testsuite.id, instance.testsuite.id,
plat.name, plat.name,
plat.arch, plat.arch,
simulator.name if simulator is not None else 'na' sim_name
) )
if matched_quarantine and not self.options.quarantine_verify: if matched_quarantine and not self.options.quarantine_verify:
instance.add_filter("Quarantine: " + matched_quarantine, Filters.QUARANTINE) instance.add_filter("Quarantine: " + matched_quarantine, Filters.QUARANTINE)