Commit Graph

722 Commits

Author SHA1 Message Date
lilydjwg
ae506ba9cf add a combiner source and the underlying mechanism to wait for other entries' results 2021-06-08 14:55:57 +08:00
lilydjwg
d83d8d5367 aur: avoid the asyncio.wait warning 2021-06-06 12:26:53 +08:00
lilydjwg
943847da74 container: fix test 2021-06-06 12:26:44 +08:00
lilydjwg
68fcfe3924 container: add pagination
fixes #189
2021-06-06 12:13:07 +08:00
依云
6f7633a93c
Merge pull request #188 from yan12125/fix-test-pacman
Fix test_pacman in some scenarios
2021-06-03 12:38:14 +08:00
Chih-Hsuan Yen
1064f3d948
Update test_anitya.py
Shutter is now actively developed :)
2021-06-03 12:33:07 +08:00
Chih-Hsuan Yen
61bc0c5562
Fix test_pacman in some scenarios
For example, on reproducible.archlinux.org, apparently pacman databases
are not synced before building synced before building packages, and thus
packages cannot be found. From https://reproducible.archlinux.org/api/v0/builds/110565/log,

=================================== FAILURES ===================================
_________________________________ test_pacman __________________________________

get_version = <function get_version.<locals>.__call__ at 0x7f2fa5ed1310>

    async def test_pacman(get_version):
>       assert await get_version("ipw2100-fw", {
            "source": "pacman",
        }) == "1.3-10"

tests/test_pacman.py:11:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/conftest.py:46: in __call__
    newvers = await run(entries)
tests/conftest.py:40: in run
    return await main.run(result_coro, runner_coro)
nvchecker/__main__.py:92: in run
    return await result_fu
nvchecker/core.py:361: in process_result
    r1 = _process_result(r)
nvchecker/core.py:322: in _process_result
    logger.error(version.msg, **kw)
/usr/lib/python3.9/site-packages/structlog/_log_levels.py:118: in meth
    return self._proxy_to_logger(name, event, **kw)
/usr/lib/python3.9/site-packages/structlog/_base.py:198: in _proxy_to_logger
    args, kw = self._process_event(method_name, event, event_kw)
/usr/lib/python3.9/site-packages/structlog/_base.py:155: in _process_event
    event_dict = proc(self._logger, method_name, event_dict)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

logger = <PrintLogger(file=<_io.TextIOWrapper name="<_io.FileIO name=6 mode='rb+' closefd=True>" mode='r+' encoding='utf-8'>)>
method_name = 'error'
event_dict = {'cmd': "LANG=C pacman -Si ipw2100-fw | grep -F Version | awk '{print $3}' | head -n 1", 'error': "warning: database f...r: package 'ipw2100-fw' was not found", 'event': 'command exited without output', 'logger_name': 'nvchecker.core', ...}

    def proc(logger, method_name, event_dict):
      if method_name in ('warning', 'error'):
        if 'exc_info' in event_dict:
          raise event_dict['exc_info']
        if not event_dict['event'].startswith(('rate limited', 'no-result')):
>         raise RuntimeError(event_dict['event'])
E         RuntimeError: command exited without output

tests/conftest.py:85: RuntimeError
----------------------------- Captured stdout call -----------------------------
running cmd
__________________________ test_pacman_strip_release ___________________________

get_version = <function get_version.<locals>.__call__ at 0x7f2fa5ed1310>

    async def test_pacman_strip_release(get_version):
>       assert await get_version("ipw2100-fw", {
            "source": "pacman",
            "strip_release": 1,
        }) == "1.3"

tests/test_pacman.py:16:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/conftest.py:46: in __call__
    newvers = await run(entries)
tests/conftest.py:40: in run
    return await main.run(result_coro, runner_coro)
nvchecker/__main__.py:92: in run
    return await result_fu
nvchecker/core.py:361: in process_result
    r1 = _process_result(r)
nvchecker/core.py:322: in _process_result
    logger.error(version.msg, **kw)
