Commit graph

270 commits

Author SHA1 Message Date
Daniel Peukert
5052d82550
github: implement option to include prereleases 2023-08-25 23:23:30 +02:00
Chih-Hsuan Yen
386d05f8e3 tests: skip testing with broken Deepin mirror 2023-08-22 19:51:16 +08:00
Chih-Hsuan Yen
07cddd9bd6 tests: fix tests with httpbin 0.10.0
The latest httpbin changes the format of JSON response. For example:
```
{
  "authenticated": true,
  "user": "username"
}
```
2023-08-22 18:44:51 +08:00
Chih-Hsuan Yen
598bb94135 tests: update Android SDK version 2023-08-22 18:40:01 +08:00
Eric Long
fe1342e9fb tests: bump android-sdk-cmake and xml2 version 2023-07-13 16:54:24 +08:00
Chih-Hsuan Yen
d9888cc49d Fix test_alpmfiles in Arch chroots
In general, there are no /var/lib/pacman/sync/*.files in Arch chroots,
and thus tests in test_alpmfiles.py fail.

The tempfile approach roughly follows tests/test_alpm.py.

Follow-up https://github.com/lilydjwg/nvchecker/pull/226
2023-06-19 22:06:47 +08:00
lilydjwg
e708d19d35 tests: update test_htmlparser to avoid httpbin.org
it produces a lot of 504 errors.
2023-06-02 00:58:24 +08:00
Pekka Ristola
8157e08b59
Add alpmfiles source
Rewritten from the `archfiles` source in archlinuxcn/lilac
2023-05-31 21:29:17 +03:00
lilydjwg
af77af34f3 fight mypy[1]
The following error will be reported without if:

  error: Name "tomllib" already defined (by an import)

While this can be silenced by a "# type: ignore", in some case[2] mypy
will report the following error:

  error: Unused "type: ignore" comment

[1]: https://github.com/python/mypy/issues/1153
[2]: https://github.com/lilydjwg/nvchecker/actions/runs/4916840821/jobs/8793454970
2023-05-09 13:31:11 +08:00
lilydjwg
e9ecbd514b silence mypy for new module 2023-05-08 23:28:20 +08:00
Felix Yan
34e87db8f9
Use tomllib on Python 3.11+
Fallback to tomli for compatibility with older Python.
2023-05-08 10:52:27 +03:00
Alexandru Fikl
fed4fc52ff
test_cran: bump xml2 version to pass test 2023-05-01 09:59:16 +03:00
Chih-Hsuan Yen
166dfb11a4 Fix test_alpm in Arch chroots
Arch chroots with recent devtools has options=(debug) by default, and
thus test_alpm fails:

_________________________ ERROR at setup of test_alpm __________________________

module = <module 'tests.test_alpm' from '/build/nvchecker/src/nvchecker/tests/test_alpm.py'>

    def setup_module(module):
      global temp_dir, db_path
      temp_dir = tempfile.TemporaryDirectory()
      temp_path = pathlib.Path(temp_dir.name)
      pkg_path = temp_path / 'test-pkg'
      pkg_path.mkdir()
      with (pkg_path / 'PKGBUILD').open('w') as f:
        f.write(
          'pkgname=test-pkg\n'
          'pkgver=1.2.3\n'
          'pkgrel=4\n'
          'arch=(any)\n'
          'provides=("test-provides=5.6-7" "test-provides-unversioned")\n'
        )
      subprocess.check_call(['makepkg', '--nosign'], cwd=pkg_path)
      pkg_file = subprocess.check_output(['makepkg', '--packagelist'], cwd=pkg_path, text=True).strip()
      db_path = pkg_path / 'test-db'
      db_path.mkdir()
      repo_path = db_path / 'sync'
      repo_path.mkdir()
>     subprocess.check_call([
        'repo-add',
        repo_path / 'test-repo.db.tar.gz',
        pkg_path / pkg_file
      ])

tests/test_alpm.py:40:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

popenargs = (['repo-add', PosixPath('/tmp/tmp2kl26h_y/test-pkg/test-db/sync/test-repo.db.tar.gz'), PosixPath('/pkgdest/test-pkg-1.2.3-4-any.pkg.tar.zst\n/pkgdest/test-pkg-debug-1.2.3-4-any.pkg.tar.zst')],)
kwargs = {}, retcode = 1
cmd = ['repo-add', PosixPath('/tmp/tmp2kl26h_y/test-pkg/test-db/sync/test-repo.db.tar.gz'), PosixPath('/pkgdest/test-pkg-1.2.3-4-any.pkg.tar.zst\n/pkgdest/test-pkg-debug-1.2.3-4-any.pkg.tar.zst')]

    def check_call(*popenargs, **kwargs):
        """Run command with arguments.  Wait for command to complete.  If
        the exit code was zero then return, otherwise raise
        CalledProcessError.  The CalledProcessError object will have the
        return code in the returncode attribute.

        The arguments are the same as for the call function.  Example:

        check_call(["ls", "-l"])
        """
        retcode = call(*popenargs, **kwargs)
        if retcode:
            cmd = kwargs.get("args")
            if cmd is None:
                cmd = popenargs[0]
>           raise CalledProcessError(retcode, cmd)
E           subprocess.CalledProcessError: Command '['repo-add', PosixPath('/tmp/tmp2kl26h_y/test-pkg/test-db/sync/test-repo.db.tar.gz'), PosixPath('/pkgdest/test-pkg-1.2.3-4-any.pkg.tar.zst\n/pkgdest/test-pkg-debug-1.2.3-4-any.pkg.tar.zst')]' returned non-zero exit status 1.

/usr/lib/python3.10/subprocess.py:369: CalledProcessError
---------------------------- Captured stdout setup -----------------------------
==> Making package: test-pkg 1.2.3-4 (Fri Apr  7 11:53:43 2023)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
==> Extracting sources...
==> Entering fakeroot environment...
==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Stripping unneeded symbols from binaries and libraries...
  -> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "test-pkg"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: test-pkg 1.2.3-4 (Fri Apr  7 11:53:44 2023)
==> No packages modified, nothing to do.
---------------------------- Captured stderr setup -----------------------------
==> ERROR: File '/pkgdest/test-pkg-1.2.3-4-any.pkg.tar.zst
/pkgdest/test-pkg-debug-1.2.3-4-any.pkg.tar.zst' not found.
2023-04-07 20:38:17 +08:00
lilydjwg
577a42ef89 update tests
Microsoft's teams repo has gone.
2023-03-26 18:39:05 +08:00
lilydjwg
fad7cf631d Merge remote-tracking branch 'origin/pr/212'
Conflicts:
      setup.cfg
      setup.py
2022-11-20 13:42:22 +08:00
Chih-Hsuan Yen
2fc6be9d4e Update versions in test_{openvsx,vsmarketplace} 2022-10-29 14:22:23 +08:00
Chih-Hsuan Yen
3d3d8c6136 Fix test_{archpkg,pacman}
Apparently the ipw2100-fw package is dropped. I switched to another
package that is rarely updated.
2022-10-29 14:21:02 +08:00
lilydjwg
13cca483e1 update test_android_sdk.py 2022-08-12 13:52:04 +08:00
lilydjwg
914c6414e8 fix tests trying to raise exc_info=True 2022-06-12 14:22:14 +08:00
lilydjwg
8b32c26d1e htmlparser: handle xpath pointing to element instead of text() 2022-06-12 12:31:11 +08:00
lilydjwg
ffe84cae08 add support for using awesomeversion to compare versions 2022-06-05 14:31:54 +08:00
lilydjwg
d706961669 update tests 2022-04-21 17:23:20 +08:00
lilydjwg
69a5d82d25 tests: fix some warnings 2022-04-07 14:06:03 +08:00
Chih-Hsuan Yen
c15e9b7576
android-sdk improvements
* Returns all matched versions to support list options
* Don't hard-code the host OS
* Document the default of `channel`
2022-04-02 11:53:27 +08:00
Dusk Banks
2598b0fd19 tests: pytest-asyncio asyncio_mode -> strict
the `asyncio_mode` of `legacy` (current default) is deprecated.
`asyncio_mode` will be `strict` by default in the future.
2022-03-03 09:56:33 -08:00
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