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

Improve software tests #49

Merged
merged 63 commits into from
Nov 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
61631cf
[qa] Switch test framework from `nose` to `pytest`
amotl Apr 13, 2022
7a8546c
[qa] Refactor test files
amotl Apr 14, 2022
ec5f4e8
[qa] Improve Python test harness
amotl Apr 14, 2022
275635d
[mw] Fix getting PDF documents and drawings from USPTO
amotl Apr 15, 2022
60571e6
[qa] Add software test infrastructure for data acquisition subsystems
amotl Apr 15, 2022
d57d9ce
This and that
amotl Apr 15, 2022
4b5955e
[qa] Add tests covering acquisition of USPTO PDF documents and drawings
amotl Apr 15, 2022
5242861
[mw] Refactor the bootloader subsystem
amotl Apr 18, 2022
507903d
[qa] Add tests for EPO OPS data source
amotl Apr 18, 2022
0541579
[ui] Fix depa.tech data source logo
amotl Apr 18, 2022
638112f
[ui] Improve loading behaviour for vendor data source logos
amotl Apr 18, 2022
e7779eb
[mw] EPO/OPS: Update list of full text authorities
amotl Apr 18, 2022
2fcdada
[mw] Fix JSON Web Token adapter for generating shareable links
amotl Apr 19, 2022
9c4c4d5
[ci] Remove macOS from test matrix again
amotl Apr 19, 2022
31c1f8d
[mw] Improve reading lists of document numbers from text files
amotl Apr 19, 2022
a4ffa1c
[mw] Improve application bootstrapping and bootstrap testing
amotl Apr 19, 2022
267e8b5
[qa] Improve tests for EPO OPS data source
amotl Apr 20, 2022
31c69ec
[mw] Fix acquisition of claims and description for DE and US documents
amotl Apr 25, 2022
ef24fc6
[mw] Improve gracefulness when decoding document numbers
amotl Apr 26, 2022
e4bb138
[mw] Improve parameter validation in authentication handler
amotl Apr 27, 2022
0a79f7e
This and that
amotl Apr 28, 2022
1793762
[mw] Honour `fulltext_enabled` setting of data source
amotl Apr 28, 2022
1b48379
[mw] Disable acquisition of PDF documents from DPMA/DEPATISconnect
amotl May 24, 2022
6b2c06b
[mw] EPO/OPS: Unlock inquiry of image info for documents w/o kind code
amotl May 24, 2022
b349367
[mw] EPO/Espacenet: Repair access layer
amotl May 25, 2022
b80079f
[ui] EPO/Espacenet: Repair "external sources" links
amotl May 25, 2022
d44a5b7
[qa] Fix tests
amotl May 25, 2022
4d0f78b
[mw] EPO/Espacenet: Acquire "abstract" text
amotl May 26, 2022
905e0b0
[mw] EPO/Espacenet: Make access layer production ready
amotl May 26, 2022
fb48f6d
[mw] EPO/Espacenet: Acquire "abstract" text from OPS API
amotl May 26, 2022
55bb13c
[ui] Adjust JavaScript dependencies for `bootbox`
amotl May 26, 2022
c98d5cd
[infra] Don't use designated port 9999 to avoid confusion
amotl May 26, 2022
0eb9e08
[infra] Rework the Docker setup
amotl May 26, 2022
b4911d5
[doc] Various documentation updates across the board
amotl May 26, 2022
512a78b
[doc] Fix building the documentation
amotl May 26, 2022
84368c5
[mw] Fix installation
amotl May 26, 2022
77ce295
[mw] Fix logging
amotl May 26, 2022
e5689fa
[cli] Start using the `Click` command line parser
amotl May 26, 2022
376a279
[infra] Update infrastructure to generate third-party license notes
amotl May 26, 2022
e4ba7ce
[infra] Update notes about third-party licenses
amotl May 26, 2022
d068104
[mw] Improve "minimal" application framework bootstrapping
amotl May 26, 2022
353b94b
[mw] Minor adjustments to application bootstrapping in CLI mode
amotl May 30, 2022
7eac138
[doc] Improve README
amotl May 30, 2022
a3031bf
[mw] Add CLI interface for basic operations on EPO/OPS
amotl May 30, 2022
10e15e8
[mw] Fix access to DPMAregister due to upstream changes
amotl Jun 3, 2022
3ba5d76
[mw] Add CLI interface for search operation on IFI CLAIMS
amotl Jun 3, 2022
90f7271
[mw] Adjust Dockerfile
amotl Jun 14, 2022
2f82c70
[mw] Add inline backlog comment to EPO/OPS cli interface
amotl Jun 14, 2022
792d72b
[mw] Convert Dockerfile and docker-compose.yml using `dos2unix`
amotl Nov 27, 2022
a151d73
[qa] Refactor tests needing credentials into individual modules
amotl Nov 27, 2022
97299f4
[qa] Compensate for DPMAregister being protected by F5 Advanced WAF
amotl Nov 27, 2022
9e3457e
[mw] Fix access to USPTO documents using USPTO PPUBS
amotl Nov 28, 2022
72dadcc
[qa] Improve pytest configuration
amotl Nov 28, 2022
5e59ed4
[ci] Improve efficiency on GHA
amotl Nov 28, 2022
e654e96
[ci] Use `ubuntu-20.04` to keep support for Python 2.7
amotl Nov 28, 2022
907f43d
[ci] Upgrade to `actions/setup-python@v4`
amotl Nov 28, 2022
01b3807
[qa] Adjust dependencies to keep compatibility with Python 2
amotl Nov 28, 2022
eebfd11
[mw] Generalize image format conversion
amotl Nov 28, 2022
b86fb2e
[ci] Allow ImageMagick to read and write the PDF format
amotl Nov 28, 2022
a03c548
[ci] Install `pdftk` program
amotl Nov 28, 2022
130bbae
[mw] Fix compatibility with `python-jwt>=3.3.4`
amotl Nov 28, 2022
d8bbba7
[mw] Stop using `requests-cache` again
amotl Nov 29, 2022
0afc55f
[infra] Update notes about third-party licenses
amotl Nov 29, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .coveragerc

