Skip to content

Commit

Permalink
Optimize feature folder retrieval in Impacted Area Based PR Testing (#…
Browse files Browse the repository at this point in the history
…16345)

What is the motivation for this PR?
In the Impacted Area Based PR testing, we identify the modified feature folders for the changes in a PR. Previously, the code retrieved the same feature folder multiple times if multiple modified scripts were located within it. However, we only need to retrieve each feature folder once. This PR optimizes the process to eliminate redundant retrievals.

How did you do it?
Implement a check to skip retrieval if the feature folder has already been processed.

How did you verify/test it?
I modified three scripts under the same feature folder and verified that the feature folder was only retrieved once
  • Loading branch information
yutongzhang-microsoft authored Jan 6, 2025
1 parent d4418fc commit 6d966ff
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .azure-pipelines/impacted_area_testing/get-impacted-area.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@ steps:
FEATURE=$(echo "$FEATURE" | cut -d'/' -f1-2)
fi
FEATURE=${FEATURE#tests/}
if [[ -z "$FINAL_FEATURES" ]]; then
FINAL_FEATURES="${FEATURE#tests/}"
else
FINAL_FEATURES="$FINAL_FEATURES,${FEATURE#tests/}"
FINAL_FEATURES="$FEATURE"
elif [[ ! "$FINAL_FEATURES" == *$FEATURE* ]]; then
FINAL_FEATURES="$FINAL_FEATURES,$FEATURE"
fi
# If changes related to other folders excpet tests, we also consider them as common part.
Expand Down

0 comments on commit 6d966ff

Please sign in to comment.