Skip to content

Commit dab7092

Browse files
authored
Add checkout optional sonic-mgmt param in PR test template (#21224)
What is the motivation for this PR? In other repos, if we want to use PR test template to run KVM tests, we need to checkout sonic-mgmt first to execute PR test related yaml and python files. How did you do it? CHECKOUT_SONIC_MGMT was defined but not used, use CHECKOUT_SONIC_MGMT to allow other repos to checkout sonic-mgmt code. How did you verify/test it? PR test passed means it won't affect PR test. Tested in pipeline to let buildimage to use the template.
1 parent 2b70f2a commit dab7092

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.azure-pipelines/pr_test_template.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ jobs:
5353
continueOnError: false
5454
pool: sonic-ubuntu-1c
5555
steps:
56+
- ${{ if eq(parameters.CHECKOUT_SONIC_MGMT, true) }}:
57+
- checkout: ${{ parameters.SONIC_MGMT_NAME }}
58+
displayName: "Checkout sonic-mgmt repository"
59+
5660
- template: impacted_area_testing/get-impacted-area.yml
5761
parameters:
5862
BUILD_BRANCH: $(BUILD_BRANCH)
@@ -69,6 +73,10 @@ jobs:
6973
continueOnError: false
7074
pool: sonic-ubuntu-1c
7175
steps:
76+
- ${{ if eq(parameters.CHECKOUT_SONIC_MGMT, true) }}:
77+
- checkout: ${{ parameters.SONIC_MGMT_NAME }}
78+
displayName: "Checkout sonic-mgmt repository"
79+
7280
- template: impacted_area_testing/calculate-instance-numbers.yml
7381
parameters:
7482
TOPOLOGY: t0
@@ -101,6 +109,10 @@ jobs:
101109
continueOnError: false
102110
pool: sonic-ubuntu-1c
103111
steps:
112+
- ${{ if eq(parameters.CHECKOUT_SONIC_MGMT, true) }}:
113+
- checkout: ${{ parameters.SONIC_MGMT_NAME }}
114+
displayName: "Checkout sonic-mgmt repository"
115+
104116
- template: impacted_area_testing/calculate-instance-numbers.yml
105117
parameters:
106118
TOPOLOGY: t0-2vlans
@@ -134,6 +146,10 @@ jobs:
134146
continueOnError: false
135147
pool: sonic-ubuntu-1c
136148
steps:
149+
- ${{ if eq(parameters.CHECKOUT_SONIC_MGMT, true) }}:
150+
- checkout: ${{ parameters.SONIC_MGMT_NAME }}
151+
displayName: "Checkout sonic-mgmt repository"
152+
137153
- template: impacted_area_testing/calculate-instance-numbers.yml
138154
parameters:
139155
TOPOLOGY: t1
@@ -166,6 +182,10 @@ jobs:
166182
continueOnError: false
167183
pool: sonic-ubuntu-1c
168184
steps:
185+
- ${{ if eq(parameters.CHECKOUT_SONIC_MGMT, true) }}:
186+
- checkout: ${{ parameters.SONIC_MGMT_NAME }}
187+
displayName: "Checkout sonic-mgmt repository"
188+
169189
- template: impacted_area_testing/calculate-instance-numbers.yml
170190
parameters:
171191
TOPOLOGY: dualtor
@@ -198,6 +218,10 @@ jobs:
198218
continueOnError: false
199219
pool: sonic-ubuntu-1c
200220
steps:
221+
- ${{ if eq(parameters.CHECKOUT_SONIC_MGMT, true) }}:
222+
- checkout: ${{ parameters.SONIC_MGMT_NAME }}
223+
displayName: "Checkout sonic-mgmt repository"
224+
201225
- template: impacted_area_testing/calculate-instance-numbers.yml
202226
parameters:
203227
TOPOLOGY: t0-sonic
@@ -235,6 +259,10 @@ jobs:
235259
continueOnError: false
236260
pool: sonic-ubuntu-1c
237261
steps:
262+
- ${{ if eq(parameters.CHECKOUT_SONIC_MGMT, true) }}:
263+
- checkout: ${{ parameters.SONIC_MGMT_NAME }}
264+
displayName: "Checkout sonic-mgmt repository"
265+
238266
- template: impacted_area_testing/calculate-instance-numbers.yml
239267
parameters:
240268
TOPOLOGY: dpu
@@ -271,6 +299,10 @@ jobs:
271299
continueOnError: false
272300
pool: sonic-ubuntu-1c
273301
steps:
302+
- ${{ if eq(parameters.CHECKOUT_SONIC_MGMT, true) }}:
303+
- checkout: ${{ parameters.SONIC_MGMT_NAME }}
304+
displayName: "Checkout sonic-mgmt repository"
305+
274306
- template: impacted_area_testing/calculate-instance-numbers.yml
275307
parameters:
276308
TOPOLOGY: t1
@@ -304,6 +336,10 @@ jobs:
304336
continueOnError: false
305337
pool: sonic-ubuntu-1c
306338
steps:
339+
- ${{ if eq(parameters.CHECKOUT_SONIC_MGMT, true) }}:
340+
- checkout: ${{ parameters.SONIC_MGMT_NAME }}
341+
displayName: "Checkout sonic-mgmt repository"
342+
307343
- template: impacted_area_testing/calculate-instance-numbers.yml
308344
parameters:
309345
TOPOLOGY: t2

0 commit comments

Comments
 (0)