Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
- master

# Declare default permissions as read only.
permissions: read-all

Check warning on line 14 in .github/workflows/build.yaml

View workflow job for this annotation

GitHub Actions / zizmor-output

excessive-permissions

build.yaml:14: overly broad permissions: uses read-all permissions

defaults:
run:
Expand Down Expand Up @@ -74,7 +74,7 @@
wget -qO- https://dcm.dev/pgp-key.public | sudo gpg --dearmor -o /usr/share/keyrings/dcm.gpg
echo 'deb [signed-by=/usr/share/keyrings/dcm.gpg arch=amd64] https://dcm.dev/debian stable main' | sudo tee /etc/apt/sources.list.d/dart_stable.list
sudo apt-get update
sudo apt-get install dcm=1.38.1-1 # To avoid errors add `-1` (build number) to the version
sudo apt-get install dcm=1.38.3-1 # To avoid errors add `-1` (build number) to the version
sudo chmod +x /usr/bin/dcm
echo "$(dcm --version)"
- name: Setup Dart SDK
Expand Down Expand Up @@ -190,7 +190,7 @@
run: ./tool/ci/bots.sh

- name: Upload Golden Failure Artifacts
uses: actions/upload-artifact@v7

Check failure on line 193 in .github/workflows/build.yaml

View workflow job for this annotation

GitHub Actions / zizmor-output

zizmor/unpinned-uses

unpinned action reference: action is not pinned to a hash (required by blanket policy)

Check failure on line 193 in .github/workflows/build.yaml

View workflow job for this annotation

GitHub Actions / zizmor-output

unpinned-uses

build.yaml:193: unpinned action reference: action is not pinned to a hash (required by blanket policy)
if: failure()
with:
name: golden_image_failures.${{ matrix.bot }}
Expand Down Expand Up @@ -263,7 +263,7 @@
run: ./tool/ci/bots.sh

- name: Upload Golden Failure Artifacts
uses: actions/upload-artifact@v7

Check failure on line 266 in .github/workflows/build.yaml

View workflow job for this annotation

GitHub Actions / zizmor-output

zizmor/unpinned-uses

unpinned action reference: action is not pinned to a hash (required by blanket policy)

Check failure on line 266 in .github/workflows/build.yaml

View workflow job for this annotation

GitHub Actions / zizmor-output

unpinned-uses

