Skip to content

Commit bad0df2

Browse files
authored
Change to using gradle for test and verify (#8407)
Test is still being used for provision tool (which I'm not sure what this is about - #8401), so I kept the command code for now. Verify command code is being removed in this PR.
1 parent bb67f19 commit bad0df2

File tree

7 files changed

+8
-149
lines changed

7 files changed

+8
-149
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ name and contact info to the [AUTHORS](AUTHORS) file.
144144
- `cd path/to/flutter-intellij`
145145
- `dart pub get`
146146
- `(cd tool/plugin; dart pub get)`
147-
- `bin/plugin test`
147+
- `./gradlew test`
148148
- 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.
149149

150150
### Configure "Project Structure" settings
@@ -301,23 +301,13 @@ The plugin tool (below) can be a more reliable way to run tests.
301301
302302
To run unit tests on the command line:
303303
304-
```
305-
bin/plugin test
306-
```
307-
308-
See `TestCommand` in `tool/plugin/lib/plugin.dart` for more options.
309-
310-
It is also possible to run tests directly with Gradle, which would allow passing more command-line arguments:
311-
312304
```
313305
./gradlew test
314306
```
315307
316308
If you wanted to run a subset of the tests, you could do so this way.
317309
See the [Gradle docs](https://docs.gradle.org/current/userguide/java_testing.html)
318310
for more info about testing.
319-
*However*, you must have run the tests once using the plugin tool,
320-
to ensure all the dependencies have been configured.
321311
322312
## Adding platform sources
323313

src/org/jetbrains/android/facet/AndroidFrameworkDetector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ private static boolean getFirstAsBoolean(@NotNull Pair<String, VirtualFile> pair
4747
}
4848

4949
// TODO(jwren) Add this support back into the plugin or delete the code
50-
// Method is current dead when uncommented, commented out for the `./bin/plugin verify` command
50+
// Method is currently dead when uncommented, commented out for the `./gradlew verify*` commands
5151
//@NotNull
5252
//public static Notification showDexOptionNotification(@NotNull Module module, @NotNull String propertyName) {
5353
// Project project = module.getProject();

tool/github.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,14 @@ elif [ "CHECK_BOT" = "$BOT" ] ; then
6969

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

7474
elif [ "VERIFY_BOT" = "$BOT" ] ; then
7575
# Run the verifier for this version
76-
./bin/plugin verify
76+
./gradlew verifyPluginProjectConfiguration
77+
./gradlew verifyPluginStructure
78+
./gradlew verifyPluginSignature
79+
./gradlew verifyPlugin
7780

7881
else
7982
# Run the build.

tool/kokoro/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ setup
66
(cd testData/sample_tests; echo "dart pub get `pwd`"; dart pub get --no-precompile)
77

88
echo "kokoro test start"
9-
./bin/plugin test
9+
./gradlew test
1010

1111
echo "kokoro test finished"

tool/plugin/lib/plugin.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import 'globals.dart';
1616
import 'lint.dart';
1717
import 'runner.dart';
1818
import 'util.dart';
19-
import 'verify.dart';
2019

2120
Future<int> main(List<String> args) async {
2221
var runner = BuildCommandRunner();
@@ -26,7 +25,6 @@ Future<int> main(List<String> args) async {
2625
runner.addCommand(TestCommand(runner));
2726
runner.addCommand(DeployCommand(runner));
2827
runner.addCommand(GenerateCommand(runner));
29-
runner.addCommand(VerifyCommand(runner));
3028
runner.addCommand(RunIdeCommand(runner));
3129

3230
try {

tool/plugin/lib/verify.dart

Lines changed: 0 additions & 100 deletions
This file was deleted.

tool/plugin/test/plugin_test.dart

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import 'dart:io';
66

77
import 'package:plugin_tool/plugin.dart';
88
import 'package:plugin_tool/runner.dart';
9-
import 'package:plugin_tool/verify.dart';
109
import 'package:string_validator/string_validator.dart' as validator;
1110
import 'package:test/test.dart';
1211

@@ -27,10 +26,6 @@ void main() {
2726
test('generate', () {
2827
expect(GenerateCommand(BuildCommandRunner()).name, "generate");
2928
});
30-
31-
test('verify', () {
32-
expect(VerifyCommand(BuildCommandRunner()).name, "verify");
33-
});
3429
});
3530

3631
group("spec", () {
@@ -92,13 +87,6 @@ void main() {
9287
buildSpecAssertions(runner, "deploy");
9388
});
9489
});
95-
96-
test('verify', () async {
97-
var runner = makeTestRunner();
98-
await runner.run(["-r19", "-d../..", "verify"]).whenComplete(() {
99-
buildSpecAssertions(runner, "verify");
100-
});
101-
});
10290
});
10391

10492
group('release', () {
@@ -173,15 +161,6 @@ void main() {
173161
});
174162
});
175163

176-
group('verify', () {
177-
test('only-version', () async {
178-
ProductCommand command =
179-
makeTestRunner().commands['verify'] as ProductCommand;
180-
var results = command.argParser.parse(['--only-version=2023.1']);
181-
expect(results['only-version'], '2023.1');
182-
});
183-
});
184-
185164
group('ProductCommand', () {
186165
test('parses release', () async {
187166
var runner = makeTestRunner();
@@ -233,7 +212,6 @@ BuildCommandRunner makeTestRunner() {
233212
runner.addCommand(TestTestCommand(runner));
234213
runner.addCommand(TestDeployCommand(runner));
235214
runner.addCommand(TestGenCommand(runner));
236-
runner.addCommand(TestVerifyCommand(runner));
237215
return runner;
238216
}
239217

@@ -295,13 +273,3 @@ class TestTestCommand extends TestCommand {
295273
@override
296274
Future<int> doit() async => Future(() => 0);
297275
}
298-
299-
class TestVerifyCommand extends VerifyCommand {
300-
TestVerifyCommand(super.runner);
301-
302-
@override
303-
bool get isTesting => true;
304-
305-
@override
306-
Future<int> doit() async => Future(() => 0);
307-
}

0 commit comments

Comments
 (0)