-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running tests shows Warnings and Deprecation's #4416
Comments
Hi @frunjik. These warnings are expected. Most of them are from recent deprecations and warnings added to the code base. Since they don't fail the build these cleaning up the old tests often get missed. If you have some time to get rid of some of these that would be great. |
My knowledge lacks to be able to solve the issues myself. DEPRECATION: Using the global version of DS is deprecated. Please either import the specific modules needed or import DS from 'ember-data';. [deprecation id: ember-data.global-ds]
WARNING: FEATURE["ds-serialize-ids-and-types"] is set as enabled, but FEATURE flags are only available in canary builds.
DEPRECATION: The adapter returned an array for the primary data of a queryRecord response. This is deprecated as queryRecord should return a single record. [deprecation id: ds.serializer.rest.queryRecord-array-response]
DEPRECATION: RESTSerializer.normalizeHash has been deprecated. Please use serializer.normalize to modify the payload of single resources. [deprecation id: ds.serializer.normalize-hash-deprecated]
WARNING: There is no attribute or relationship with the name notInMapping on post. Check your serializers attrs hash.
WARNING: Ember Data expected to find records with the following ids in the adapter response but they were missing: [igor]
WARNING: Interacting with a record errors object will no longer change the record state.
tests/unit/model/errors.js (all tests in this module give the warning)
|
Tracking progress
|
With regards to the queryRecord warning, there are two tests (next to each other) in rest-adapter-test. One "queryRecord - returning an array picks the first one but saves all records to the store" seems to run counter to "queryRecord - returning an array is deprecated". I'm not sure which of these tests is the valid one. It appears that the code is following the latter (deprecation warning). |
[CLEANUP beta] Remove feature flag for ds-serialize-ids-and-types (shipped in 2.6) #4416
There are some tests in the Ember Data repo that test for deprecated behavior. I don't believe we want to remove those tests yet because the deprecated behavior is still valid until Ember Data 3.0 and we don't want to accidentally break it before then. Recently I discovered that the ember-dev library injects an ignoreDeprecation(function() {
//... some code that is deprecated
}) We may also need to add |
That sounds great - unfortunately it seems to only apply to synchronous code. I opened a corresponding issue emberjs/ember-dev#165 |
One technique that is used in some places in the Ember Data tests is to mock out the API response and wrap some async code in an |
Thx for helping me understand :) A general test question: To test locally i run: ember serve -lrp 49155 - localhost:4200/tests both succeed... But when i push the commit, the build (sometimes) fails ... What command(s) do i need to invoke to simulate the test run's the CI's do ? |
@frunjik Thank you so much for tackling this and please forgive the late response. Are you still willing to work on this? Is there anything I can do to help? Feel free to reach out in the Ember Community Slack. |
When i run the tests i get warnings and deprecation's.
Before i try to see if i can get rid of them i want to understand if this is expected behavior, or am i doing something wrong ?
import DS from 'ember-data';
. [deprecation id: ember-data.global-ds]at HANDLERS.(anonymous function) (http://localhost:4200/assets/vendor.js:16464:7)
at raiseOnDeprecation (http://localhost:4200/assets/vendor.js:16372:12)
at HANDLERS.(anonymous function) (http://localhost:4200/assets/vendor.js:16464:7)
at invoke (http://localhost:4200/assets/vendor.js:16480:7)
at deprecate (http://localhost:4200/assets/vendor.js:16433:32)
at Object.deprecate (http://localhost:4200/assets/vendor.js:26472:37)
at deprecate (http://localhost:4200/assets/vendor.js:69315:40)
at get (http://localhost:4200/assets/vendor.js:82215:44)
at http://localhost:4200/assets/tests.js:21:21
queryRecord
response. This is deprecated asqueryRecord
should return a single record. [deprecation id: ds.serializer.rest.queryRecord-array-response]at HANDLERS.(anonymous function) (http://localhost:4200/assets/vendor.js:16464:7)
at raiseOnDeprecation (http://localhost:4200/assets/vendor.js:16372:12)
at HANDLERS.(anonymous function) (http://localhost:4200/assets/vendor.js:16464:7)
at invoke (http://localhost:4200/assets/vendor.js:16480:7)
at deprecate (http://localhost:4200/assets/vendor.js:16433:32)
at Object.deprecate (http://localhost:4200/assets/vendor.js:26472:37)
at deprecate (http://localhost:4200/assets/vendor.js:69315:40)
at http://localhost:4200/assets/vendor.js:85334:48
at runInDebug (http://localhost:4200/assets/vendor.js:16645:5)
notInMapping
onpost
. Check your serializers attrs hash.RESTSerializer.normalizeHash
has been deprecated. Please useserializer.normalize
to modify the payload of single resources. [deprecation id: ds.serializer.normalize-hash-deprecated]at HANDLERS.(anonymous function) (http://localhost:4200/assets/vendor.js:16464:7)
at raiseOnDeprecation (http://localhost:4200/assets/vendor.js:16372:12)
at HANDLERS.(anonymous function) (http://localhost:4200/assets/vendor.js:16464:7)
at invoke (http://localhost:4200/assets/vendor.js:16480:7)
at deprecate (http://localhost:4200/assets/vendor.js:16433:32)
at Object.deprecate (http://localhost:4200/assets/vendor.js:26472:37)
at deprecate (http://localhost:4200/assets/vendor.js:69315:40)
at normalize (http://localhost:4200/assets/vendor.js:85181:46)
at superWrapper as normalize
The text was updated successfully, but these errors were encountered: