Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
9bdf9b8b
Commit
9bdf9b8b
authored
Sep 09, 2019
by
Paul Slaughter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add CI check for no partial karma jest migration
parent
6e470884
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
1 deletion
+40
-1
scripts/frontend/check_no_partial_karma_jest.sh
scripts/frontend/check_no_partial_karma_jest.sh
+38
-0
scripts/static-analysis
scripts/static-analysis
+2
-1
No files found.
scripts/frontend/check_no_partial_karma_jest.sh
0 → 100755
View file @
9bdf9b8b
#!/usr/bin/env bash
karma_files
=
$(
find spec/javascripts ee/spec/javascripts
-type
f
-name
'*_spec.js'
-not
-path
'*/helpers/*'
)
violations
=
""
for
karma_file
in
$karma_files
;
do
jest_file
=
${
karma_file
/spec\/javascripts/
"spec/frontend"
}
if
[
-f
$jest_file
]
;
then
violations
=
"
$violations
$jest_file
"
fi
done
if
[[
-z
"
$violations
"
]]
;
then
echo
"All good!"
exit
0
else
echo
"Danger! The following Jest specs have corresponding files in the Karma spec directory (i.e. spec/javascripts):"
echo
""
echo
"------------------------------"
for
file
in
$violations
;
do
echo
$file
done
echo
"------------------------------"
echo
""
echo
"For each of these files, please either:"
echo
""
echo
"1. Fully migrate the file to Jest and remove the corresponding Karma file."
echo
"2. Remove the Jest file for now, make any relevant changes in the corresponding Karma file, and handle the migration to Jest in a separate MR."
echo
""
echo
"Why is this a problem?"
echo
""
echo
"- It's nice to have a single source of truth for the unit tests of a subject."
echo
"- This will cause conflicts if the remaining Karma spec is migrated using our automated tool."
echo
" https://gitlab.com/gitlab-org/frontend/playground/migrate-karma-to-jest"
echo
""
exit
1
fi
scripts/static-analysis
View file @
9bdf9b8b
...
@@ -35,7 +35,8 @@ def jobs_to_run(node_index, node_total)
...
@@ -35,7 +35,8 @@ def jobs_to_run(node_index, node_total)
%w[yarn run prettier-all]
,
%w[yarn run prettier-all]
,
%w[bundle exec rubocop --parallel]
,
%w[bundle exec rubocop --parallel]
,
%w[scripts/lint-conflicts.sh]
,
%w[scripts/lint-conflicts.sh]
,
%w[scripts/lint-rugged]
%w[scripts/lint-rugged]
,
%w[scripts/frontend/check_no_partial_karma_jest.sh]
]
]
case
node_total
case
node_total
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment