Repository navigation
test(e2e): upgrade-with-history test — server must answer while legacy data migrates - #264
Conversation
|
| */ | ||
| @RunWith(AndroidJUnit4::class) | ||
| class UpgradeWithHistoryTest { | ||
| @get:Rule |
There was a problem hiding this comment.
PACKAGE_USAGE_STATS is controlled by AppOps, and the repository's existing instrumentation setup documents that GrantPermissionRule cannot enable it on a fresh CI emulator. This test can therefore start without usage access, causing MainActivity to redirect to onboarding instead of starting the server. The readiness check then times out without exercising the migration.
There was a problem hiding this comment.
Fixed in 4cebe1c.
Replaced GrantPermissionRule with the AppOps grant NativeWindowInsetsTest already uses (appops set … GET_USAGE_STATS allow). PACKAGE_USAGE_STATS is not a runtime permission, so the old rule left usage access off on a fresh emulator and MainActivity would have redirected to onboarding before the server started.
Retriggering Greptile on this commit.
…y data migrates Regression guard for ActivityWatch#261. Every instrumented test started from a fresh install, so the legacy-bucket migration path (both buckets present, six-figure history) never ran in CI and an O(n^2) merge shipped to production. Seeds a v5-schema sqlite.db with 100k legacy + 10k current events and one overlapping cutover heartbeat before the datastore opens, launches MainActivity, and asserts /api/0/info answers within 20 s and the merge completes within 60 s (only the overlapping pair stays behind). Runs in its own instrumentation process via make test-e2e-upgrade; make test-e2e now runs the main suite first and this test after. Git-Session-Id: 70b6
d722a96 to
864a972
Compare
GrantPermissionRule cannot enable PACKAGE_USAGE_STATS on a fresh CI emulator. MainActivity then redirects to onboarding and /api/0/info never answers, so the regression never exercises the migration. Use the same AppOps grant NativeWindowInsetsTest already uses. Git-Session-Id: 3824146
|
@greptileai review |
|
CI-green and mergeable (Greptile 5/5) — waiting only on a maintainer click. This PR is ready to merge, but the bot has pull-only access to this repo and can't self-merge — surfacing it here so it isn't lost. The monitoring loop will stop re-flagging it now that this note is posted. |
Regression guard for #261, the CI gap behind the v0.14.0 incident.
Every instrumented test started from a fresh install, so the legacy-bucket migration path (both
aw-watcher-android-test_<host>andaw-watcher-android_<host>present, six-figure history) never ran in CI and an O(n²) merge shipped to production.What it does: before the native datastore opens, seeds a v5-schema
sqlite.dbintofilesDirwith 100k legacy + 10k current five-minute events and one heartbeat straddling the cutover, marks onboarding/hostname migration done, launchesMainActivity, then asserts:GET /api/0/infoanswers within 20 s of launch/events/count)How it runs: in its own instrumentation process (the datastore is opened once per process), via the new
make test-e2e-upgrade;make test-e2enow runs the main suite first and this test after, so the existing CI E2E job picks it up without workflow changes.Expected result on this PR as-is: red at "server did not answer /api/0/info", because master still pins the aw-server-rust with the quadratic merge. That failure is the demonstration. Green after #263 (submodule bump) merges; I'll rebase then.