Skip to content

Fix the analyzer-from-sdk test to work on stable #2361

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 25, 2020
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 0 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ matrix:
# it is unlikely to work and produces uninteresting
# results.
dart: stable
allow_failures:
# Some packages at HEAD require 2.10.0-dev.
- env: DARTDOC_BOT=sdk-analyzer
dart: stable

env:
jobs:
Expand Down
13 changes: 10 additions & 3 deletions tool/grind.dart
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,9 @@ Future<String> createComparisonDartdoc() async {
/// to be a git repository), configured to use packages from the Dart SDK.
///
/// This copy of dartdoc depends on the HEAD versions of various packages
/// developed within the SDK, such as 'analyzer' and 'meta'.
Future<String> createSdkDartdoc() async {
/// developed within the SDK, such as 'analyzer' and '_fe_analyzer_shared'.
/// 'meta' is overridden if [overrideMeta] is true.
Future<String> createSdkDartdoc(bool overrideMeta) async {
var launcher = SubprocessLauncher('create-sdk-dartdoc');
var dartdocSdk = Directory.systemTemp.createTempSync('dartdoc-sdk');
await launcher
Expand Down Expand Up @@ -473,9 +474,13 @@ dependency_overrides:
path: '${sdkClone.path}/pkg/analyzer'
_fe_analyzer_shared:
path: '${sdkClone.path}/pkg/_fe_analyzer_shared'
''', mode: FileMode.append);
if (overrideMeta) {
dartdocPubspec.writeAsStringSync('''
meta:
path: '${sdkClone.path}/pkg/meta'
''', mode: FileMode.append);
}
await launcher.runStreamed(sdkBin('pub'), ['get'],
workingDirectory: dartdocSdk.path);
return dartdocSdk.path;
Expand All @@ -484,7 +489,9 @@ dependency_overrides:
@Task('Run grind tasks with the analyzer SDK.')
Future<void> testWithAnalyzerSdk() async {
var launcher = SubprocessLauncher('test-with-analyzer-sdk');
var sdkDartdoc = await createSdkDartdoc();
// Do not override meta on branches outside of stable.
var sdkDartdoc =
await createSdkDartdoc(RegExp('[.]\w+').hasMatch(Platform.version));
var defaultGrindParameter =
Platform.environment['DARTDOC_GRIND_STEP'] ?? 'test';
await launcher.runStreamed(
Expand Down