Repository navigation
fix(tests): make the Ember test job finish and pass - #14
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the Ember.js CI
Teststep, 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
ember testbuilds.index.jsnow loads the engine eagerly only whenember testruns from this package; host apps keep lazy loading. This is the same approach fleetops uses.tracked-built-inswithout declaring it, soservice:universe/registry-servicecould not be created in any test. 0.3.26 declares it.API/osrm/socketconfig ember-core reads when it loadsEXTEND_PROTOTYPES: true, as the console sets it and ember-ui relies onhostRouteralias@fleetbase/console/extensionsmodulecompany,user,file, …) that pallet's models relate toTests
orders/*/detailsand theoperations/*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.