test(e2e): migrate template alias tests to sdk_compat framework#1052
Open
sparkzky wants to merge 4 commits into
Open
test(e2e): migrate template alias tests to sdk_compat framework#1052sparkzky wants to merge 4 commits into
sparkzky wants to merge 4 commits into
Conversation
sparkzky
requested review from
chenhengqi,
fslongjin,
ls-ggg,
tinklone and
wbzdssm
as code owners
July 21, 2026 07:42
lkml-likexu
reviewed
Jul 21, 2026
sparkzky
force-pushed
the
fix/e2e-template-alias-migration
branch
from
July 21, 2026 13:13
f6e66fc to
68d9165
Compare
Move template e2e tests from sdk/python/tests/test_template_e2e.py to tests/e2e/sdk_compat/cases/templates/test_alias.py, matching the TencentCloud#835 framework structure. - Add cube_template_e2e_image (default: busybox from Tencent mirror) and cube_template_e2e_writable_layer_size (default: 1G) to config so users no longer need to set env vars manually. - Add templates marker to pytest.ini. - Replace the old validation test (which created 3 templates) with a lightweight one that hits GET /templates/aliases/:alias with invalid formats and expects 400 — no template creation needed. Autonomously-by: OhMyPi:zai/glm-5.2 Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>
Per reviewer feedback, switch default from busybox to sandbox-code (cube-sandbox-cn.tencentcloudcr.com/cube-sandbox/sandbox-code:latest) which is the project's own image and more representative of real usage. Autonomously-by: OhMyPi:zai/glm-5.2 Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>
…changes - Remove TemplateAdapter and dual-backend parameterization. Template operations are CubeSandbox-only (E2B SDK template API is incompatible with CubeAPI — different endpoint format). - Revert framework/config.py to master (remove cube_template_e2e_image and cube_template_e2e_writable_layer_size fields). - Hardcode DEFAULT_IMAGE and DEFAULT_WRITABLE_LAYER_SIZE as module constants in test_alias.py. No env vars needed. Autonomously-by: OhMyPi:zai/glm-5.2 Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>
sparkzky
force-pushed
the
fix/e2e-template-alias-migration
branch
from
July 21, 2026 13:24
cbc4432 to
5669ede
Compare
Template operations only support cubesandbox backend. Add sdk_backend parameter to template tests so [e2b] variants show as SKIPPED with "template operations only support cubesandbox backend (E2B SDK template API is incompatible with CubeAPI)" instead of silently not running. test_template_alias_dedicated_endpoint_rejects_invalid stays unparameterized since it tests raw HTTP validation (no SDK dependency). Autonomously-by: OhMyPi:zai/glm-5.2 Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Migrates template alias e2e tests from the standalone
sdk/python/tests/test_template_e2e.pyinto thetests/e2e/sdk_compat/framework introduced by #835.Follow-up to #749 (template alias feature, merged).
Changes
sdk/python/tests/test_template_e2e.pytests/e2e/sdk_compat/cases/templates/test_alias.pytests/e2e/sdk_compat/cases/templates/__init__.pytests/e2e/sdk_compat/pytest.initemplatesmarkerNo changes to
framework/config.py. Container image (sandbox-code:latest) and writable layer size (1G) are hardcoded as module constants in the test file — no env vars needed.Design decisions
/v3/templateswith Dockerfile) that CubeAPI does not implement. E2B SDK compatibility is sandbox-operations-only. Template alias is a CubeSandbox feature inspired by E2B concepts, not an E2B SDK wire-compatible implementation.CUBE_TEMPLATE_E2E_IMAGE/CUBE_TEMPLATE_E2E_WRITABLE_LAYER_SIZEenv vars: hardcoded defaults in the test module. OnlyCUBE_TEMPLATE_ID(already required by the framework) is needed.Tests
test_template_list_and_get_existingtest_template_create_from_image_and_cleanuptest_template_alias_dedicated_endpoint_rejects_invalidtest_template_alias_create_get_and_deletetest_template_alias_dedicated_lookup_endpointGET /templates/aliases/:aliasendpointtest_template_alias_rebuild_reassignmentVerified against a live one-click deployment: 6 passed in 55s.
Assisted-by: OhMyPi:zai/glm-5.2