-
Notifications
You must be signed in to change notification settings - Fork 27
Ianjennings/self hosted #466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ianjennings
wants to merge
24
commits into
main
Choose a base branch
from
ianjennings/self-hosted
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,081
−5
Open
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
c16a99c
direct connect via ip
ianjennings 65d7439
direct instance
ianjennings 9e28dea
comment out stuff needed for act
ianjennings 12bea13
aws setup chmod
ianjennings c1d3f3e
add aws region
ianjennings 79624af
ensure vpc regions match
ianjennings 70c1e08
ensure vpc regions match
ianjennings 1206ad6
new launchtemplate via vpc
ianjennings d8c3b2f
dont forget to run provision
ianjennings a283b7e
lol all tests at same ip
ianjennings a60ce06
ai generated docs
ianjennings bc7d379
Fix typo
ericclemmons e780573
this method is unused
ianjennings 1a059a9
Merge branch 'ianjennings/self-hosted' of github.com:testdriverai/tes…
ianjennings fab4c0d
Update agent/index.js
ianjennings fc36ddc
Update docs/getting-started/self-hosting.mdx
ianjennings 71407ee
Merge branch 'main' into ianjennings/self-hosted
ianjennings 734b778
Apply suggestion from @ericclemmons
ianjennings a345fdf
docs update, and path refactor
ianjennings bc973be
Merge branch 'ianjennings/self-hosted' of github.com:testdriverai/cli…
ianjennings 8a3366f
small eslint fix
ianjennings aec9eec
small path fix for gh action
ianjennings d50b8c1
use new launch template
ianjennings 5a92984
prettier
ianjennings File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
name: AWS | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
|
||
jobs: | ||
gather: | ||
name: Gather Test Files | ||
runs-on: ubuntu-latest | ||
outputs: | ||
test_files: ${{ steps.test_list.outputs.files }} | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Find all test files | ||
id: test_list | ||
run: | | ||
FILES=$(ls ./testdriver/acceptance/*.yaml) | ||
FILENAMES=$(basename -a $FILES) | ||
FILES_JSON=$(echo "$FILENAMES" | jq -R -s -c 'split("\n")[:-1]') | ||
echo "files=$FILES_JSON" >> $GITHUB_OUTPUT | ||
|
||
test: | ||
needs: gather | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
test: ${{ fromJson(needs.gather.outputs.test_files) }} | ||
fail-fast: false | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
# only needed for `act` | ||
# - name: Install AWS CLI | ||
# run: | | ||
# apt-get update | ||
# apt-get install curl unzip -y | ||
# curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" | ||
# unzip awscliv2.zip | ||
# ./aws/install | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20" | ||
cache: "npm" | ||
- name: Install dependencies | ||
run: NODE_ENV=production npm ci | ||
- name: Setup AWS Instance | ||
id: aws-setup | ||
run: | | ||
OUTPUT=$(./setup/aws/spawn-runner.sh | tee /dev/stderr) # Capture and display output | ||
echo "$OUTPUT" | ||
PUBLIC_IP=$(echo "$OUTPUT" | grep "PUBLIC_IP=" | cut -d'=' -f2) | ||
INSTANCE_ID=$(echo "$OUTPUT" | grep "INSTANCE_ID=" | cut -d'=' -f2) | ||
AWS_REGION=$(echo "$OUTPUT" | grep "AWS_REGION=" | cut -d'=' -f2) | ||
echo "public-ip=$PUBLIC_IP" >> $GITHUB_OUTPUT | ||
echo "instance-id=$INSTANCE_ID" >> $GITHUB_OUTPUT | ||
echo "aws-region=$AWS_REGION" >> $GITHUB_OUTPUT | ||
env: | ||
FORCE_COLOR: 3 | ||
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: lt-00d02f31cfc602f27 | ||
AMI_ID: ami-085f872ca0cd80fed | ||
- name: Run TestDriver | ||
run: node bin/testdriverai.js run testdriver/acceptance/${{ matrix.test }} --ip="${{ steps.aws-setup.outputs.public-ip }}" --junit=out.xml | ||
env: | ||
TD_API_KEY: ${{ secrets.TD_API_KEY }} | ||
TD_WEBSITE: https://testdriver-sandbox.vercel.app | ||
TD_THIS_FILE: ${{ matrix.test }} | ||
- name: Upload TestDriver AI CLI logs | ||
if: always() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: testdriverai-cli-logs-${{ matrix.test }} | ||
path: /tmp/testdriverai-cli-*.log | ||
if-no-files-found: warn | ||
retention-days: 30 | ||
- name: Upload test results as artifact | ||
if: always() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: test-results-${{ matrix.test }} | ||
path: out.xml | ||
retention-days: 30 | ||
- name: Shutdown AWS Instance | ||
if: always() | ||
run: aws ec2 terminate-instances --region "$AWS_REGION" --instance-ids "$INSTANCE_ID" | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
AWS_REGION: ${{ steps.aws-setup.outputs.aws-region }} | ||
INSTANCE_ID: ${{ steps.aws-setup.outputs.instance-id }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,6 +50,7 @@ | |
} | ||
] | ||
}, | ||
"/getting-started/self-hosting", | ||
"/getting-started/playwright", | ||
"/getting-started/vscode" | ||
] | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.