Skip to content

Change to using gradle for test and verify #8407

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 1 commit into from
Aug 6, 2025
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
12 changes: 1 addition & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ name and contact info to the [AUTHORS](AUTHORS) file.
- `cd path/to/flutter-intellij`
- `dart pub get`
- `(cd tool/plugin; dart pub get)`
- `bin/plugin test`
- `./gradlew test`
- Note: If there are Dart errors during build originating in the `tool/plugin` directory, try deleting the contents of the `pubspec.lock` file and re-running the pub get steps. This will allow you to get a fresh set of pub packages.

### Configure "Project Structure" settings
Expand Down Expand Up @@ -301,23 +301,13 @@ The plugin tool (below) can be a more reliable way to run tests.

To run unit tests on the command line:

```
bin/plugin test
```

See `TestCommand` in `tool/plugin/lib/plugin.dart` for more options.

It is also possible to run tests directly with Gradle, which would allow passing more command-line arguments:

```
./gradlew test
```

If you wanted to run a subset of the tests, you could do so this way.
See the [Gradle docs](https://docs.gradle.org/current/userguide/java_testing.html)
for more info about testing.
*However*, you must have run the tests once using the plugin tool,
to ensure all the dependencies have been configured.

## Adding platform sources

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ private static boolean getFirstAsBoolean(@NotNull Pair<String, VirtualFile> pair
}

// TODO(jwren) Add this support back into the plugin or delete the code
// Method is current dead when uncommented, commented out for the `./bin/plugin verify` command
// Method is currently dead when uncommented, commented out for the `./gradlew verify*` commands
//@NotNull
//public static Notification showDexOptionNotification(@NotNull Module module, @NotNull String propertyName) {
// Project project = module.getProject();
Expand Down
7 changes: 5 additions & 2 deletions tool/github.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,14 @@ elif [ "CHECK_BOT" = "$BOT" ] ; then

elif [ "UNIT_TEST_BOT" = "$BOT" ] ; then
# Run unit tests.
./bin/plugin test --no-setup
./gradlew test

elif [ "VERIFY_BOT" = "$BOT" ] ; then
# Run the verifier for this version
./bin/plugin verify
./gradlew verifyPluginProjectConfiguration
./gradlew verifyPluginStructure
./gradlew verifyPluginSignature
./gradlew verifyPlugin

else
# Run the build.
Expand Down
2 changes: 1 addition & 1 deletion tool/kokoro/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ setup
(cd testData/sample_tests; echo "dart pub get `pwd`"; dart pub get --no-precompile)

echo "kokoro test start"
./bin/plugin test
./gradlew test

echo "kokoro test finished"
2 changes: 0 additions & 2 deletions tool/plugin/lib/plugin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import 'globals.dart';
import 'lint.dart';
import 'runner.dart';
import 'util.dart';
import 'verify.dart';

Future<int> main(List<String> args) async {
var runner = BuildCommandRunner();
Expand All @@ -26,7 +25,6 @@ Future<int> main(List<String> args) async {
runner.addCommand(TestCommand(runner));
runner.addCommand(DeployCommand(runner));
runner.addCommand(GenerateCommand(runner));
runner.addCommand(VerifyCommand(runner));
runner.addCommand(RunIdeCommand(runner));

try {
Expand Down
100 changes: 0 additions & 100 deletions tool/plugin/lib/verify.dart

This file was deleted.

32 changes: 0 additions & 32 deletions tool/plugin/test/plugin_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import 'dart:io';

import 'package:plugin_tool/plugin.dart';
import 'package:plugin_tool/runner.dart';
import 'package:plugin_tool/verify.dart';
import 'package:string_validator/string_validator.dart' as validator;
import 'package:test/test.dart';

Expand All @@ -27,10 +26,6 @@ void main() {
test('generate', () {
expect(GenerateCommand(BuildCommandRunner()).name, "generate");
});

test('verify', () {
expect(VerifyCommand(BuildCommandRunner()).name, "verify");
});
});

group("spec", () {
Expand Down Expand Up @@ -92,13 +87,6 @@ void main() {
buildSpecAssertions(runner, "deploy");
});
});

test('verify', () async {
var runner = makeTestRunner();
await runner.run(["-r19", "-d../..", "verify"]).whenComplete(() {
buildSpecAssertions(runner, "verify");
});
});
});

group('release', () {
Expand Down Expand Up @@ -173,15 +161,6 @@ void main() {
});
});

group('verify', () {
test('only-version', () async {
ProductCommand command =
makeTestRunner().commands['verify'] as ProductCommand;
var results = command.argParser.parse(['--only-version=2023.1']);
expect(results['only-version'], '2023.1');
});
});

group('ProductCommand', () {
test('parses release', () async {
var runner = makeTestRunner();
Expand Down Expand Up @@ -233,7 +212,6 @@ BuildCommandRunner makeTestRunner() {
runner.addCommand(TestTestCommand(runner));
runner.addCommand(TestDeployCommand(runner));
runner.addCommand(TestGenCommand(runner));
runner.addCommand(TestVerifyCommand(runner));
return runner;
}

Expand Down Expand Up @@ -295,13 +273,3 @@ class TestTestCommand extends TestCommand {
@override
Future<int> doit() async => Future(() => 0);
}

class TestVerifyCommand extends VerifyCommand {
TestVerifyCommand(super.runner);

@override
bool get isTesting => true;

@override
Future<int> doit() async => Future(() => 0);
}