Skip to content
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

Add a workaround for long tests crashing Android instrumentation #1753

Merged
merged 8 commits into from
Sep 30, 2023

Conversation

bartekpacia
Copy link
Contributor

This PR is aimed at #1725.

See also the previous (wrong) attempt: #1732

Minimize the number of places that try to access the current test name using the
Invoker API.
@github-actions github-actions bot added the package: patrol Related to the patrol package (native automation, test bundling) label Sep 29, 2023
@bartekpacia bartekpacia marked this pull request as ready for review September 29, 2023 22:24
@bartekpacia
Copy link
Contributor Author

bartekpacia commented Sep 29, 2023

Sample test that will still be failing
test('smoke test 4 (long group and test names)', () {
  // given
  final topLevelGroup = Group.root([
    LocalTest('patrol_test_explorer', Metadata.empty, () {}),
    Group(
      'example_test',
      [
        Group(
          'example_test myGroupWithLongName',
          [
            _localTest('example_test myGroupWithLongName alpha'),
          ],
        ),
      ],
    ),
  ]);

  // when
  final dartTestGroup = createDartTestGroup(
    topLevelGroup,
    maxTestCaseLength: 20,
  );

  // then
  expect(
    dartTestGroup,
    equals(
      DartGroupEntry(
        name: '',
        type: GroupEntryType.group,
        entries: [
          DartGroupEntry(
            name: 'example_test',
            type: GroupEntryType.group,
            entries: [
              DartGroupEntry(
                name: 'myGroup',
                type: GroupEntryType.group,
                entries: [
                  _testEntry(' '),
                ],
              ),
            ],
          ),
        ],
      ),
    ),
  );
});

@bartekpacia bartekpacia merged commit 08e7d37 into develop Sep 30, 2023
@bartekpacia bartekpacia deleted the fix/long_test_names branch September 30, 2023 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: patrol Related to the patrol package (native automation, test bundling)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant