@@ -2139,99 +2139,6 @@ targets:
2139
2139
);
2140
2140
});
2141
2141
2142
- group ('treats postsubmit as presubmit if a label is present' , () {
2143
- final runAllTests = IssueLabel (name: 'test: all' );
2144
- setUp (() async {
2145
- ciYamlFetcher.setCiYamlFrom (r'''
2146
- enabled_branches:
2147
- - main
2148
- - master
2149
- targets:
2150
- - name: Linux Presubmit
2151
- presubmit: true
2152
- scheduler: luci
2153
- - name: Linux Conditional Presubmit (runIf)
2154
- presubmit: true
2155
- scheduler: luci
2156
- runIf:
2157
- - .ci.yaml
2158
- - DEPS
2159
- - dev/run_if/**
2160
- - name: Linux Postsubmit
2161
- presubmit: false
2162
- scheduler: luci
2163
- - name: Linux Cache
2164
- presubmit: false
2165
- scheduler: luci
2166
- properties:
2167
- cache_name: "builder"
2168
- ''' );
2169
- });
2170
-
2171
- test ('with a specific label in the flutter/engine repo' , () async {
2172
- final enginePr = generatePullRequest (
2173
- branch: Config .defaultBranch (Config .flutterSlug),
2174
- labels: < IssueLabel > [runAllTests],
2175
- repo: Config .flutterSlug.name,
2176
- );
2177
- final presubmitTargets = await scheduler.getPresubmitTargets (
2178
- enginePr,
2179
- );
2180
- expect (presubmitTargets.map ((Target target) => target.name).toList (), <
2181
- String
2182
- > [
2183
- // Always runs.
2184
- 'Linux Presubmit' ,
2185
- // test: all label is present, so runIf is skipped.
2186
- 'Linux Conditional Presubmit (runIf)' ,
2187
- // test: all label is present, so postsubmit is treated as presubmit.
2188
- 'Linux Postsubmit' ,
2189
- ]);
2190
- });
2191
-
2192
- test ('with a specific label in the flutter/flutter repo' , () async {
2193
- final frameworkPr = generatePullRequest (
2194
- branch: Config .defaultBranch (Config .flutterSlug),
2195
- labels: < IssueLabel > [runAllTests],
2196
- repo: Config .flutterSlug.name,
2197
- );
2198
- final presubmitTargets = await scheduler.getPresubmitTargets (
2199
- frameworkPr,
2200
- );
2201
- expect (presubmitTargets.map ((Target target) => target.name).toList (), <
2202
- String
2203
- > [
2204
- // Always runs.
2205
- 'Linux Presubmit' ,
2206
- // test: all label is present, so runIf is skipped.
2207
- 'Linux Conditional Presubmit (runIf)' ,
2208
- // test: all label is present, so postsubmit is treated as presubmit.
2209
- 'Linux Postsubmit' ,
2210
- ]);
2211
- });
2212
-
2213
- test ('without a specific label' , () async {
2214
- final enginePr = generatePullRequest (
2215
- branch: Config .defaultBranch (Config .flutterSlug),
2216
- labels: < IssueLabel > [],
2217
- repo: Config .flutterSlug.name,
2218
- );
2219
-
2220
- // Assume a file that is not runIf'd was changed.
2221
- getFilesChanged.cannedFiles = ['README.md' ];
2222
- final presubmitTargets = await scheduler.getPresubmitTargets (
2223
- enginePr,
2224
- );
2225
- expect (
2226
- presubmitTargets.map ((Target target) => target.name).toList (),
2227
- < String > [
2228
- // Always runs.
2229
- 'Linux Presubmit' ,
2230
- ],
2231
- );
2232
- });
2233
- });
2234
-
2235
2142
test ('checks for release branches' , () async {
2236
2143
const branch = 'flutter-1.24-candidate.1' ;
2237
2144
ciYamlFetcher.setCiYamlFrom (r'''
0 commit comments