Skip to content

Commit 9c8197d

Browse files
authored
Remove the test: all feature. (#4722)
Closes flutter/flutter#169374.
1 parent 2d8094c commit 9c8197d

File tree

2 files changed

+0
-136
lines changed

2 files changed

+0
-136
lines changed

app_dart/lib/src/service/scheduler.dart

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -892,26 +892,6 @@ $s
892892
)
893893
.toList();
894894

895-
// See https://github.com/flutter/flutter/issues/138430.
896-
final includePostsubmitAsPresubmit = _includePostsubmitAsPresubmit(
897-
inner,
898-
pullRequest,
899-
);
900-
if (includePostsubmitAsPresubmit) {
901-
log.info(
902-
'Including postsubmit targets as presubmit for ${pullRequest.number}',
903-
);
904-
905-
for (var target in inner.postsubmitTargets) {
906-
// We don't want to include a presubmit twice
907-
// We don't want to run the builder_cache target as a presubmit
908-
if (!target.presubmit &&
909-
!target.getProperties().containsKey('cache_name')) {
910-
presubmitTargets.add(target);
911-
}
912-
}
913-
}
914-
915895
log.info('Collected ${presubmitTargets.length} presubmit targets.');
916896
// Release branches should run every test.
917897
if (pullRequest.base!.ref !=
@@ -921,12 +901,6 @@ $s
921901
);
922902
return presubmitTargets;
923903
}
924-
if (includePostsubmitAsPresubmit) {
925-
log.info(
926-
'Postsubmit targets included as presubmit, scheduling all targets for ${pullRequest.number}',
927-
);
928-
return presubmitTargets;
929-
}
930904

931905
// Filter builders based on the PR diff
932906
final filesChanged = await _getFilesChanged.get(
@@ -936,23 +910,6 @@ $s
936910
return getTargetsToRun(presubmitTargets, filesChanged);
937911
}
938912

939-
static final _allowTestAll = {Config.flutterSlug};
940-
941-
/// Returns `true` if [ciYaml.postsubmitTargets] should be ran during presubmit.
942-
static bool _includePostsubmitAsPresubmit(
943-
CiYaml ciYaml,
944-
PullRequest pullRequest,
945-
) {
946-
if (!_allowTestAll.contains(ciYaml.slug)) {
947-
return false;
948-
}
949-
if (pullRequest.labels?.any((label) => label.name.contains('test: all')) ??
950-
false) {
951-
return true;
952-
}
953-
return false;
954-
}
955-
956913
/// Process a completed GitHub `check_run`.
957914
///
958915
/// Handles both fusion engine build and test stages, and both pull requests

app_dart/test/service/scheduler_test.dart

Lines changed: 0 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -2139,99 +2139,6 @@ targets:
21392139
);
21402140
});
21412141

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-
22352142
test('checks for release branches', () async {
22362143
const branch = 'flutter-1.24-candidate.1';
22372144
ciYamlFetcher.setCiYamlFrom(r'''

0 commit comments

Comments
 (0)