Skip to content

feat(smoke): add canonical SDK smoke against sdk_demo_backend#10

Merged
Taure merged 2 commits into
mainfrom
feat/smoke-test
May 1, 2026
Merged

feat(smoke): add canonical SDK smoke against sdk_demo_backend#10
Taure merged 2 commits into
mainfrom
feat/smoke-test

Conversation

@Taure
Copy link
Copy Markdown
Contributor

@Taure Taure commented May 1, 2026

Summary

Adds the canonical SDK smoke test from sdk_demo_backend/SMOKE.md and a CI workflow that brings up the demo backend and runs it on every PR + push to main.

The smoke imports only from package:flame_asobi/flame_asobi.dart, so a green run also proves the bridge package's re-export contract still works (AsobiClient, AsobiRealtime, the realtime event streams, PlayerState).

The Flame mixins (HasAsobi, HasAsobiInput, AsobiNetworkSync, ...) require a running FlameGame loop and are out of scope for a headless smoke. Proving the underlying client contract holds is enough to gate releases on the upstream SDK contract.

What the smoke verifies

Per SMOKE.md:

  1. Auth + WS connect — register two players (smoke_a_<ts>_<rand>, smoke_b_...), open WebSockets.
  2. Matchmaker -> match.matched — both queue with mode "demo", both receive a match.matched event with the same match_id within 10 s.
  3. match.input -> match.state — capture x_initial from the first match.state, send {move_x: 1, move_y: 0} via realtime.sendMatchInput({...}), assert a subsequent match.state shows x > x_initial + 10 within 3 s.

asobi dependency

Pinned to a git ref on main:

asobi:
  git:
    url: https://github.com/widgrensit/asobi-dart
    ref: main

The smoke depends on the post-PR-#14 sendMatchInput(Map<String, dynamic>) signature (typed MatchInput was removed). asobi-dart 0.1.0 on pub.dev still has the old typed API. The git pin should be reverted to a pub.dev version (>= 0.2.0) once asobi-dart cuts a release.

Out of scope

  • The pre-existing 70+ analyzer errors in test/ (class -> mixin migration). Untouched.
  • Publishing prep — keeping the version at 0.1.0 and the git dep is intentional for now; a follow-up PR should swap to a pub.dev version before the next release.

CI

.github/workflows/smoke.yml checks out flame_asobi + widgrensit/sdk_demo_backend, brings up docker compose, sets up Flutter (needed because flame_asobi transitively imports package:flutter), runs dart run smoke_tests/smoke.dart against http://localhost:8084, and dumps backend logs on failure.

Test plan

  • CI smoke job goes green on this PR.
  • Manual: cd ../sdk_demo_backend && docker compose up -d && cd - && ASOBI_URL=http://localhost:8084 dart run smoke_tests/smoke.dart -> [smoke] PASS.
  • Once asobi-dart publishes >= 0.2.0, replace the git pin with a pub.dev constraint.

Taure added 2 commits May 1, 2026 19:18
Adds smoke_tests/smoke.dart implementing the three canonical scenarios
defined in widgrensit/sdk_demo_backend/SMOKE.md (auth + WS connect,
matchmaker -> match.matched, match.input -> match.state with
x > x_initial + 10).

The smoke imports only from package:flame_asobi/flame_asobi.dart so a
green run also proves the bridge package's re-export contract holds for
AsobiClient, AsobiRealtime, and the realtime event streams. The Flame
mixins (HasAsobi, HasAsobiInput, AsobiNetworkSync, ...) require a
running FlameGame loop and are not exercised here.

Adds a GitHub Actions workflow (.github/workflows/smoke.yml) that
checks out widgrensit/sdk_demo_backend, brings up its docker compose
stack, runs the smoke against http://localhost:8084, dumps backend
logs on failure, and tears the stack down.

Pins asobi to a git ref on main until asobi-dart publishes the
post-PR-#14 release that drops typed MatchInput in favour of
Map<String, dynamic>; revert to a pub.dev version (>= 0.2.0) once
published.
flame_asobi transitively imports `package:flame`, which depends on
`dart:ui`. The standalone Dart VM does not expose `dart:ui`, so
`dart run smoke_tests/smoke.dart` fails at compile time. The Flutter
test VM does expose `dart:ui`, so wrapping the smoke in a `test()`
block and invoking it through `flutter test` keeps the
package:flame_asobi-only re-export contract intact while letting the
binary actually compile and run.

Functionally the smoke is unchanged: a single async test, identical
canonical flow, exits non-zero on assertion or timeout.

Verified locally against `widgrensit/sdk_demo_backend` running on
localhost:8084: PASS.
@Taure Taure merged commit d7cdf3d into main May 1, 2026
1 check passed
@Taure Taure deleted the feat/smoke-test branch May 1, 2026 17:25
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