Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

[tools] Add 'run_tests.sh' to the dev-only list #6474

Merged
merged 2 commits into from
Sep 23, 2022
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
3 changes: 2 additions & 1 deletion script/tool/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## NEXT
## 0.10.0+1

* Recognizes `run_test.sh` as a developer-only file in `version-check`.
* Adds `readme-check` validation that the example/README.md for a federated
plugin's implementation packages has a warning about the intended use of the
example instead of the template boilerplate.
Expand Down
3 changes: 3 additions & 0 deletions script/tool/lib/src/common/package_state_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ Future<bool> _isDevChange(List<String> pathComponents,
// The top-level "tool" directory is for non-client-facing utility
// code, such as test scripts.
pathComponents.first == 'tool' ||
// Entry point for the 'custom-test' command, which is only for CI and
// local testing.
pathComponents.first == 'run_tests.sh' ||
// Ignoring lints doesn't affect clients.
pathComponents.contains('lint-baseline.xml') ||
await _isGradleTestDependencyChange(pathComponents,
Expand Down
2 changes: 1 addition & 1 deletion script/tool/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: flutter_plugin_tools
description: Productivity utils for flutter/plugins and flutter/packages
repository: https://github.com/flutter/plugins/tree/main/script/tool
version: 0.10.0
version: 0.10.0+1

dependencies:
args: ^2.1.0
Expand Down
1 change: 1 addition & 0 deletions script/tool/test/common/package_state_utils_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ void main() {
'packages/a_plugin/example/ios/RunnerTests/Foo.m',
'packages/a_plugin/example/ios/RunnerUITests/info.plist',
'packages/a_plugin/tool/a_development_tool.dart',
'packages/a_plugin/run_tests.sh',
'packages/a_plugin/CHANGELOG.md',
];

Expand Down
32 changes: 32 additions & 0 deletions script/tool/test/version_check_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1059,6 +1059,38 @@ packages/plugin/android/build.gradle
]),
);
});

test('allows missing CHANGELOG and version change for dev-only changes',
() async {
final RepositoryPackage plugin =
createFakePlugin('plugin', packagesDir, version: '1.0.0');

const String changelog = '''
## 1.0.0
* Some changes.
''';
plugin.changelogFile.writeAsStringSync(changelog);
processRunner.mockProcessesForExecutable['git-show'] = <io.Process>[
MockProcess(stdout: 'version: 1.0.0'),
];
processRunner.mockProcessesForExecutable['git-diff'] = <io.Process>[
// File list.
MockProcess(stdout: '''
packages/plugin/tool/run_tests.dart
packages/plugin/run_tests.sh
'''),
];

final List<String> output =
await _runWithMissingChangeDetection(<String>[]);

expect(
output,
containsAllInOrder(<Matcher>[
contains('Running for plugin'),
]),
);
});
});

test('allows valid against pub', () async {
Expand Down