ワンクリックで
run-tests
Run project test suite
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Run project test suite
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
AI Agent code quality check - Use Ruff to check code standards for LangChain, AutoGen, and other AI Agent projects
Database migration management - Use Flyway and Atlas for version-controlled database schema migrations
Dockerfile best practices check - Use hadolint to validate Dockerfile security, performance, and compliance
Format JavaScript/TypeScript code with Prettier
Format Python code with Black
Auto-generate project changelog
| name | run-tests |
| description | Run project test suite |
Intelligently run project test suites, automatically detecting test frameworks and executing:
| Framework | Language | Detection Files | Installation |
|---|---|---|---|
| Pytest | Python | pytest.ini, test_*.py | pip install pytest pytest-cov |
| Jest | JavaScript | jest.config.js, *.test.js | npm install --save-dev jest |
| Mocha | JavaScript | mocha.opts, test/ | npm install --save-dev mocha |
| JUnit | Java | pom.xml, build.gradle | Built into Maven/Gradle |
| Go Test | Go | *_test.go | Built into Go |
Note: AI will automatically detect the test framework used by the project
"Run project tests"
"Execute all unit tests"
"Run tests and generate coverage report"
Python (Pytest):
pytest # Run all tests
pytest --cov=. # Generate coverage
pytest tests/test_api.py # Run specific file
pytest -k "test_login" # Run matching tests
pytest -v # Verbose output
JavaScript (Jest):
npm test # Run all tests
npm test -- --coverage # Generate coverage
npm test -- api.test.js # Run specific file
npm test -- -t "login" # Run matching tests
jest --watch # Watch mode
JavaScript (Mocha):
npm test # Run all tests
mocha test/ # Specify directory
mocha test/**/*.test.js # Use glob
mocha --reporter spec # Specify reporter format
Java (Maven):
mvn test # Run all tests
mvn test -Dtest=ApiTest # Run specific test class
mvn test -DfailIfNoTests=false # Don't fail if no tests
Go:
go test ./... # Run tests in all packages
go test -v ./... # Verbose output
go test -cover ./... # Coverage
go test -run TestLogin # Run specific test
Pytest Output:
================================= test session starts ==================================
platform win32 -- Python 3.11.7, pytest-7.4.3
rootdir: C:\Project
plugins: cov-4.1.0
collected 45 items
tests/test_api.py ........ [ 17%]
tests/test_auth.py ..... [ 29%]
tests/test_database.py .......... [ 51%]
tests/test_utils.py .................... [100%]
---------- coverage: platform win32, python 3.11.7 -----------
Name Stmts Miss Cover
-----------------------------------------
src/api.py 120 5 96%
src/auth.py 85 0 100%
src/database.py 150 12 92%
src/utils.py 95 3 97%
-----------------------------------------
TOTAL 450 20 96%
============================== 45 passed in 2.34s ==================================
Jest Output:
PASS tests/api.test.js
PASS tests/auth.test.js
PASS tests/utils.test.js
Test Suites: 3 passed, 3 total
Tests: 45 passed, 45 total
Snapshots: 0 total
Time: 3.421 s
Ran all test suites.
----------------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
----------------------|---------|----------|---------|---------|-------------------
All files | 94.2 | 88.5 | 96.3 | 94.8 |
api.js | 96.5 | 90.2 | 100.0 | 97.1 | 45,78
auth.js | 100.0 | 100.0 | 100.0 | 100.0 |
utils.js | 89.4 | 82.1 | 91.7 | 90.2 | 23,45-48,92
----------------------|---------|----------|---------|---------|-------------------
[pytest]
testpaths = tests
python_files = test_*.py
python_classes = Test*
python_functions = test_*
addopts =
-v
--cov=src
--cov-report=html
--cov-report=term
--cov-fail-under=80
markers =
slow: marks tests as slow
integration: marks tests as integration tests
module.exports = {
testEnvironment: 'node',
coverageDirectory: 'coverage',
collectCoverageFrom: [
'src/**/*.{js,ts}',
'!src/**/*.test.{js,ts}',
],
coverageThreshold: {
global: {
branches: 80,
functions: 80,
lines: 80,
statements: 80,
},
},
testMatch: [
'**/__tests__/**/*.[jt]s?(x)',
'**/?(*.)+(spec|test).[jt]s?(x)',
],
};
{
"require": ["chai"],
"spec": "test/**/*.test.js",
"reporter": "spec",
"timeout": 5000,
"recursive": true
}
name: Run Tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
pip install -r requirements.txt
pip install pytest pytest-cov
- name: Run tests
run: pytest --cov=src --cov-report=xml
- name: Upload coverage
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
test:
stage: test
image: python:3.11
script:
- pip install -r requirements.txt pytest pytest-cov
- pytest --cov=src --cov-report=term
coverage: '/TOTAL.*\s+(\d+%)$/'
Q: How to run only failed tests?
A:
pytest --lf (last failed)jest --onlyFailuresQ: How to skip slow tests?
A:
@pytest.mark.slow then pytest -m "not slow"test.skip() or --testPathIgnorePatternsQ: How to run tests in parallel?
A:
pip install pytest-xdist then pytest -n auto--maxWorkers=4 to adjustQ: What if test coverage is low?
A:
Q: What if tests run slowly?
A: