M31A वर्कस्पेस पैकेजेस में Vitest का उपयोग करता है और कई स्पेशलाइज्ड सूट्स भी।
यूनिट टेस्ट्स
npm run test # सभी वर्कस्पेस टेस्ट्स + SEA लॉन्च टेस्ट
npm run test:ci # CI वेरिएंट, स्क्रिप्ट टेस्ट्स भी चलाता है
npm run test:scripts # scripts/tests के तहत टेस्ट्स
npm run test:sea-launch # SEA लॉन्चर स्मोक टेस्टएक सिंगल वर्कस्पेस टेस्ट फाइल चलाएं:
npm test -w @m31a/core -- src/routing/modelRouterService.test.tsposttest डिफॉल्ट टेस्ट कमांड के बाद npm run build चलाता है।
इंटीग्रेशन टेस्ट्स
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 इंस्टॉल करें।
इवैल्यूएशन
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 को फोर्क्स में रिपॉजिटरी सीक्रेट के रूप में कॉन्फिगर करना आवश्यक है।
परफॉर्मेंस और मेमोरी
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/ में रहती हैं।
फ्लेकी टेस्ट टूलिंग
npm run deflake
npm run deflake:test:integration:sandbox:none
npm run deflake:test:integration:sandbox:dockerटाइपचेक और लिंट
npm run typecheck
npm run lint
npm run lint:all
node scripts/lint.js --actionlint --yamllint
node scripts/lint.js --check-github-actions-pinningGitHub Actions को 40-कैरेक्टर कमिट SHAs पर पिन किया जाना चाहिए।
कन्वेंशन्स
beforeEachमेंvi.stubEnv('NAME', 'value')से एनवायरनमेंट वेरिएबल्स स्टब करें औरafterEachमेंvi.unstubAllEnvs()से रिस्टोर करें।- टेस्ट्स को उनके वर्कस्पेस पैकेज के लिए स्कोप्ड रखें।
- पुल रिक्वेस्ट सबमिट करने से पहले
npm run preflightचलाएं।
अगले चरण
डेवलपमेंट और रूट CONTRIBUTING.md देखें।