Skip to content

M31A वर्कस्पेस पैकेजेस में Vitest का उपयोग करता है और कई स्पेशलाइज्ड सूट्स भी।

यूनिट टेस्ट्स ​

bash
npm run test                 # सभी वर्कस्पेस टेस्ट्स + SEA लॉन्च टेस्ट
npm run test:ci              # CI वेरिएंट, स्क्रिप्ट टेस्ट्स भी चलाता है
npm run test:scripts         # scripts/tests के तहत टेस्ट्स
npm run test:sea-launch      # SEA लॉन्चर स्मोक टेस्ट

एक सिंगल वर्कस्पेस टेस्ट फाइल चलाएं:

bash
npm test -w @m31a/core -- src/routing/modelRouterService.test.ts

posttest डिफॉल्ट टेस्ट कमांड के बाद npm run build चलाता है।

इंटीग्रेशन टेस्ट्स ​

bash
npm run test:e2e                          # सैंडबॉक्स डिसेबल्ड, वर्बोज
npm run test:integration:sandbox:none
npm run test:integration:sandbox:docker
npm run test:integration:sandbox:podman
npm run test:integration:all
npm run test:integration:flaky

इंटीग्रेशन टेस्ट्स tests/integration-tests/ में रहते हैं। Docker और Podman वेरिएंट्स को संबंधित रनटाइम की आवश्यकता होती है और पहले सैंडबॉक्स इमेज बनाते हैं। यदि आपका एनवायरनमेंट यूजर-नेमस्पेस आइसोलेशन की आवश्यकता करता है तो Linux पर bubblewrap इंस्टॉल करें।

इवैल्यूएशन ​

bash
npm run test:always_passing_evals
npm run test:all_evals
npm run eval:validate
npm run eval:inventory
npm run eval:report
npm run eval:coverage

इवैल्यूएशन डेफिनिशन्स tests/evals/ में रहती हैं। लाइव API टेस्ट्स के लिए NVIDIA_API_KEY को फोर्क्स में रिपॉजिटरी सीक्रेट के रूप में कॉन्फिगर करना आवश्यक है।

परफॉर्मेंस और मेमोरी ​

bash
npm run test:perf
npm run test:perf:update-baselines
npm run test:memory
npm run test:memory:update-baselines

ये सूट्स tests/perf-tests/ और tests/memory-tests/ में रहती हैं।

फ्लेकी टेस्ट टूलिंग ​

bash
npm run deflake
npm run deflake:test:integration:sandbox:none
npm run deflake:test:integration:sandbox:docker

टाइपचेक और लिंट ​

bash
npm run typecheck
npm run lint
npm run lint:all
node scripts/lint.js --actionlint --yamllint
node scripts/lint.js --check-github-actions-pinning

GitHub Actions को 40-कैरेक्टर कमिट SHAs पर पिन किया जाना चाहिए।

कन्वेंशन्स ​

  • beforeEach में vi.stubEnv('NAME', 'value') से एनवायरनमेंट वेरिएबल्स स्टब करें और afterEach में vi.unstubAllEnvs() से रिस्टोर करें।
  • टेस्ट्स को उनके वर्कस्पेस पैकेज के लिए स्कोप्ड रखें।
  • पुल रिक्वेस्ट सबमिट करने से पहले npm run preflight चलाएं।

अगले चरण ​

डेवलपमेंट और रूट CONTRIBUTING.md देखें।

VitePress के साथ निर्मित। NVIDIA NIM द्वारा संचालित।