pingcap / tidb

TiDB is an open-source, cloud-native, distributed, MySQL-Compatible database for elastic scale and real-time analytics. Try AI-powered Chat2Query free at : https://www.pingcap.com/tidb-serverless/
https://pingcap.com
Apache License 2.0
37.13k stars 5.83k forks source link

Introducing the -test.short parameter for skipping long-running tests #45386

Open hawkingrei opened 1 year ago

hawkingrei commented 1 year ago

Enhancement

We have introduced a new parameter for our Go tests: -test.short. This parameter allows developers to skip long-running tests, which can save a significant amount of time during development and testing.

Long-running tests can be a bottleneck in the development process, especially when running complete test suites. With the -test.short parameter, developers can quickly run tests and get feedback on their code without waiting for long-running tests to complete. We recommend using this parameter during development and testing, as it can significantly speed up the testing process. However, please note that this parameter may skip some important tests, so it should not be used in production environments.

To use the -test.short parameter, simply add it to the command line when running tests. For example, "go test -test.short" will skip long-running tests.

We encourage all developers to start using this parameter in their testing process to improve efficiency and reduce development time.

How to define short tests?

If a test meets the following conditions, we consider it a short test:

bb7133 commented 1 year ago

For example, "go test -test.short" will skip long-running tests.

How should we define 'long-running' tests?

hawkingrei commented 1 year ago

How should we define 'long-running' tests?

Yes, We need to define them.

hawkingrei commented 1 year ago

For example, "go test -test.short" will skip long-running tests.

How should we define 'long-running' tests?

I have added a definition for short tasks.

hawkingrei commented 1 year ago

@tiancaiamao This work is still in progress.