This file was deleted.

75 changes: 71 additions & 4 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,65 @@ on:
branches: [ main ]
pull_request:
branches: [ main ]

# Allow job to be triggered manually.
workflow_dispatch:

# Cancel in-progress jobs when pushing to the same branch.
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}

jobs:

tests-backend:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['ubuntu-latest', 'macos-latest']
os: [
'ubuntu-20.04',

# Don't use macOS for now, it is currently unstable, otherwise slow. -- 2022-04-19, amo
# 'macos-latest',
]
python-version: ['2.7']

defaults:
run:
shell: bash

env:
OPS_API_CONSUMER_KEY: ${{ secrets.OPS_API_CONSUMER_KEY }}
OPS_API_CONSUMER_SECRET: ${{ secrets.OPS_API_CONSUMER_SECRET }}
IFICLAIMS_API_URI: ${{ secrets.IFICLAIMS_API_URI }}
IFICLAIMS_API_USERNAME: ${{ secrets.IFICLAIMS_API_USERNAME }}
IFICLAIMS_API_PASSWORD: ${{ secrets.IFICLAIMS_API_PASSWORD }}

name: Python ${{ matrix.python-version }} on OS ${{ matrix.os }}
steps:

- name: Acquire sources
uses: actions/checkout@v3

- name: Install dependencies for Linux
if: runner.os == 'Linux'
run: |
sudo apt install --yes pdftk poppler-utils

- name: Install dependencies for macOS
if: runner.os == 'macOS'
run: |
brew install poppler

- name: Configure policy for ImageMagick
# https://stackoverflow.com/q/52998331
# https://stackoverflow.com/a/57721936
if: runner.os == 'Linux'
run: |
sudo rm /etc/ImageMagick-6/policy.xml

- name: Setup Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: x64
Expand All @@ -40,7 +76,7 @@ jobs:
make setup-test

- name: Run tests
run: make test
run: make test-coverage options="--app-cache-backend=memory"

- name: Upload coverage results to Codecov
uses: codecov/codecov-action@v3
Expand All @@ -51,11 +87,42 @@ jobs:
name: codecov-umbrella
fail_ci_if_error: false

tests-docs:
runs-on: "ubuntu-20.04"

defaults:
run:
shell: bash

name: Build documentation
steps:

