Browse Source

rework tox.ini

separate works for py27, py35
add docs test
some other changes to let tests pass

Change-Id: I94291a5e65fee1e266fbe4e2ec3e14f042654598
tags/6.0.0
tikitavi 1 year ago
parent
commit
0445156611

+ 6
- 8
doc/source/conf.py View File

@@ -1,11 +1,9 @@
1 1
 
2 2
 from __future__ import print_function
3 3
 
4
+import os
4 5
 import subprocess
5 6
 import sys
6
-import os
7
-import fileinput
8
-import fnmatch
9 7
 import warnings
10 8
 
11 9
 BASE_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -19,8 +17,8 @@ os.environ['DJANGO_SETTINGS_MODULE'] = 'openstack_dashboard.settings'
19 17
 
20 18
 # -- General configuration ----------------------------------------------------
21 19
 
22
-# Add any Sphinx extension module names here, as strings. They can be extensions
23
-# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
20
+# Add any Sphinx extension module names here, as strings. They can be
21
+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
24 22
 extensions = ['sphinx.ext.autodoc',
25 23
               'sphinx.ext.doctest',
26 24
               'sphinx.ext.todo',
@@ -63,9 +61,9 @@ pygments_style = 'sphinx'
63 61
 
64 62
 # The theme to use for HTML and HTML Help pages.  Major themes that come with
65 63
 # Sphinx are currently 'default' and 'sphinxdoc'.
66
-#html_theme_path = ["."]
67
-#html_theme = '_theme'
68
-#html_static_path = ['static']
64
+# html_theme_path = ["."]
65
+# html_theme = '_theme'
66
+# html_static_path = ['static']
69 67
 html_theme = 'openstackdocs'
70 68
 
71 69
 html_last_updated_fmt = '%Y-%m-%d %H:%M'

+ 6
- 6
doc/source/configuration/api.rst View File

@@ -8,11 +8,11 @@ Configuration options
8 8
 The following options allow configuration that EC2API supports.
9 9
 
10 10
 
11
-.. include:: ./tables/ec2api-clients.rst
12
-.. include:: ./tables/ec2api-database.rst
13
-.. include:: ./tables/ec2api-service.rst
14
-.. include:: ./tables/ec2api-ec2.rst
15
-.. include:: ./tables/ec2api-s3.rst
16
-.. include:: ./tables/ec2api-common.rst
11
+.. include:: ./tables/ec2api-clients.inc
12
+.. include:: ./tables/ec2api-database.inc
13
+.. include:: ./tables/ec2api-service.inc
14
+.. include:: ./tables/ec2api-ec2.inc
15
+.. include:: ./tables/ec2api-s3.inc
16
+.. include:: ./tables/ec2api-common.inc
17 17
 
18 18
 

+ 1
- 1
doc/source/configuration/metadata.rst View File

@@ -13,4 +13,4 @@ To configure Metadata Service for ec2api, EC2 API configuration_ common sections
13 13
 
14 14
 The additional configuration options for EC2 Metadata:
15 15
 
16
-.. include:: ./tables/ec2api-metadata.rst
16
+.. include:: ./tables/ec2api-metadata.inc

doc/source/configuration/tables/ec2api-clients.rst → doc/source/configuration/tables/ec2api-clients.inc View File


doc/source/configuration/tables/ec2api-common.rst → doc/source/configuration/tables/ec2api-common.inc View File


doc/source/configuration/tables/ec2api-database.rst → doc/source/configuration/tables/ec2api-database.inc View File


doc/source/configuration/tables/ec2api-ec2.rst → doc/source/configuration/tables/ec2api-ec2.inc View File


doc/source/configuration/tables/ec2api-metadata.rst → doc/source/configuration/tables/ec2api-metadata.inc View File


doc/source/configuration/tables/ec2api-s3.rst → doc/source/configuration/tables/ec2api-s3.inc View File


doc/source/configuration/tables/ec2api-service.rst → doc/source/configuration/tables/ec2api-service.inc View File


+ 1
- 0
test-requirements.txt View File

@@ -8,6 +8,7 @@ fixtures>=3.0.0 # Apache-2.0/BSD
8 8
 mock>=2.0.0 # BSD
9 9
 nose>=1.3.7 # LGPL
10 10
 oslotest>=1.10.0 # Apache-2.0
11
+os-testr>=1.0.0 # Apache-2.0
11 12
 pylint==1.4.5 # GPLv2
12 13
 python-subunit>=0.0.18 # Apache-2.0/BSD
13 14
 sphinx>=1.6.2 # BSD

+ 0
- 81
tools/config/analyze_opts.py View File

@@ -1,81 +0,0 @@
1
-#!/usr/bin/env python
2
-# Copyright (c) 2012, Cloudscaling
3
-# All Rights Reserved.
4
-#
5
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
6
-#    not use this file except in compliance with the License. You may obtain
7
-#    a copy of the License at
8
-#
9
-#         http://www.apache.org/licenses/LICENSE-2.0
10
-#
11
-#    Unless required by applicable law or agreed to in writing, software
12
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
-#    License for the specific language governing permissions and limitations
15
-#    under the License.
16
-'''
17
-find_unused_options.py
18
-
19
-Compare the ec2api.conf file with the ec2api.conf.sample file to find any
20
-unused options or default values in ec2api.conf
21
-'''
22
-
23
-from __future__ import print_function
24
-
25
-import argparse
26
-import os
27
-import sys
28
-
29
-from oslo_config import iniparser
30
-sys.path.append(os.getcwd())
31
-
32
-
33
-class PropertyCollecter(iniparser.BaseParser):
34
-    def __init__(self):
35
-        super(PropertyCollecter, self).__init__()
36
-        self.key_value_pairs = {}
37
-
38
-    def assignment(self, key, value):
39
-        self.key_value_pairs[key] = value
40
-
41
-    def new_section(self, section):
42
-        pass
43
-
44
-    @classmethod
45
-    def collect_properties(cls, lineiter, sample_format=False):
46
-        def clean_sample(f):
47
-            for line in f:
48
-                if line.startswith("#") and not line.startswith("# "):
49
-                    line = line[1:]
50
-                yield line
51
-        pc = cls()
52
-        if sample_format:
53
-            lineiter = clean_sample(lineiter)
54
-        pc.parse(lineiter)
55
-        return pc.key_value_pairs
56
-
57
-
58
-if __name__ == '__main__':
59
-    parser = argparse.ArgumentParser(description='''Compare the ec2api.conf
60
-    file with the ec2api.conf.sample file to find any unused options or
61
-    default values in ec2api.conf''')
62
-
63
-    parser.add_argument('-c', action='store',
64
-                        default='/etc/ec2api/ec2api.conf',
65
-                        help='path to ec2api.conf\
66
-                        (defaults to /etc/ec2api/ec2api.conf)')
67
-    parser.add_argument('-s', default='./etc/ec2api/ec2api.conf.sample',
68
-                        help='path to ec2api.conf.sample\
69
-                        (defaults to ./etc/ec2api/ec2api.conf.sample')
70
-    options = parser.parse_args()
71
-
72
-    conf_file_options = PropertyCollecter.collect_properties(open(options.c))
73
-    sample_conf_file_options = PropertyCollecter.collect_properties(
74
-        open(options.s), sample_format=True)
75
-
76
-    for k, v in sorted(conf_file_options.items()):
77
-        if k not in sample_conf_file_options:
78
-            print("Unused:", k)
79
-    for k, v in sorted(conf_file_options.items()):
80
-        if k in sample_conf_file_options and v == sample_conf_file_options[k]:
81
-            print("Default valued:", k)

+ 0
- 42
tools/enable-pre-commit-hook.sh View File

@@ -1,42 +0,0 @@
1
-#!/bin/sh
2
-
3
-# Copyright 2011 OpenStack Foundation
4
-#
5
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
6
-# not use this file except in compliance with the License. You may obtain
7
-# a copy of the License at
8
-#
9
-# http://www.apache.org/licenses/LICENSE-2.0
10
-#
11
-# Unless required by applicable law or agreed to in writing, software
12
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
-# License for the specific language governing permissions and limitations
15
-# under the License.
16
-
17
-PRE_COMMIT_SCRIPT=.git/hooks/pre-commit
18
-
19
-make_hook() {
20
-    echo "exec ./run_tests.sh -N -p" >> $PRE_COMMIT_SCRIPT
21
-    chmod +x $PRE_COMMIT_SCRIPT
22
-
23
-    if [ -w $PRE_COMMIT_SCRIPT -a -x $PRE_COMMIT_SCRIPT ]; then
24
-        echo "pre-commit hook was created successfully"
25
-    else
26
-        echo "unable to create pre-commit hook"
27
-    fi
28
-}
29
-
30
-# NOTE(jk0): Make sure we are in ec2-api's root directory before adding the hook.
31
-if [ ! -d ".git" ]; then
32
-    echo "unable to find .git; moving up a directory"
33
-    cd ..
34
-    if [ -d ".git" ]; then
35
-        make_hook
36
-    else
37
-        echo "still unable to find .git; hook not created"
38
-    fi
39
-else
40
-    make_hook
41
-fi
42
-

+ 0
- 72
tools/install_venv.py View File

@@ -1,72 +0,0 @@
1
-# Copyright 2010 United States Government as represented by the
2
-# Administrator of the National Aeronautics and Space Administration.
3
-# All Rights Reserved.
4
-#
5
-# Copyright 2010 OpenStack Foundation
6
-# Copyright 2013 IBM Corp.
7
-#
8
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
9
-#    not use this file except in compliance with the License. You may obtain
10
-#    a copy of the License at
11
-#
12
-#         http://www.apache.org/licenses/LICENSE-2.0
13
-#
14
-#    Unless required by applicable law or agreed to in writing, software
15
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
16
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
17
-#    License for the specific language governing permissions and limitations
18
-#    under the License.
19
-
20
-import os
21
-import sys
22
-
23
-import install_venv_common as install_venv
24
-
25
-
26
-def print_help(venv, root):
27
-    help = """
28
-    EC2 development environment setup is complete.
29
-
30
-    EC2 development uses virtualenv to track and manage Python dependencies
31
-    while in development and testing.
32
-
33
-    To activate the EC2 virtualenv for the extent of your current shell
34
-    session you can run:
35
-
36
-    $ source %s/bin/activate
37
-
38
-    Or, if you prefer, you can run commands in the virtualenv on a case by case
39
-    basis by running:
40
-
41
-    $ %s/tools/with_venv.sh <your command>
42
-
43
-    Also, make test will automatically use the virtualenv.
44
-    """
45
-    print help % (venv, root)
46
-
47
-
48
-def main(argv):
49
-    root = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
50
-
51
-    if os.environ.get('tools_path'):
52
-        root = os.environ['tools_path']
53
-    venv = os.path.join(root, '.venv')
54
-    if os.environ.get('venv'):
55
-        venv = os.environ['venv']
56
-
57
-    pip_requires = os.path.join(root, 'requirements.txt')
58
-    test_requires = os.path.join(root, 'test-requirements.txt')
59
-    py_version = "python%s.%s" % (sys.version_info[0], sys.version_info[1])
60
-    project = 'ec2api'
61
-    install = install_venv.InstallVenv(root, venv, pip_requires, test_requires,
62
-                             py_version, project)
63
-    options = install.parse_args(argv)
64
-    install.check_python_version()
65
-    install.check_dependencies()
66
-    install.create_virtualenv(no_site_packages=options.no_site_packages)
67
-    install.install_dependencies()
68
-    install.post_process()
69
-    print_help(venv, root)
70
-
71
-if __name__ == '__main__':
72
-    main(sys.argv)

+ 0
- 211
tools/install_venv_common.py View File

@@ -1,211 +0,0 @@
1
-# Copyright 2013 OpenStack Foundation
2
-# Copyright 2013 IBM Corp.
3
-#
4
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
5
-#    not use this file except in compliance with the License. You may obtain
6
-#    a copy of the License at
7
-#
8
-#         http://www.apache.org/licenses/LICENSE-2.0
9
-#
10
-#    Unless required by applicable law or agreed to in writing, software
11
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
-#    License for the specific language governing permissions and limitations
14
-#    under the License.
15
-
16
-"""Provides methods needed by installation script for OpenStack development
17
-virtual environments.
18
-
19
-Since this script is used to bootstrap a virtualenv from the system's Python
20
-environment, it should be kept strictly compatible with Python 2.6.
21
-
22
-Synced in from openstack-common
23
-"""
24
-
25
-from __future__ import print_function
26
-
27
-import optparse
28
-import os
29
-import subprocess
30
-import sys
31
-
32
-
33
-class InstallVenv(object):
34
-
35
-    def __init__(self, root, venv, requirements,
36
-                 test_requirements, py_version,
37
-                 project):
38
-        self.root = root
39
-        self.venv = venv
40
-        self.requirements = requirements
41
-        self.test_requirements = test_requirements
42
-        self.py_version = py_version
43
-        self.project = project
44
-
45
-    def die(self, message, *args):
46
-        print(message % args, file=sys.stderr)
47
-        sys.exit(1)
48
-
49
-    def check_python_version(self):
50
-        if sys.version_info < (2, 6):
51
-            self.die("Need Python Version >= 2.6")
52
-
53
-    def run_command_with_code(self, cmd, redirect_output=True,
54
-                              check_exit_code=True):
55
-        """Runs a command in an out-of-process shell.
56
-
57
-        Returns the output of that command. Working directory is self.root.
58
-        """
59
-        if redirect_output:
60
-            stdout = subprocess.PIPE
61
-        else:
62
-            stdout = None
63
-
64
-        proc = subprocess.Popen(cmd, cwd=self.root, stdout=stdout)
65
-        output = proc.communicate()[0]
66
-        if check_exit_code and proc.returncode != 0:
67
-            self.die('Command "%s" failed.\n%s', ' '.join(cmd), output)
68
-        return (output, proc.returncode)
69
-
70
-    def run_command(self, cmd, redirect_output=True, check_exit_code=True):
71
-        return self.run_command_with_code(cmd, redirect_output,
72
-                                          check_exit_code)[0]
73
-
74
-    def get_distro(self):
75
-        if (os.path.exists('/etc/fedora-release') or
76
-                os.path.exists('/etc/redhat-release')):
77
-            return Fedora(
78
-                self.root, self.venv, self.requirements,
79
-                self.test_requirements, self.py_version, self.project)
80
-        else:
81
-            return Distro(
82
-                self.root, self.venv, self.requirements,
83
-                self.test_requirements, self.py_version, self.project)
84
-
85
-    def check_dependencies(self):
86
-        self.get_distro().install_virtualenv()
87
-
88
-    def create_virtualenv(self, no_site_packages=True):
89
-        """Creates the virtual environment and installs PIP.
90
-
91
-        Creates the virtual environment and installs PIP only into the
92
-        virtual environment.
93
-        """
94
-        if not os.path.isdir(self.venv):
95
-            print('Creating venv...', end=' ')
96
-            if no_site_packages:
97
-                self.run_command(['virtualenv', '-q', '--no-site-packages',
98
-                                 self.venv])
99
-            else:
100
-                self.run_command(['virtualenv', '-q', self.venv])
101
-            print('done.')
102
-        else:
103
-            print("venv already exists...")
104
-            pass
105
-
106
-    def pip_install(self, *args):
107
-        self.run_command(['tools/with_venv.sh',
108
-                         'pip', 'install', '--upgrade'] + list(args),
109
-                         redirect_output=False)
110
-
111
-    def install_dependencies(self):
112
-        print('Installing dependencies with pip (this can take a while)...')
113
-
114
-        # First things first, make sure our venv has the latest pip and
115
-        # setuptools and pbr
116
-        self.pip_install('pip>=1.4')
117
-        self.pip_install('setuptools')
118
-        self.pip_install('pbr')
119
-
120
-        self.pip_install('-r', self.requirements, '-r', self.test_requirements)
121
-
122
-    def post_process(self):
123
-        self.get_distro().post_process()
124
-
125
-    def parse_args(self, argv):
126
-        """Parses command-line arguments."""
127
-        parser = optparse.OptionParser()
128
-        parser.add_option('-n', '--no-site-packages',
129
-                          action='store_true',
130
-                          help="Do not inherit packages from global Python "
131
-                               "install")
132
-        return parser.parse_args(argv[1:])[0]
133
-
134
-
135
-class Distro(InstallVenv):
136
-
137
-    def check_cmd(self, cmd):
138
-        return bool(self.run_command(['which', cmd],
139
-                    check_exit_code=False).strip())
140
-
141
-    def install_virtualenv(self):
142
-        if self.check_cmd('virtualenv'):
143
-            return
144
-
145
-        if self.check_cmd('easy_install'):
146
-            print('Installing virtualenv via easy_install...', end=' ')
147
-            if self.run_command(['easy_install', 'virtualenv']):
148
-                print('Succeeded')
149
-                return
150
-            else:
151
-                print('Failed')
152
-
153
-        self.die('ERROR: virtualenv not found.\n\n%s development'
154
-                 ' requires virtualenv, please install it using your'
155
-                 ' favorite package management tool' % self.project)
156
-
157
-    def post_process(self):
158
-        """Any distribution-specific post-processing gets done here.
159
-
160
-        In particular, this is useful for applying patches to code inside
161
-        the venv.
162
-        """
163
-        pass
164
-
165
-
166
-class Fedora(Distro):
167
-    """This covers all Fedora-based distributions.
168
-
169
-    Includes: Fedora, RHEL, CentOS, Scientific Linux
170
-    """
171
-
172
-    def check_pkg(self, pkg):
173
-        return self.run_command_with_code(['rpm', '-q', pkg],
174
-                                          check_exit_code=False)[1] == 0
175
-
176
-    def apply_patch(self, originalfile, patchfile):
177
-        self.run_command(['patch', '-N', originalfile, patchfile],
178
-                         check_exit_code=False)
179
-
180
-    def install_virtualenv(self):
181
-        if self.check_cmd('virtualenv'):
182
-            return
183
-
184
-        if not self.check_pkg('python-virtualenv'):
185
-            self.die("Please install 'python-virtualenv'.")
186
-
187
-        super(Fedora, self).install_virtualenv()
188
-
189
-    def post_process(self):
190
-        """Workaround for a bug in eventlet.
191
-
192
-        This currently affects RHEL6.1, but the fix can safely be
193
-        applied to all RHEL and Fedora distributions.
194
-
195
-        This can be removed when the fix is applied upstream.
196
-
197
-        EC2: https://bugs.launchpad.net/nova/+bug/884915
198
-        Upstream: https://bitbucket.org/eventlet/eventlet/issue/89
199
-        RHEL: https://bugzilla.redhat.com/958868
200
-        """
201
-
202
-        if os.path.exists('contrib/redhat-eventlet.patch'):
203
-            # Install "patch" program if it's not there
204
-            if not self.check_pkg('patch'):
205
-                self.die("Please install 'patch'.")
206
-
207
-            # Apply the eventlet patch
208
-            self.apply_patch(os.path.join(self.venv, 'lib', self.py_version,
209
-                                          'site-packages',
210
-                                          'eventlet/green/subprocess.py'),
211
-                             'contrib/redhat-eventlet.patch')

+ 0
- 48
tools/patch_tox_venv.py View File

@@ -1,48 +0,0 @@
1
-# Copyright 2013 Red Hat, Inc.
2
-#
3
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
4
-#    not use this file except in compliance with the License. You may obtain
5
-#    a copy of the License at
6
-#
7
-#         http://www.apache.org/licenses/LICENSE-2.0
8
-#
9
-#    Unless required by applicable law or agreed to in writing, software
10
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12
-#    License for the specific language governing permissions and limitations
13
-#    under the License.
14
-
15
-import os
16
-import sys
17
-
18
-import install_venv_common as install_venv  # noqa
19
-
20
-
21
-def first_file(file_list):
22
-    for candidate in file_list:
23
-        if os.path.exists(candidate):
24
-            return candidate
25
-
26
-
27
-def main(argv):
28
-    root = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
29
-
30
-    venv = os.environ['VIRTUAL_ENV']
31
-
32
-    pip_requires = first_file([
33
-        os.path.join(root, 'requirements.txt'),
34
-        os.path.join(root, 'tools', 'pip-requires'),
35
-    ])
36
-    test_requires = first_file([
37
-        os.path.join(root, 'test-requirements.txt'),
38
-        os.path.join(root, 'tools', 'test-requires'),
39
-    ])
40
-    py_version = "python%s.%s" % (sys.version_info[0], sys.version_info[1])
41
-    project = 'ec2api'
42
-    install = install_venv.InstallVenv(root, venv, pip_requires, test_requires,
43
-                                       py_version, project)
44
-    #NOTE(dprince): For Tox we only run post_process (which patches files, etc)
45
-    install.post_process()
46
-
47
-if __name__ == '__main__':
48
-    main(sys.argv)

+ 0
- 30
tools/tox_install.sh View File

@@ -1,30 +0,0 @@
1
-#!/usr/bin/env bash
2
-
3
-# Client constraint file contains this client version pin that is in conflict
4
-# with installing the client from source. We should remove the version pin in
5
-# the constraints file before applying it for from-source installation.
6
-
7
-CONSTRAINTS_FILE="$1"
8
-shift 1
9
-
10
-set -e
11
-
12
-# NOTE(tonyb): Place this in the tox enviroment's log dir so it will get
13
-# published to logs.openstack.org for easy debugging.
14
-localfile="$VIRTUAL_ENV/log/upper-constraints.txt"
15
-
16
-if [[ "$CONSTRAINTS_FILE" != http* ]]; then
17
-    CONSTRAINTS_FILE="file://$CONSTRAINTS_FILE"
18
-fi
19
-# NOTE(tonyb): need to add curl to bindep.txt if the project supports bindep
20
-curl "$CONSTRAINTS_FILE" --insecure --progress-bar --output "$localfile"
21
-
22
-pip install -c"$localfile" openstack-requirements
23
-
24
-# This is the main purpose of the script: Allow local installation of
25
-# the current repo. It is listed in constraints file and thus any
26
-# install will be constrained and we need to unconstrain it.
27
-edit-constraints "$localfile" -- "$CLIENT_NAME"
28
-
29
-pip install -c"$localfile" -U "$@"
30
-exit $?

+ 0
- 7
tools/with_venv.sh View File

@@ -1,7 +0,0 @@
1
-#!/bin/bash
2
-tools_path=${tools_path:-$(dirname $0)}
3
-venv_path=${venv_path:-${tools_path}}
4
-venv_dir=${venv_name:-/../.venv}
5
-TOOLS=${tools_path}
6
-VENV=${venv:-${venv_path}/${venv_dir}}
7
-source ${VENV}/bin/activate && "$@"

+ 34
- 32
tox.ini View File

@@ -1,50 +1,59 @@
1 1
 [tox]
2
-minversion = 2.0
3
-envlist = py35,py27,pep8
2
+minversion = 2.1
3
+envlist = py{35,27},pep8,docs,api-ref
4 4
 skipsdist = True
5 5
 
6 6
 [testenv]
7
-sitepackages = False
8 7
 usedevelop = True
9
-install_command = {toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
8
+# tox is silly... these need to be separated by a newline....
9
+whitelist_externals = bash
10
+                      find
11
+                      rm
12
+                      env
13
+install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
10 14
 setenv = VIRTUAL_ENV={envdir}
11
-         BRANCH_NAME=master
12
-         CLIENT_NAME=ec2-api
13 15
          LANG=en_US.UTF-8
14 16
          LANGUAGE=en_US:en
15 17
          LC_ALL=C
16
-deps = -r{toxinidir}/requirements.txt
17
-       -r{toxinidir}/test-requirements.txt
18
+deps = -r{toxinidir}/test-requirements.txt
18 19
 commands =
20
+  find . -type f -name "*.pyc" -delete
19 21
   rm -f .testrepository/times.dbm
20
-  python tools/patch_tox_venv.py
21
-  python setup.py testr --slowest --testr-args='{posargs}'
22
-whitelist_externals =
23
-  rm
24 22
 
25
-[tox:jenkins]
26
-sitepackages = False
23
+[testenv:py27]
24
+commands =
25
+    {[testenv]commands}
26
+    stestr --test-path 'ec2api/tests/unit' run '{posargs}'
27
+    stestr slowest
28
+
29
+[testenv:py35]
30
+commands =
31
+    {[testenv]commands}
32
+    stestr --test-path 'ec2api/tests/unit' run '{posargs}'
33
+    stestr slowest
27 34
 
28 35
 [testenv:pep8]
29
-sitepackages = False
30 36
 commands =
31 37
   flake8 {posargs}
32 38
 
33 39
 [testenv:genconfig]
34 40
 commands = oslo-config-generator --config-file=etc/ec2api/ec2api-config-generator.conf
35 41
 
36
-[testenv:cover]
37
-# Also do not run test_coverage_ext tests while gathering coverage as those
38
-# tests conflict with coverage.
39
-commands =
40
-  coverage erase
41
-  python setup.py test --coverage --testr-args='{posargs}'
42
-  coverage combine
43
-  coverage html --include='ec2api/*' --omit='ec2api/tests/*' -d covhtml -i
44
-
45 42
 [testenv:venv]
46 43
 commands = {posargs}
47 44
 
45
+[testenv:docs]
46
+# This environment is called from CI scripts to test and publish
47
+# the API Ref and Docs to developer.openstack.org.
48
+commands = python setup.py build_sphinx
49
+
50
+[testenv:api-ref]
51
+# This environment is called from CI scripts to test and publish
52
+# the API Ref to developer.openstack.org.
53
+commands =
54
+  rm -rf api-ref/build
55
+  sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
56
+
48 57
 [flake8]
49 58
 # E712 is ignored on purpose, since it is normal to use 'column == true'
50 59
 #      in sqlalchemy.
@@ -55,15 +64,8 @@ ignore = E121,E122,E123,E124,E126,E127,E128,E711,E712,H102,H303,H404,F403,F811,F
55 64
 # H106: Don’t put vim configuration in source files
56 65
 # H203: Use assertIs(Not)None to check for None
57 66
 enable-extensions=H106,H203
58
-exclude =  .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,tools,ec2api/tests/functional/obsolete
67
+exclude =  .venv,.git,.tox,dist,envname,*lib/python*,*egg,build,tools,ec2api/tests/functional/obsolete
59 68
 max-complexity=25
60 69
 
61 70
 [hacking]
62 71
 local-check-factory = ec2api.hacking.checks.factory
63
-
64
-[testenv:api-ref]
65
-# This environment is called from CI scripts to test and publish
66
-# the API Ref to developer.openstack.org.
67
-commands = 
68
-  rm -rf api-ref/build
69
-  sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html

Loading…
Cancel
Save