Skip to content

fix(tests): make the Ember test job finish and pass - #14

Merged
roncodes merged 13 commits into
release/v0.1.0from
fix/ember-ci-hang
Nov 17, 2026
Merged

roncodes merged 13 commits into
release/v0.1.0from
fix/ember-ci-hang

Conversation

@roncodes

@roncodes roncodes commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Fixes the Ember.js CI Test step, which hung until the job timed out (since at least October). With this branch the suite finishes: 116 tests, 116 passing, and the Build step runs again.

Why it hung

The test build had no @fleetbase/pallet-engine/* modules, so loading the dummy app threw before any test ran. Every test then failed and the runner never reported completion. Once the modules load, the run finishes normally.

Causes fixed

  • Lazy engine loading. It kept the engine's modules out of the dummy app that ember test builds. index.js now loads the engine eagerly only when ember test runs from this package; host apps keep lazy loading. This is the same approach fleetops uses.
  • ember-core 0.3.22 → 0.3.26. 0.3.22 imports tracked-built-ins without declaring it, so service:universe/registry-service could not be created in any test. 0.3.26 declares it.
  • Dummy app now stands in for the console host:
    • the API / osrm / socket config ember-core reads when it loads
    • EXTEND_PROTOTYPES: true, as the console sets it and ember-ui relies on
    • a hostRouter alias
    • an inert @fleetbase/console/extensions module
    • stand-in host models (company, user, file, …) that pallet's models relate to
    • an ember-intl locale before first render
    • an ember-local-storage reset between tests

Tests

  • The 17 component tests were untouched ember-cli placeholders asserting an empty render. Each now renders its component with a record and checks what it shows.
  • Removed tests for components and routes that were deleted earlier: product-panel, product-form-panel, cell/product-info, supplier-form-panel/create-form and edit-form, and inventory/index/stock-adjustment.
  • The canonical route and controller lists now point at orders/*/details and the operations/* index and details children.

One commit (tmp: debug inventory form error) is temporary logging that the next commit removes. Squash on merge if you'd rather not keep it.

Pins expiry day counts as absolute integers so they read the same on Carbon 2 and 3. Based on release/v0.0.2, because main has no diffIn calls yet.
Laravel 11+ ships a native Request::array(), which wins over core-api's macro of that
name and stops it splitting comma-separated values. Needs core-api with inputArray.
Laravel 11+ dropped Doctrine. Three things in pallet relied on it:

- add_order_number's hasIndex() called getDoctrineSchemaManager(), which no
  longer exists. The catch turned that into "no index", so down() never
  dropped the unique index and a re-run would add it twice. It now uses
  Schema::hasIndex().
- SQLite column drops now rebuild the table, and fail on a foreign key or
  index left on the column. The down() migrations skipped dropForeign on
  SQLite and never dropped indexes. They now drop the foreign key and index
  first on every driver, which is also what MySQL needs.
- repair_warehouse_hierarchy_keys passed a key name to dropForeign([...]),
  which takes column names, so the MySQL path looked for a key that doesn't
  exist. It passes the column now.

Tests: Pest 3 needs --test-directory server/tests (as composer test:unit
passes). The SQLite lane registers a polygon() column macro, since Laravel 11
removed it from Blueprint (MySQL gets it from the spatial fork), and no
longer maps Doctrine types. 334 tests pass.
…uild

The engine is lazy-loaded, which keeps its modules out of the dummy app that
`ember test` builds, so every test importing @fleetbase/pallet-engine/* failed
to load. Eager loading is now scoped to `ember test` run from this package.

ember-core 0.3.22 imports tracked-built-ins without declaring it, so the
universe registry service could not be created in tests. 0.3.26 declares it.
…or removed code

The dummy app now carries the API/OSRM/socket config ember-core reads at import, the
prototype extensions the console enables and ember-ui depends on, a hostRouter alias,
an inert @fleetbase/console/extensions module, and an ember-intl locale before first
render.

Tests for components and routes that no longer exist are removed, and the canonical
route/controller lists follow the order details views to orders/*/details.
The integration tests were untouched ember-cli blueprints asserting an empty render,
which no panel satisfies once it can load. Each now renders its component with a record
and checks what it shows: form titles for new and existing records, detail headers and
the default tab, context-panel focus/clear, the category list (store query stubbed),
and the warehouse editor's wormholed overlay.

The dummy app gains stand-ins for the console host models pallet's models relate to,
and the canonical route/controller lists follow operations/* into their index and
details children.
…ve records

ember-local-storage caches storage proxies at module scope, so a later test read
proxies owned by an earlier test's destroyed container. Every setup helper now resets
them. The inventory form test creates the record with a batch as the inventory route
does, and the form-title checks look at the overlay title rather than the whole panel,
whose submit button says Add until the record is saved.
The form's custom fields resolve their owner through the current user's company,
which the console always has loaded before a form can open. Also removes the
temporary error-stack logging from the previous commit.
@roncodes
roncodes marked this pull request as ready for review November 17, 2026 07:11
@roncodes
roncodes merged commit 1ed1e1f into release/v0.1.0 Nov 17, 2026
4 checks passed
@roncodes
roncodes deleted the fix/ember-ci-hang branch November 17, 2026 07:39
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