diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 00000000..83fe23af --- /dev/null +++ b/.coveragerc @@ -0,0 +1,7 @@ +[run] +branch = True +source = elastic-recheck +omit = elastic-recheck/tests/*,elastic-recheck/openstack/* + +[report] +ignore-errors = True \ No newline at end of file diff --git a/.gitignore b/.gitignore index 8b7898a5..cfbf22d8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,49 @@ -*pyc -.testrepository elasticRecheck.conf + +*.py[cod] + +# C extensions +*.so + +# Packages +*.egg +*.egg-info +dist +build +eggs +parts +bin +var +sdist +develop-eggs +.installed.cfg +lib +lib64 + +# Installer logs +pip-log.txt + +# Unit test / coverage reports +.coverage +.tox +nosetests.xml +.testrepository + +# Translations +*.mo + +# Mr Developer +.mr.developer.cfg +.project +.pydevproject + +# Complexity +output/*.html +output/*/index.html + +# Sphinx +doc/build + +# pbr generates these +AUTHORS +ChangeLog diff --git a/.gitreview b/.gitreview new file mode 100644 index 00000000..444c1363 --- /dev/null +++ b/.gitreview @@ -0,0 +1,4 @@ +[gerrit] +host=review.openstack.org +port=29418 +project=openstack-infra/elastic-recheck.git \ No newline at end of file diff --git a/.testr.conf b/.testr.conf index 081907d5..fb622677 100644 --- a/.testr.conf +++ b/.testr.conf @@ -1,4 +1,7 @@ [DEFAULT] -test_command=${PYTHON:-python} -m subunit.run discover -t ./ ./tests $LISTOPT $IDOPTION +test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \ + OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \ + OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \ + ${PYTHON:-python} -m subunit.run discover -t ./ . $LISTOPT $IDOPTION test_id_option=--load-list $IDFILE -test_list_option=--list +test_list_option=--list \ No newline at end of file diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst new file mode 100644 index 00000000..031ea68b --- /dev/null +++ b/CONTRIBUTING.rst @@ -0,0 +1,17 @@ +If you would like to contribute to the development of OpenStack, +you must follow the steps in the "If you're a developer, start here" +section of this page: + + http://wiki.openstack.org/HowToContribute + +Once those steps have been completed, changes to OpenStack +should be submitted for review via the Gerrit tool, following +the workflow documented at: + + http://wiki.openstack.org/GerritWorkflow + +Pull requests submitted through GitHub will be ignored. + +Bugs should be filed on Launchpad, not GitHub: + + https://bugs.launchpad.net/openstack-ci diff --git a/LICENSE b/LICENSE index 68c771a0..67db8588 100644 --- a/LICENSE +++ b/LICENSE @@ -173,4 +173,3 @@ defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. - diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 00000000..90f8a7ae --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,6 @@ +include AUTHORS +include ChangeLog +exclude .gitignore +exclude .gitreview + +global-exclude *.pyc \ No newline at end of file diff --git a/README.md b/README.rst similarity index 55% rename from README.md rename to README.rst index 118f2e7f..f2acfa77 100644 --- a/README.md +++ b/README.rst @@ -1,7 +1,11 @@ -elasticRecheck -============== +=============================== +elastic-recheck +=============================== -Classify tempest-devstack failures using a list of elastic search queries. +"Classify tempest-devstack failures using ElasticSearch" + +* Free software: Apache license +* Documentation: http://docs.openstack.org/developer/elastic-recheck Idea ---- @@ -11,8 +15,7 @@ Eventually this can be tied into the rechecker tool and launchpad Future Work ------------ -- Make unit tests robust and not need internet -- Use cookiecutter to clean this repo up +- Make unit tests robust Dependencies ------------ diff --git a/babel.cfg b/babel.cfg new file mode 100644 index 00000000..efceab81 --- /dev/null +++ b/babel.cfg @@ -0,0 +1 @@ +[python: **.py] diff --git a/doc/source/conf.py b/doc/source/conf.py new file mode 100644 index 00000000..ff811f69 --- /dev/null +++ b/doc/source/conf.py @@ -0,0 +1,75 @@ +# -*- coding: utf-8 -*- +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os +import sys + +sys.path.insert(0, os.path.abspath('../..')) +# -- General configuration ---------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. +extensions = [ + 'sphinx.ext.autodoc', + 'sphinx.ext.intersphinx', + 'oslo.sphinx' +] + +# autodoc generation is a bit aggressive and a nuisance when doing heavy +# text edit cycles. +# execute "export SPHINX_DEBUG=1" in your terminal to disable + +# The suffix of source filenames. +source_suffix = '.rst' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = u'elastic-recheck' +copyright = u'2013, OpenStack Foundation' + +# If true, '()' will be appended to :func: etc. cross-reference text. +add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +add_module_names = True + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# -- Options for HTML output -------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. Major themes that come with +# Sphinx are currently 'default' and 'sphinxdoc'. +# html_theme_path = ["."] +# html_theme = '_theme' +# html_static_path = ['static'] + +# Output file base name for HTML help builder. +htmlhelp_basename = '%sdoc' % project + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, author, documentclass +# [howto/manual]). +latex_documents = [ + ('index', + '%s.tex' % project, + u'%s Documentation' % project, + u'OpenStack Foundation', 'manual'), +] + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = {'http://docs.python.org/': None} \ No newline at end of file diff --git a/doc/source/contributing.rst b/doc/source/contributing.rst new file mode 100644 index 00000000..8cb3146f --- /dev/null +++ b/doc/source/contributing.rst @@ -0,0 +1 @@ +.. include:: ../../CONTRIBUTING.rst \ No newline at end of file diff --git a/doc/source/index.rst b/doc/source/index.rst new file mode 100644 index 00000000..61174b46 --- /dev/null +++ b/doc/source/index.rst @@ -0,0 +1,24 @@ +.. elastic-recheck documentation master file, created by + sphinx-quickstart on Tue Jul 9 22:26:36 2013. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to elastic-recheck's documentation! +======================================================== + +Contents: + +.. toctree:: + :maxdepth: 2 + + readme + installation + usage + contributing + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/doc/source/installation.rst b/doc/source/installation.rst new file mode 100644 index 00000000..9c1a61dc --- /dev/null +++ b/doc/source/installation.rst @@ -0,0 +1,12 @@ +============ +Installation +============ + +At the command line:: + + $ pip install elastic-recheck + +Or, if you have virtualenvwrapper installed:: + + $ mkvirtualenv elastic-recheck + $ pip install elastic-recheck \ No newline at end of file diff --git a/doc/source/readme.rst b/doc/source/readme.rst new file mode 100644 index 00000000..6b2b3ec6 --- /dev/null +++ b/doc/source/readme.rst @@ -0,0 +1 @@ +.. include:: ../README.rst \ No newline at end of file diff --git a/doc/source/usage.rst b/doc/source/usage.rst new file mode 100644 index 00000000..0a43401f --- /dev/null +++ b/doc/source/usage.rst @@ -0,0 +1,8 @@ +======== +Usage +======== + +To use elastic-recheck, set up the config file and run one of the following:: + + elastic-recheck + bot diff --git a/requirements.txt b/requirements.txt index d51d5ea4..e84d535f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,8 @@ pyelasticsearch gerritlib -testtools daemon irc pyyaml lockfile +pbr>=0.5.21,<1.0 +Babel>=0.9.6 diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 00000000..a42f5a8f --- /dev/null +++ b/setup.cfg @@ -0,0 +1,46 @@ +[metadata] +name = elastic-recheck +summary = "Classify tempest-devstack failures using ElasticSearch" +description-file = + README.rst +author = OpenStack +author-email = openstack-dev@lists.openstack.org +home-page = http://www.openstack.org/ +classifier = + Environment :: OpenStack + Intended Audience :: Information Technology + Intended Audience :: System Administrators + License :: OSI Approved :: Apache Software License + Operating System :: POSIX :: Linux + Programming Language :: Python + Programming Language :: Python :: 2 + Programming Language :: Python :: 2.7 + Programming Language :: Python :: 2.6 + Programming Language :: Python :: 3 + Programming Language :: Python :: 3.3 + +[files] +packages = + elastic-recheck + +[build_sphinx] +source-dir = doc/source +build-dir = doc/build +all_files = 1 + +[upload_sphinx] +upload-dir = doc/build/html + +[compile_catalog] +directory = elastic-recheck/locale +domain = elastic-recheck + +[update_catalog] +domain = elastic-recheck +output_dir = elastic-recheck/locale +input_file = elastic-recheck/locale/elastic-recheck.pot + +[extract_messages] +keywords = _ gettext ngettext l_ lazy_gettext +mapping_file = babel.cfg +output_file = elastic-recheck/locale/elastic-recheck.pot \ No newline at end of file diff --git a/setup.py b/setup.py new file mode 100644 index 00000000..2a0786a8 --- /dev/null +++ b/setup.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT +import setuptools + +setuptools.setup( + setup_requires=['pbr>=0.5.21,<1.0'], + pbr=True) diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 00000000..3434db12 --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1,11 @@ +hacking>=0.5.6,<0.8 + +coverage>=3.6 +discover +fixtures>=0.3.14 +python-subunit +sphinx>=1.1.2 +oslo.sphinx +testrepository>=0.0.17 +testscenarios>=0.4,<0.5 +testtools>=0.9.32 \ No newline at end of file diff --git a/tox.ini b/tox.ini index e836287c..287fc475 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,32 @@ +[tox] +minversion = 1.6 +envlist = py26,py27,py33,pypy,pep8 +skipsdist = True + +[testenv] +usedevelop = True +install_command = pip install -U {opts} {packages} +setenv = + VIRTUAL_ENV={envdir} + LANG=en_US.UTF-8 + LANGUAGE=en_US:en + LC_ALL=C +deps = -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt +commands = python setup.py testr --slowest --testr-args='{posargs}' + +[testenv:pep8] +commands = flake8 + +[testenv:venv] +commands = {posargs} + +[testenv:cover] +commands = python setup.py testr --coverage --testr-args='{posargs}' + [flake8] # H803 Skipped on purpose # E501 skipped temporarily ignore = E123,E122,E126,E128,E501,H803 +exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build