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
JS Static tests added to CI (ESLint + JSCS) #9093
Changes from 5 commits
90790da
e68d69c
9bb08b3
6235ddc
05f9f88
f851c55
816561e
aa63efc
4b15bb0
969e324
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"file": { | ||
"options": { | ||
"configFile": "dev/tests/static/testsuite/Magento/Test/Js/_files/eslint/.eslintrc", | ||
"reset": true, | ||
"useEslintrc": false | ||
} | ||
}, | ||
"test": { | ||
"options": { | ||
"configFile": "dev/tests/static/testsuite/Magento/Test/Js/_files/eslint/.eslintrc", | ||
"reset": true, | ||
"outputFile": "dev/tests/static/eslint-error-report.xml", | ||
"format": "junit", | ||
"quiet": true | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ module.exports = function (grunt) { | |
}; | ||
|
||
grunt.registerTask('static', function (target) { | ||
var currentTarget = target || 'test', | ||
var currentTarget = target || 'file', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Currently we use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. UX. Dev should be able to quickly run If you need to generate this XML files for some reason, run There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, make sense. But change, please, in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But... the whole point is to not use Also, Results of
Results of
|
||
file = grunt.option('file'), | ||
tasks = [ | ||
'eslint:' + currentTarget, | ||
|
@@ -26,7 +26,11 @@ module.exports = function (grunt) { | |
|
||
setConfig('eslint', currentTarget, cvf.getFiles(file)); | ||
setConfig('jscs', currentTarget, cvf.getFiles(file)); | ||
grunt.option('force', true); | ||
|
||
if (grunt.option('force') !== false) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please, revert this changes, we already solve this issue. We add grunt-continue, that provide ability to run in force mode(for collect eslint and jscs errors) and fail on warnings. Internal ticket MAGETWO-67342 now in delivery process. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
grunt.option('force', false); | ||
} | ||
|
||
grunt.task.run(tasks); | ||
|
||
if (!grunt.option('file')) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
case $TEST_SUITE in | ||
static) | ||
TEST_FILTER='--filter "Magento\\Test\\Php\\LiveCodeTest"' || true | ||
phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER | ||
grunt static --force=false | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please, remove --force. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
;; | ||
js) | ||
grunt spec | ||
;; | ||
esac |
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.
Please, convert jscs config to json 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.
Done.