test-component
БесплатноБез исполняемых скриптовНе проверенExpert agent for writing and maintaining tests for Keboola Python components. Use for any testing work — adding tests, fixing tests, improving coverage…
от keboola★ 17 звёзд на GitHubОб этом скилле
Keboola Component Tester
Testing approach
Three levels, in priority order:
- Datadir tests — functional tests using KBC_DATADIR structure; the primary method for all components
- Unit tests — isolated logic tests for transformations, validation, config parsing
- VCR functional tests — for components that call external HTTP APIs (preferred over manual mocks for extractors/writers)
Choosing VCR vs mocks
Use VCR (keboola.datadirtest) when the component makes external HTTP calls:
- Records real API interactions once → replays deterministically in CI without credentials
- More realistic than hand-rolled mocks; catches API contract changes
- Required for extractors; recommended for writers that call external APIs
Use mocks (unittest.mock) when:
- Testing pure logic, transformation, or validation code
- Writing unit tests for individual functions
- The component has no HTTP calls (applications, pure transformations)
VCR setup workflow
- Add
keboola.datadirtest>=2.0.0topyproject.tomldev dependencies, runuv sync -U - Copy
tests/test_functional.pyfromcomponent-developer:component-defaultsassets - Read component (
src/component.py,src/configuration.py,component_config/configSchema.json) and buildtests/setup/configs.json— see vcr-configs-format.md - For authenticated APIs: ask user for real credentials →
secrets.json(verify it's in.gitignore) - Scaffold to record:
uv run python -m keboola.datadirtest scaffold [--secrets secrets.json] [--chain-state] - Check cassettes for unsanitized dynamic values — see vcr-sanitizers.md
- Update
.gitignore,Dockerfile(COPY tests/ tests), andpush.yml(usepython -m pytest) - Verify:
python -m pytestlocally and in Docker
See vcr-quickstart.md for all scaffold commands. See vcr-troubleshooting.md for common failures.
References
| File | When to read |
|---|---|
references/datadir-tests.md |
Setting up datadir tests — directory structure, config.json, output assertions, state, error cases |
references/unit-and-mock-tests.md |
Unit tests, mocking patterns, freezegun, by component type |
references/vcr-configs-format.md |
Building configs.json — wrapped format, OAuth, writers, coverage guidelines |
references/vcr-sanitizers.md |
Adding VCR_SANITIZERS — DefaultSanitizer, ResponseUrlSanitizer, QueryParamSanitizer |
references/vcr-quickstart.md |
All scaffold/record commands and repo layout |
references/vcr-troubleshooting.md |
Common VCR failures and fixes |
references/vcr-debug-from-platform.md |
Regression tests from Keboola platform debug job output (stage_output.zip) |
Установить test-component в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
BashReadWriteEditGlobGrepAskUserQuestionВложенные файлы
FAQ
Что делает скилл test-component?
Expert agent for writing and maintaining tests for Keboola Python components. Use for any testing work — adding tests, fixing tests, improving coverage, setting up VCR functional tests. Covers datadir tests, unit tests, mock-based tests, and VCR recording with keboola.datadirtest. Triggers whenever testing is mentioned or needed for a Keboola component, including /generate-vcr-tests.
Как установить скилл test-component?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл test-component запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic