Merge lp://staging/~allanlesage/uci-engine/coverage-extractor into lp://staging/uci-engine

Proposed by Allan LeSage
Status: Needs review
Proposed branch: lp://staging/~allanlesage/uci-engine/coverage-extractor
Merge into: lp://staging/uci-engine
Diff against target: 1319 lines (+1251/-0)
12 files modified
coverage-extractor/coverageextractor/__init__.py (+75/-0)
coverage-extractor/coverageextractor/extraction.py (+226/-0)
coverage-extractor/coverageextractor/nfss_client.py (+80/-0)
coverage-extractor/coverageextractor/run_worker.py (+64/-0)
coverage-extractor/coverageextractor/tests/__init__.py (+86/-0)
coverage-extractor/coverageextractor/tests/test_extract_coverage_data.py (+162/-0)
coverage-extractor/coverageextractor/tests/test_extraction.py (+233/-0)
coverage-extractor/coverageextractor/tests/test_handle_request.py (+121/-0)
coverage-extractor/coverageextractor/tests/test_nfss_client.py (+150/-0)
coverage-extractor/setup.py (+34/-0)
coverage-extractor/tox.ini (+19/-0)
testing/run_tests.py (+1/-0)
To merge this branch: bzr merge lp://staging/~allanlesage/uci-engine/coverage-extractor
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Francis Ginther Approve
Review via email: mp+238782@code.staging.launchpad.net

Commit message

Extract line and branch coverage numbers from a coverage.xml artifact deposited in swift, post these to NFSS.

Description of the change

Extract line and branch coverage numbers from a coverage.xml artifact deposited in swift, post these to NFSS.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:858
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/1610/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/1610/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:858
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/1615/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/1615/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:859
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/1616/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/1616/rebuild

review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:860
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/1617/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/1617/rebuild

review: Approve (continuous-integration)
Revision history for this message
Francis Ginther (fginther) wrote :

Here's my first round of feedback. I'm still going through the test modules.

General comments:
We should refactor this with coverage-retriever, they share a lot of code (possibly pushing stuff into ci-utils).

We'll need to figure out how to handle some bigger picture issues. There exists the possibility of multiple coverage results being generated for a source package and a ticket. We can probably punt on this for now, but need to make 'XXX' indications where necessary to know better what will need to be updated.

Will need to pass in the values for the nfss_insert. Ideally we need to make this such that the values aren't required to deploy, but things will fail gracefully if they are missing (other parts of the engine also need to handle this better).

review: Needs Fixing
Revision history for this message
Francis Ginther (fginther) wrote :
Download full text (3.4 KiB)

Adding some more comments.

I also started executing the tests and run into:
Traceback (most recent call last):
  File "./run-tests", line 32, in <module>
    retval = run_tests.main(sys.argv[1:], sys.stdout, sys.stderr)
  File "/tmp/engine/coverage-extractor/testing/run_tests.py", line 443, in main
    options.exclude_regexps)
  File "/tmp/engine/coverage-extractor/testing/run_tests.py", line 134, in load_regular_component_tests
    component_suite = load_component_tests(loader, c)
  File "/tmp/engine/coverage-extractor/testing/run_tests.py", line 99, in load_component_tests
    suite.addTests(sub_loader.loadTestsFromTree('.'))
  File "/tmp/engine/coverage-extractor/.venv/local/lib/python2.7/site-packages/ucitests-0.1.4-py2.7.egg/ucitests/loaders.py", line 145, in loadTestsFromTree
    suite.addTests(self.loadTestsFromFiles(dir_path, names))
  File "/tmp/engine/coverage-extractor/.venv/local/lib/python2.7/site-packages/ucitests-0.1.4-py2.7.egg/ucitests/loaders.py", line 207, in loadTestsFromFiles
    suite.addTests(self.loadTestsFromTree(rel_path))
  File "/tmp/engine/coverage-extractor/.venv/local/lib/python2.7/site-packages/ucitests-0.1.4-py2.7.egg/ucitests/loaders.py", line 140, in loadTestsFromTree
    suite = self.loadTestsFromPackage(dir_path)
  File "/tmp/engine/coverage-extractor/.venv/local/lib/python2.7/site-packages/ucitests-0.1.4-py2.7.egg/ucitests/loaders.py", line 181, in loadTestsFromPackage
    suite.addTests(self.loadTestsFromFiles(dir_path, file_names))
  File "/tmp/engine/coverage-extractor/.venv/local/lib/python2.7/site-packages/ucitests-0.1.4-py2.7.egg/ucitests/loaders.py", line 207, in loadTestsFromFiles
    suite.addTests(self.loadTestsFromTree(rel_path))
  File "/tmp/engine/coverage-extractor/.venv/local/lib/python2.7/site-packages/ucitests-0.1.4-py2.7.egg/ucitests/loaders.py", line 140, in loadTestsFromTree
    suite = self.loadTestsFromPackage(dir_path)
  File "/tmp/engine/coverage-extractor/.venv/local/lib/python2.7/site-packages/ucitests-0.1.4-py2.7.egg/ucitests/loaders.py", line 181, in loadTestsFromPackage
    suite.addTests(self.loadTestsFromFiles(dir_path, file_names))
  File "/tmp/engine/coverage-extractor/.venv/local/lib/python2.7/site-packages/ucitests-0.1.4-py2.7.egg/ucitests/loaders.py", line 204, in loadTestsFromFiles
    suite.addTests(self.loadTestsFromFile(rel_path))
  File "/tmp/engine/coverage-extractor/.venv/local/lib/python2.7/site-packages/ucitests-0.1.4-py2.7.egg/ucitests/loaders.py", line 219, in loadTestsFromFile
    module = self.importFromPath(path)
  File "/tmp/engine/coverage-extractor/.venv/local/lib/python2.7/site-packages/ucitests-0.1.4-py2.7.egg/ucitests/loaders.py", line 278, in importFromPath
    raise ImportError(msg)
