aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.6k stars 3.9k forks source link

integ-runner: consistent filenames between integration tests and unit tests #25370

Open mbonig opened 1 year ago

mbonig commented 1 year ago

Describe the feature

The current default regex for finding integ tests is ^integ\..*(?<!\.d)\.ts$, putting the 'integ' at the start of the filename. However, unit tests are expecting a suffix, like ^.*(?<!\.d)\.test\.ts$.

This makes for inconsistency in filenames. It believe it would make adoption easier if the default was to look for ^.*(?<!\.integ\.d)\.ts$.

Since there are already plenty of file in the existing repos under the initial regex perhaps the default could be to look for both?

Use Case

I like my filenames to have consistent naming patterns.

Proposed Solution

Make the default TS search regex look for both the current default and ^.*(?<!\.d)\.integ\.ts$.

Other Information

No response

Acknowledgements

CDK version used

2.77.0

Environment details (OS name and version, etc.)

All

pahud commented 1 year ago

Thank you for the feedback. I am making this a p2 feature request and please help us prioritize by upvotes.

moltar commented 10 months ago

I agree with the naming. It seems odd. I went with *.itest.ts in my own setup, after consulting with ChatGPT for the naming patterns for integration tests in the Node ecosystem :)