testdriverai 6.1.6 → 6.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -19,23 +19,26 @@ Self-hosting TestDriver allows you to run tests on your own infrastructure, givi
|
|
|
19
19
|
- **Complete customization**: Modify the TestDriver Golden Image to include custom dependencies, software, and configurations at launch time.
|
|
20
20
|
- **Powerful Infrastructure**: Run tests on bare metal infrastructure that support emulators and simulators.
|
|
21
21
|
|
|
22
|
-
## Quick Start (TL;DR)
|
|
23
|
-
|
|
24
|
-
1. **Copy the workflow file**: Use [`.github/workflows/self-hosted.yml`](https://github.com/testdriverai/cli/tree/main/.github/workflows/self-hosted.yml) as your template
|
|
25
|
-
2. **Run CloudFormation**: Deploy our [`setup/aws/cloudformation.yaml`](https://github.com/testdriverai/cli/tree/main/setup/aws/cloudformation.yaml) to provision infrastructure
|
|
26
|
-
3. **Setup instances**: Use [`setup/aws/spawn-runner.sh`](https://github.com/testdriverai/cli/tree/main/setup/aws/spawn-runner.sh) with your launch template ID
|
|
27
|
-
4. **Configure GitHub Actions**: Add AWS credentials to your repository secrets
|
|
28
|
-
|
|
29
22
|
## Overview
|
|
30
23
|
|
|
31
|
-
Self-hosting TestDriver gives you complete control over your test execution environment. You'll provision EC2 instances on AWS using our pre-configured AMI and infrastructure templates
|
|
24
|
+
Self-hosting TestDriver gives you complete control over your test execution environment. You'll provision EC2 instances on AWS using our pre-configured AMI and infrastructure templates:
|
|
25
|
+
|
|
26
|
+
1. **GitHub Workflow**: Use `.github/workflows/self-hosted.yml` as your template to test in CI.
|
|
27
|
+
2. **CloudFormation**: Deploy our `setup/aws/cloudformation.yaml` to provision infrastructure.
|
|
28
|
+
3. **On-Demand Runners**: Use `setup/aws/spawn-runner.sh` with your Launch Template ID from CloudFormation to spawn runners on-demand.
|
|
29
|
+
4. **GitHub Secrets**: Store AWS Credentials to your GitHub repository's secrets.
|
|
32
30
|
|
|
33
31
|
## Prerequisites
|
|
34
32
|
|
|
35
|
-
- AWS account with
|
|
36
|
-
- AWS CLI installed locally
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
- AWS account with permissions to run CloudFormation.
|
|
34
|
+
- [AWS CLI](https://aws.amazon.com/cli/) installed locally.
|
|
35
|
+
|
|
36
|
+
<Tip>
|
|
37
|
+
Be sure to run `aws configure` with your credentials
|
|
38
|
+
</Tip>
|
|
39
|
+
- Access to the TestDriver AMI\
|
|
40
|
+
[Contact us with your preferred AWS Region for access](https://form.typeform.com/to/UECf9rDx?typeform-source=testdriver.ai).
|
|
41
|
+
- A GitHub repository for committing your tests & workflow.
|
|
39
42
|
|
|
40
43
|
## Step 1: Set Up AWS Infrastructure
|
|
41
44
|
|
|
@@ -78,7 +81,9 @@ aws cloudformation describe-stacks \
|
|
|
78
81
|
--output text
|
|
79
82
|
```
|
|
80
83
|
|
|
81
|
-
|
|
84
|
+
<Tip>
|
|
85
|
+
**Save this ID** – you'll need it for the next step.
|
|
86
|
+
</Tip>
|
|
82
87
|
|
|
83
88
|
## Step 2: Spawn a New TestDriver Runner
|
|
84
89
|
|
|
@@ -93,10 +98,10 @@ Our [`setup/aws/spawn-runner.sh`](https://github.com/testdriverai/cli/tree/main/
|
|
|
93
98
|
```bash
|
|
94
99
|
# Launch an instance
|
|
95
100
|
export AWS_REGION=us-east-2
|
|
96
|
-
export AMI_ID=ami
|
|
97
|
-
export AWS_LAUNCH_TEMPLATE_ID=lt
|
|
101
|
+
export AMI_ID=ami-•••••••••• # Your TestDriver AMI (contact us to get one)
|
|
102
|
+
export AWS_LAUNCH_TEMPLATE_ID=lt-•••••••••• # From CloudFormation output from step 1
|
|
98
103
|
|
|
99
|
-
./aws-setup.sh
|
|
104
|
+
/bin/bash ./setup/aws/aws-setup.sh
|
|
100
105
|
```
|
|
101
106
|
|
|
102
107
|
The script outputs:
|
|
@@ -113,7 +118,7 @@ Once you have an instance IP, run tests directly:
|
|
|
113
118
|
|
|
114
119
|
```bash
|
|
115
120
|
# Basic test execution
|
|
116
|
-
npx testdriverai run test.yaml --ip=1.2.3.4
|
|
121
|
+
npx testdriverai@latest run test.yaml --ip=1.2.3.4
|
|
117
122
|
```
|
|
118
123
|
|
|
119
124
|
You can use the `PUBLIC_IP` to target the instance you just spawned via `./setup/aws/spawn-runner.sh`:
|
|
@@ -126,9 +131,7 @@ npx testdriverai@latest run testdriver/your-test.yaml \
|
|
|
126
131
|
Note that the instance will remain running until you terminate it. You can do this manually via the AWS console, or programmatically in your CI workflow:
|
|
127
132
|
|
|
128
133
|
```bash
|
|
129
|
-
aws ec2 terminate-instances
|
|
130
|
-
--region us-east-2 \
|
|
131
|
-
--instance-ids $INSTANCE_ID
|
|
134
|
+
aws ec2 terminate-instances --instance-ids $INSTANCE_ID
|
|
132
135
|
```
|
|
133
136
|
|
|
134
137
|
## Step 3: GitHub Actions Integration
|
|
@@ -162,7 +165,7 @@ jobs:
|
|
|
162
165
|
env:
|
|
163
166
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
164
167
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
165
|
-
AWS_REGION:
|
|
168
|
+
AWS_REGION: ${{ secrets.AWS_REGION }}
|
|
166
169
|
AWS_LAUNCH_TEMPLATE_ID: ${{ secrets.AWS_LAUNCH_TEMPLATE_ID }}
|
|
167
170
|
AMI_ID: ${{ secrets.AMI_ID }}
|
|
168
171
|
|
|
@@ -177,10 +180,11 @@ jobs:
|
|
|
177
180
|
if: always()
|
|
178
181
|
run: |
|
|
179
182
|
aws ec2 terminate-instances \
|
|
180
|
-
--region
|
|
183
|
+
--region ${{ secrets.AWS_REGION }}
|
|
181
184
|
--instance-ids ${{ steps.aws-setup.outputs.instance-id }}
|
|
182
185
|
env:
|
|
183
186
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
187
|
+
AWS_REGION: ${{ secrets.AWS_REGION }}
|
|
184
188
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
185
189
|
```
|
|
186
190
|
|
|
@@ -191,6 +195,7 @@ Configure these secrets in your GitHub repository:
|
|
|
191
195
|
| Secret | Description | Example |
|
|
192
196
|
| ------------------------ | ----------------------------------- | ------------------------------------------------------------ |
|
|
193
197
|
| `AWS_ACCESS_KEY_ID` | AWS access key | `AKIAIOSFODNN7EXAMPLE` |
|
|
198
|
+
| `AWS_REGION` | AWS Region | `us-east-2` |
|
|
194
199
|
| `AWS_SECRET_ACCESS_KEY` | AWS secret key | `wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY` |
|
|
195
200
|
| `AWS_LAUNCH_TEMPLATE_ID` | Launch template from CloudFormation | `lt-07c53ce8349b958d1` |
|
|
196
201
|
| `AMI_ID` | TestDriver AMI ID | `ami-085f872ca0cd80fed` |
|