Skip to content
Closed
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .azure-pipelines/run-test-elastictest-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,24 @@ steps:

rm -f new_test_plan_id.txt

# all feature branches branched out from master can use py3only image
parent_commit=$(git rev-parse HEAD^1)
master_commit=$(git rev-parse master)
branch_from_master=0
if [ "$parent_commit" == "$master_commit" ]
Copy link
Contributor

@xwjiang-ms xwjiang-ms Sep 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compare the commit id doesn't make sense to me. Once a branch like 202411 branched out from master in the future, and certainly it could use py3only image, but compare commit id would cause branch_from_master=0 and use internal image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's right. Thanks. I will probably use a list of known branches that use mixed and the rest can use py3only.

then
branch_from_master=1
fi

if [ "${{ parameters.MGMT_BRANCH }}" == "master" ] || [ $branch_from_master -eq 1 ]
then
PTF_IMAGETAG="--ptf_imagetag=py3only"
else
PTF_IMAGETAG="--ptf_imagetag=internal"
fi
common_extra_params="${{ parameters.COMMON_EXTRA_PARAMS }} $PTF_IMAGETAG"
echo "##vso[task.setvariable variable=COMMON_EXTRA_PARAMS;]$common_extra_params"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to create pipeline variable "COMMON_EXTRA_PARAMS". Then subsequent pipeline tasks can access to this pipeline variable.

Since the common extra params is only used this task, it is unnecessary to create such pipeline variable. Just use bash variable should be enough. Then, in line 223, refer to bash variable instead of pipeline parameter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. I have modified that bit.


python ./.azure-pipelines/test_plan.py create \
-t ${{ parameters.TOPOLOGY }} \
-o new_test_plan_id.txt \
Expand Down