# अपने एजेंट से अपने ऐप के tests चलवाएँ

> किसी एजेंट से अपने ऐप के tests चलाने को कहें, चैट में run पर नज़र रखें, नतीजा पढ़ें और fix माँगें।

Source: https://air.build/hi/docs/build/run-your-apps-tests/

आपके एजेंट आपके प्रोजेक्ट के automated tests चलाकर बता सकते हैं कि क्या pass हुआ और क्या fail। आप प्रोजेक्ट की चैट में कहते हैं। एजेंट `runtest` command से tests चलाता है (देखें [runtest](https://air.build/hi/docs/cli/runtest/)) और चैट में नतीजा बताता है।

tests कहाँ चलते हैं, यह आपकी टीम पर निर्भर है:

| टीम | tests कहाँ चलते हैं |
| --- | --- |
| Cloud टीम | cloud में एक Mac builder पर। Android version (beta) के tests एक Linux builder पर चलते हैं। एजेंट जो दूसरी scripts किसी Linux builder पर चलाता है, वे [runlinux](https://air.build/hi/docs/cli/runlinux/) इस्तेमाल करती हैं। |
| आपके Mac पर टीम | उसी Mac पर। |

test run आपके Preview डिवाइस इस्तेमाल नहीं करता, इसलिए आप इसे Preview में नहीं देखेंगे। इसकी जगह किसी एजेंट को डिवाइस पर आपके ऐप में आगे बढ़ते देखने के लिए, उससे Preview में ऐप आज़माने को कहें। देखें [Preview में अपना ऐप चलाएँ](https://air.build/hi/docs/build/preview-your-app/)।

## Test run माँगें

प्रोजेक्ट की चैट में tests माँगें, उदाहरण के लिए:

```text
Run the app's tests and tell me what fails.
```

उनमें से सिर्फ़ कुछ चलाने के लिए, बताएँ कौन-से, जैसे "सिर्फ़ sign-in tests चलाओ।"

प्रोजेक्ट के tests उसकी `airbuild.yaml` फ़ाइल में `test:` के नीचे सूचीबद्ध होते हैं, हर एक किसी नाम के नीचे। अगर अभी कोई नहीं है, तो एजेंट से पहले कुछ लिखने को कहें, फिर उन्हें चलाने को:

```text
Add tests for sign-in and checkout, then run them.
```

## Run पर नज़र रखें

tests चलते समय, message box के ऊपर की row दिखाती है कि एजेंट क्या कर रहा है, जैसा वह बताता है। देखें [चैट में अपने एजेंट के साथ काम करें](https://air.build/hi/docs/projects/work-with-agents-in-chat/#see-what-agents-are-doing)। अगर run किसी task का हिस्सा है, तो task का card भी यही दिखाता है। देखें [tasks से अपने एजेंट के काम पर नज़र रखें](https://air.build/hi/docs/projects/track-work-with-tasks/)।

**Show What Agents Are Doing**, एक experimental feature, के साथ टीम का owner एजेंट के tools और output को होते हुए भी देख सकता है। देखें [देखें कि कोई एजेंट क्या कर रहा है](https://air.build/hi/docs/agents/watch-agents-work/)।

run पूरा होने तक चलता रहता है, भले एजेंट को बीच में रोका जाए, और एजेंट उसे फिर से उठा सकता है। इसे रोकने के लिए कहें:

```text
Cancel the test run.
```

## नतीजा पढ़ें

एजेंट चैट में बताता है कि tests pass हुए या नहीं। test command ख़ुद कोई card post नहीं करता, पर एजेंट एक report card भेज सकता है जिसमें fail हुई चीज़ें हों। अगर आपको चाहिए, तो माँग लें। देखें [एजेंट का भेजा चार्ट या जाँच रिपोर्ट पढ़ें](https://air.build/hi/docs/agents/read-charts-and-checks-from-agents/#read-a-report)।

## Fix माँगें

चैट में जवाब दें, उदाहरण के लिए:

```text
Fix the two failing tests and run them again.
```

fail होने वाले test का मतलब हो सकता है कि ऐप ग़लत है या test। अगर पक्का नहीं कि कौन, तो एजेंट के किसी को बदलने से पहले उससे पूछें:

```text
Is the app wrong, or is the test out of date?
```

बदलाव के बाद, एजेंट नया run शुरू करता है। जब वह ऐप फिर से build करता है, तो आप Preview में fix जाँच सकते हैं। देखें [नया बिल्ड तैयार होने पर Preview खोलें](https://air.build/hi/docs/build/open-the-preview-when-a-build-is-ready/)।

## Test करने के दूसरे तरीक़े

| क्या | कहाँ देखें |
| --- | --- |
| आपके ऐप के Android version (beta) के tests | उन्हें उसी तरह माँगें, जैसे "Android tests चलाओ।" देखें [Android या PocketJS version बनाएँ (beta)](https://air.build/hi/docs/build/android-and-pocketjs/)। |
| **Test** action वाले Xcode Cloud workflows | प्रोजेक्ट का **Xcode Cloud** टैब हर run के test failures दिखाता है। देखें [Xcode Cloud से बिल्ड करें](https://air.build/hi/docs/app-store/build-with-xcode-cloud/)। |
| beta आज़माते लोग | देखें [TestFlight से बीटा शेयर करें](https://air.build/hi/docs/app-store/test-with-testflight/)। |

## सवाल

**क्या कई test runs एक साथ चल सकते हैं?**

cloud टीम में, हाँ। आपके Mac पर टीम एक बार में एक चलाती है।
