Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
Odoo scripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
XCG
Odoo scripts
Commits
c0b3edd1
Commit
c0b3edd1
authored
2 years ago
by
Vincent Hatakeyama
Browse files
Options
Downloads
Patches
Plain Diff
detect import errors in run_tests
parent
082f9923
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!126
🚑 detect import errors in run_tests
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
NEWS.rst
+2
-0
2 additions, 0 deletions
NEWS.rst
run_tests
+14
-0
14 additions, 0 deletions
run_tests
with
16 additions
and
0 deletions
NEWS.rst
+
2
−
0
View file @
c0b3edd1
...
@@ -11,6 +11,8 @@
...
@@ -11,6 +11,8 @@
Make docker_pylint work on Odoo 11 projects that uses python3.8.
Make docker_pylint work on Odoo 11 projects that uses python3.8.
Detect import errors in run_tests.
16.6.0
16.6.0
------
------
...
...
This diff is collapsed.
Click to expand it.
run_tests
+
14
−
0
View file @
c0b3edd1
...
@@ -73,6 +73,12 @@
...
@@ -73,6 +73,12 @@
then
then
tests_errors
=
0
tests_errors
=
0
fi
fi
import_errors
=
$(
grep
-P
'o(penerp|doo).(modules.module|[^ ]+): Can not `import [a-z0-9_]+`.'
$logfile
)
import_errors_number
=
$(
cat
$import_errors
|wc
-l
)
if
[[
"
$import_errors_number
"
-ne
0
]]
;
then
test_errors
=
$((
test_errors+import_errors_number
))
fi
fi
fi
# create a OpenMetrics metrics file
# create a OpenMetrics metrics file
if
[
"
$CI
"
=
"true"
]
;
if
[
"
$CI
"
=
"true"
]
;
...
@@ -85,6 +91,10 @@
...
@@ -85,6 +91,10 @@
fi
fi
# odoo 13 uses FAIL as the error message, in the form: FAIL: TestReorderingRule.test_reordering_rule
# odoo 13 uses FAIL as the error message, in the form: FAIL: TestReorderingRule.test_reordering_rule
failed
=
$(
grep
' FAIL\(ED\|:\)\| CRITICAL\| ERROR [^ ]* openerp.modules.module: Can not .import openerp\.addons\.\| TEST .* ERROR:\|Failed to initialize database\| ERROR \([[:alnum:]]\|_\)* .\+\.test_.\+ ERROR: '
$logfile
-c
)
failed
=
$(
grep
' FAIL\(ED\|:\)\| CRITICAL\| ERROR [^ ]* openerp.modules.module: Can not .import openerp\.addons\.\| TEST .* ERROR:\|Failed to initialize database\| ERROR \([[:alnum:]]\|_\)* .\+\.test_.\+ ERROR: '
$logfile
-c
)
if
[[
-n
"
$import_errors_number
"
]]
;
then
failed
=
$((
failed+
$import_errors_number
))
fi
warnings
=
$(
grep
' WARNING '
$logfile
-c
)
warnings
=
$(
grep
' WARNING '
$logfile
-c
)
# XXX Not sure this is needed anymore with the tests_failures/tests_errors detection
# XXX Not sure this is needed anymore with the tests_failures/tests_errors detection
if
[[
$failed
-eq
0
]]
;
if
[[
$failed
-eq
0
]]
;
...
@@ -121,6 +131,10 @@
...
@@ -121,6 +131,10 @@
GREP_COLOR
=
'0;31'
grep
--color
=
always
"TEST .* ERROR:"
$logfile
GREP_COLOR
=
'0;31'
grep
--color
=
always
"TEST .* ERROR:"
$logfile
# this one is for odoo 13 for tests that produces errors (failures are matched with FAIL: )
# this one is for odoo 13 for tests that produces errors (failures are matched with FAIL: )
GREP_COLOR
=
'0;31'
grep
--color
=
always
"ERROR
\(
[[:alnum:]]
\|
_
\)
* .
\+\.
test_.
\+
ERROR:"
$logfile
GREP_COLOR
=
'0;31'
grep
--color
=
always
"ERROR
\(
[[:alnum:]]
\|
_
\)
* .
\+\.
test_.
\+
ERROR:"
$logfile
if
[[
-n
"
$import_errors
"
]]
;
then
echo
$import_errors
fi
fi
fi
echo
''
echo
''
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment