Skip to main content

test-connector

Test a Fivetran connector by running fivetran debug and checking the results. Use when the user wants to validate or run their connector locally.

跳到安装

来源信息

仓库
fivetran/connector_sdk_tools
最近来源活动
2026年9月11日 18:54
检测到的 SKILL.md 语言
英语
星标
88
分支
0

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
test-connector
description
Test a Fivetran connector by running fivetran debug and checking the results. Use when the user wants to validate or run their connector locally.
argument-hint
Connector directory name (e.g., 'github_connector')
<!-- GENERATED FILE — DO NOT EDIT. Canonical source: canonical/skills/test-connector/SKILL.md Regenerate with: bash scripts/sync-plugins.sh --> > **Context**: This plugin is for the Fivetran Connector SDK (CSDK). "CSDK" is shorthand for "Connector SDK". # Test Connector **FIRST**: Read `sdk-reference.md` from the plugin directory to load SDK rules and patterns. Test the connector specified by the user. **If no connector name is provided:** Ask which connector to test. List any directories in the workspace that contain a `connector.py` file as options. Example: "Which connector would you like to test? I found: github_connector, stripe_connector" ## Step 1: Verify Project Files Check that required files exist in the connector directory: - `connector.py` — main implementation - `configuration.json` — connector settings as a flat JSON object with string values only - `requirements.txt` — dependencies If any are missing, inform the user and stop. ## Step 2: Setup Environment (only if needed) **Skip if `.venv` already exists.** macOS/Linux: ```bash uv venv .venv uv pip install --python .venv/bin/python -r requirements.txt fivetran_connector_sdk ``` Windows PowerShell: ```powershell uv venv .venv uv pip install --python .\.venv\Scripts\python.exe -r requirements.txt fivetran_connector_sdk ``` ## Step 3: Configuration Follow **Configuration entry** in `sdk-reference.md` only for missing values. Reuse existing configuration and accept supplied ordinary values without requiring interactive re-entry or encryption. Do not dump configuration into model context. Collect missing secrets through the form or the user's local editor/terminal; do not ask users to paste them into chat. ## Step 4: Run the Connector **If the connector's schema or primary keys changed since the last local test**, reset the local state first so the run simulates a clean initial sync (clears `warehouse.db` and `state.json`; it does not touch credentials): macOS/Linux: ```bash cd "<connector_directory>" && .venv/bin/fivetran reset --force ``` Windows PowerShell: ```powershell cd "<connector_directory>"; .\.venv\Scripts\fivetran.exe reset --force ``` Once configuration is ready, run the connector once; reuse an already successful test: ```bash python "<plugin>/tools/run_connector.py" "<connector_directory>" --timeout-seconds 600 ``` The runner defaults to 120 seconds and accepts up to 600. Use 600 for debug runs because the first run downloads and starts the Java tester. Set the harness command timeout to 600 seconds as well. This passes plaintext configuration through to `fivetran debug`; only existing encrypted fields require decryption. Plaintext configuration never requires an encryption key. **IMPORTANT**: If `run_connector.py` fails, report the error to the user. Do NOT read or modify plugin tools. ## Step 5: Check Results If the test succeeded (exit code 0), query the DuckDB warehouse: macOS/Linux: ```bash .venv/bin/python -c " import duckdb conn = duckdb.connect('files/warehouse.db') tables = conn.execute(\"\"\" SELECT table_name FROM information_schema.tables WHERE table_schema = 'tester' \"\"\").fetchall() print(f'Tables synced: {len(tables)}') for (table,) in tables: count = conn.execute(f'SELECT COUNT(*) FROM tester.{table}').fetchone()[0] print(f' tester.{table}: {count} rows') rows = conn.execute(f'SELECT * FROM tester.{table} LIMIT 3').fetchall() cols = [desc[0] for desc in conn.description] print(f' Columns: {cols}') for row in rows: print(f' {row}') print() conn.close() " ``` Windows PowerShell: ```powershell .\.venv\Scripts\python.exe -c 'import duckdb; conn = duckdb.connect("files/warehouse.db"); tables = conn.execute("SELECT table_name FROM information_schema.tables WHERE table_schema = ''tester''").fetchall(); print("Tables synced:", len(tables)); [print(" tester." + table + ": " + str(conn.execute("SELECT COUNT(*) FROM tester." + table).fetchone()[0]) + " rows") for (table,) in tables]; conn.close()' ``` ## Step 6: Report Results ### On Success Report which tables were synced and how many rows each. ### On Failure — Classify the Error **INFRA error** (infrastructure/network — do NOT change code): - Connection refused, timeout, DNS errors - JVM/Java runtime errors - SDK internal errors (gRPC, port 50051) - SSL/certificate errors → Explain the infrastructure issue. **FIRST_RUN error** (connector has never run successfully — do NOT change code): - Invalid API credentials or expired tokens - Wrong API endpoints or URLs in config - Missing permissions on the external service → Explain that since the connector has never run successfully, it's likely a configuration issue. Ask the user to verify credentials and config values. **CODE error** (connector has run successfully before, now failing, OR the error is clearly a code bug): - Syntax errors or import failures - Logic bugs or incorrect SDK API usage - Type annotation issues - Wrong logging methods → Ask: "This looks like a code issue. Would you like me to fix it?" **If the user wants a fix:** apply the fixer workflow (see `workflows/fixer.md` in the plugin, or — in plugins that support subagents — invoke the `connector-fixer` subagent). After fixing, re-run the test to verify.
在 GitHub 查看