test_dataset.json 3.34 KB
{
  "skill": "youtube-data-expert",
  "version": "1.0.0",
  "total_samples": 12,
  "description": "测试数据集,用于验证技能掌握程度",
  "samples": [
    {
      "id": "test-001",
      "type": "integration",
      "task": "完整流程:搜索视频 → 获取详情 → 导出数据",
      "steps": [
        "搜索 'JavaScript tutorial' 视频",
        "获取前 10 个视频的完整详情",
        "导出为 JSON 格式"
      ],
      "expected_quota_max": 103,
      "pass_criteria": "返回 10 条完整视频数据,配额使用正确"
    },
    {
      "id": "test-002",
      "type": "integration",
      "task": "完整流程:频道分析",
      "steps": [
        "获取频道详情",
        "获取频道上传列表",
        "批量获取最近 30 个视频详情"
      ],
      "expected_quota_max": 4,
      "pass_criteria": "返回频道统计和视频列表"
    },
    {
      "id": "test-003",
      "type": "error_recovery",
      "task": "错误恢复测试",
      "scenario": "前 3 个视频 ID 有效,第 4 个无效",
      "expected_behavior": "返回 3 个有效视频数据,记录第 4 个的错误"
    },
    {
      "id": "test-004",
      "type": "performance",
      "task": "大批量请求性能",
      "input": {"videoIds": 100},
      "expected_behavior": "自动分批(2批 x 50),并发控制",
      "expected_time_max": 10000
    },
    {
      "id": "test-005",
      "type": "data_quality",
      "task": "数据质量验证",
      "checks": [
        "所有返回记录都有 id, title, publishedAt",
        "duration 已转换为秒数",
        "viewCount 已转换为数字"
      ]
    },
    {
      "id": "test-006",
      "type": "edge_case",
      "task": "极端情况处理",
      "scenarios": [
        {"videoId": "", "expected": "返回错误"},
        {"videoId": "too_long_id_12345678901234567890", "expected": "返回错误"},
        {"part": "invalid_part", "expected": "返回 400 错误"}
      ]
    },
    {
      "id": "test-007",
      "type": "quota_management",
      "task": "配额管理验证",
      "steps": [
        "执行 5 次不同请求",
        "验证配额追踪准确性"
      ],
      "expected_quota": "sum of all requests"
    },
    {
      "id": "test-008",
      "type": "output_format",
      "task": "多种格式导出",
      "formats": ["json", "csv"],
      "validation": "格式正确,数据完整"
    },
    {
      "id": "test-009",
      "type": "pagination",
      "task": "分页获取大量数据",
      "input": {"search": "music", "maxResults": 150},
      "expected_pages": 3,
      "expected_total": 150
    },
    {
      "id": "test-010",
      "type": "api_coverage",
      "task": "API 端点覆盖",
      "required_endpoints": ["videos", "channels", "search", "playlistItems"],
      "pass_criteria": "所有端点都能正确调用"
    },
    {
      "id": "test-011",
      "type": "resilience",
      "task": "容错能力测试",
      "scenario": "网络不稳定,部分请求失败",
      "expected_behavior": "重试失败请求,最终返回所有可用数据"
    },
    {
      "id": "test-012",
      "type": "real_world",
      "task": "真实场景模拟",
      "scenario": "分析一个真实 YouTube 频道",
      "channel": "@GoogleDevelopers",
      "expected_output": "频道统计 + 最近 20 个视频数据"
    }
  ]
}