Commit graph

194 commits

Author SHA1 Message Date
Dusk Banks
9005c96d10 introduce tox support 2022-03-03 09:56:33 -08:00
Dusk Banks
a62866a2d3 tests: spell test_htmlparser correctly 2022-02-22 21:51:47 -08:00
Pekka Ristola
e03023bd6c
add CRAN support 2022-02-22 19:06:15 +02:00
Guizai
7739f5c8c0
fix: source sparkle (#210)
fix: source sparkle
2022-02-22 20:13:18 +08:00
依云
acb56d7827
Merge pull request #206 from alexfikl/bitbucket-order-tags
Bitbucket: Add support for queries and sorting
2022-02-08 14:40:59 +08:00
Alexandru Fikl
a8228bb594
bitbucket: use querying and sorting for improved tag search 2022-02-04 10:31:41 -06:00
lilydjwg
d5920efa54 add a test to test the whole command tool 2022-02-04 16:54:13 +08:00
lilydjwg
bc2c2edfde update test_android_sdk.py 2022-01-20 17:22:24 +08:00
lilydjwg
1fb3c970cf fix types and tests 2022-01-20 16:38:10 +08:00
lilydjwg
5e60a1dc86 replace the toml library with tomli 2021-12-29 16:36:23 +08:00
lilydjwg
b8b6e47d59 update test_apt 2021-11-06 10:57:41 +08:00
lilydjwg
f3be1c585f regex: make sure we don't have more than one group in the regex 2021-11-06 10:44:10 +08:00
Yichao Yu
c43d4e900f
Support HTTP POST request in the htmlparser and regex source
Example:

    source = "regex"
    regex = "spcm_linux_libs_v[0-9a-zA-Z]*"
    url = "https://spectrum-instrumentation.com/spcm_downloads_downloads_ajax"
    post_data = "series%5B%5D=273&families%5B%5D=475"
2021-09-07 00:40:23 -04:00
Chih-Hsuan Yen
9acae25c0f
regex: make sure regex fails if nothing is found
This is a regression since 2019 [1].
Before that commit, max() raises ValuError if re.findall returns an
empty list. After that commit, regex fails silently if nothing is found.

[1] 7897317294 (diff-fd40f1295f9ddece86df8d2c385ddb02bd4e2a10cd20bd9a95306d3d35a9b601)
2021-08-31 20:07:06 +08:00
Chih-Hsuan Yen
b8afc43430
Update tests
* Use a seemingly never updated container for testing container
  registries other than docker.io
* Update versions for openvsx and vsmarketplace
2021-08-22 22:43:33 +08:00
Chih-Hsuan Yen
44b9f1856f
anitya: relax the test - shutter is updated often these days 2021-08-07 14:37:18 +08:00
lilydjwg
151b03801f update tests 2021-07-14 22:45:13 +08:00
Th3Whit3Wolf
25d7a7498d Add Visual Studio Code Marketplace 2021-07-14 22:45:13 +08:00
Th3Whit3Wolf
ad2dc19415 Add OpenVSX source 2021-07-14 13:05:45 +01:00
lilydjwg
6fd3ba95ba apt: handle multiple verions correctly
closes #191
2021-06-25 15:22:40 +08:00
lilydjwg
ffaca8c949 option to not verify HTTPS certificate
fixes #190.
2021-06-23 16:08:47 +08:00
Maud LAURENT
9deb55806d
Add optional token for regex and httpheader. Add htmlparser source (#182)
add an httptoken option; add htmlparser with xpath source

Co-authored-by: Maud LAURENT <maud.laurent@eurecia.com>
Co-authored-by: lilydjwg <lilydjwg@gmail.com>
2021-06-11 16:18:39 +08:00
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
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
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
Chih-Hsuan Yen
134a6885f1
Update tests 2021-05-06 12:44:55 +08:00
Mario Rodas
7366d82bfc tests: add needs_net marker to httpheader test 2021-03-20 04:20:00 +00:00
lilydjwg
f8f261c476 gitlab: omit default branch if not specified, fix for blm 2021-03-18 13:19:05 +08:00
Chih-Hsuan Yen
bf8a4c9298
Use pytest for sortversion tests 2021-02-21 15:24:01 +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
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
491a71add7 git source: support fetching commit hash on a branch 2020-12-24 22:01:22 +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
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
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
Chih-Hsuan Yen
ea1200126b
Add channel for Android SDK packages 2020-10-10 13:19:36 +08:00
Chih-Hsuan Yen
75e72c11b3
Add container source plugin
Closes https://github.com/lilydjwg/nvchecker/issues/59
2020-10-07 19:17:48 +08:00
Chih-Hsuan Yen
f957acc756
Use my formal English name for previous contributions 2020-10-06 22:17:47 +08:00
lilydjwg
494c67beb0 Merge remote-tracking branch 'origin/pr/155' into master 2020-10-02 12:38:13 +08:00
Felix Yan
071b57c580
Allow empty to_pattern
It's useful to have a partial match pattern to be replaced by an empty
string, like stripping a suffix. Let's allow it as "not to_pattern" will
reject this.
2020-10-02 04:39:57 +08:00
lilydjwg
4cb63cbe65 test_gitea: remove some cases that go out of date too frequently 2020-09-28 16:12:22 +08:00
lilydjwg
4f3a900505 setup httpclient from configuration options
closes #76
2020-09-28 15:09:51 +08:00
lilydjwg
cd1cbfde30 support per source plugin configuration and support different registry for the npm source 2020-09-24 18:27:30 +08:00
Felix Yan
c9b689d67b
Add a git source
It's a thin wrapper around the cmd source, and reuses its get_cmd
function.
2020-09-24 04:26:12 +08:00
lilydjwg
185a7e88a9 use asyncio.Semaphore instead of self-made queue 2020-09-20 22:15:54 +08:00