Skip to content

test(integration): component lifecycle tests (port legacy 15)#759

Open
kriszyp wants to merge 2 commits into
mainfrom
claude/api-tests-components
Open

test(integration): component lifecycle tests (port legacy 15)#759
kriszyp wants to merge 2 commits into
mainfrom
claude/api-tests-components

Conversation

@kriszyp
Copy link
Copy Markdown
Member

@kriszyp kriszyp commented May 23, 2026

Summary

Ports apiTests/tests/15_customFunctionsAndComponents.mjs to the self-contained integration-test framework.

Covers:

  • deploy_component via GitHub package (with retry logic), inline tar payload, and inline tar.gz payload (with restart: true)
  • set_component_file / get_component_file
  • add_component (using local fixture) / package_component / get_components / drop_component
  • Full custom functions API: add_custom_function_project, custom_functions_status, set/get/drop_custom_function, get_custom_functions, drop_custom_function_project
  • deploy_custom_function_project with an inline payload

Skipped on Windows and Bun due to restart: true crashing the single-worker model (#549).

Design decisions

  • The three large inline base64 payloads (tar, tar.gz, custom-function archive) are extracted into named constants at the top of the file for readability. They are preserved verbatim from the legacy test.
  • add_component now uses the local fixtures/application-template-1.0.0.tgz unconditionally rather than only on Windows — this avoids a live npm-registry network call on Linux/macOS CI.
  • The get_custom_functions after project drop assertion was relaxed from a deepEqual of the full response (fragile if GitHub deploy is flaky) to just checking the dropped project key is absent.
  • Deploy assertions are now applied on both the success and retry paths of the GitHub deploy test.

Known limitations (from Gemini review — suggestions, not blockers)

  • Hardcoded sleeps (5s + 15s for GitHub deploy, 30s for restart, 22s for custom-function deploy): ~72s total idle time per run. Polling helpers would reduce this but require more refactoring. Tracked as a follow-up improvement.
  • Entire suite skipped on Windows/Bun rather than per-test: Only the deploy_component using tar.gz payload test strictly requires a restart. A finer-grained skip would allow the other tests to run on those platforms. Left as a follow-up.

Generated by Claude Sonnet 4.6

kriszyp and others added 2 commits May 22, 2026 21:30
Port 15_customFunctionsAndComponents.mjs to the self-contained integration-test
framework. Covers deploy_component (GitHub, tar, tar.gz payloads),
set/get_component_file, add/package/drop_component, and the full custom-functions
API (add, set, get, drop, deploy_custom_function_project).

Skipped on Windows (restart_service crash) and Bun (restart reliability).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Assert deploy_component GitHub response on both success and retry paths
- Use local fixture file for add_component unconditionally (avoids npm registry dependency)
- Relax get_custom_functions assertion after drop to not deepEqual full state
  (fragile when GitHub deploy is flaky)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@kriszyp kriszyp requested a review from Ethan-Arrowood May 23, 2026 03:35
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 23, 2026

Reviewed; no blockers found.

@kriszyp kriszyp marked this pull request as ready for review May 23, 2026 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant