282 Commits

Author SHA1 Message Date
John Dickinson
5374ba3a80 drop Python 2.6 testing support
Change-Id: I78f21e5794e8ba7a095f03d279247516a241f555
2015年05月27日 12:28:04 -07:00
John Dickinson
e567722c4e updated hacking rules
1) Added comment for H231, which we were already enforcing. H231
is for Python 3.x compatible except statements.
2) Added check for H201, which we were enforcing in reviews
but waiting on hacking checks to be updated. H201 is for bare
except statements, and the update in upstream hacking is to
support the " # noqa" flag on it.
The H201 check catches some existing bare excepts that are fixed.
Change-Id: I68638aa9ea925ef62f9035a426548c2c804911a8
2014年09月25日 11:04:31 -07:00
Steve Martinelli
b7254b2d83 Update the swift documentation theme
Currently the theme used by the swift developer docs are out of
date, it should be using oslosphinx, to provide a similar look
and feel between all openstack related projects.
Change-Id: Id7c226cdc13c6c4f3b5082b1ef4dfe09966b21ec
2014年08月05日 01:01:22 -04:00
Christian Berendt
f6ff06b678 Use except x as y instead of except x, y
According to https://docs.python.org/3/howto/pyporting.html the
syntax changed in Python 3.x. The new syntax is usable with
Python >= 2.6 and should be preferred to be compatible with Python3.
Enabled hacking check H231.
Change-Id: I2c41dc3ec83e79181e8fd50e76771a74c393269c
2014年07月07日 15:42:13 -07:00
Alex Gaynor
fac6568e8e Added a tox job for running flake8 under Python 3
Change-Id: I04a78cc5e3613d1d765d716633bca297bf7207b6
2014年05月17日 08:18:27 -07:00
Peter Portante
067b41e854 In-process swift server for functional tests
Provide a way to run the functional tests using a p/a/c/o server setup
in the same process running the nosetests infrastructure.
By setting the environment variable, SWIFT_TEST_IN_PROCESS, to a true
value, the functional test framework will construct a set of proxy,
account, container and object servers running in the same process that
is running the functional tests, ignoring any external swift
service. This in-process swift environment is akin to the one used in
test/unit/proxy/test_server.py.
Setting that same environment variable to a false value will ensure the
in-process servers are not used.
When the above environment variable is not present, and the
/etc/swift/test.conf is _not_ present (or present but empty) on the
system where the functional tests are executing, the in-process
environment will be used. Previously, if no /etc/swift/test.conf file
was found, the tests would just be marked as skipped.
Using this in-process method allows one to gather code coverage using
the functional tests to exercise code paths, in addition to the unit
tests, or more easily debug existing functional tests, or even write new
ones.
There are two constraints that are changed for use with the in-process
functional tests: max_file_size is lowered to roughly 8 MB, and
client_timeout is set to 4s.
Change-Id: I5acd65e3068868d6509feae1d1954237d37fad45
2014年04月29日 08:45:11 -04:00
Jenkins
429445d97b Merge "Only run flake8 on Swift code" 2014年04月02日 01:46:40 +00:00
Samuel Merritt
bb7bb4e034 Only run flake8 on Swift code
In particular, this skips the "build" directory, which is prone to
containing third-party stuff that doesn't comply with all the various
hacking/flake8/pep8 checks.
Change-Id: Ibe2240d8c6ca5947b2cac259cd7d0a1154f8a9cd
2014年03月27日 11:44:42 -07:00
Clay Gerrard
3f857898a9 Update tox.ini so flake8 works even without hacking
The flake8 command (when run from the command line or via vim-flake8) seems to
bypass the the normal pep8 [W]arning and [E]rror as well as py[F]lake checks
if the project level tox.ini includes a select, but doesn't include them in
it's select option (tested on flake8 v2.0 and v2.1). Somehow if hacking is
installed these checks always run even if they're not explicitly listed in the
select list - but adding them so flake8 works on our project even without
hacking doesn't seem to cause any problems.
Also The [flake8] section's "select" option in tox.ini doesn't seem to run all
checks when presented with the space-comma seperated list. I had to pull out
the bare except check (H201), because our hacking fix for the "H201 # noqa"
hasn't been released to pypi yet (maybe hacking version 0.9.0?).
As far as I know the Swift core development team is fully onboard with pep8,
and the flake8 checks are mostly like "unused import" stuff - so I *think*
this change is more about making the tool test what we want it too and not
changing or adding any new requirements or expectations.
Change-Id: Ia911c63745100cce182d5c5eb67b77e31c1e9b18
2014年03月04日 08:29:38 -08:00
John Dickinson
af91eea634 use specific hacking rules
Change-Id: I91cb5e30ec081262e2a590d64ba46fddadc7590f
2014年01月11日 14:02:20 +08:00
Jeremy Stanley
157482baa0 Whitelist external netifaces requirement
* tox.ini(testenv.install_command): Use the --allow-external and
--allow-insecure options so that pip 1.5 and later will assent to
retrieve the netifaces package even though it's not hosted on PyPI.
The --allow-insecure option is aliased to a clearer
--allow-unverified wording in 1.5, but the old form is being used to
avoid breaking users of 1.4.x and will be valid at least through
1.6.x according to comments in the pip source.
Change-Id: I587b516f3f77c930475ca2eaae5ff73c5d2ab576
2014年01月06日 03:38:47 +00:00
Samuel Merritt
5f4790a82a Allow running just one test with tox
Now, "tox -e py26 -- test.unit.proxy.test_server" runs just that one
test file.
"tox -e py26" still runs all the tests with py26, just like before.
Change-Id: I40db12dd5e7cc8f9388e29b30447f70d3bfc4b28
2013年12月18日 12:11:47 -08:00
Sushil Kumar
9eb42460c7 Updates tox.ini to use new features
tox 1.6 allows us to skip the sdist step, which is slow. This does that.
It also allows us to override the install line. In this case, it's
important as it allows us to stop getting pre-release software we
weren't asking for.
Original patch by Monty Taylor, talked about here:
http://lists.openstack.org/pipermail/openstack-dev/2013-September/015495.html
Change-Id: I2042cae5ebf5467408fe6cdb71f6147081b72ca6
2013年12月11日 04:34:01 +00:00
Morgan Fainberg
9a2bd79073 Sync global requirements to pin sphinx to sphinx>=1.1.2,<1.2
Sync the global requirements to pin sphinx. This addresses an issue
where Sphinx 1.2 is not building documents correctly and causing
check/gate to fail.
We also had to adjust the pip command used.
Change-Id: I8894c0199db845e90e5086a7c0e6bb7c7a26b5a0
2013年12月10日 17:31:21 -05:00
Peter Portante
bdcf6adc28 Remove Python 3.3 from list of tox environments
Remove Python 3.3 from the list of tox test environments since we do
not currently support Python 3.3 for swift.
Change-Id: I7993a511e8433b21b292f21f4775e4ef2b5c2539
2013年12月02日 13:54:40 -05:00
John Dickinson
ef42c0f0de allow bare excepts in flake8
Change-Id: I4751f9f65712960019f9a303b7d7fe017c6e85c7
2013年11月15日 15:10:39 -08:00
Jenkins
31f706b97b Merge "Add support for POST commit coverage runs" 2013年09月14日 00:19:05 +00:00
Dirk Mueller
00f9d718d2 Move string expansion outside localisation (H702)
String expansion should be done outside localisation call (_()),
otherwise there will never be a matching string found in the
catalogue.
Also enable gating on this Hacking check (H702).
Change-Id: Ie7c89fbfb52629e75d5e68e9afda8bcf50bf4cdd
2013年09月07日 10:51:21 +02:00
Peter Portante
93ab856f66 Add support for POST commit coverage runs
Modeled on how keystone does it.
Change-Id: Idad4f854f1bfb915a48ff69988553810a76accc0
Signed-off-by: Peter Portante <peter.portante@redhat.com>
2013年09月05日 13:50:43 -04:00
Peter Portante
22451b22cb Pep8 final two unit test modules and enforce (12 of 12)
We also fix up any other pep8 failures that snuck in from merges along
the way.
Change-Id: I4ea984780ac2eac458c98fe181684eef4e04beaf
Signed-off-by: Peter Portante <peter.portante@redhat.com>
2013年09月04日 23:35:46 -04:00
Alex Gaynor
0f3b0410e3 Removed unnecessary monkeypatching of __builtin__
Replaced it with explicitly importing the gettext function, which is
significantly more readable.
Change-Id: Ia0a7edcf685fb6e4052a8290367b233169529ab8
2013年07月27日 21:34:35 -07:00
Dirk Mueller
8aba2d602e Start using Hacking
Instead of blacklisting Hacking globally,
only blacklist those that currently occur frequently
(for a later followup patch), and fix the rest. In
detail:
H101 Use TODO(NAME)
H201 no 'except:' at least use 'except Exception:'
H231 octal number 022 should be written as 0o22
H401 docstring should not start with a space
H701 Empty localization string
Change-Id: Ib3b3d56b68d1cf15d3b67ac9749fcbdb876dc52a
2013年07月15日 11:41:58 +02:00
Jenkins
d5736ec00b Merge "python3: Introduce py33 to tox.ini" 2013年06月21日 01:45:45 +00:00
Peter Portante
9094c5cc66 Add branch coverage reporting
Except where the python-nose package version does not support the
"--cover-branches" option.
Change-Id: I9ea6452d9834b3ac414e14e628002f593dd4b8c8
Signed-off-by: Peter Portante <peter.portante@redhat.com>
2013年06月10日 10:30:40 -04:00
Chuck Short
7fc2477425 python3: Introduce py33 to tox.ini
Introduce py33 to tox.ini to make testing with
python3 easier.
Change-Id: Id5c76d58551af4671f30ace85bdbbf5803a58368
Signed-off-by: Chuck Short <chuck.short@canonical.com>
2013年06月01日 19:21:58 -05:00
niu-zglinux
627d0ba52f Rename requires files to standard names.
Rename tools/pip-requires to requirements.txt and tools/test-requires
to test-requirements.txt. These are standard files, and tools in the
general world are growing intelligence about them.
Change-Id: Ib3e50a811868e2969923d978ee00c4f92682aa1c
Fixes: bug #1179008 
2013年05月30日 22:14:01 +00:00
Monty Taylor
de2e5aa462 Update to flake8 instead of pep8.
Change-Id: I3d4a31111c3044da06611405ce80f208ef8a0ce3
2013年05月01日 14:19:38 -04:00
Samuel Merritt
35f4d29ed6 Upgrade pep8 to 1.3.3.
This required a bunch of whitespace-poking of the scripts in bin, but
that's all. Now every file in swift/ and bin/ is pep8-1.3.3-compliant,
so hopefully we can be done with this pep8 stuff for a good long time.
Change-Id: I44fdb41d219c57400a4c396ab7eb0ffa9dcd8db8
2012年11月26日 18:15:21 -08:00
Monty Taylor
e7180a5876 Align tox.ini and fix coverage jobs in jenkins.
The jenkins coverage jobs expect there to be a .coverage file, so deleting
it is a bad idea. Also, coverage erase will do that for us.
While we're in there, update tox.ini and setup.cfg to the latest.
Change-Id: Icd0a8fc66a5146e0d94f62a9f65a4536981d2916
2012年06月08日 20:05:14 -04:00
Samuel Merritt
2ccf219ec1 Make scripts in bin/ PEP8-compliant.
Also made tox's PEP8 check look at the scripts in bin/ to keep them
PEP8-compliant.
Change-Id: I710365ea929d7fc15578d5f742a236bad47ef28e
2012年05月04日 08:24:51 -07:00
Monty Taylor
85b1d72715 Add venv commands to tox.ini.
The recent tox addition missed the general purpose that we use
for things like building docs and other arbitrary commands.
Change-Id: Ib195a78d084a170c5051906f619743def4dbfbea
2012年03月16日 11:07:33 -07:00
Maru Newby
e6ea310751 Add support for venv-based test run with tox.
* Adds tox config
 - based on the config from python-quantumclient and updated for
 test, pep8 and coverage execution as per nova's run_tests.sh.
 * Adds nosetests defaults in setup.cfg
 * Adds runtime dependencies in tools/pip-requires
 - dependencies were gathered by referencing the packages used in
 creation of a Swift All In One. Versions were determined by
 checking the swift-core/trunk ppa or, failing that, the version
 available in lucid.
 * Adds test dependencies in tools/test-requires
 * Updates swift/common/middleware/formpost.py for pep8 compliance
 * Adds instructions for executing the tests with Tox to the
 developer_guidelines
 * Adds instructions for installing openstack.nose_plugin to
 developer_saio
 * Fixes bug 909177
Change-Id: I5407924d2181e9ab335aaf76bf30c8d40deccbb4
2012年03月07日 22:44:34 -08:00