Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 2 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
7 changes: 6 additions & 1 deletion lib/web_ui/dev/felt.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,17 @@ void main(List<String> args) async {
} on ToolException catch (e) {
io.stderr.writeln(e.message);
exitCode = 1;
} on ProcessException catch (e) {
io.stderr.writeln('description: ${e.description}'
'executable: ${e.executable} ${e.arguments} '
'exit code: ${e.exitCode}');
exitCode = e.exitCode;
} catch (e) {
rethrow;
} finally {
await cleanup();
// The exit code is changed by one of the branches.
if(exitCode != -1) {
if (exitCode != -1) {
io.exit(exitCode);
}
}
Expand Down
27 changes: 27 additions & 0 deletions lib/web_ui/dev/macos_info.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:convert';

import 'utils.dart';

class MacOSInfo {
Future<void> collectInformation() async {
final String systemProfileJson = await evalProcess(
'system_profiler', ['SPApplicationsDataType', '-json']);

final Map<String, dynamic> json =
jsonDecode(systemProfileJson) as Map<String, dynamic>;
final List<dynamic> systemProfile = json.values.first as List<dynamic>;
for (int i = 0; i < systemProfile.length; i++) {
final Map<String, dynamic> application =
systemProfile[i] as Map<String, dynamic>;
final String applicationName = application['_name'] as String;
if (applicationName.contains('Safari')) {
print('application: $applicationName '
'fullInfo: ${application.toString()}');
print('version: ${application['version']}');
}
}
}
}
8 changes: 8 additions & 0 deletions lib/web_ui/dev/test_runner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import 'package:simulators/simulator_manager.dart';
import 'environment.dart';
import 'exceptions.dart';
import 'integration_tests_manager.dart';
import 'macos_info.dart';
import 'safari_installation.dart';
import 'supported_browsers.dart';
import 'test_platform.dart';
Expand Down Expand Up @@ -124,6 +125,13 @@ class TestCommand extends Command<bool> with ArgUtils {
// Check the flags to see what type of integration tests are requested.
testTypesRequested = findTestType();

if (isSafariOnMacOS) {
/// Collect information on the bot.
final MacOSInfo macOsInfo = new MacOSInfo();
await macOsInfo.collectInformation();
return true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't tell if this is intentional or a remnant from debugging.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is intentional. Safari tests are still failing on some method version combinations. I'm adding this code to collect information on the bots. The return with true without running the tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added isLUCI check, so we can still use felt test --browser=safari locally :)

}

switch (testTypesRequested) {
case TestTypesRequested.unit:
return runUnitTests();
Expand Down