/usr/lib/python3.9/site-packages/structlog/_log_levels.py:118: in meth
    return self._proxy_to_logger(name, event, **kw)
/usr/lib/python3.9/site-packages/structlog/_base.py:198: in _proxy_to_logger
    args, kw = self._process_event(method_name, event, event_kw)
/usr/lib/python3.9/site-packages/structlog/_base.py:155: in _process_event
    event_dict = proc(self._logger, method_name, event_dict)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

logger = <PrintLogger(file=<_io.TextIOWrapper name="<_io.FileIO name=6 mode='rb+' closefd=True>" mode='r+' encoding='utf-8'>)>
method_name = 'error'
event_dict = {'cmd': "LANG=C pacman -Si ipw2100-fw | grep -F Version | awk '{print $3}' | head -n 1", 'error': "warning: database f...r: package 'ipw2100-fw' was not found", 'event': 'command exited without output', 'logger_name': 'nvchecker.core', ...}

    def proc(logger, method_name, event_dict):
      if method_name in ('warning', 'error'):
        if 'exc_info' in event_dict:
          raise event_dict['exc_info']
        if not event_dict['event'].startswith(('rate limited', 'no-result')):
>         raise RuntimeError(event_dict['event'])
E         RuntimeError: command exited without output

tests/conftest.py:85: RuntimeError
----------------------------- Captured stdout call -----------------------------
running cmd
2021-06-03 12:11:41 +08:00
lilydjwg
8db5c6a938 doc: we may need a newer rtd theme 2021-05-23 17:47:12 +08:00
lilydjwg
c65513b37d doc: clarify options of the container source
See also: https://github.com/lilydjwg/nvchecker/issues/183
2021-05-23 17:38:19 +08:00
依云
9d2d47ed15
Merge pull request #181 from yan12125/update-tests
Update tests
2021-05-06 13:07:47 +08:00
Chih-Hsuan Yen
134a6885f1
Update tests 2021-05-06 12:44:55 +08:00
依云
d7c553ae94
Merge pull request #179 from marsam/fix-test_httpheader
tests: add needs_net marker to httpheader test
2021-03-21 11:19:20 +08:00
Mario Rodas
7366d82bfc tests: add needs_net marker to httpheader test 2021-03-20 04:20:00 +00:00
lilydjwg
1b7736a549 bump version to 2.4dev and fix docs/*.py being included in dist tarball 2021-03-19 13:51:48 +08:00
lilydjwg
46da41147f version 2.3
update docs for gitlab source.
2021-03-19 13:41:26 +08:00
lilydjwg
f8f261c476 gitlab: omit default branch if not specified, fix for blm 2021-03-18 13:19:05 +08:00
依云
968af3df0b
Merge pull request #178 from yan12125/test-sortversion
Use pytest for sortversion tests
2021-02-21 17:37:07 +08:00
Chih-Hsuan Yen
bf8a4c9298
Use pytest for sortversion tests 2021-02-21 15:24:01 +08:00
依云
bace59de78
Merge pull request #177 from yan12125/patch-1
Fix tests
2021-02-14 08:50:45 +08:00
Chih-Hsuan Yen
e6e8573c33
Fix tests
Upstream commits: https://salsa.debian.org/med-team/golang-github-dataence-porter2/-/commits/master
2021-02-13 23:30:48 +08:00
lilydjwg
de0a5fe02e github actions: omit pypy tests
continue-on-error doesn't work as expected and there is no way to
"allow-failure". See https://github.com/actions/toolkit/issues/399.
2021-02-01 17:58:14 +08:00
lilydjwg
27269534d2 update test status badget 2021-02-01 17:43:55 +08:00
lilydjwg
0114a411f2 switch tests from travis to github actions
because travis queues are too long.
2021-02-01 15:17:44 +08:00
依云
d2a5a1bf79
Merge pull request #176 from aminvakil/master
Correct package name in httpheader test
2021-01-29 16:58:47 +08:00
Amin Vakil
d2130b64c6
Correct package name in httpheader test 2021-01-29 12:18:00 +03:30
lilydjwg
29f2bad400 tests: use another url because jmeter-plugins.org one has issues with Tornado's simple HTTP client. 2021-01-29 16:11:11 +08:00
lilydjwg
305c329e02 add a httpheader source
see #175 for use cases.
2021-01-28 18:05:58 +08:00
lilydjwg
9c2d2a39d7 httpclient: add follow_redirects argument 2021-01-28 17:56:18 +08:00
lilydjwg
2e069fe1c7 add headers to HTTP Response objects and support for HTTP HEAD method 2021-01-28 17:43:09 +08:00
lilydjwg
8b9bd1ca1c Merge remote-tracking branch 'origin/pr/173' 2021-01-17 20:21:06 +08:00
Chih-Hsuan Yen
91daf5ad4d
Make the generated man page reproducible 2021-01-17 17:20:10 +08:00
lilydjwg
e09750b7a2 pypi source: use packaging.version.Version directly 2021-01-15 15:40:23 +08:00
lilydjwg
491a71add7 git source: support fetching commit hash on a branch 2020-12-24 22:01:22 +08:00
lilydjwg
a0c32ce5f0 travis: test on Python 3.9 2020-12-24 22:01:22 +08:00
依云
d053fc3ba4
Merge pull request #169 from felixonmars/limit-entry
Add a command line option to run nvchecker only on a specific entry
2020-11-17 11:44:06 +08:00
Felix Yan
e6c0ce38e5
Add a command line option to run nvchecker only on a specific entry
This is useful for debugging purpose, when your nvchecker.toml is very
large.
2020-11-17 06:34:53 +08:00
lilydjwg
e5a28b0fb1 bump version to 2.3dev 2020-11-10 23:27:55 +08:00
lilydjwg
372454136f tests/test_alpm: add --nosign and remove an unused import 2020-11-10 23:27:09 +08:00
DDoSolitary
5622d6d0c1
add ALPM source 2020-11-09 05:07:14 +08:00
lilydjwg
630f41c19b docs: a missed - -> _ conversion
[skip ci]
2020-11-05 00:11:03 +08:00
lilydjwg
64994e4a74 version 2.2 2020-11-03 14:29:45 +08:00
lilydjwg
b4689369c8 repology: return a list of versions instead
to support list options. Returning the first isn't usually desirable.
2020-10-30 17:57:31 +08:00
Jakub Ružička
024849c242 repology: add support for subrepo
Without this, querying latest Fedora packages is impossible because they
reside in 'updates' subrepo but old 'release' versions are returned.
Same thing for openSUSE.

Example config to query Fedora 32 latest packages in updates subrepo:

[somepackage]
source = "repology"
repo = "fedora_32"
subrepo = "updates"
2020-10-30 06:06:15 +01:00
lilydjwg
b83f92cc67 give better error messages when failing to load file 2020-10-24 16:31:18 +08:00
lilydjwg
a8073e2ad5 usage.rst: mention the `git source in 2.x changes on removed vcs` one 2020-10-24 16:22:00 +08:00
lilydjwg
cddf866ef6 tests/test_archpkg: use "dbus" to test "provided"
This package provides a package and a so.
2020-10-23 17:06:44 +08:00
依云
c8b0e673ca
Merge pull request #166 from DDoSolitary/patch-archpkg-provided
fix the provided option for unversioned "provides"
2020-10-23 17:05:16 +08:00
DDoSolitary
6815b035a1
fix the provided option for non-soname "provides"
this fixes #165
2020-10-23 03:35:11 +08:00
依云
30055a9dcb
Merge pull request #164 from DDoSolitary/patch-gems-list
Add list options support for gems source
2020-10-22 00:35:59 +08:00
DDoSolitary
ab66fc0468
Add list options support for gems source 2020-10-22 00:10:45 +08:00