Testdriver:Aws Setup 标志

Testdriver:Aws Setup

组织
testdriverai
testdriver:aws-setup

Deploy TestDriver on your AWS infrastructure using CloudFormation

概览

发布者testdriverai
代码仓库testdriverai
技能名称testdriver:aws-setup
星标数
465
复刻数
39
附带文件
仅含指令
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 指令自成一体

    模型所需的一切都包含在指令中,无需同步额外文件。

  • 开源

    由 testdriverai 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Testdriver:Aws Setup AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/testdriverai/testdriverai/tree/main/ai/skills/testdriver-aws-setup
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/testdriverai/testdriverai.git /tmp/testdriverai
mkdir -p .claude/skills
cp -r /tmp/testdriverai/ai/skills/testdriver-aws-setup .claude/skills/testdriverai-testdriver-aws-setup
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Testdriver:Aws Setup,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Testdriver:Aws Setup。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Testdriver:Aws Setup 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

This guide helps you to set up self-hosted TestDriver instances on AWS. At the end, you have automated test infrastructure. It starts and stops instances when you need them.

How It Works

TestDriver manages the AWS EC2 instances for your tests automatically:

  1. Deploy CloudFormation. Set up the infrastructure one time.
  2. Configure Vitest. Add one line to your config.
  3. Run Tests. The instances start automatically, run the tests, and stop.

That is all. You do not need to manage the instances by hand.

Quickstart

Overview

The setup process is simple:

  1. Deploy CloudFormation — Creates VPC, security groups, IAM roles, and launch templates
  2. Configure Vitest — Add setup-aws to automatically manage instance lifecycle
  3. Run Tests — Set TD_OS=windows with AWS credentials and instances spawn/terminate automatically

Prerequisites

Before you begin, ensure you have:

  • AWS account with CloudFormation permissions
  • AWS CLI installed and configured (aws configure)
  • Access to the TestDriver AMI — Contact us with your AWS region
  • A GitHub repository for your tests

Step 1: Deploy CloudFormation Stack

Our CloudFormation template creates all the AWS infrastructure you need:

  • Dedicated VPC with public subnet
  • Security group with required port access
  • IAM roles and instance profiles
  • EC2 launch template for instance creation
<Card 
  title="Launch Stack" 
  icon="aws" 
  href="https://console.aws.amazon.com/cloudformation/home#/stacks/create/review?templateURL=https://v7-cloudformation-template.s3.us-east-2.amazonaws.com/cloudformation.yaml" 
  horizontal 
  arrow
>
  Deploy TestDriver infrastructure with one click
</Card>

Configure the stack parameters:
- **Stack name**: `testdriver-infrastructure` (or your preferred name)
- **ProjectTag**: `testdriver`
- **AllowedIngressCidr**: Your IP range (e.g., `203.0.113.0/24`)
- **InstanceType**: `c5.xlarge` (recommended)
- **CreateKeyPair**: `true`

<Warning>
  **Security**: Replace `AllowedIngressCidr` with your specific IP ranges to restrict VPC access. Avoid using `0.0.0.0/0` in production.
</Warning>

### Get Your Launch Template ID

After the stack creation completes, navigate to the **Outputs** tab to find your `LaunchTemplateId`:

![Launch Template ID](/images/content/self-hosted/launchtemplateid.png)

<Tip>
  **Save this ID** — you'll need it for spawning instances and CI configuration.
</Tip>
```bash
aws cloudformation deploy \
  --template-file setup/aws/cloudformation.yaml \
  --stack-name testdriver-infrastructure \
  --parameter-overrides \
    ProjectTag=testdriver \
    AllowedIngressCidr=0.0.0.0/0 \
    InstanceType=c5.xlarge \
    CreateKeyPair=true \
  --capabilities CAPABILITY_IAM
```

<Warning>
  **Security**: Replace `AllowedIngressCidr=0.0.0.0/0` with your specific IP ranges to restrict VPC access.
</Warning>

### Get Your Launch Template ID

After deployment completes, retrieve the launch template ID:

```bash
aws cloudformation describe-stacks \
  --stack-name testdriver-infrastructure \
  --query 'Stacks[0].Outputs[?OutputKey==`LaunchTemplateId`].OutputValue' \
  --output text
```

<Tip>
  **Save this ID** — you'll need it for spawning instances and CI configuration.
</Tip>

Step 2: Configure Vitest

Add the AWS setup hook to your vitest.config.mjs:

javascript
import { defineConfig } from 'vitest/config';
import { config } from 'dotenv';
import TestDriver from 'testdriverai/vitest';

config(); // Load .env file

export default defineConfig({
  test: {
    testTimeout: 900000,
    hookTimeout: 900000,
    maxConcurrency: 3,
    reporters: [
      'default',
      TestDriver(),
      ['junit', { outputFile: 'test-report.junit.xml' }]
    ],
    setupFiles: ['testdriverai/vitest/setup', 'testdriverai/vitest/setup-aws'],
  },
});

Step 3: Write Your Tests

Tests should use context.ip || process.env.TD_IP for the IP configuration:

javascript
import { describe, it } from "vitest";
import { TestDriver } from "testdriverai/vitest/hooks";

describe("My Test", () => {
  it("should run on self-hosted instance", async (context) => {
    const testdriver = TestDriver(context, {
      ip: context.ip || process.env.TD_IP,
    });

    await testdriver.provision.chrome({ url: "https://example.com" });
    // ... your test steps
  });
});

Step 4: Run Tests

Locally

bash
TD_OS=windows \
AWS_REGION=us-east-2 \
AWS_LAUNCH_TEMPLATE_ID=lt-xxx \
AMI_ID=ami-0504bf50fad62f312 \
vitest run

In GitHub Actions

Automate testing with self-hosted instances in your CI/CD pipeline. TestDriver automatically spawns a fresh instance for each test, runs the test, and terminates the instance.

yaml
name: TestDriver Self-Hosted Windows Tests

on:
  push:
    branches: [main]
  pull_request:

jobs:
  test:
    runs-on: ubuntu-latest
    
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '20'
          cache: 'npm'

      - name: Install dependencies
        run: npm ci

      - name: Run Windows tests with self-hosted instances
        run: npx vitest run examples/*.test.mjs
        env:
          TD_API_KEY: ${{ secrets.TD_API_KEY }}
          TD_OS: windows
          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
          AWS_REGION: us-east-2
          AWS_LAUNCH_TEMPLATE_ID: ${{ secrets.AWS_LAUNCH_TEMPLATE_ID }}
          AMI_ID: ${{ secrets.AMI_ID }}

      - name: Upload test results
        if: always()
        uses: actions/upload-artifact@v4
        with:
          name: test-results
          path: test-report.junit.xml

Required GitHub Secrets

SecretDescriptionExample
AWS_ACCESS_KEY_IDAWS access keyAKIAIOSFODNN7EXAMPLE
AWS_SECRET_ACCESS_KEYAWS secret keywJalrXUtnFEMI/K7MDENG...
AWS_REGIONAWS regionus-east-2
AWS_LAUNCH_TEMPLATE_IDFrom CloudFormation outputlt-07c53ce8349b958d1
AMI_IDTestDriver AMI IDami-0504bf50fad62f312
TD_API_KEYYour TestDriver API keyFrom console.testdriver.ai

Example Workflows

For complete production examples, see:

Advanced Usage

Using an Existing Instance

If you already have a running instance, you can skip automatic spawning by providing TD_IP:

bash
TD_OS=windows TD_IP=1.2.3.4 vitest run

The setup-aws hook will detect TD_IP is already set and skip spawning a new instance.

Manual Instance Management

For advanced use cases, you can manually spawn instances using the spawn-runner.sh script:

bash
AWS_REGION=us-east-2 \
AMI_ID=ami-0504bf50fad62f312 \
AWS_LAUNCH_TEMPLATE_ID=lt-xxx \
bash setup/aws/spawn-runner.sh

Output:

PUBLIC_IP=1.2.3.4
INSTANCE_ID=i-1234567890abcdef0
AWS_REGION=us-east-2

Then manually terminate when done:

bash
aws ec2 terminate-instances \
  --instance-ids i-1234567890abcdef0 \
  --region us-east-2

For complete production examples, see:

Connecting to an Instance

You can connect to running instances via:

  • RDP — Use the public IP on port 3389
  • VNC — Access via web browser at http://<public-ip>:5900
  • AWS Console — Use EC2 Instance Connect or Session Manager

AMI Customization

The TestDriver Golden Image comes pre-configured with:

  • Windows Server with desktop environment
  • VNC + web server for remote access
  • Python, Node.js, Git
  • TestDriver agent and dependencies

Creating a Custom AMI

You can customize the AMI to include additional software or configurations:

Security Best Practices

Network Security

  • Restrict CIDR blocks — Only allow access from known IP ranges
  • Use VPC endpoints — For private AWS service communication
  • Enable VPC Flow Logs — For network monitoring

AWS Authentication

Use OIDC instead of long-term credentials for GitHub Actions:

yaml
permissions:
  id-token: write
  contents: read

steps:
  - name: Configure AWS credentials
    uses: aws-actions/configure-aws-credentials@v4
    with:
      role-to-assume: arn:aws:iam::123456789012:role/GitHubActionsRole
      aws-region: us-east-2

See GitHub's OIDC documentation for setup instructions.

Instance Security

  • Terminate immediately after tests complete
  • Monitor costs with AWS billing alerts
  • Use least-privilege IAM roles
  • Enable CloudTrail for audit logging

Troubleshooting

Instance Not Responding

  • Check security groups — Verify required ports are open (RDP 3389, VNC 5900, TestDriver ports)
  • Verify status checks — Ensure instance has passed AWS status checks
  • Check AMI compatibility — Some instance types don't support certain AMIs

Connection Timeouts

  • Verify network connectivity from CI runner to instance
  • Check VPC routing and internet gateway configuration
  • Confirm instance is in the correct subnet

AWS CLI Errors

  • Validate credentials and permissions
  • Check service quotas and limits
  • Verify region consistency across all resources

常见问题

Testdriver:Aws Setup AI 技能有什么作用?

Deploy TestDriver on your AWS infrastructure using CloudFormation

为什么在 TypingMind 中使用 Testdriver:Aws Setup?

因为您只需安装一次,就能搭配任何模型使用。Testdriver:Aws Setup 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Testdriver:Aws Setup?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/testdriverai/testdriverai/tree/main/ai/skills/testdriver-aws-setup。TypingMind 会读取其中的 SKILL.md,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Testdriver:Aws Setup?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Testdriver:Aws Setup 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Testdriver:Aws Setup 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Testdriver:Aws Setup AI 技能免费吗?

testdriverai 已在 GitHub 上发布了该技能。请查看代码仓库了解许可条款。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