Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

rm integration test template work

0div411631385d74
diff --git a/packages/js-sdk/tests/integration/stress.test.ts b/packages/js-sdk/tests/integration/stress.test.ts
deleted file mode 100644
index b82830372..000000000
--- a/packages/js-sdk/tests/integration/stress.test.ts
+++ /dev/null
@@ -1,73 +0,0 @@
-import { test } from 'vitest'
-
-import Sandbox from '../../src/index.js'
-import { wait, isIntegrationTest } from '../setup.js'
-
-const heavyArray = new ArrayBuffer(256 * 1024 * 1024) // 256 MiB = 256 * 1024 * 1024 bytes
-const view = new Uint8Array(heavyArray)
-for (let i = 0; i < view.length; i++) {
- view[i] = Math.floor(Math.random() * 256)
-}
-
-const integrationTestTemplate = 'jonas_base'
-
-test.skipIf(!isIntegrationTest)(
- 'stress test heavy file writes and reads',
- async () => {
- const promises: Array<Promise<string | void>> = []
- for (let i = 0; i < 500; i++) {
- promises.push(
- Sandbox.create(integrationTestTemplate, { timeoutMs: 60 })
- .then((sbx) => {
- console.log(sbx.sandboxId)
- return sbx.files
- .write('heavy-file', heavyArray)
- .then(() => sbx.files.read('heavy-file'))
- })
- .catch(console.error)
- )
- }
- await wait(10_000)
- await Promise.all(promises)
- }
-)
-
-test.skipIf(!isIntegrationTest)('stress network ingress', async ({}) => {
- const promises: Array<Promise<string | void>> = []
-
- for (let i = 0; i < 10; i++) {
- promises.push(
- Sandbox.create(integrationTestTemplate, { timeoutMs: 60 }).then((sbx) => {
- console.log('created sandbox', sbx.sandboxId)
- sbx.files
- .write('heavy-file', heavyArray)
- .then(() => {
- sbx.commands.run('python -m http.server 8000', { background: true })
- })
- .then(() => {
- new Promise((resolve, reject) => {
- try {
- resolve(sbx.getHost(8000))
- } catch (e) {
- console.error('error getting sbx host', e)
- reject(e)
- }
- }).then((host) => {
- const url = `https://${host}`
- console.log('fetching url', url)
- fetch(url)
- })
-
- try {
- sbx.kill()
- } catch (e) {
- console.error('error killing sbx', e)
- }
- })
- })
- )
- }
-
- await wait(10_000)
- await Promise.all(promises)
-})
diff --git a/packages/js-sdk/tests/integration/template/README.md b/packages/js-sdk/tests/integration/template/README.md
deleted file mode 100644
index 2d4155dc3..000000000
--- a/packages/js-sdk/tests/integration/template/README.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# Integration test template
-
-# Build the template
-
-`$ e2b template build"`
diff --git a/packages/js-sdk/tests/integration/template/e2b.Dockerfile b/packages/js-sdk/tests/integration/template/e2b.Dockerfile
deleted file mode 100644
index 65ceb7d65..000000000
--- a/packages/js-sdk/tests/integration/template/e2b.Dockerfile
+++ /dev/null
@@ -1,8 +0,0 @@
-FROM e2bdev/code-interpreter:latest
-
-# Clone the Next.js app repository
-RUN git clone https://github.com/ezesundayeze/basic-nextjs-app
-
-# Install dependencies
-RUN cd basic-nextjs-app && npm install
-
diff --git a/packages/js-sdk/tests/integration/template/e2b.toml b/packages/js-sdk/tests/integration/template/e2b.toml
deleted file mode 100644
index 4f6dff736..000000000
--- a/packages/js-sdk/tests/integration/template/e2b.toml
+++ /dev/null
@@ -1,18 +0,0 @@
-# This is a config for E2B sandbox template.
-# You can use template ID (2e2z80zhv34yumbrybvn) or template name (integration-test-v1) to create a sandbox:
-
-# Python SDK
-# from e2b import Sandbox, AsyncSandbox
-# sandbox = Sandbox("integration-test-v1") # Sync sandbox
-# sandbox = await AsyncSandbox.create("integration-test-v1") # Async sandbox
-
-# JS SDK
-# import { Sandbox } from 'e2b'
-# const sandbox = await Sandbox.create('integration-test-v1')
-
-team_id = "b9c07023-d095-4bdc-9634-e25d5530ba47"
-memory_mb = 1_024
-start_cmd = "npm run dev"
-dockerfile = "e2b.Dockerfile"
-template_name = "integration-test-v1"
-template_id = "2e2z80zhv34yumbrybvn"