Skip to content
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

WIP: upgrade dependencies #120

Closed
wants to merge 9 commits into from
Closed

Conversation

jelhan
Copy link
Collaborator

@jelhan jelhan commented Dec 10, 2019

Upgrades all dependencies to their latest versions.

@jelhan jelhan mentioned this pull request Dec 20, 2019
10 tasks
Copy link
Owner

@rwjblue rwjblue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ember-cli@3.15.1 is out, mind updating for that blueprint?

@jelhan
Copy link
Collaborator Author

jelhan commented Dec 21, 2019

Do not merge. CI is green even so one scenario has failed:

  7 passing (4m)

  1 failing

  1) e2e: provides test support

       does not cause tests failures if `failTests` config option is `false`:

     Error: the object {

  "code": 1

  "errors": [

    "'@ember/string' is imported by ../../../broccoli-7817MYh85jahRM0H/cache-118-rollup/build/-private/system/normalize-model-name.js, but could not be resolved – treating it as an external dependency\n"

    "'@ember/string' is imported by ../../../broccoli-7817MYh85jahRM0H/cache-118-rollup/build/-private/adapters/build-url-mixin.js, but could not be resolved – treating it as an external dependency\n"

    "'@ember/string' is imported by ../../../broccoli-7817MYh85jahRM0H/cache-118-rollup/build/-private/system/debug/debug-adapter.js, but could not be resolved – treating it as an external dependency\n"

    "Testem finished with non-zero exit code. Tests failed.\n"

    "\n"

  ]

  "output": [

    "Building\n"

    "Environment: test\n"

    "building... \n"

    "cleaning up\n"

    "cleaning up...\n"

    "Built project successfully. Stored in \"/tmp/tests-dist-20191121-7817-1c0ndcd.dlza\".\n"

    "not ok 1 Chrome 79.0 - [undefined ms] - Global error: Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: \"script-src 'self' 'nonce-abcdefg'\".\n at http://localhost:7357/assets/vendor.js, line 90704\n    ---\n        browser log: |\n            testContext: [object Object]\n            ERROR: Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: \"script-src 'self' 'nonce-abcdefg'\".\n             at http://localhost:7357/assets/vendor.js, line 90704\n            \n    ...\n"

    "not ok 2 Chrome 79.0 - [undefined ms] - Global error: Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: \"script-src 'self' 'nonce-abcdefg'\".\n at http://localhost:7357/assets/test-support.js, line 16797\n    ---\n        browser log: |\n            testContext: [object Object]\n            ERROR: Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: \"script-src 'self' 'nonce-abcdefg'\".\n             at http://localhost:7357/assets/test-support.js, line 16797\n            \n    ...\n"

    "not ok 3 Chrome 79.0 - [2 ms] - global failure\n    ---\n        actual: >\n            null\n        stack: >\n            EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: \"script-src 'self' 'nonce-abcdefg'\".\n            \n                at Object.1 (http://localhost:7357/assets/test-support.js:16797:1)\n                at __webpack_require__ (http://localhost:7357/assets/test-support.js:16699:30)\n                at http://localhost:7357/assets/test-support.js:16763:18\n                at http://localhost:7357/assets/test-support.js:16766:10\n        message: >\n            Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: \"script-src 'self' 'nonce-abcdefg'\".\n            \n        negative: >\n            false\n        browser log: |\n    ...\n"

    "ok 4 Chrome 79.0 - [98 ms] - Integration | Component | my-component: it renders\n"

    "ok 5 Chrome 79.0 - [1 ms] - ESLint | app: app.js\n"

    "ok 6 Chrome 79.0 - [0 ms] - ESLint | app: router.js\n"

    "ok 7 Chrome 79.0 - [1 ms] - TemplateLint: default/templates/application.hbs\n"

    "ok 8 Chrome 79.0 - [1 ms] - ESLint | tests: integration/components/my-component-test.js\n"

    "ok 9 Chrome 79.0 - [0 ms] - ESLint | tests: test-helper.js\n"

    "ok 10 Chrome 79.0 - [0 ms] - ember-qunit: Ember.onerror validation: Ember.onerror is functioning properly\n"

    "\n1..10\n# tests 10\n# pass  7\n# skip  0\n# fail  3\n"

  ]

  "signal": [null]

} was thrown, throw an Error :)

      at <anonymous>

      at process._tickCallback (internal/process/next_tick.js:189:7)

Seems like the hacky work-a-round used by yarn test:node is reporting wrong results.

@@ -19,50 +19,55 @@
"start": "ember serve",
"test": "ember test",
"test:all": "ember try:each",
"test:node": "for i in node-tests/*/*; do mocha $i; done"
"test:node": "( for i in node-tests/*/*; do mocha $i || exit $?; done )"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exit code of a for loop is the exit code of last iteration. So that's not very helpful here. To avoid wrong test result we use a subshell that is exit as soon as one test fails. Have found that trick here: https://stackoverflow.com/questions/14059342/how-to-get-the-exit-status-a-loop-in-bash

This will stop the tests as soon as the first file fails. It will not process later tests.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@jelhan
Copy link
Collaborator Author

jelhan commented Dec 23, 2019

I was able to trace it down to the upgrade of ember-cli from 3.14.0-beta.1 to 3.14.0. It seems like Ember CLI started to treat CSP violations as Global error:

"not ok 1 Chrome 79.0 - [undefined ms] - Global error: Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: \"script-src 'self' 'nonce-abcdefg'\".\n at http://localhost:7357/assets/vendor.js, line 87376\n    ---\n        browser log: |\n            testContext: [object Object]\n            ERROR: Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: \"script-src 'self' 'nonce-abcdefg'\".\n             at http://localhost:7357/assets/vendor.js, line 87376\n            \n    ...\n"

This error is not caused by this addon but by the browser. It's somehow forwarded to Ember CLI and causes ember test to fail. Need to have a look into the changes between ember-cli@3.14.0-beta.1 and 3.14.0 in detail. Not sure if we can control this behavior from an addon at all.

@jelhan jelhan changed the title Upgrade dependencies WIP: upgrade dependencies Jan 6, 2020
@jelhan
Copy link
Collaborator Author

jelhan commented Jan 6, 2020

Fear I have broken GitHub / Travis integration by rewriting the history too much. The commits are not linked to correct CI runs. I'm also still struggling getting a clear picture about which upgrade has broken the pipeline... Please just ignore the PR for now until I have more details to share.

@jelhan jelhan mentioned this pull request Jan 7, 2020
@jelhan
Copy link
Collaborator Author

jelhan commented Jan 7, 2020

Superseded by #126

@jelhan jelhan closed this Jan 7, 2020
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.

2 participants