Skip to content

Commit

Permalink
[Bugfix]Adding conditions to longer matching entries in conditional m…
Browse files Browse the repository at this point in the history
…arks (#14912)

What is the motivation for this PR?
As part of #11968, a bugfix was introduced in the find_longest_matches function to identify only the longest matching entry in tests_mark_conditions.yaml.

The previous bug led to incorrect behavior in finding the matching entries, deviating from our intended logic before:

Our expected behavior was to retrieve only the longest matching entry and evaluate the conditions under this single, unique entry.
Instead, the bug caused the function to retrieve all entries matching the test case prefix, evaluating conditions from all matching entries.
This resulted in an unintended situation where conditions from shorter matching entries which are absent in the longest one would still be considered during evaluation.
In PR #14395, we optimized the logic for finding marks in conditional marking. Now, although we will retrieve all entries matching the test case prefix but only the longest matching entry is evaluated if the mark is identical across all matching entries, which aligns with our original expectations. Additionally, conditions that exist only in shorter matching entries with the same mark are now ignored. To maintain consistency with previous behavior(although unexpected), we have added these conditions to the longer matching entry.

How did you do it?
To maintain consistency with previous behavior(although unexpected), we have added these conditions to the longer matching entry.
  • Loading branch information
yutongzhang-microsoft authored Oct 10, 2024
1 parent 5d8e614 commit da4486a
Show file tree
Hide file tree
Showing 2 changed files with 249 additions and 108 deletions.
Loading

0 comments on commit da4486a

Please sign in to comment.