File tree Expand file tree Collapse file tree 6 files changed +30
-9
lines changed Expand file tree Collapse file tree 6 files changed +30
-9
lines changed Original file line number Diff line number Diff line change 66 E2B_API_KEY :
77 required : true
88 E2B_DOMAIN :
9- required : true
9+ required : false
10+ E2B_TEMPLATE_CONFIG :
11+ required : false
1012
1113permissions :
1214 contents : read
5456 run : npm install -g @e2b/cli
5557
5658 - name : Build E2B template
57- run : e2b template build --config e2b.test.toml
59+ run : e2b template build --config ${{ secrets.E2B_TEMPLATE_CONFIG }}
5860 working-directory : ./template
5961 env :
6062 E2B_ACCESS_TOKEN : ${{ secrets.E2B_ACCESS_TOKEN }}
61- E2B_DOMAIN : ${{ secrets.E2B_DOMAIN }}
63+ E2B_DOMAIN : ${{ secrets.E2B_DOMAIN }}
64+ E2B_TEMPLATE_CONFIG : ${{ secrets.E2B_TEMPLATE_CONFIG }}
Original file line number Diff line number Diff line change 66 E2B_API_KEY :
77 required : true
88 E2B_DOMAIN :
9- required : true
9+ required : false
10+ E2B_TEMPLATE_CONFIG :
11+ required : false
1012
1113permissions :
1214 contents : read
Original file line number Diff line number Diff line change 1919 secrets :
2020 E2B_API_KEY : ${{ secrets.E2B_API_KEY }}
2121 E2B_DOMAIN : ${{ secrets.E2B_DOMAIN }}
22+ E2B_TEMPLATE : ${{ secrets.E2B_TEMPLATE }}
23+ E2B_TEMPLATE_CONFIG : ${{ secrets.E2B_TEMPLATE_CONFIG }}
2224 js-sdk :
2325 uses : ./.github/workflows/js_tests.yml
2426 secrets :
2931 secrets :
3032 E2B_API_KEY : ${{ secrets.E2B_API_KEY }}
3133 E2B_DOMAIN : ${{ secrets.E2B_DOMAIN }}
34+ E2B_TEMPLATE : ${{ secrets.E2B_TEMPLATE }}
3235 charts-tests :
3336 uses : ./.github/workflows/charts_tests.yml
3437 secrets :
3538 E2B_API_KEY : ${{ secrets.E2B_API_KEY }}
3639 E2B_DOMAIN : ${{ secrets.E2B_DOMAIN }}
40+ E2B_TEMPLATE : ${{ secrets.E2B_TEMPLATE }}
Original file line number Diff line number Diff line change 55 secrets :
66 E2B_API_KEY :
77 required : true
8+ E2B_DOMAIN :
9+ required : false
10+ E2B_TEMPLATE_CONFIG :
11+ required : false
812
913permissions :
1014 contents : read
Original file line number Diff line number Diff line change @@ -3,14 +3,18 @@ import { test as base } from 'vitest'
33
44const timeoutMs = 60_000
55
6+ const template = process . env . E2B_TEMPLATE || 'code-interpreter-v1'
7+
68interface SandboxFixture {
79 sandbox : Sandbox
810}
911
1012export const sandboxTest = base . extend < SandboxFixture > ( {
1113 sandbox : [
1214 async ( { } , use ) => {
13- const sandbox = await Sandbox . create ( { timeoutMs } )
15+ const sandbox = await Sandbox . create ( template , {
16+ timeoutMs,
17+ } )
1418 try {
1519 await use ( sandbox )
1620 } finally {
Original file line number Diff line number Diff line change 99
1010timeout = 60
1111
12+ @pytest .fixture ()
13+ def template ():
14+ return os .getenv ("E2B_TEMPLATE" , "code-interpreter-v1" )
15+
1216
1317@pytest .fixture ()
14- def sandbox (debug ):
15- sandbox = Sandbox (timeout = timeout )
18+ def sandbox (template , debug ):
19+ sandbox = Sandbox (template , timeout = timeout )
1620
1721 try :
1822 yield sandbox
@@ -27,8 +31,8 @@ def sandbox(debug):
2731
2832
2933@pytest_asyncio .fixture
30- async def async_sandbox (debug ):
31- sandbox = await AsyncSandbox .create (timeout = timeout )
34+ async def async_sandbox (template , debug ):
35+ sandbox = await AsyncSandbox .create (template , timeout = timeout )
3236
3337 try :
3438 yield sandbox
You can’t perform that action at this time.
0 commit comments