- name: Acquire sources
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '2.7'
architecture: 'x64'
cache: 'pip'
cache-dependency-path: 'requirements-docs.txt'

- name: Invoke Sphinx
run: |
pip install virtualenv
make docs-html

tests-ui:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['ubuntu-latest', 'macos-latest']
os: [
'ubuntu-20.04',

# Don't use macOS for now, it is currently unstable, otherwise slow. -- 2022-04-19, amo
# 'macos-latest',
]
node-version: ['11']

defaults:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ coverage.xml
o-*.min.js
o-*.min.map
yarn-error.log
patzilla-uspto-cache.sqlite
46 changes: 39 additions & 7 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,43 @@ Development
- [ui] EPO/OPS: Support CPCI classifications
- [ui] Fix dependencies: Upgrade Moment.js and Async
- [ci] Add CI/GHA configuration
- [ci] Add macOS to test matrix
- [ui] Update a few JavaScript dependencies
- [qa] Switch test framework from ``nose`` to ``pytest``
- [qa] Improve Python test harness
- [mw] Fix getting PDF documents and drawings from USPTO. Thanks, @aghster!
- [qa] Add software test infrastructure for data acquisition subsystems
- [qa] Add tests covering the acquisition of USPTO PDF documents and drawings
- [mw] Refactor the bootloader subsystem
- [qa] Add tests for EPO OPS data source
- [ui] Fix depa.tech data source logo
- [ui] Improve loading behaviour for vendor data source logos
- [mw] EPO/OPS: Update list of full text authorities. Thanks, @epo and @aghster!
- [mw] Fix JSON Web Token adapter for generating shareable links
- [mw] Improve reading lists of document numbers from text files
- [mw] Fix acquisition of claims and description for DE and US documents
- [mw] Improve gracefulness when decoding document numbers
- [mw] Improve parameter validation in authentication handler
- [mw] Honour ``fulltext_enabled`` setting of data source
- [mw] Disable acquisition of PDF documents from DPMA/DEPATISconnect
- [mw] EPO/OPS: Unlock inquiry of image information for documents without kind code
- [mw] EPO/Espacenet: Repair access layer. Thanks, @aghster!
- [ui] EPO/Espacenet: Repair "external sources" links
- [mw] EPO/Espacenet: Acquire "abstract" text
- [mw] EPO/Espacenet: Make access layer production ready
- [mw] EPO/Espacenet: Acquire "abstract" text from OPS API
- [ui] Adjust JavaScript dependencies for ``bootbox``
- [infra] Don't use designated port 9999 to avoid confusion
- [infra] Rework the Docker setup
- [doc] Various documentation updates across the board
- [doc] Fix building the documentation
- [mw] Fix logging. Thanks, @think-nice-things!
- [cli] Start using the ``Click`` command line parser
- [mw] Improve "minimal" application framework bootstrapping
- [mw] Add CLI interface for basic operations on EPO/OPS
- [mw] Fix access to DPMAregister due to upstream changes
- [mw] Add CLI interface for search operation on IFI CLAIMS
- [mw] Fix access to USPTO documents using USPTO PPUBS, PatFT and AppFT are deprecated
- [mw] Generalize image format conversion


2019-11-01 0.169.3
Expand Down Expand Up @@ -189,7 +224,7 @@ Development
- [ui] Add ApplicationProfile subsystem
- [ui] Improve Stack subsystem data model
- [ui] Improve jQuery3 compatibility
- [ui] Improve INID code labels, refactoring
- [ui] Improve INID code labels, refactoring
- [ui] Add display flavour with verbose INID code labels
- [ui] Add a few Material Design Components
- [ui] Add Stack opener button
Expand Down Expand Up @@ -262,7 +297,7 @@ Development
- [ui] Fix occasional cropped display of drawings
- [ui] Prepare drawings loader for fetching new items when navigating to previous item
- [ui] Reorder comfort form fields again
- [ui] Nail Javascript module dependencies to exact versions
- [ui] Nail Javascript module dependencies to exact versions
- [mw] Fix error reporting and logging issues
- [ui] Hide previous/next drawing navigation buttons when displaying a single drawing
- [ui] Prevent out of bounds navigation to the previous drawing if there's just one item in the collection
Expand Down Expand Up @@ -2362,15 +2397,12 @@ Bug fixes and minor updates
2013-10-24 0.0.7
================

feature:
- backpropagate current basket entries into checkbox state
- display "inventor" attribute
- add portfolio demo frameset
- add ship-mode=single-bibdata
- fix: be more graceful if applicants or inventors are missing from data
- renamed ingress query parameters "ship_*" to "ship-*"

tech:
- renamed ingress query parameters ``ship_*`` to ``ship-*``
- route refactoring
- ui refactoring: more responsive through "twitter bootstrap responsive css"

Expand Down
19 changes: 10 additions & 9 deletions CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,32 @@ the people who contributed to this software:
* Alexander Wagner <https://ip7.tech/>
* Andreas Büchler <https://www.coperion.com/>
* Andreas Motl <andreas.motl@elmyra.de>
* Andreas Sykora <http://www.q-ip.de/sykora-lang.php>
* Andreas Sykora <http://q-ip.de/de/menschen.html#Syko_Content_Btn>
* Andrii Danyleiko <https://github.com/DefteZ>
* Arne Krüger <https://depa.tech/>
* Benjamin Walter <b.walter@europatent.net>
* David Santamauro <https://www.ificlaims.com/>
* David Santamauro <https://www.ificlaims.com/about-team.htm>
* Erik Zscherpe <http://blumpatentrecherchen.de/>
* Ernst Fischer <http://www.pateris.de/dr-ernst-fischer/>
* Felix Berkemeier <http://www.patente.de/en/dr-felix-berkemeier.html>
* Ernst Fischer <https://www.pateris.de/dr-ernst-fischer/>
* Felix Berkemeier <https://www.patente.de/en/dr-felix-berkemeier.html>
* Frank Heider <https://github.com/frankheider>
* Gaby Strauß <http://www.patentberichterstatter-muenchen.de/>
* Johannes Steimel <https://www.festool.com/>
* Johannes Zellner <johannes@zellner.org>
* Klaus Hager <http://www.patentberichterstatter-muenchen.de/>
* Lars Witte <https://www.patentfamily.com/>
* Luca Martinuzzi <http://www.patentberichterstatter-muenchen.de/>
* Marc Haus <https://depa.tech/>
* Martin Bock <http://www.serviva.com/>
* Martin Bock <https://serviva.com/>
* Martin Glatzer <https://www.guentner.com/>
* Michael Behl <m.behl@europatent.net>
* Papoteur <https://github.com/papoteur-mga>
* Raphael Jung <http://www.serviva.com/>
* Robert Frenzel <http://www.serviva.com/>
* Raphael Jung <https://serviva.com/>
* Robert Frenzel <https://serviva.com/>
* Siegfried Greiner <http://greiner-mv.de/>
* Steffen Köhler <s.koehler@europatent.net>
* Uwe Spadaccini <http://www.serviva.com/>
* Uwe Spadaccini <https://www.infovida.de/ueber-infovida.html>
* Wilhelm von Krüchten <http://www.patentberichterstatter-muenchen.de/>
* Wolf-Rüdiger von Gartzen <gartzen@europatent.net>
* Wolf-Rüdiger von Gartzen <info@innovationship.de>

Thanks a bunch!
83 changes: 50 additions & 33 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,24 @@ $(eval venvpath := .venv2)
$(eval pip := $(venvpath)/bin/pip)
$(eval twine := $(venvpath)/bin/twine)
$(eval python := $(venvpath)/bin/python)
$(eval pserve := $(venvpath)/bin/pserve)
$(eval pytest := $(venvpath)/bin/pytest)
$(eval bumpversion := $(venvpath)/bin/bumpversion)
$(eval fab := $(venvpath)/bin/fab)

$(eval venv3path := .venv)
$(eval yarn := $(venv3path)/bin/yarn)
$(eval npx := $(venv3path)/bin/npx)


setup: setup-py

jswatch:
npx yarn watch

pywatch:
HUPPER_DEFAULT_MONITOR=hupper.watchdog.WatchdogFileMonitor $(pserve) --reload patzilla/config/development-local.ini


js:
# url cleaner
Expand All @@ -28,6 +43,7 @@ js-release: js
@echo ------------------------------------------
npx yarn release


sdist:
$(python) setup.py sdist

Expand All @@ -51,9 +67,11 @@ upload-pypi:
setup-virtualenv:
@test -e $(python) || virtualenv --python=python2 $(venvpath)

setup-test: setup-virtualenv
setup-py: setup-virtualenv
$(pip) install --editable=.[test]

setup-test: setup-py

setup-deployment:
$(pip) install --requirement requirements-deploy.txt

Expand Down Expand Up @@ -81,39 +99,31 @@ install-nginx-auth:
fab upload_nginx_auth

test:
@$(python) runtests.py \
$(options) \
--all-modules \
--traverse-namespace \
--with-doctest \
--doctest-tests \
--doctest-extension=rst \
--doctest-options=doctestencoding=utf-8,+ELLIPSIS,+NORMALIZE_WHITESPACE,+REPORT_UDIFF \
--exclude-dir=patzilla/navigator/static \
--exclude-dir=patzilla/navigator/templates \
--exclude-dir=patzilla/util/database \
--exclude-dir=patzilla/util/web/uwsgi \
--exclude-dir=patzilla/access/sip \
--ignore-files=setup.py \
--ignore-files=fabfile.py \
--nocapture \
--nologcapture \
--verbose

# +REPORT_ONLY_FIRST_FAILURE


test-cover:
$(MAKE) test options="--with-coverage"

nginx_path=/Users/amo/dev/celeraone/sources/c1-ocb-integrator/rem_rp/parts/openresty
nginx-start:
@$(nginx_path)/nginx/sbin/nginx -p $(nginx_path)/nginx -c `pwd`/nginx-auth/etc/nginx.conf -g "daemon off; error_log /dev/stdout info;"

mongodb-start:
@$(pytest) \
$(options) \
patzilla tests

test-coverage:
@$(MAKE) test options="$(options) --cov"

# --all-modules
# --traverse-namespace
# --doctest-options=doctestencoding=utf-8,+ELLIPSIS,+NORMALIZE_WHITESPACE,+REPORT_UDIFF
# +REPORT_ONLY_FIRST_FAILURE
# --nocapture
# --nologcapture

nginx:
nginx -c `pwd`/nginx-auth/etc/nginx.conf -g "daemon off; error_log /dev/stdout info;"

nginx-start: nginx

mongodb:
mkdir -p ./var/lib/mongodb
mongod --dbpath=./var/lib/mongodb

mongodb-start: mongodb

mongodb-sip-export:
mkdir -p var/tmp/mongodb
mongoexport --db patzilla_development --collection sip_country > var/tmp/mongodb/sip_country.mongodb
Expand All @@ -132,22 +142,29 @@ sloccount:
genlicenses:
$(pip) install third-party-license-file-generator
$(pip) freeze > /tmp/requirements.txt
$(python) -m third_party_license_file_generator --requirements-path /tmp/requirements.txt --python-path $(python) --output-file licenses-backend.txt
$(python) -m third_party_license_file_generator \
--requirements-path /tmp/requirements.txt --python-path $(python) \
--permit-gpl --permit-commercial \
--output-file licenses-backend.txt
npx yarn licenses generate-disclaimer > licenses-frontend.txt

clear-cache:
mongo beaker --eval 'db.dropDatabase();'

docs-virtualenv:
$(eval venvpath := ".venv_sphinx")
@test -e $(venvpath)/bin/python || `command -v virtualenv` --python=`command -v python` --no-site-packages $(venvpath)
@test -e $(venvpath)/bin/python || `command -v virtualenv` --python=`command -v python2` $(venvpath)
@$(venvpath)/bin/pip --quiet install --requirement requirements-docs.txt

docs-html: docs-virtualenv
$(eval venvpath := ".venv_sphinx")
touch docs/index.rst
export SPHINXBUILD="`pwd`/$(venvpath)/bin/sphinx-build"; cd docs; make html

docs-linkcheck: docs-virtualenv
$(eval venvpath := ".venv_sphinx")
export SPHINXBUILD="`pwd`/$(venvpath)/bin/sphinx-build"; cd docs; make linkcheck

pdf-EP666666:
/usr/local/bin/wkhtmltopdf \
--no-stop-slow-scripts --debug-javascript \
Expand Down
Loading