Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Run integration test once again on temporary failure #497

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
Dec 13, 2022
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
22 changes: 14 additions & 8 deletions tools/lib/src/device.dart
Original file line number Diff line number Diff line change
Expand Up @@ -127,16 +127,23 @@ class Device {
/// nor [PackageResult.exclude].
Future<PackageResult> runIntegrationTest(
Directory workingDir,
Duration timeout,
) async {
Duration timeout, {
bool debug = false,
}) async {
if (!isConnected) {
return PackageResult.fail(
<String>['Device $name ($profile) is not connected.']);
}

final io.Process process = await _processRunner.start(
'flutter-tizen',
<String>['-d', serial!, 'test', 'integration_test'],
<String>[
if (debug) '-v',
Copy link
Member Author

Choose a reason for hiding this comment

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

Temporarily added for debugging purpose. May be removed in the future.

'-d',
serial!,
'test',
'integration_test',
],
workingDirectory: workingDir,
);

Expand Down Expand Up @@ -393,11 +400,11 @@ class EmulatorDevice extends Device {
@override
Future<PackageResult> runIntegrationTest(
Directory workingDir,
Duration timeout,
) async {
Duration timeout, {
bool debug = false,
}) async {
bool autoLaunched = false;
bool autoCreated = false;
late final PackageResult result;
try {
if (!exists) {
autoCreated = true;
Expand All @@ -408,7 +415,7 @@ class EmulatorDevice extends Device {
await launch();
}
_disablePermissionPopups();
result = await super.runIntegrationTest(workingDir, timeout);
return await super.runIntegrationTest(workingDir, timeout, debug: debug);
} finally {
if (autoLaunched) {
await close();
Expand All @@ -417,6 +424,5 @@ class EmulatorDevice extends Device {
await delete();
}
}
return result;
}
}
11 changes: 7 additions & 4 deletions tools/lib/src/integration_test_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,13 @@ class IntegrationTestCommand extends PackageLoopingCommand {
}

for (final Device device in devices) {
final PackageResult packageResult = await device.runIntegrationTest(
example.directory,
_timeout,
);
PackageResult packageResult =
await device.runIntegrationTest(example.directory, _timeout);
if (packageResult.state == RunState.failed) {
// Tests may fail unexpectedly on a self-hosted runner. Try again.
packageResult = await device
.runIntegrationTest(example.directory, _timeout, debug: true);
}
if (packageResult.state == RunState.failed) {
errors.addAll(packageResult.details);
}
Expand Down