Skip to content

Conversation

@chunhtai
Copy link
Contributor

@chunhtai chunhtai commented Aug 2, 2023

related flutter/packages#4627

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read the Flutter Style Guide recently, and have followed its advice.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@chunhtai chunhtai requested a review from stuartmorgan-g August 2, 2023 17:30
// of various plugin test types and locations.
if (filename.endsWith('_test.dart') ||
// Test files in custom package-specific test folders.
filename.contains(RegExp('packages/packages/[^/]+/tool/')) ||
Copy link
Contributor

Choose a reason for hiding this comment

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

It's not the case that everything in the tool directory is a test, so this is too broad. tool is just the convention for non-public scripts: https://dart.dev/tools/pub/package-layout#public-tools

E.g., a code generation script might live in tool, but not be a test.

Copy link
Contributor Author

@chunhtai chunhtai Aug 2, 2023

Choose a reason for hiding this comment

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

What about we match any file that has word test anywhere in this folder? something like this
'packages/packages/[^/]+/tool/.+test.+'

Or do you prefer more package specific exception here? like
packages/packages/go_router/tool/test_fixes

Copy link
Contributor

Choose a reason for hiding this comment

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

What about we match any file that has word test anywhere in this folder? something like this
'packages/packages/[^/]+/tool/.+test.+'

There are currently only three examples of that pattern, at at least one is a false positive (pigeon/tool/test.dart, which is just a script for running manual tests locally, so provides no automated test coverage).

The missing-test bot should err on the side of false positives rather than false negatives.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sounds good I will make this more specific to package instead. If we have more and more use cases, we can come up with a more systematic solution later.

@chunhtai chunhtai changed the title Counts custom package specific test runners folder as tests Counts go_router and go_router_builder custom test folder as tests Aug 2, 2023
@chunhtai chunhtai changed the title Counts go_router and go_router_builder custom test folder as tests Counts go_router and go_router_builder custom test folders as tests Aug 2, 2023
@chunhtai chunhtai requested a review from stuartmorgan-g August 2, 2023 20:44
if (filename.endsWith('_test.dart') ||
// Test files in package-specific test folders.
filename.contains('packages/packages/go_router/test_fixes/') ||
filename.contains('packages/packages/go_router_builder/test_inputs/') ||
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Could you put these at the end, so the generic rules continue to be first?

// of various plugin test types and locations.
if (filename.endsWith('_test.dart') ||
// Test files in package-specific test folders.
filename.contains('packages/packages/go_router/test_fixes/') ||
Copy link
Contributor

Choose a reason for hiding this comment

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

The packages/packages/ part of these parts unnecessarily ties these patterns to the specific repo structure; we should just start with the package name.

@chunhtai chunhtai requested a review from stuartmorgan-g August 2, 2023 21:09
Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

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

LGTM

@chunhtai chunhtai added the autosubmit Merge PR when tree becomes green via auto submit App. label Aug 3, 2023
@auto-submit auto-submit bot merged commit 303b86f into flutter:main Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants