Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Lu Xu
slapos
Commits
c7f620fc
Commit
c7f620fc
authored
May 09, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stack/erp5: handle coverage reporting from erp5.git
This now supports producing html reports directly
parent
9c6ed6c5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
45 deletions
+13
-45
software/erp5/instance-erp5-input-schema.json
software/erp5/instance-erp5-input-schema.json
+6
-0
stack/erp5/buildout.cfg
stack/erp5/buildout.cfg
+7
-45
No files found.
software/erp5/instance-erp5-input-schema.json
View file @
c7f620fc
...
@@ -590,6 +590,12 @@
...
@@ -590,6 +590,12 @@
"examples"
:
[
"examples"
:
[
"https://user:password@example.com/{test_result_id}/{test_name}.coverage.sqlite3"
"https://user:password@example.com/{test_result_id}/{test_name}.coverage.sqlite3"
]
]
},
"fail-under"
:
{
"description"
:
"Make the test reporting coverage fail if combined coverage is below this percentage value."
,
"type"
:
"number"
,
"minimum"
:
0
,
"maximum"
:
100
}
}
}
}
},
},
...
...
stack/erp5/buildout.cfg
View file @
c7f620fc
...
@@ -73,7 +73,6 @@ parts +=
...
@@ -73,7 +73,6 @@ parts +=
slapos-cookbook
slapos-cookbook
mroonga-mariadb
mroonga-mariadb
tesseract
tesseract
.coveragerc
# Buildoutish
# Buildoutish
eggs-all-scripts
eggs-all-scripts
...
@@ -432,52 +431,15 @@ initialization =
...
@@ -432,52 +431,15 @@ initialization =
if coverage_process:
if coverage_process:
coverage_process.stop()
coverage_process.stop()
coverage_process.save()
coverage_process.save()
# upload the coverage so that they can be combined
from another machine
# upload the coverage so that they can be combined
upload_url = test_runner_configuration['coverage'].get('upload-url')
upload_url = test_runner_configuration['coverage'].get('upload-url')
if upload_url:
if upload_url:
import requests
import Products.ERP5Type.tests.coverage_report
import time
Products.ERP5Type.tests.coverage_report.upload(
import uritemplate
coverage_data_file,
from six.moves.urllib.parse import urlparse
upload_url,
test_name)
auth_list = (None, )
parsed_url = urlparse(upload_url)
if parsed_url.username:
# try Digest and Basic authentication and retry 5 times to tolerate transiant errors
auth_list = (
requests.auth.HTTPDigestAuth(parsed_url.username, parsed_url.password),
requests.auth.HTTPBasicAuth(parsed_url.username, parsed_url.password),
) * 5
url = uritemplate.URITemplate(upload_url).expand(
test_name=test_name,
# Environment variables are set in parts/erp5/product/ERP5Type/tests/runTestSuite.py
test_result_id=os.environ.get('ERP5_TEST_RESULT_ID', 'unknown_test_result_id'),
test_result_revision=os.environ.get('ERP5_TEST_RESULT_REVISION', 'unknown_test_result_revision'),
)
for auth in auth_list:
with open(coverage_data_file, 'rb') as f:
resp = requests.put(url, data=f, auth=auth)
if resp.ok:
# print just the hostname, not to include the auth part
print('Uploaded coverage data to {parsed_url.hostname}'.format(parsed_url=parsed_url))
break
print('Error {resp.status_code} uploading coverage data to {parsed_url.hostname} with {auth.__class__.__name__}'.format(
resp=resp, parsed_url=parsed_url, auth=auth))
time.sleep(1)
else:
sys.stderr.write('Error uploading coverage data to {parsed_url.hostname}\n'.format(parsed_url=parsed_url))
[.coveragerc]
recipe = slapos.recipe.template
output = ${buildout:directory}/${:_buildout_section_name_}
inline =
# coverage configuration file, useful when making html report
[run]
plugins =
erp5_coverage_plugin
relative_files = true
[test-suite-runner]
[test-suite-runner]
# XXX: Workaround for fact ERP5Type is not an distribution and does not
# XXX: Workaround for fact ERP5Type is not an distribution and does not
...
...
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