Skip to content
Open

Linux #497

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions .github/workflows/acceptance-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: v6 Linux

on:
workflow_dispatch:
push:
branches:
- main
paths-ignore:
- "docs/**"
pull_request:
branches:
- main

schedule:
- cron: "0 0 * * *"

jobs:
# Job to gather all test files
test-setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 22
cache: npm
- run: npm ci

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@v2

- 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) }}
max-parallel: 8
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- 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: Run test in headless mode
run: node bin/testdriverai.js run testdriver/acceptance/${{ matrix.test }} --junit=out.xml
env:
FORCE_COLOR: 3
TD_API_KEY: 49c2996c-0687-40bf-9f2c-5d2e55b2a2c6
TD_WEBSITE: https://testdriver-sandbox.vercel.app
TD_THIS_FILE: ${{ matrix.test }}
TD_API_ROOT: "https://replayable-dev-ian-mac-m1-16.ngrok.io"
169 changes: 0 additions & 169 deletions .github/workflows/acceptance-v6.yml

This file was deleted.

29 changes: 22 additions & 7 deletions agent/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1776,15 +1776,26 @@ ${regression}
return this.createNewSandbox();
});

this.saveLastSandboxId(newSandbox.sandbox.instanceId);
let instance = await this.connectToSandboxDirect(
newSandbox.sandbox.instanceId,
true, // always persist by default
);
this.instance = instance;
await this.renderSandbox(instance, headless);
console.log("New sandbox created:", newSandbox);

this.emitter.emit(events.sandbox.connected);

let data = {
resolution: this.config.TD_RESOLUTION,
url: newSandbox.url,
};

const encodedData = Buffer.from(JSON.stringify(data)).toString('base64');

// Use the debugger URL instead of the VNC URL
const urlToOpen = `${this.debuggerUrl}?data=${encodedData}`;

this.emitter.emit(events.showWindow, urlToOpen);

await this.newSession();
await this.runLifecycle("provision");

console.log("provision run");
}

async start() {
Expand Down Expand Up @@ -1963,6 +1974,7 @@ Please check your network connection, TD_API_KEY, or the service status.`,
async createNewSandbox() {
const sandboxConfig = {
type: "create",
os: "linux",
resolution: this.config.TD_RESOLUTION,
ci: this.config.CI,
};
Expand All @@ -1976,6 +1988,9 @@ Please check your network connection, TD_API_KEY, or the service status.`,
}

let instance = await this.sandbox.send(sandboxConfig);

console.log("instance created", instance);

return instance;
}

Expand Down
Loading
Loading