# How to Run a single YAML IT test?

**URL:** <https://discuss.elastic.co/t/how-to-run-a-single-yaml-it-test/209928>\
**Category:** Elasticsearch\
**Created:** [November 29, 2019, 6:28am UTC](https://discuss.elastic.co/t/how-to-run-a-single-yaml-it-test/209928 "2019-11-29T06:28:37Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ethan-Zhang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ethan-zhang/32/54812_2.png) [@Ethan-Zhang](https://discuss.elastic.co/u/Ethan-Zhang)\
**Post date:** [November 29, 2019, 6:28am UTC](https://discuss.elastic.co/t/how-to-run-a-single-yaml-it-test/209928/1 "2019-11-29T06:28:37Z")

</div>

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="org.elasticsearch.test.rest.*Yaml*IT"

```

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

---

<div class="post-metadata">

**Author:** ![Armin\_Braun](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/armin_braun/32/20092_2.png) [@Armin\_Braun](https://discuss.elastic.co/u/Armin_Braun)\
**Post date:** [November 29, 2019, 8:05am UTC](https://discuss.elastic.co/t/how-to-run-a-single-yaml-it-test/209928/2 "2019-11-29T08:05:27Z")

</div>

Hi @Ethan-Zhang,

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

```auto
./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.

---

<div class="post-metadata">

**Author:** ![Ethan-Zhang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ethan-zhang/32/54812_2.png) [@Ethan-Zhang](https://discuss.elastic.co/u/Ethan-Zhang)\
**Post date:** [November 29, 2019, 11:22am UTC](https://discuss.elastic.co/t/how-to-run-a-single-yaml-it-test/209928/3 "2019-11-29T11:22:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Ethan-Zhang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ethan-zhang/32/54812_2.png) [@Ethan-Zhang](https://discuss.elastic.co/u/Ethan-Zhang)\
**Post date:** [November 29, 2019, 11:42am UTC](https://discuss.elastic.co/t/how-to-run-a-single-yaml-it-test/209928/4 "2019-11-29T11:42:24Z")

</div>

Could this run with gradle instead of gradlew.

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

```

didn't work

---

<div class="post-metadata">

**Author:** ![Ethan-Zhang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ethan-zhang/32/54812_2.png) [@Ethan-Zhang](https://discuss.elastic.co/u/Ethan-Zhang)\
**Post date:** [November 29, 2019, 12:58pm UTC](https://discuss.elastic.co/t/how-to-run-a-single-yaml-it-test/209928/5 "2019-11-29T12:58:00Z")

</div>

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

```

that the Plugins runs the IT

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 27, 2019, 12:58pm UTC](https://discuss.elastic.co/t/how-to-run-a-single-yaml-it-test/209928/6 "2019-12-27T12:58:14Z")

</div>

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