Skip to content

Commit 793d575

Browse files
authored
Remove unused coverage feature (dart-lang#3444)
1 parent 19ad21a commit 793d575

File tree

9 files changed

+39
-267
lines changed

9 files changed

+39
-267
lines changed

.github/workflows/test.yaml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,8 @@ jobs:
7777
run: ./tool/ci.sh
7878
env:
7979
DARTDOC_BOT: ${{ matrix.job }}
80-
#COVERAGE_TOKEN: true # this needs to be set to enable coverage
8180
- name: ${{ matrix.job }}
8281
if: runner.os == 'Windows' && matrix.job == 'main'
8382
run: dart run grinder buildbot
8483
env:
8584
DARTDOC_BOT: ${{ matrix.job }}
86-
# - id: coverage
87-
# name: Upload coverage
88-
# if: runner.os == 'Linux' && matrix.job == 'main' && matrix.sdk == 'dev'
89-
# uses: coverallsapp/github-action@v1.1.2
90-
# with:
91-
# github-token: ${{ secrets.GITHUB_TOKEN }}
92-
# path-to-lcov: lcov.info
93-
# - name: Echo coveralls api result
94-
# if: runner.os == 'Linux' && matrix.job == 'main' && matrix.sdk == 'dev'
95-
# run: echo ${{ steps.coverage.outputs['coveralls-api-result'] }}

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Dart documentation generator
22

33
[![Build Status](https://github.com/dart-lang/dartdoc/workflows/Test/badge.svg)](https://github.com/dart-lang/dartdoc/actions?query=workflow%3ATest)
4-
[![Coverage Status](https://coveralls.io/repos/github/dart-lang/dartdoc/badge.svg?branch=main)](https://coveralls.io/github/dart-lang/dartdoc?branch=main)
54
[![OpenSSF
65
Scorecard](https://api.securityscorecards.dev/projects/github.com/dart-lang/dartdoc/badge)](https://deps.dev/project/github/dart-lang%2Fdartdoc)
76

lib/src/generator/templates.runtime_renderers.dart

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8574,19 +8574,6 @@ class _Renderer_Library extends RendererBase<Library> {
85748574
parent: r, getters: _invisibleGetters['Scope']!);
85758575
},
85768576
),
8577-
'sdkLib': Property(
8578-
getValue: (CT_ c) => c.sdkLib,
8579-
renderVariable: (CT_ c, Property<CT_> self,
8580-
List<String> remainingNames) =>
8581-
self.renderSimpleVariable(
8582-
c, remainingNames, 'SdkLibrary'),
8583-
isNullValue: (CT_ c) => c.sdkLib == null,
8584-
renderValue: (CT_ c, RendererBase<CT_> r,
8585-
List<MustachioNode> ast, StringSink sink) {
8586-
renderSimple(c.sdkLib, ast, r.template, sink,
8587-
parent: r, getters: _invisibleGetters['SdkLibrary']!);
8588-
},
8589-
),
85908577
'sidebarPath': Property(
85918578
getValue: (CT_ c) => c.sidebarPath,
85928579
renderVariable:
@@ -12565,7 +12552,7 @@ class _Renderer_Package extends RendererBase<Package> {
1256512552
}
1256612553
}
1256712554

12568-
String renderIndex(PackageTemplateData context, Template template) {
12555+
String renderSearchPage(PackageTemplateData context, Template template) {
1256912556
var buffer = StringBuffer();
1257012557
_render_PackageTemplateData(context, template.ast, template, buffer);
1257112558
return buffer.toString();
@@ -12853,7 +12840,7 @@ String renderError(PackageTemplateData context, Template template) {
1285312840
return buffer.toString();
1285412841
}
1285512842

12856-
String renderSearchPage(PackageTemplateData context, Template template) {
12843+
String renderIndex(PackageTemplateData context, Template template) {
1285712844
var buffer = StringBuffer();
1285812845
_render_PackageTemplateData(context, template.ast, template, buffer);
1285912846
return buffer.toString();
@@ -17136,19 +17123,6 @@ const _invisibleGetters = {
1713617123
'variable'
1713717124
},
1713817125
'Scope': {'hashCode', 'runtimeType'},
17139-
'SdkLibrary': {
17140-
'category',
17141-
'hashCode',
17142-
'isDart2JsLibrary',
17143-
'isDocumented',
17144-
'isImplementation',
17145-
'isInternal',
17146-
'isShared',
17147-
'isVmLibrary',
17148-
'path',
17149-
'runtimeType',
17150-
'shortName'
17151-
},
1715217126
'Set': {
1715317127
'first',
1715417128
'hashCode',

lib/src/model/library.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,9 +268,6 @@ class Library extends ModelElement
268268
SdkLibrary? get _sdkLib =>
269269
packageGraph.sdkLibrarySources[element.librarySource];
270270

271-
@Deprecated('Will be removed soon')
272-
SdkLibrary? get sdkLib => _sdkLib;
273-
274271
@override
275272
bool get isPublic {
276273
if (!super.isPublic) return false;

lib/src/model/package_graph.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -624,9 +624,6 @@ class PackageGraph with CommentReferable, Nameable, ModelBuilder {
624624

625625
final Map<Element?, Library?> _canonicalLibraryFor = {};
626626

627-
@Deprecated('Not public API; will be removed')
628-
Library? findCanonicalLibraryFor(Element e) => _findCanonicalLibraryFor(e);
629-
630627
/// Tries to find a top level library that references this element.
631628
Library? _findCanonicalLibraryFor(Element e) {
632629
assert(allLibrariesAdded);

pubspec.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ dev_dependencies:
3131
build_test: ^2.1.7
3232
build_version: ^2.1.1
3333
code_builder: ^4.4.0
34-
coverage: ^1.6.3
3534
dart_style: ^2.3.1
3635
grinder: ^0.9.4
3736
http: ">=0.13.6 <2.0.0"

tool/ci.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
set -ex
99

1010
DART_VERSION=`dart --version 2>&1 | awk '{print $4}'`
11-
# Do not run coverage on non-dev builds or non-Linux platforms.
12-
if ! echo "${DART_VERSION}" | grep -q dev || ! uname | grep -q Linux ; then
13-
unset COVERAGE_TOKEN
14-
fi
1511

1612
if [ "$DARTDOC_BOT" = "sdk-docs" ]; then
1713
# Build the SDK docs
@@ -31,7 +27,6 @@ elif [ "$DARTDOC_BOT" = "packages" ]; then
3127
PACKAGE_NAME=flutter_plugin_tools PACKAGE_VERSION=">=0.0.14+1" dart run grinder build-pub-package 2>&1 | grep "warning: package:flutter_plugin_tools has no documentable libraries"
3228
elif [ "$DARTDOC_BOT" = "sdk-analyzer" ]; then
3329
echo "Running all tests against the SDK analyzer"
34-
unset COVERAGE_TOKEN
3530
dart run grinder test-with-analyzer-sdk
3631
else
3732
echo "Running main dartdoc bot"

tool/grind.dart

Lines changed: 22 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -214,33 +214,21 @@ void analyzeTestPackages() async {
214214
void checkFormat() async {
215215
if (Platform.version.contains('dev')) {
216216
var filesToFix = <String>[];
217-
// Filter out test packages as they always have strange formatting.
218-
// Passing parameters to dart format for directories to search results in
219-
// filenames being stripped of the dirname so we have to filter here.
220-
void addFileToFix(String line) {
221-
if (!line.startsWith('Changed ')) return;
222-
var fileName = line.substring(8);
223-
var pathComponents = p.split(fileName);
224-
if (pathComponents.isNotEmpty && pathComponents.first == 'testing') {
225-
return;
226-
}
227-
filesToFix.add(fileName);
228-
}
229217

230218
log('Validating dart format with version ${Platform.version}');
231219
await SubprocessLauncher('dart format').runStreamed(
232-
Platform.resolvedExecutable,
233-
[
234-
'format',
235-
'-o',
236-
'none',
237-
'bin',
238-
'lib',
239-
'test',
240-
'tool',
241-
'web',
242-
],
243-
perLine: addFileToFix);
220+
Platform.resolvedExecutable,
221+
[
222+
'format',
223+
'-o',
224+
'none',
225+
'bin',
226+
'lib',
227+
'test',
228+
'tool',
229+
'web',
230+
],
231+
);
244232
if (filesToFix.isNotEmpty) {
245233
fail(
246234
'dart format found files needing reformatting. Use this command to reformat:\n'
@@ -257,16 +245,16 @@ void checkFormat() async {
257245
checkFormat,
258246
checkBuild,
259247
tryPublish,
260-
smokeTest,
248+
test,
261249
)
262250
void presubmit() {}
263251

264-
@Task('Run long tests, self-test dartdoc, and run the publish test')
265-
@Depends(presubmit, longTest, testDartdoc)
252+
@Task('Run tests, self-test dartdoc, and run the publish test')
253+
@Depends(presubmit, test, testDartdoc)
266254
void buildbot() {}
267255

268256
@Task('Run buildbot tests, but without publish test')
269-
@Depends(analyze, checkFormat, checkBuild, smokeTest, longTest, testDartdoc)
257+
@Depends(analyze, checkFormat, checkBuild, test, testDartdoc)
270258
void buildbotNoPublish() {}
271259

272260
@Task('Generate docs for the Dart SDK')
@@ -895,7 +883,7 @@ Future<Iterable<Map<String, Object?>>> _buildFlutterDocs(
895883
flutterRepo.cacheDart,
896884
['pub', 'global', 'deactivate', 'snippets'],
897885
);
898-
} on SubProcessException {
886+
} on SubprocessException {
899887
// Ignore failure to deactivate so this works on completely clean bots.
900888
}
901889
await flutterRepo.launcher.runStreamed(
@@ -1068,7 +1056,6 @@ final _generatedFilesList = <String>[
10681056
].map((s) => p.joinAll(p.posix.split(s)));
10691057

10701058
@Task('Verify generated files are up to date')
1071-
@Depends(clean)
10721059
Future<void> checkBuild() async {
10731060
var originalFileContents = <String, String>{};
10741061
var differentFiles = <String>[];
@@ -1123,24 +1110,10 @@ Future<void> tryPublish() async {
11231110
.runStreamed(Platform.resolvedExecutable, ['pub', 'publish', '-n']);
11241111
}
11251112

1126-
@Task('Run a smoke test, only')
1127-
@Depends(clean)
1128-
Future<void> smokeTest() async {
1129-
await testDart(smokeTestFiles);
1130-
await testFutures.tasksComplete;
1131-
}
1132-
1133-
@Task('Run non-smoke tests, only')
1134-
@Depends(clean)
1135-
Future<void> longTest() async {
1136-
await testDart(testFiles);
1137-
await testFutures.tasksComplete;
1138-
}
1139-
11401113
@Task('Run all the tests.')
1141-
@Depends(clean)
1114+
@Depends(analyzeTestPackages)
11421115
Future<void> test() async {
1143-
await testDart(smokeTestFiles.followedBy(testFiles));
1116+
await testDart(testFiles);
11441117
await testFutures.tasksComplete;
11451118
}
11461119

@@ -1169,32 +1142,19 @@ Iterable<Directory> get buildCacheDirectories => Directory('.dart_tool')
11691142
.whereType<Directory>()
11701143
.where((e) => ['build', 'build_resolvers'].contains(p.basename(e.path)));
11711144

1172-
List<File> get smokeTestFiles => Directory('test')
1173-
.listSync(recursive: true)
1174-
.whereType<File>()
1175-
.where((e) => p.basename(e.path) == 'model_test.dart')
1176-
.toList(growable: false);
1177-
11781145
List<File> get testFiles => Directory('test')
11791146
.listSync(recursive: true)
11801147
.whereType<File>()
11811148
.where((e) => e.path.endsWith('test.dart'))
1182-
.where((e) => p.basename(e.path) != 'model_test.dart')
11831149
.toList(growable: false);
11841150

11851151
Future<void> testDart(Iterable<File> tests) async {
1186-
var parameters = <String>['--enable-asserts'];
1187-
11881152
for (var dartFile in tests) {
11891153
await testFutures.add(() =>
1190-
CoverageSubprocessLauncher('dart-${p.basename(dartFile.path)}')
1191-
.runStreamed(Platform.resolvedExecutable,
1192-
<String>[...parameters, dartFile.path]));
1154+
SubprocessLauncher('dart-${p.basename(dartFile.path)}').runStreamed(
1155+
Platform.resolvedExecutable,
1156+
<String>['--enable-asserts', dartFile.path]));
11931157
}
1194-
1195-
return CoverageSubprocessLauncher.generateCoverageToFile(
1196-
PhysicalResourceProvider.INSTANCE.getFile(p.canonicalize('lcov.info')),
1197-
PhysicalResourceProvider.INSTANCE);
11981158
}
11991159

12001160
@Task('Generate docs for dartdoc without link-to-remote')

0 commit comments

Comments
 (0)