ImportError: Failed to import britney.tests.test_process_requests at ./britney/tests/test_process_requests.py:
Traceback (most recent call last):
  File "/tmp/engine/coverage-extractor/.venv/local/lib/python2.7/site-packages/ucitests-0.1.4-py2.7.egg/ucitests/loaders.py", line 274, in importFromPath
    return importlib.import_module(mod_name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "britney_proxy/britney/...

Read more...

review: Needs Fixing
Revision history for this message
Allan LeSage (allanlesage) wrote :

Francis, I've adapted your suggested changes with a couple of exceptions:

* Thomi explained the manual process of generating an OAuth1 key for NFSS to me--it doesn't sound like it's compatible with the automated deploy that you're explained via unit_config, as there are post-deploy steps. In any case I'd like to open a bug to discuss, and implement a later (likely the next) phase of our development.

* I've removed the NFSS deployment items from our juju_deploy template, meanwhile it seems unlikely that these would cause the deploy error you mention above as they're in a separate MP?

Revision history for this message
Allan LeSage (allanlesage) wrote :

Note that we've created an Asana task for the NFSS deployment discussion, hopefully to happen this week while we're all together :) .

Revision history for this message
Francis Ginther (fginther) wrote :

I should have found this format sooner. Please use the format for filing XXX comments:

# XXX <irc handle> <YYYYMMDD>

So:

# XXX alesage 20141022
# Something to revisit, blah blah.

Also, please keep these inside comments and not docstrings.

There are some additional comments inline, but this is much closer.

review: Needs Fixing
Revision history for this message
Allan LeSage (allanlesage) wrote :

Francis, I've updated per your comments--can you be persuaded to accept a second MP concerning the NFSS deployment details? Thomi agrees to defer (even until next phase) but I intend to discuss and probably fix before EOW--unless this just doesn't make sense in your opinion.

Revision history for this message
Francis Ginther (fginther) wrote :

Allan, I'm fine with a follow up MP. Also, I may have crossed my comments with your responses. As this component isn't deployed just yet. I'm ok to just address the TODO and XXX comments before top-approving. Please ping me tomorrow (or is it now today) if there is any confusion or my inline comments are not visible.

review: Needs Fixing
Revision history for this message
Allan LeSage (allanlesage) wrote :

Ok I've updated my code-comments, amending them to XXX alesage <date> format, adding a link to this MP where helpful.

Revision history for this message
Francis Ginther (fginther) wrote :

This looks good, thanks for the update.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:863
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/1631/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/1631/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Francis Ginther (fginther) wrote :

The unit tests for the coverage-extractor are failing. Looks like the reason is that the version of ucitests in setup.py don't match the other components. Should be 0.1.5.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:864
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/1632/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/1632/rebuild

review: Approve (continuous-integration)
Revision history for this message
Allan LeSage (allanlesage) wrote :

Top-approved with fginther's looking over my shoulder :) .

Revision history for this message
Ubuntu CI Bot (uci-bot) wrote :

The attempt to merge lp:~allanlesage/uci-engine/coverage-extractor into lp:uci-engine failed. Below is the output from the failed tests.

INFO:root:Creating a virtualenv to run under...
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/virtualenv.py", line 2339, in <module>
    main()
  File "/usr/lib/python2.7/dist-packages/virtualenv.py", line 825, in main
    symlink=options.symlink)
  File "/usr/lib/python2.7/dist-packages/virtualenv.py", line 985, in create_environment
    site_packages=site_packages, clear=clear, symlink=symlink))
  File "/usr/lib/python2.7/dist-packages/virtualenv.py", line 1193, in install_python
    writefile(site_filename_dst, SITE_PY)
  File "/usr/lib/python2.7/dist-packages/virtualenv.py", line 487, in writefile
    f.write(content.encode('utf-8'))
IOError: [Errno 28] No space left on device
INFO:root:virtualenv created in 0.10s.
Traceback (most recent call last):
  File "bin/called-by-tarmac.py", line 140, in <module>
    sys.exit(main())
  File "bin/called-by-tarmac.py", line 110, in main
    venv.install()
  File "/tmp/tarmac/branch.NK5zgD/bin/../testing/venv.py", line 139, in install
    path = create()
  File "/tmp/tarmac/branch.NK5zgD/bin/../testing/venv.py", line 53, in create
    subprocess.check_call(cmd, stdout=devnull)
  File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['virtualenv', '/dev/shm/venv-xZxs_5', '-p', 'python2.7']' returned non-zero exit status 1

Revision history for this message
Francis Ginther (fginther) wrote :

We're working on the tarmac deployment to resolve the out-of-space issue.

Unmerged revisions

864. By Allan LeSage

Update ucitests version to 0.1.5 for coverage-extractor.

863. By Allan LeSage

Coverage-extractor fix XXX comments.

862. By Allan LeSage

Adapt to some fginther suggestions for coverage-extractor.

861. By Allan LeSage

Amend a test docstring FTW.

860. By Allan LeSage

Amend some FIXME comments for coverage-extractor.

859. By Allan LeSage

Add setup.py :/ .

858. By Allan LeSage

Add coverage-extractor to run_tests.py.

857. By Allan LeSage

Merge trunk.

856. By Allan LeSage

Extract line and branch coverage from a coverage.xml artifact in swift, post to NFSS.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches