Skip to content

test: full integration coverage on all desktop platforms - #30

Merged
iota9star merged 4 commits into
mainfrom
test/platform-integration-coverage
Sep 30, 2026
Merged

iota9star merged 4 commits into
mainfrom
test/platform-integration-coverage

Conversation

@iota9star

Copy link
Copy Markdown
Member

Summary

Extends verification so every desktop platform exercises the real runtime end to end, and closes the test gaps found along the way.

Integration tests on every desktop platform

CI previously ran only smoke_test.dart on Linux. The Linux, macOS, and Windows legs now run all four example integration suites (smoke_test, simple_test, runtime_driver_test, fjs_service_test) sequentially per file — sequential execution avoids the single-device concurrency flakiness seen when running the whole directory at once. Verified locally on macOS: all four suites green.

New unit coverage for the publish path

fetch-precompiled-artifacts (the command that materializes the signed SwiftPM binary into the pub package) now has a full test suite: verified composite fetch into the output directory, multi-asset sorted byte-exact fetch, rejection of non-composite asset names, empty request rejection, missing precompiled config, wrong signing key, missing generation, and a consistency check between the derived manifest expectations and the fixture.

Findings and fixes

  • Fixed: FjsService.dispose() closed the engine immediately, leaking late CANCELLED_ERRORs after tests completed. It now drains scheduled JavaScript work with closeGracefully() (the draining shutdown added for exactly this).
  • Known issue documented: through the Dart bridge inside an app, memory-limit failures currently surface as CANCELLED_ERROR instead of MEMORY_LIMIT_ERROR (verified independent of the limit size; the Rust API returns MemoryLimit correctly in direct, threaded, and release-mode tests). Added a Rust regression test locking the core contract (test_async_engine_memory_limit_error_code) and skipped the single Dart case with an explicit reason pointing at it.

Test counts

Rust 627 (+1), build_tool 137 (+9 net new file), example integration suites all green locally on macOS.

CI previously executed only the Linux smoke test. Every desktop leg
(Linux, macOS, Windows) now runs all four example integration suites
sequentially, avoiding single-device concurrency flakiness.

Add a complete unit-test suite for the fetch-precompiled-artifacts
publish-path command: verified composite fetch, multi-asset sorted
fetch, non-composite rejection, empty request, missing precompiled
config, wrong signing key, missing generation, and derived manifest
expectations.

Lock the async engine memory-limit contract with a Rust regression
test (MemoryLimit error, engine stays usable). Through the Dart
bridge inside an app the memory-limit failure currently surfaces as
CANCELLED_ERROR (teardown races propagation), so that one Dart case
is skipped with an explicit pointer until the bridge issue is fixed.

Fix the example FjsService to drain pending JavaScript with
closeGracefully() before teardown; the immediate close leaked late
cancelled errors after tests completed.
Copilot AI balanced review requested due to automatic review settings September 30, 2026 12:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The Windows CI command is invalid, Rust formatting fails, and teardown/test races remain.

Review effort: Balanced
Findings: 2 High severity · 1 Medium severity · 2 Low severity

Open (5)
What changed in this PR

Extends desktop integration coverage, adds publish-path tests, and adjusts engine teardown behavior.

Changes:

  • Runs integration suites across Linux, macOS, and Windows.
  • Adds precompiled-artifact fetch tests.
  • Documents and tests memory-limit and graceful-shutdown behavior.
File Description
.github/​workflows/​build-all-platforms.yml Expands desktop integration CI.
CHANGELOG.md Documents the changes.
cargokit/​build_tool/​test/​fetch_precompiled_artifacts_test.dart Adds artifact-fetch tests.
example/​integration_test/​simple_test.dart Skips the memory-limit case.
example/​lib/​services/​fjs_service.dart Uses graceful session shutdown.
libfjs/​src/​tests/​boundary_tests.rs Adds memory-limit regression coverage.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/build-all-platforms.yml
// Drain already-scheduled JavaScript work before teardown so pending
// evaluations settle normally instead of surfacing as late cancelled
// errors after the caller has moved on.
Future<void> dispose() => engine.closeGracefully();
Comment on lines +1960 to +1961
},
skip: 'known bridge issue: memory-limit error surfaces as CANCELLED_ERROR');
Comment on lines +152 to +158
test('fetches several composite outputs sorted and byte-exact', () async {
final outputDir = Directory(path.join(temp.path, 'out'))..createSync();

await fetcher(outputDir: outputDir.path, assetNames: [
'fjs.xcframework.zip.checksum',
'fjs.xcframework.zip',
]).run();
std::thread::spawn(|| {
let runtime = tokio::runtime::Runtime::new().unwrap();
runtime.block_on(async {
let engine = JsEngine::create(
@iota9star
iota9star merged commit dda7f8f into main Sep 30, 2026
14 checks passed
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.

2 participants