Open-source, secure environment with real-world tools for enterprise-grade agents.
Python agentaiai-agentai-agentscode-interpretercopilotdevelopmentdevtoolsgptgpt-4javascriptllmnextjsopenaipythonreactsoftwaretypescript
fix: template tests after infra update (#956)
Jakub Dobry86786e578f70
diff --git a/packages/js-sdk/tests/template/stacktrace.test.ts b/packages/js-sdk/tests/template/stacktrace.test.tsindex 07cb08988..1b74e020b 100644--- a/packages/js-sdk/tests/template/stacktrace.test.ts+++ b/packages/js-sdk/tests/template/stacktrace.test.ts@@ -1,6 +1,6 @@+import fs from 'node:fs'import { assert } from 'vitest'import { Template, waitForTimeout } from '../../src'-import fs from 'node:fs'import { buildTemplateTest } from '../setup'const __fileContent = fs.readFileSync(__filename, 'utf8') // read current file content@@ -181,8 +181,11 @@ buildTemplateTest('traces on runCmd', async ({ buildTemplate }) => {})buildTemplateTest('traces on setWorkdir', async ({ buildTemplate }) => {- let template = Template().fromBaseImage()- template = template.skipCache().setWorkdir('.bashrc')+ const template = Template()+ .fromBaseImage()+ .setUser('root')+ .skipCache()+ .setWorkdir('/root/.bashrc')await expectToThrowAndCheckTrace(async () => {await buildTemplate(template)}, 'setWorkdir')@@ -190,7 +193,7 @@ buildTemplateTest('traces on setWorkdir', async ({ buildTemplate }) => {buildTemplateTest('traces on setUser', async ({ buildTemplate }) => {let template = Template().fromBaseImage()- template = template.skipCache().setUser(';')+ template = template.skipCache().setUser('; exit 1')await expectToThrowAndCheckTrace(async () => {await buildTemplate(template)}, 'setUser')diff --git a/packages/python-sdk/tests/async/template_async/test_stacktrace.py b/packages/python-sdk/tests/async/template_async/test_stacktrace.pyindex 509c7b8cb..aa7924639 100644--- a/packages/python-sdk/tests/async/template_async/test_stacktrace.py+++ b/packages/python-sdk/tests/async/template_async/test_stacktrace.py@@ -126,7 +126,7 @@ async def test_traces_on_rename(async_build):async def test_traces_on_make_dir(async_build):template = AsyncTemplate()template = template.from_base_image()- template = template.skip_cache().make_dir(".bashrc")+ template = template.set_user("root").skip_cache().make_dir("/root/.bashrc")await _expect_to_throw_and_check_trace(lambda: async_build(template), "make_dir")@@ -152,7 +152,7 @@ async def test_traces_on_run_cmd(async_build):async def test_traces_on_set_workdir(async_build):template = AsyncTemplate()template = template.from_base_image()- template = template.skip_cache().set_workdir(".bashrc")+ template = template.set_user("root").skip_cache().set_workdir("/root/.bashrc")await _expect_to_throw_and_check_trace(lambda: async_build(template), "set_workdir")@@ -160,7 +160,7 @@ async def test_traces_on_set_workdir(async_build):async def test_traces_on_set_user(async_build):template = AsyncTemplate()template = template.from_base_image()- template = template.skip_cache().set_user(";")+ template = template.skip_cache().set_user("; exit 1")await _expect_to_throw_and_check_trace(lambda: async_build(template), "set_user")diff --git a/packages/python-sdk/tests/sync/template_sync/test_stacktrace.py b/packages/python-sdk/tests/sync/template_sync/test_stacktrace.pyindex 6ffd6a7be..9ad61869c 100644--- a/packages/python-sdk/tests/sync/template_sync/test_stacktrace.py+++ b/packages/python-sdk/tests/sync/template_sync/test_stacktrace.py@@ -120,7 +120,7 @@ def test_traces_on_rename(build):def test_traces_on_make_dir(build):template = Template()template = template.from_base_image()- template = template.skip_cache().make_dir(".bashrc")+ template = template.set_user("root").skip_cache().make_dir("/root/.bashrc")_expect_to_throw_and_check_trace(lambda: build(template), "make_dir")@@ -144,7 +144,7 @@ def test_traces_on_run_cmd(build):def test_traces_on_set_workdir(build):template = Template()template = template.from_base_image()- template = template.skip_cache().set_workdir(".bashrc")+ template = template.set_user("root").skip_cache().set_workdir("/root/.bashrc")_expect_to_throw_and_check_trace(lambda: build(template), "set_workdir")@@ -152,7 +152,7 @@ def test_traces_on_set_workdir(build):def test_traces_on_set_user(build):template = Template()template = template.from_base_image()- template = template.skip_cache().set_user(";")+ template = template.skip_cache().set_user("; exit 1")_expect_to_throw_and_check_trace(lambda: build(template), "set_user")