nvchecker/tests
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
..
__init__.py version 2: MVP 2020-08-11 17:43:03 +08:00
conftest.py Merge remote-tracking branch 'origin/pr/212' 2022-11-20 13:42:22 +08:00
test_alpm.py Fix test_alpm in Arch chroots 2023-04-07 20:38:17 +08:00
test_android_sdk.py update test_android_sdk.py 2022-08-12 13:52:04 +08:00
test_anitya.py anitya: relax the test - shutter is updated often these days 2021-08-07 14:37:18 +08:00
test_apt.py update tests 2023-03-26 18:39:05 +08:00
test_archpkg.py Fix test_{archpkg,pacman} 2022-10-29 14:21:02 +08:00
test_aur.py start porting tests to new version 2020-08-17 15:11:14 +08:00
test_bitbucket.py bitbucket: use querying and sorting for improved tag search 2022-02-04 10:31:41 -06:00
test_cache.py dash doesn't have $RANDOM 2020-08-20 15:31:00 +08:00
test_cmd.py start porting tests to new version 2020-08-17 15:11:14 +08:00
test_combiner.py add a combiner source and the underlying mechanism to wait for other entries' results 2021-06-08 14:55:57 +08:00
test_container.py Update tests 2021-08-22 22:43:33 +08:00
test_cpan.py port more tests 2020-08-18 16:45:20 +08:00
test_cran.py add CRAN support 2022-02-22 19:06:15 +02:00
test_cratesio.py port more tests 2020-08-17 16:31:59 +08:00
test_debianpkg.py tests/test_debianpkg: update 2020-09-03 16:30:32 +08:00
test_gems.py port more tests 2020-08-18 16:45:20 +08:00
test_git.py git source: support fetching commit hash on a branch 2020-12-24 22:01:22 +08:00
test_gitea.py test_gitea: remove some cases that go out of date too frequently 2020-09-28 16:12:22 +08:00
test_github.py final tweak of keyfile 2020-08-20 15:18:43 +08:00
test_gitlab.py Update tests 2021-05-06 12:44:55 +08:00
test_hackage.py hackage is flaky 2020-08-20 17:07:16 +08:00
test_htmlparser.py Merge remote-tracking branch 'origin/pr/212' 2022-11-20 13:42:22 +08:00
test_httpheader.py Add optional token for regex and httpheader. Add htmlparser source (#182) 2021-06-11 16:18:39 +08:00
test_manual.py port more tests 2020-08-17 16:31:59 +08:00
test_npm.py port more tests 2020-08-18 16:45:20 +08:00
test_openvsx.py Update versions in test_{openvsx,vsmarketplace} 2022-10-29 14:22:23 +08:00
test_packagist.py port more tests 2020-08-18 16:45:20 +08:00
test_pacman.py Fix test_{archpkg,pacman} 2022-10-29 14:21:02 +08:00
test_pagure.py Add support for Pagure 2020-09-01 18:11:57 +08:00
test_pypi.py port more tests 2020-08-17 16:21:02 +08:00
test_regex.py regex: make sure we don't have more than one group in the regex 2021-11-06 10:44:10 +08:00
test_repology.py repology: add support for subrepo 2020-10-30 06:06:15 +01:00
test_simplerun.py add a test to test the whole command tool 2022-02-04 16:54:13 +08:00
test_sortversion.py add support for using awesomeversion to compare versions 2022-06-05 14:31:54 +08:00
test_sparkle.py fix: source sparkle (#210) 2022-02-22 20:13:18 +08:00
test_substitute.py Allow empty to_pattern 2020-10-02 04:39:57 +08:00
test_ubuntupkg.py port more tests 2020-08-17 16:31:59 +08:00
test_vsmarketplace.py update tests 2023-03-26 18:39:05 +08:00