Error DartTestGroup isn't a type while running patrol test

149 Views Asked by At

While executing patrol test on iOS simulator. Getting the below error:

error: integration_test/test_bundle.dart:8:8: Error: Error when reading '../../.pub-cache/git/patrol-4211399e946fa2268527db8b02baeb7959457f25/packages/patrol/lib/src/native/contracts/contracts.pbgrpc.dart': No such file or directory
        import 'package:patrol/src/native/contracts/contracts.pbgrpc.dart';
               ^
        integration_test/test_bundle.dart:51:46: Error: 'DartTestGroup' isn't a type.
          final testExplorationCompleter = Completer<DartTestGroup>();
                                                     ^^^^^^^^^^^^^
Target kernel_snapshot failed: Exception
Failed to package /Users/himakondubhotla/StudioProjects/flutter_pca.
note: Building targets in dependency order

I have followed the steps provided in the below link for the steps and configured in the same way.

https://patrol.leancode.co/getting-started

Pubspec.yaml configuration:
dev_dependencies:
  integration_test:
    sdk: flutter
  flutter_test:
    sdk: flutter
  leancode_lint: ^3.0.0  
  patrol:
    git:
      url: https://github.com/leancodepl/patrol.git
      path: packages/patrol
      ref: develop
patrol:
  app_name: app name
  android:
    package_name: com.package.name
  ios:
    bundle_id: com.package.name
1

There are 1 best solutions below

0
On

The latest changes in Patrol v2.3.0 have renamed some of these classes.

You need to rebuild your generated classes after upgrading, e.g. just run patrol test again.

For info, some classes changed, e.g. DartTestGroup is now DartGroupEntry.

You can glean the changes from this file packages/patrol_cli/lib/src/test_bundler.dart when viewing the changeset for v2.3.0