build.yaml:266: unpinned action reference: action is not pinned to a hash (required by blanket policy)
if: failure()
with:
name: golden_image_failures.${{ matrix.bot }}
Expand Down
3 changes: 2 additions & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ dart_code_metrics:
# Investigate internal usages of inspector_controller before removing.
- lib/src/screens/inspector/**_controller.dart
- lib/src/shared/**
- test/**
# This fixture has unused code for testing the debugger.
- test/test_infra/fixtures/flutter_app/**
rules:
# - arguments-ordering Too strict
# - avoid-banned-imports # TODO(polina-c): add configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,10 @@ class PerformanceController extends DevToolsScreenController
@override
final screenId = ScreenMetaData.performance.id;

// ignore: dispose-class-fields, false positive. See `applyToFeatureControllers` in the dispose() method.
late final FlutterFramesController flutterFramesController;

// ignore: dispose-class-fields, false positive. See `applyToFeatureControllers` in the dispose() method.
late final TimelineEventsController timelineEventsController;

// ignore: dispose-class-fields, false positive. See `applyToFeatureControllers` in the dispose() method.
late final RebuildStatsController rebuildStatsController;

// ignore: dispose-class-fields, false positive. See `applyToFeatureControllers` in the dispose() method.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void main() {
final score = await benchmark.measure();
expect(
score,
lessThan(110000),
lessThan(120000),
reason: 'Exceeded benchmark for run $i: $score',
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,39 @@ import '../../test_infra/matchers/matchers.dart';
// reduced to under 1 second without introducing flakes.
const inspectorChangeSettleTime = Duration(seconds: 2);

void _copyDirectorySync(Directory source, Directory destination) {
if (!destination.existsSync()) {
destination.createSync(recursive: true);
}
for (final entity in source.listSync(recursive: false)) {
final newPath = p.join(destination.path, p.basename(entity.path));
if (entity is Directory) {
_copyDirectorySync(entity, Directory(newPath));
} else if (entity is File) {
entity.copySync(newPath);
}
}
}

void main() {
// We need to use real async in this test so we need to use this binding.
initializeLiveTestWidgetsFlutterBindingWithAssets();
const windowSize = Size(2600.0, 1200.0);

// We copy the fixture app to a temporary directory because the
// auto-refresh tests modify lib/main.dart in-place. If this used the shared
// 'inspector_app' fixture, it could cause flaky test failures in other tests
// (like inspector_service_test.dart) that run in parallel.
final tempAppDir =
'test/test_infra/fixtures/inspector_app_temp_${DateTime.now().millisecondsSinceEpoch}';
_copyDirectorySync(
Directory('test/test_infra/fixtures/inspector_app'),
Directory(tempAppDir),
);

final env = FlutterTestEnvironment(
const FlutterRunConfiguration(withDebugger: true),
testAppDirectory: 'test/test_infra/fixtures/inspector_app',
testAppDirectory: tempAppDir,
);

env.afterEverySetup = () async {
Expand Down Expand Up @@ -67,6 +92,10 @@ void main() {

tearDownAll(() {
env.finalTeardown();
final dir = Directory(tempAppDir);
if (dir.existsSync()) {
dir.deleteSync(recursive: true);
}
});

group('screenshot tests', () {
Expand Down Expand Up @@ -653,17 +682,6 @@ void verifyPropertyIsVisible({
expect(propertyNameCenter.dy, equals(propertyValueCenter.dy));
}

bool areHorizontallyAligned(
Finder widgetAFinder,
Finder widgetBFinder, {
required WidgetTester tester,
}) {
final widgetACenter = tester.getCenter(widgetAFinder);
final widgetBCenter = tester.getCenter(widgetBFinder);

return widgetACenter.dy == widgetBCenter.dy;
}

bool _treeRowsAreInOrder({
required List<String> treeRowDescriptions,
required int startingAtIndex,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,26 @@ class CustomContainer extends StatelessWidget {
}
}

class CustomCenter extends Align {
const CustomCenter(
{super.key, super.widthFactor, super.heightFactor, super.child});
class CustomCenter extends StatelessWidget {
const CustomCenter({
super.key,
this.widthFactor,
this.heightFactor,
this.child,
});

final double? widthFactor;
final double? heightFactor;
final Widget? child;

@override
Widget build(BuildContext context) {
return Align(
widthFactor: widthFactor,
heightFactor: heightFactor,
child: child,
);
}
}

class CustomText extends StatelessWidget {
Expand Down

This file was deleted.

38 changes: 0 additions & 38 deletions packages/devtools_app/test/test_infra/fixtures/logging_app.dart

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,6 @@ class _HttpClient {

final _dio = Dio();

void close() {
_client.close(force: true);
_dio.close(force: true);
}

void get() async {
print('Sending GET...');
final request = await _client.getUrl(_uri);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,9 @@ abstract class FlutterTestDriver {
final errorBuffer = StringBuffer();
late String lastResponse;
late Uri _vmServiceWsUri;
bool hasExited = false;

VmServiceWrapper? vmService;

String get lastErrorInfo => errorBuffer.toString();

Stream<String> get stderr => stderrController.stream;
Stream<String> get stdout => stdoutController.stream;

Uri get vmServiceUri => _vmServiceWsUri;

String _debugPrint(String msg) {
const maxLength = 500;
final truncatedMsg = msg.length > maxLength
Expand Down Expand Up @@ -94,7 +86,6 @@ abstract class FlutterTestDriver {
unawaited(
proc.exitCode.then((int code) {
_debugPrint('Process exited ($code)');
hasExited = true;
}),
);
transformToLines(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,6 @@ class FlutterTestEnvironment {
/// test/my_test.dart`).
final String _flutterExe;

// This function will be called after we have ran the Flutter app and the
// vmService is opened.
Future<void> Function()? _afterNewSetup;
set afterNewSetup(Future<void> Function() f) => _afterNewSetup = f;

// This function will be called for every call to [setupEnvironment], even
// when the setup is not forced or triggered by a new FlutterRunConfiguration.
Future<void> Function()? _afterEverySetup;
Expand All @@ -89,12 +84,6 @@ class FlutterTestEnvironment {
set beforeEveryTearDown(Future<void> Function() f) =>
_beforeEveryTearDown = f;

// The function will be called before the final forced teardown at the end
// of the test suite (which will then stop the Flutter app).
Future<void> Function()? _beforeFinalTearDown;
set beforeFinalTearDown(Future<void> Function() f) =>
_beforeFinalTearDown = f;

bool _needsSetup = true;

Completer<bool>? _setupInProgress;
Expand Down Expand Up @@ -173,8 +162,6 @@ class FlutterTestEnvironment {
} finally {
_setupInProgress!.complete(!_needsSetup);
}

if (_afterNewSetup != null) await _afterNewSetup!();
}
if (_afterEverySetup != null) await _afterEverySetup!();
}
Expand All @@ -192,8 +179,6 @@ class FlutterTestEnvironment {
return;
}

if (_beforeFinalTearDown != null) await _beforeFinalTearDown!();

await serviceConnection.serviceManager.manuallyDisconnect();

await _service.allFuturesCompleted.timeout(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ CustomApp
└─Padding
└─Container
└─CustomCenter
└─CustomButton
└─GestureDetector
└─CustomContainer
└─Padding
└─Container
└─CustomText
└─Text
└─Align
└─CustomButton
└─GestureDetector
└─CustomContainer
└─Padding
└─Container
└─CustomText
└─Text
Loading
Loading