Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@chinmaygarde
Copy link
Contributor

This fixes numerous issues in the way in which fixtures were managed
in the engine unit-tests.

  • Instead of only being able to specify Dart fixtures, unit-tests may specify
    non-Dart fixtures as well. These are simply copied over to the fixtures
    directory known to the unit-test at runtime.
  • An issue where numerous Dart files could be given to the kernel snapshotter
    has been addressed. It was anticipated that such a (legal) invocation to the
    kernel snapshotter would produce a snapshot with the contents of all the Dart
    files added to the root library. This is incorrect and the behavior in this
    case is undefined.
  • Dart files referenced by the main Dart file are correctly tracked via a
    depfile.
  • The snapshotter arguments have been cleaned up to get rid of unused
    arguments (—strong) and the use of the VM product mode argument has been
    corrected to no longer depend on the Flutter product mode.

This fixes numerous issues in the way in which fixtures were managed
in the engine unit-tests.

* Instead of only being able to specify Dart fixtures, unit-tests may specify
  non-Dart fixtures as well. These are simply copied over to the fixtures
  directory known to the unit-test at runtime.
* An issue where numerous Dart files could be given to the kernel snapshotter
  has been addressed. It was anticipated that such a (legal) invocation to the
  kernel snapshotter would produce a snapshot with the contents of all the Dart
  files added to the root library. This is incorrect and the behavior in this
  case is undefined.
* Dart files referenced by the main Dart file are correctly tracked via a
  depfile.
* The snapshotter arguments have been cleaned up to get rid of unused
  arguments (`—strong`) and  the use of the VM product mode argument has been
  corrected to no longer depend on the Flutter product mode.
@chinmaygarde
Copy link
Contributor Author

cc @rmacnak-google who helped audit the snapshotter arguments.

Copy link
Member

@cbracken cbracken left a comment

Choose a reason for hiding this comment

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

LGTM stamp from a Japanese personal seal

#
# Arguments:
#
# fixtures (required): The list of test fixtures. An empty list may be
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder why we must provide an empty list []? For example, is

test_fixtures("runtime_fixtures") {
  dart_main = "fixtures/runtime_test.dart"
   fixtures = []
}

a little unnecessarily verbose and confusing than

test_fixtures("runtime_fixtures") {
  dart_main = "fixtures/runtime_test.dart"
}

?

If there's a nice reason to put an empty list here, maybe it's worth to write down that reason in this documentation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reason for the empty list is a GN quirk where if the template expansion does not need any arguments (as it is in this case where the target_gen_dir used to compute the fixtures directory), the invoker scope goes unused in the expansion and GN warns of this and errors out.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You can have either one or both the arguments in the template and it will work fine. If you have none, then you'll see the unused invoker scope error.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see, thanks! It would be nice to add You can have either one or both the arguments in the template and it will work fine. If you have none, then you'll see the unused invoker scope error. to the comment so in a few months for now, I can still figure this out by reading the comments instead of git blame 😄

#
# Arguments:
#
# fixtures (required): The list of test fixtures. An empty list may be
Copy link
Contributor

Choose a reason for hiding this comment

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

I see, thanks! It would be nice to add You can have either one or both the arguments in the template and it will work fine. If you have none, then you'll see the unused invoker scope error. to the comment so in a few months for now, I can still figure this out by reading the comments instead of git blame 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants