-
Notifications
You must be signed in to change notification settings - Fork 81
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
DCOS_OSS-2185: Upgrade jest #2783
Conversation
This repo has @mesosphere-mergebot integration. You can interact with the following commands.
|
ee935a5
to
14c1330
Compare
5e46095
to
27a966e
Compare
f0537bb
to
af40809
Compare
62bb818
to
f870618
Compare
1636a0a
to
366d9e2
Compare
af40809
to
2bd6033
Compare
This is needed as the updated jest version does not allow this anymore: jestjs/jest#3970 This jscodeshift did the change together with an eslint --fix https://gist.github.com/DanielMSchmidt/9e1bc548ab5d8d1a3fadddc2d735f8c2 DCOS_OSS-2185
DCOS_OSS-2185
This jest version does not allow contexts DCOS_OSS-2185
The codemod run earlier didn't catch this case DCOS_OSS-2185
DCOS_OSS-2185
Relates to DCOS_OSS-2185
Using this is okay in this case Relates to DCOS_OSS-2185
The second argument of expect would set some context. This refactoring uses call directly Relates to DCOS_OSS-2185
jasmine.clock().tick() worked differently, with jest we need to reset Relates to DCOS_OSS-2185
It works fine when we switch to enzyme, so I created https://jira.mesosphere.com/browse/DCOS_OSS-2206 to keep track of the move to enzyme Relates to DCOS_OSS-2206 & DCOS_OSS-2185
By changing this we can use cmd+click to open up the tests from the terminal. Relates to DCOS_OSS-2185
366d9e2
to
9243786
Compare
@@ -9,7 +9,7 @@ import TaskFileViewer from "../TaskFileViewer"; | |||
|
|||
let thisContainer, thisInstance; | |||
|
|||
describe("TaskFileViewer", function() { | |||
describe.skip("TaskFileViewer", function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should expend 1hr here trying to have it not skippable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you get to do this yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not yet, but will have some time later today. A Will do it or unblock it.
Jenkinsfile
Outdated
@@ -51,7 +51,23 @@ pipeline { | |||
stage('Unit Test') { | |||
steps { | |||
ansiColor('xterm') { | |||
sh '''npm run test -- --maxWorkers=2''' | |||
sh '''npm run test -- --maxWorkers=2 --coverage''' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we move it to another PR so we make sure that this does not get too many resources, or that it really works independently?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I openend this PR: #2801
jest/gen-config.js
Outdated
@@ -56,7 +56,7 @@ var config = { | |||
moduleFileExtensions: ["js", "json", "es6"], | |||
modulePathIgnorePatterns: ["/tmp/", "/node_modules/", "/.module-cache/"], | |||
timers: "fake", | |||
coverageReporters: ["json", "lcov", "cobertura", "text"], | |||
coverageReporters: ["cobertura"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you move the previous commit, you have to move this too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#2801 is the PR for this now
9243786
to
fe5132d
Compare
He @Fabs Could you review again? :) |
I ran:
And I was left with some jest untracked files and changes to npm-shrink-wrap. https://gist.github.com/Fabs/e158d9b8031e7a3e16b5bec8f55a9eb3 |
I think I have to run with the respective private branch. |
@Fabs the untracked file is because you already had a For the shrinkwrap, they can change with time, because dependencies of dependencies might change |
After changing the tests to not use the 'this' keyword we had some unused variables that we skipped linting. This commit cleans up this by effectively removing those variables.
d2d517c
to
d7c03f1
Compare
Fixed vartiable declarations and import ReactDOM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I approve daniel work, but I added some commits myself, so maybe lets aim for 3 approvals?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ran locally and looked over code 🚢
Impact:
The max MB used as a heap are 476MB 👍 This means smaller CI nodes for us
ToDos
this.foo
in tests, a jscodeshift is work in progressRouterUtil-test
depends hard on the location, which seems to be not settable anymore. I would like to change the API and usewindow.location. ...
as a default value to make this easier testableReducerUtil-test.js
fails to a "valid" reason, needs more investigationPackageDetailTab-test.js
fails due to transition from jests two argument expect to only one argument being supported (removing the second doesn't work, seems like it was the this or sth?)advanceTimersByTime
does not properly move the time forward inMetronomeStore-test
Authenticated-test
fails due tofindAllInRenderedTree: instance must be a composite component
Checklist