How to Run a single YAML IT test?

Hi, Elastic team:

I read the doc from TESTING, and If we want to run whole YAML IT, we should do as below:

./gradlew :distribution:archives:integ-test-zip:integTest -Dtests.class="*Yaml*IT"

And if I run a single IT, Maybe the analysis-smartcn plugin YAML IT, What command should I execute?

Hi @Ethan-Zhang,

you should be able to run individual tests by specifying them through their path in the yaml via e.g.

./gradlew ':x-pack:qa:rolling-upgrade:v6.8.5#twoThirdsUpgradedTest' --tests "org.elasticsearch.upgrades.UpgradeClusterClientYamlTestSuiteIT.test {p0=mixed_cluster/30_ml_jobs_crud/Test get old cluster categorization job}" 

I would point out that to my knowledge this may not be a stable API across ES versions, which is also why it's not documented fully I think. If you absolutely must run a single test though it should work.
If it doesn't (or it's too tricky to find out the correct path for say a docs test), one hack/work-around to finding out the path would be to just change the test assertion in the test you want to run slightly so that it fails => then you can get the command to run that test from the reproduce line printed for the failing test.

Add parmeter -Dtests.method="test {p0=analysis_smartcn/10_basic/Tokenizer}" could run a specific test case.

Could this run with gradle instead of gradlew.

gradle :distribution:archives:integ-test-zip:integTest -Dtests.class="*Yaml*IT" -Dtests.method="test {p0=analysis_smartcn/10_basic/Tokenizer}"

didn't work

./gradlew ':plugins:analysis-smartcn:integTestRunner' --tests "org.elasticsearch.index.analysis.SmartCNClientYamlTestSuiteIT.test {yaml=analysis_smartcn/10_basic/Tokenizer}" -Dtests.seed=3634FEF91B4EB272 -Dtests.locale=mk -Dtests.timezone=America/Bahia_Banderas

that the Plugins runs the IT

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.