Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] RFC8 - Move to pytest testing tool [Issue#428] #492

Closed
wants to merge 124 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
84acf66
moving tests to pytest
ricardogsilva May 25, 2016
95cee97
working on POST tests
ricardogsilva May 25, 2016
4aca3bd
adding ports for each suite
ricardogsilva May 29, 2016
07d644a
refactoring tests to use py.test
ricardogsilva May 29, 2016
0ecc653
Removed pycsw placeholder text and unnecessary config KVP param
ricardogsilva May 31, 2016
5f5c272
Adding back test logic
ricardogsilva May 31, 2016
6d78dbb
adding database stuff to test configuration
ricardogsilva Jun 10, 2016
820d390
refactoring tests to use py.test
ricardogsilva Aug 18, 2016
625db7f
Merge branch 'master' into issue#428
ricardogsilva Nov 5, 2016
28b8127
added pycharm's project files to gitignore
ricardogsilva Nov 5, 2016
e481836
refactored the implementation
ricardogsilva Nov 16, 2016
3d640da
made new copies of the test data files under tests/functionaltests
ricardogsilva Nov 16, 2016
3e4ae83
moving tests to pytest
ricardogsilva May 25, 2016
207b9e4
working on POST tests
ricardogsilva May 25, 2016
a96c146
adding ports for each suite
ricardogsilva May 29, 2016
9c93bbd
refactoring tests to use py.test
ricardogsilva May 29, 2016
fb02cb2
Removed pycsw placeholder text and unnecessary config KVP param
ricardogsilva May 31, 2016
d3e8c73
Adding back test logic
ricardogsilva May 31, 2016
45740e0
adding database stuff to test configuration
ricardogsilva Jun 10, 2016
825c417
refactoring tests to use py.test
ricardogsilva Aug 18, 2016
963c91b
added pycharm's project files to gitignore
ricardogsilva Nov 5, 2016
1f7dbd5
refactored the implementation
ricardogsilva Nov 16, 2016
daa52ba
made new copies of the test data files under tests/functionaltests
ricardogsilva Nov 16, 2016
852347d
changed test parameters
ricardogsilva Nov 18, 2016
5909cc5
Merge branch 'issue#428' of https://github.com/ricardogsilva/pycsw in…
ricardogsilva Nov 18, 2016
22d20d8
Merge branch 'master' into issue#428
ricardogsilva Nov 18, 2016
6ba89af
updated failing harvesting tests like in master
ricardogsilva Nov 18, 2016
094f602
Added docstrings to all functions
ricardogsilva Nov 18, 2016
8fa84a1
refactored gen_html to account for the change in location for test su…
ricardogsilva Nov 18, 2016
ed8b384
Added support for postgresql in tests
ricardogsilva Dec 13, 2016
e7233b3
Changed some tests in order to have uniform sorting
ricardogsilva Dec 13, 2016
546c87a
Added support for tox
ricardogsilva Dec 14, 2016
7c71a0c
Using unicode strings instead of bytes in test function
ricardogsilva Dec 14, 2016
2ee0b9f
fixed version for pytest
ricardogsilva Dec 14, 2016
5dd9379
improved docs on testing
ricardogsilva Dec 14, 2016
850a63a
Removed old testing tasks from pavement file
ricardogsilva Dec 14, 2016
93e6c14
moving tests to pytest
ricardogsilva May 25, 2016
4a21b40
working on POST tests
ricardogsilva May 25, 2016
936d5b5
adding ports for each suite
ricardogsilva May 29, 2016
9eae009
refactoring tests to use py.test
ricardogsilva May 29, 2016
657bcf5
Removed pycsw placeholder text and unnecessary config KVP param
ricardogsilva May 31, 2016
a3da2e4
Adding back test logic
ricardogsilva May 31, 2016
2e4944d
adding database stuff to test configuration
ricardogsilva Jun 10, 2016
c57370b
refactoring tests to use py.test
ricardogsilva Aug 18, 2016
7c1a230
added pycharm's project files to gitignore
ricardogsilva Nov 5, 2016
537b2ec
refactored the implementation
ricardogsilva Nov 16, 2016
99187d1
made new copies of the test data files under tests/functionaltests
ricardogsilva Nov 16, 2016
425744c
moving tests to pytest
ricardogsilva May 25, 2016
c4be99d
working on POST tests
ricardogsilva May 25, 2016
eccdea0
refactoring tests to use py.test
ricardogsilva May 29, 2016
8709622
Adding back test logic
ricardogsilva May 31, 2016
affe847
refactoring tests to use py.test
ricardogsilva Aug 18, 2016
4b8117f
refactored the implementation
ricardogsilva Nov 16, 2016
c544071
changed test parameters
ricardogsilva Nov 18, 2016
f38e1fb
updated failing harvesting tests like in master
ricardogsilva Nov 18, 2016
87a9307
Added docstrings to all functions
ricardogsilva Nov 18, 2016
305c071
refactored gen_html to account for the change in location for test su…
ricardogsilva Nov 18, 2016
d21a808
Added support for postgresql in tests
ricardogsilva Dec 13, 2016
19147b6
Changed some tests in order to have uniform sorting
ricardogsilva Dec 13, 2016
7cc7d32
Added support for tox
ricardogsilva Dec 14, 2016
aa44c18
Using unicode strings instead of bytes in test function
ricardogsilva Dec 14, 2016
d0f3d00
fixed version for pytest
ricardogsilva Dec 14, 2016
e8ddd58
improved docs on testing
ricardogsilva Dec 14, 2016
d84f5e2
Removed old testing tasks from pavement file
ricardogsilva Dec 14, 2016
f3db82c
Merge branch 'issue#428' of https://github.com/ricardogsilva/pycsw in…
ricardogsilva Dec 14, 2016
5e9c231
Updated several expected test results
ricardogsilva Dec 14, 2016
1d8bbee
deleted old suites and expected diectories
ricardogsilva Dec 14, 2016
76bf5df
deleted older run_tests.py test runner
ricardogsilva Dec 14, 2016
2ba3579
Convert py3 bytes to str before exporting and test exporting (#491)
kwilcox Dec 14, 2016
b0274e3
send exported files to tests/results which is ignored by Git
tomkralidis Dec 15, 2016
6c227aa
Improving docstrings
ricardogsilva Dec 15, 2016
2946d29
Added python2.6 to tox
ricardogsilva Dec 15, 2016
24af749
Requirements-dev now includes the other requirements files
ricardogsilva Dec 15, 2016
2a1c4b3
testing travis builds
ricardogsilva Dec 15, 2016
3f790f4
Testing out travis builds
ricardogsilva Dec 15, 2016
35627e8
Testing out travis builds
ricardogsilva Dec 15, 2016
62162fe
Testing out travis builds
ricardogsilva Dec 15, 2016
a80b0c9
Testing out travis builds
ricardogsilva Dec 15, 2016
3d4e10a
Zh translations, for Chinese. (#493)
bukun Dec 17, 2016
0e5f02e
add locale_dirs for i18n
tomkralidis Dec 17, 2016
0cf53ac
testing out travis builds
ricardogsilva Dec 21, 2016
6f4d39c
added gitignore files to relevant test dirs
ricardogsilva Dec 21, 2016
621a988
testing travis builds
ricardogsilva Dec 21, 2016
af3bcc9
testing travis builds
ricardogsilva Dec 22, 2016
c1964dc
fix formatting [ci skip]
tomkralidis Dec 22, 2016
e8654ce
changed travis settings in order to use tox
ricardogsilva Dec 23, 2016
87e8cd7
moving tests to pytest
ricardogsilva May 25, 2016
868981d
working on POST tests
ricardogsilva May 25, 2016
de4cb6d
adding ports for each suite
ricardogsilva May 29, 2016
267a9e8
refactoring tests to use py.test
ricardogsilva May 29, 2016
1427598
Adding back test logic
ricardogsilva May 31, 2016
b73c281
adding database stuff to test configuration
ricardogsilva Jun 10, 2016
cd49f53
refactoring tests to use py.test
ricardogsilva Aug 18, 2016
1ab35ea
added pycharm's project files to gitignore
ricardogsilva Nov 5, 2016
95253b4
refactored the implementation
ricardogsilva Nov 16, 2016
37289c6
made new copies of the test data files under tests/functionaltests
ricardogsilva Nov 16, 2016
c37de9a
Removed pycsw placeholder text and unnecessary config KVP param
ricardogsilva May 31, 2016
6dbcf88
changed test parameters
ricardogsilva Nov 18, 2016
d1ec34d
updated failing harvesting tests like in master
ricardogsilva Nov 18, 2016
6dee5b8
Added docstrings to all functions
ricardogsilva Nov 18, 2016
73ec843
refactored gen_html to account for the change in location for test su…
ricardogsilva Nov 18, 2016
c0b10aa
Added support for postgresql in tests
ricardogsilva Dec 13, 2016
cbcafb0
Changed some tests in order to have uniform sorting
ricardogsilva Dec 13, 2016
052b5ec
Added support for tox
ricardogsilva Dec 14, 2016
a102698
Using unicode strings instead of bytes in test function
ricardogsilva Dec 14, 2016
ca8f4bf
fixed version for pytest
ricardogsilva Dec 14, 2016
a16a907
improved docs on testing
ricardogsilva Dec 14, 2016
306ba20
Removed old testing tasks from pavement file
ricardogsilva Dec 14, 2016
a1c0f9c
moving tests to pytest
ricardogsilva May 25, 2016
0de23c0
working on POST tests
ricardogsilva May 25, 2016
dc8853d
refactoring tests to use py.test
ricardogsilva May 29, 2016
151cb47
Adding back test logic
ricardogsilva May 31, 2016
cc5a433
refactoring tests to use py.test
ricardogsilva Aug 18, 2016
76d29e2
refactored the implementation
ricardogsilva Nov 16, 2016
bc30518
Updated several expected test results
ricardogsilva Dec 14, 2016
7eb3367
deleted old suites and expected diectories
ricardogsilva Dec 14, 2016
cda6ab6
deleted older run_tests.py test runner
ricardogsilva Dec 14, 2016
25c708e
Improving docstrings
ricardogsilva Dec 15, 2016
686d2a4
Added python2.6 to tox
ricardogsilva Dec 15, 2016
393f162
Requirements-dev now includes the other requirements files
ricardogsilva Dec 15, 2016
4acbcdd
added gitignore files to relevant test dirs
ricardogsilva Dec 21, 2016
32299b3
changed travis settings in order to use tox
ricardogsilva Dec 23, 2016
c904a06
Merge branch 'issue#428' of https://github.com/ricardogsilva/pycsw in…
ricardogsilva Dec 23, 2016
d2bdf23
re-added travis notifications
ricardogsilva Dec 23, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 12 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[run]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this file for coverage.py? Is coverage.py enabled by the tox --cov flag?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Yes, .coveragerc is the configuration for running coverage.py. More details here. In our case I am using it mostly to:
    • enable branch covering, which is useful to see whether tests cover multiple options in if.. elif.. else blocks
    • allow for collecting results inside tox virtualenvs
  2. Yes, coverage is enabled in tox too. This is configured in the tox.ini. I've chosen to enable coverage only on python3.4 for now. In the future we can report coverage on all python versions and then combine them all, but this will require additional work

branch = True
source = pycsw

[paths]
source =
pycsw
.tox/*/lib/python*/site-packages/pycsw
/usr/local/lib/python*/dist-packages/pycsw
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this hardcoded path safe enough or should it be abstracted somehow?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe so.

  • The second line refers to paths inside the virtualenvs generated by tox, so they are always the same, and they do not depend on the base system.
  • The third line is the standard path where python packages are installed whenever they are pip installed in a debian-like system. I'm not so sure this is the same on other distros. However, I don't think it is relevant, as this configuration's purpose is for allowing the coverage output's to be treated as the same by coverage.py, specifically for the continuous integration service. Since we are using Travis, which is based on ubuntu, the paths are the expected ones.


[report]
show_missing = True
16 changes: 8 additions & 8 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
- Python version:
- pycsw version:
- source/distribution
- [ ] git clone
- [ ] DebianGIS/UbuntuGIS
- [ ] PyPI
- [ ] zip/tar.gz
- [ ] other (please specify):
- [ ] git clone
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes in this file are already committed upstream.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I really have to clean up the commit history...

- [ ] DebianGIS/UbuntuGIS
- [ ] PyPI
- [ ] zip/tar.gz
- [ ] other (please specify):
- web server
- [ ] Apache/mod_wsgi
- [ ] CGI
- [ ] other (please specify):
- [ ] Apache/mod_wsgi
- [ ] CGI
- [ ] other (please specify):

# Steps to Reproduce

Expand Down
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ MANIFEST
# testing artifacts
tests/index.html
tests/results
**.cache
.coverage
.tox

# test configurations
/default.cfg

# test repositories
data
# pycharm ide
.idea
39 changes: 18 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,34 @@
language: python

sudo: required
dist: trusty
cache: pip

python:
- "2.6"
- "2.7"
- "3.4"
dist: trusty

#matrix:
# allow_failures:
# - python: "3.4"
matrix:
include:
- python: "2.6"
env: TOXENV=py26-sqlite
- python: "2.7"
env: TOXENV=py27-sqlite
- python: "3.4"
env: TOXENV=py34-sqlite
- python: "3.5"
env: TOXENV=py35-sqlite

addons:
apt:
packages:
- libgeos-c1
- libgeos-dev
- libpq-dev
- libxml2-dev

before_script:
- pycsw-admin.py -c get_sysprof
- libxslt1-dev
- libz-dev

install:
- pip install -r requirements.txt
- pip install -r requirements-dev.txt
- pip install -r requirements-standalone.txt
- python setup.py -q install
- pip install tox
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we just include tox in requirements-dev.txt and pip install -r requirements-dev.txt?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is not possible. The way in which tox works is that it is responsible for creating separate virtualenvs for each python version (and other combinations of dependencies, like one virtualenv for python3.4 with sqlite, another virtualenv for python3.4 with postgresql, etc). As such, the tox process is the one which is going to be calling pip to install the dependencies inside each virtualenv after it has been created. This happens when we run tox on the command-line. This means that tox must be installed system-wide and a priori of installing pycsw rquirements.

In short, its tox's job to install the requirements, so tox has to be already installed and there is no benefit in including it in requirements.txt.


script:
- paver test

after_script:
- paver stop
- tox -- --exitfirst -k 'not harvesting'

notifications:
irc:
Expand Down
3 changes: 3 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@

# -- General configuration -----------------------------------------------------

# locale
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes in this file are already committed upstream.

locale_dirs = ['locale/']

# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'

Expand Down
Loading