0s autopkgtest [10:44:38]: starting date and time: 2024-11-29 10:44:38+0000 0s autopkgtest [10:44:38]: git checkout: be626eda Fix armhf LXD image generation for plucky 0s autopkgtest [10:44:38]: host juju-7f2275-prod-proposed-migration-environment-20; command line: /home/ubuntu/autopkgtest/runner/autopkgtest --output-dir /tmp/autopkgtest-work.1l_9g5p_/out --timeout-copy=6000 --setup-commands /home/ubuntu/autopkgtest-cloud/worker-config-production/setup-canonical.sh --apt-pocket=proposed=src:python-pygit2 --apt-upgrade git-ubuntu --timeout-short=300 --timeout-copy=20000 --timeout-build=20000 --env=ADT_TEST_TRIGGERS=python-pygit2/1.16.0-2 -- ssh -s /home/ubuntu/autopkgtest/ssh-setup/nova -- --flavor autopkgtest-ppc64el --security-groups autopkgtest-juju-7f2275-prod-proposed-migration-environment-20@bos03-ppc64el-31.secgroup --name adt-plucky-ppc64el-git-ubuntu-20241129-102451-juju-7f2275-prod-proposed-migration-environment-20-bf63012a-e1ef-445b-adaf-edf44f22686b --image adt/ubuntu-plucky-ppc64el-server --keyname testbed-juju-7f2275-prod-proposed-migration-environment-20 --net-id=net_prod-proposed-migration-ppc64el -e TERM=linux -e ''"'"'http_proxy=http://squid.internal:3128'"'"'' -e ''"'"'https_proxy=http://squid.internal:3128'"'"'' -e ''"'"'no_proxy=127.0.0.1,127.0.1.1,login.ubuntu.com,localhost,localdomain,novalocal,internal,archive.ubuntu.com,ports.ubuntu.com,security.ubuntu.com,ddebs.ubuntu.com,changelogs.ubuntu.com,keyserver.ubuntu.com,launchpadlibrarian.net,launchpadcontent.net,launchpad.net,10.24.0.0/24,keystone.ps5.canonical.com,objectstorage.prodstack5.canonical.com'"'"'' --mirror=http://ftpmaster.internal/ubuntu/ 80s autopkgtest [10:45:58]: testbed dpkg architecture: ppc64el 80s autopkgtest [10:45:58]: testbed apt version: 2.9.14ubuntu1 81s autopkgtest [10:45:59]: @@@@@@@@@@@@@@@@@@@@ test bed setup 81s autopkgtest [10:45:59]: testbed release detected to be: None 82s autopkgtest [10:46:00]: updating testbed package index (apt update) 82s Get:1 http://ftpmaster.internal/ubuntu plucky-proposed InRelease [73.9 kB] 82s Hit:2 http://ftpmaster.internal/ubuntu plucky InRelease 82s Hit:3 http://ftpmaster.internal/ubuntu plucky-updates InRelease 82s Hit:4 http://ftpmaster.internal/ubuntu plucky-security InRelease 82s Get:5 http://ftpmaster.internal/ubuntu plucky-proposed/universe Sources [766 kB] 83s Get:6 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse Sources [14.4 kB] 83s Get:7 http://ftpmaster.internal/ubuntu plucky-proposed/restricted Sources [9708 B] 83s Get:8 http://ftpmaster.internal/ubuntu plucky-proposed/main Sources [62.4 kB] 83s Get:9 http://ftpmaster.internal/ubuntu plucky-proposed/main ppc64el Packages [92.7 kB] 83s Get:10 http://ftpmaster.internal/ubuntu plucky-proposed/restricted ppc64el Packages [928 B] 83s Get:11 http://ftpmaster.internal/ubuntu plucky-proposed/universe ppc64el Packages [631 kB] 83s Get:12 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse ppc64el Packages [9968 B] 83s Fetched 1661 kB in 1s (1698 kB/s) 84s Reading package lists... 84s Reading package lists... 84s Building dependency tree... 84s Reading state information... 85s Calculating upgrade... 85s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 85s Reading package lists... 85s Building dependency tree... 85s Reading state information... 85s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 85s autopkgtest [10:46:03]: upgrading testbed (apt dist-upgrade and autopurge) 85s Reading package lists... 85s Building dependency tree... 85s Reading state information... 86s Calculating upgrade...Starting pkgProblemResolver with broken count: 0 86s Starting 2 pkgProblemResolver with broken count: 0 86s Done 86s Entering ResolveByKeep 86s 86s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 87s Reading package lists... 87s Building dependency tree... 87s Reading state information... 87s Starting pkgProblemResolver with broken count: 0 87s Starting 2 pkgProblemResolver with broken count: 0 87s Done 87s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 89s autopkgtest [10:46:07]: testbed running kernel: Linux 6.11.0-8-generic #8-Ubuntu SMP Mon Sep 16 13:49:23 UTC 2024 90s autopkgtest [10:46:08]: @@@@@@@@@@@@@@@@@@@@ apt-source git-ubuntu 91s Get:1 http://ftpmaster.internal/ubuntu plucky/universe git-ubuntu 1.1-1 (dsc) [2280 B] 91s Get:2 http://ftpmaster.internal/ubuntu plucky/universe git-ubuntu 1.1-1 (tar) [179 kB] 91s Get:3 http://ftpmaster.internal/ubuntu plucky/universe git-ubuntu 1.1-1 (diff) [5776 B] 91s gpgv: Signature made Wed Jul 3 16:18:24 2024 UTC 91s gpgv: using RSA key A62D2CFBD50B9B5BF360D54B159EB5C4EFC8774C 91s gpgv: Can't check signature: No public key 91s dpkg-source: warning: cannot verify inline signature for ./git-ubuntu_1.1-1.dsc: no acceptable signature found 91s autopkgtest [10:46:09]: testing package git-ubuntu version 1.1-1 92s autopkgtest [10:46:10]: build not needed 92s autopkgtest [10:46:10]: test self-test: preparing testbed 92s Reading package lists... 92s Building dependency tree... 92s Reading state information... 93s Starting pkgProblemResolver with broken count: 0 93s Starting 2 pkgProblemResolver with broken count: 0 93s Done 93s The following NEW packages will be installed: 93s dctrl-tools debian-archive-keyring devscripts diffstat dput gettext git 93s git-buildpackage git-man git-ubuntu libb-hooks-op-check-perl 93s libclass-method-modifiers-perl libclass-xsaccessor-perl libclone-perl 93s libdevel-callchecker-perl libdynaloader-functions-perl libencode-locale-perl 93s liberror-perl libfile-dirlist-perl libfile-homedir-perl libfile-listing-perl 93s libfile-touch-perl libfile-which-perl libgit2-1.8 libgomp1 93s libhtml-parser-perl libhtml-tagset-perl libhtml-tree-perl 93s libhttp-cookies-perl libhttp-date-perl libhttp-message-perl 93s libhttp-negotiate-perl libhttp-parser2.9 libimport-into-perl libio-html-perl 93s libio-pty-perl libio-socket-ssl-perl libipc-run-perl libjs-jquery 93s libjs-jquery-hotkeys libjs-jquery-isonscreen libjs-jquery-metadata 93s libjs-jquery-tablesorter libjs-jquery-throttle-debounce libjs-sphinxdoc 93s libjs-underscore liblwp-mediatypes-perl liblwp-protocol-https-perl 93s libmodule-runtime-perl libmoo-perl libnet-http-perl libnet-ssleay-perl 93s libnorm1t64 libparams-classify-perl libpgm-5.3-0t64 libpython3.13-minimal 93s libpython3.13-stdlib librole-tiny-perl libsodium23 libsub-quote-perl 93s libsys-cpuaffinity-perl libtimedate-perl libtry-tiny-perl liburi-perl 93s libwww-perl libwww-robotrules-perl libxdelta2t64 libzmq5 patchutils pbzip2 93s perl-openssl-defaults pixz pristine-tar pylint python3-argcomplete 93s python3-astroid python3-cachetools python3-coverage python3-dateutil 93s python3-debian python3-debianbts python3-dill python3-distro-info 93s python3-gpg python3-importlib-metadata python3-iniconfig python3-isort 93s python3-jaraco.classes python3-jeepney python3-keyring python3-keyrings.alt 93s python3-launchpadlib-desktop python3-logilab-common python3-mccabe 93s python3-mypy-extensions python3-packaging python3-platformdirs 93s python3-pluggy python3-py python3-pycryptodome python3-pygit2 python3-pytest 93s python3-pytest-cov python3-secretstorage python3-tenacity python3-tomlkit 93s python3-ubuntutools python3-xdg python3-zmq python3.13 python3.13-minimal 93s quilt ubuntu-dev-tools wdiff xdelta xdelta3 93s 0 upgraded, 116 newly installed, 0 to remove and 0 not upgraded. 93s Need to get 27.3 MB of archives. 93s After this operation, 117 MB of additional disk space will be used. 93s Get:1 http://ftpmaster.internal/ubuntu plucky/main ppc64el libpython3.13-minimal ppc64el 3.13.0-2 [881 kB] 94s Get:2 http://ftpmaster.internal/ubuntu plucky/main ppc64el python3.13-minimal ppc64el 3.13.0-2 [2302 kB] 94s Get:3 http://ftpmaster.internal/ubuntu plucky/main ppc64el libjs-jquery all 3.6.1+dfsg+~3.5.14-1 [328 kB] 94s Get:4 http://ftpmaster.internal/ubuntu plucky/universe ppc64el libjs-jquery-hotkeys all 0~20130707+git2d51e3a9+dfsg-2.1 [11.5 kB] 94s Get:5 http://ftpmaster.internal/ubuntu plucky/main ppc64el python3-distro-info all 1.12 [7754 B] 94s Get:6 http://ftpmaster.internal/ubuntu plucky/main ppc64el dctrl-tools ppc64el 2.24-3build3 [109 kB] 94s Get:7 http://ftpmaster.internal/ubuntu plucky/universe ppc64el debian-archive-keyring all 2023.4ubuntu1 [168 kB] 94s Get:8 http://ftpmaster.internal/ubuntu plucky/main ppc64el libfile-dirlist-perl all 0.05-3 [7286 B] 94s Get:9 http://ftpmaster.internal/ubuntu plucky/main ppc64el libfile-which-perl all 1.27-2 [12.5 kB] 94s Get:10 http://ftpmaster.internal/ubuntu plucky/main ppc64el libfile-homedir-perl all 1.006-2 [37.0 kB] 94s Get:11 http://ftpmaster.internal/ubuntu plucky/main ppc64el libfile-touch-perl all 0.12-2 [7498 B] 94s Get:12 http://ftpmaster.internal/ubuntu plucky/main ppc64el libio-pty-perl ppc64el 1:1.20-1build3 [32.0 kB] 94s Get:13 http://ftpmaster.internal/ubuntu plucky/main ppc64el libipc-run-perl all 20231003.0-2 [91.5 kB] 94s Get:14 http://ftpmaster.internal/ubuntu plucky/main ppc64el libclass-method-modifiers-perl all 2.15-1 [16.1 kB] 94s Get:15 http://ftpmaster.internal/ubuntu plucky/main ppc64el libclass-xsaccessor-perl ppc64el 1.19-4build5 [35.1 kB] 94s Get:16 http://ftpmaster.internal/ubuntu plucky/main ppc64el libb-hooks-op-check-perl ppc64el 0.22-3build2 [9884 B] 94s Get:17 http://ftpmaster.internal/ubuntu plucky/main ppc64el libdynaloader-functions-perl all 0.004-1 [11.4 kB] 94s Get:18 http://ftpmaster.internal/ubuntu plucky/main ppc64el libdevel-callchecker-perl ppc64el 0.009-1build1 [14.1 kB] 94s Get:19 http://ftpmaster.internal/ubuntu plucky/main ppc64el libparams-classify-perl ppc64el 0.015-2build6 [22.2 kB] 94s Get:20 http://ftpmaster.internal/ubuntu plucky/main ppc64el libmodule-runtime-perl all 0.016-2 [16.4 kB] 94s Get:21 http://ftpmaster.internal/ubuntu plucky/main ppc64el libimport-into-perl all 1.002005-2 [10.7 kB] 94s Get:22 http://ftpmaster.internal/ubuntu plucky/main ppc64el librole-tiny-perl all 2.002004-1 [16.3 kB] 94s Get:23 http://ftpmaster.internal/ubuntu plucky/main ppc64el libsub-quote-perl all 2.006008-1ubuntu1 [20.7 kB] 94s Get:24 http://ftpmaster.internal/ubuntu plucky/main ppc64el libmoo-perl all 2.005005-1 [47.4 kB] 94s Get:25 http://ftpmaster.internal/ubuntu plucky/main ppc64el libencode-locale-perl all 1.05-3 [11.6 kB] 94s Get:26 http://ftpmaster.internal/ubuntu plucky/main ppc64el libtimedate-perl all 2.3300-2 [34.0 kB] 94s Get:27 http://ftpmaster.internal/ubuntu plucky/main ppc64el libhttp-date-perl all 6.06-1 [10.2 kB] 94s Get:28 http://ftpmaster.internal/ubuntu plucky/main ppc64el libfile-listing-perl all 6.16-1 [11.3 kB] 94s Get:29 http://ftpmaster.internal/ubuntu plucky/main ppc64el libhtml-tagset-perl all 3.24-1 [14.1 kB] 94s Get:30 http://ftpmaster.internal/ubuntu plucky/main ppc64el liburi-perl all 5.30-1 [94.4 kB] 94s Get:31 http://ftpmaster.internal/ubuntu plucky/main ppc64el libhtml-parser-perl ppc64el 3.83-1build1 [91.8 kB] 94s Get:32 http://ftpmaster.internal/ubuntu plucky/main ppc64el libhtml-tree-perl all 5.07-3 [200 kB] 94s Get:33 http://ftpmaster.internal/ubuntu plucky/main ppc64el libclone-perl ppc64el 0.47-1 [11.1 kB] 94s Get:34 http://ftpmaster.internal/ubuntu plucky/main ppc64el libio-html-perl all 1.004-3 [15.9 kB] 94s Get:35 http://ftpmaster.internal/ubuntu plucky/main ppc64el liblwp-mediatypes-perl all 6.04-2 [20.1 kB] 94s Get:36 http://ftpmaster.internal/ubuntu plucky/main ppc64el libhttp-message-perl all 7.00-2ubuntu1 [75.9 kB] 94s Get:37 http://ftpmaster.internal/ubuntu plucky/main ppc64el libhttp-cookies-perl all 6.11-1 [18.2 kB] 94s Get:38 http://ftpmaster.internal/ubuntu plucky/main ppc64el libhttp-negotiate-perl all 6.01-2 [12.4 kB] 94s Get:39 http://ftpmaster.internal/ubuntu plucky/main ppc64el perl-openssl-defaults ppc64el 7build3 [6628 B] 94s Get:40 http://ftpmaster.internal/ubuntu plucky/main ppc64el libnet-ssleay-perl ppc64el 1.94-2 [323 kB] 94s Get:41 http://ftpmaster.internal/ubuntu plucky/main ppc64el libio-socket-ssl-perl all 2.089-1 [200 kB] 94s Get:42 http://ftpmaster.internal/ubuntu plucky/main ppc64el libnet-http-perl all 6.23-1 [22.3 kB] 94s Get:43 http://ftpmaster.internal/ubuntu plucky/main ppc64el liblwp-protocol-https-perl all 6.14-1 [9040 B] 94s Get:44 http://ftpmaster.internal/ubuntu plucky/main ppc64el libtry-tiny-perl all 0.32-1 [21.2 kB] 94s Get:45 http://ftpmaster.internal/ubuntu plucky/main ppc64el libwww-robotrules-perl all 6.02-1 [12.6 kB] 94s Get:46 http://ftpmaster.internal/ubuntu plucky/main ppc64el libwww-perl all 6.77-1 [138 kB] 94s Get:47 http://ftpmaster.internal/ubuntu plucky/main ppc64el patchutils ppc64el 0.4.2-1build3 [86.6 kB] 94s Get:48 http://ftpmaster.internal/ubuntu plucky/main ppc64el wdiff ppc64el 1.2.2-6build1 [29.0 kB] 94s Get:49 http://ftpmaster.internal/ubuntu plucky/main ppc64el devscripts all 2.24.4 [1081 kB] 94s Get:50 http://ftpmaster.internal/ubuntu plucky/main ppc64el diffstat ppc64el 1.67-1 [34.2 kB] 94s Get:51 http://ftpmaster.internal/ubuntu plucky/main ppc64el python3-debian all 0.1.49ubuntu3 [116 kB] 94s Get:52 http://ftpmaster.internal/ubuntu plucky/main ppc64el python3-gpg ppc64el 1.24.0-2ubuntu1 [277 kB] 94s Get:53 http://ftpmaster.internal/ubuntu plucky/main ppc64el python3-xdg all 0.28-2 [38.3 kB] 94s Get:54 http://ftpmaster.internal/ubuntu plucky/main ppc64el dput all 1.2.4ubuntu1 [49.1 kB] 94s Get:55 http://ftpmaster.internal/ubuntu plucky/main ppc64el libgomp1 ppc64el 14.2.0-8ubuntu1 [161 kB] 94s Get:56 http://ftpmaster.internal/ubuntu plucky/main ppc64el gettext ppc64el 0.22.5-2 [1082 kB] 94s Get:57 http://ftpmaster.internal/ubuntu plucky/main ppc64el liberror-perl all 0.17029-2 [25.6 kB] 94s Get:58 http://ftpmaster.internal/ubuntu plucky/main ppc64el git-man all 1:2.45.2-1.2ubuntu1 [1122 kB] 94s Get:59 http://ftpmaster.internal/ubuntu plucky/main ppc64el git ppc64el 1:2.45.2-1.2ubuntu1 [7187 kB] 95s Get:60 http://ftpmaster.internal/ubuntu plucky/main ppc64el python3-dateutil all 2.9.0-3 [80.2 kB] 95s Get:61 http://ftpmaster.internal/ubuntu plucky/main ppc64el python3-importlib-metadata all 8.5.0-1 [20.7 kB] 95s Get:62 http://ftpmaster.internal/ubuntu plucky/universe ppc64el git-buildpackage all 0.9.35 [677 kB] 95s Get:63 http://ftpmaster.internal/ubuntu plucky/universe ppc64el libsys-cpuaffinity-perl ppc64el 1.13~03-2build4 [32.6 kB] 95s Get:64 http://ftpmaster.internal/ubuntu plucky/universe ppc64el pbzip2 ppc64el 1.1.13-1build1 [42.5 kB] 95s Get:65 http://ftpmaster.internal/ubuntu plucky/universe ppc64el pixz ppc64el 1.0.7-3 [23.8 kB] 95s Get:66 http://ftpmaster.internal/ubuntu plucky/universe ppc64el libxdelta2t64 ppc64el 1.1.3-10.7 [60.3 kB] 95s Get:67 http://ftpmaster.internal/ubuntu plucky/universe ppc64el xdelta ppc64el 1.1.3-10.7 [27.7 kB] 95s Get:68 http://ftpmaster.internal/ubuntu plucky/universe ppc64el xdelta3 ppc64el 3.0.11-dfsg-1.2 [101 kB] 95s Get:69 http://ftpmaster.internal/ubuntu plucky/universe ppc64el pristine-tar ppc64el 1.50+nmu2build1 [146 kB] 95s Get:70 http://ftpmaster.internal/ubuntu plucky/universe ppc64el quilt all 0.68-1 [439 kB] 95s Get:71 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-debianbts all 4.1.1 [12.8 kB] 95s Get:72 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-jeepney all 0.8.0-4 [33.1 kB] 95s Get:73 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-secretstorage all 3.3.3-3 [13.7 kB] 95s Get:74 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-jaraco.classes all 3.4.0-1 [7664 B] 95s Get:75 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-keyring all 25.4.1-1 [40.5 kB] 95s Get:76 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-launchpadlib-desktop all 2.0.0-1 [1778 B] 95s Get:77 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-ubuntutools all 0.203 [67.4 kB] 95s Get:78 http://ftpmaster.internal/ubuntu plucky/universe ppc64el ubuntu-dev-tools all 0.203 [93.2 kB] 95s Get:79 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-astroid all 3.3.5-1 [174 kB] 95s Get:80 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-isort all 5.13.2-2 [59.3 kB] 95s Get:81 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-mypy-extensions all 1.0.0-1 [6148 B] 95s Get:82 http://ftpmaster.internal/ubuntu plucky/main ppc64el libjs-underscore all 1.13.4~dfsg+~1.11.4-3 [118 kB] 95s Get:83 http://ftpmaster.internal/ubuntu plucky/main ppc64el libjs-sphinxdoc all 7.4.7-4 [158 kB] 95s Get:84 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-logilab-common all 2.0.0-1 [281 kB] 95s Get:85 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-dill all 0.3.9-1 [84.5 kB] 95s Get:86 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-mccabe all 0.7.0-1 [8678 B] 95s Get:87 http://ftpmaster.internal/ubuntu plucky/main ppc64el python3-platformdirs all 4.3.6-1 [16.8 kB] 95s Get:88 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-tomlkit all 0.13.2-1 [37.6 kB] 95s Get:89 http://ftpmaster.internal/ubuntu plucky/universe ppc64el pylint all 3.3.1-2 [345 kB] 95s Get:90 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-argcomplete all 3.5.1-1ubuntu1 [35.6 kB] 95s Get:91 http://ftpmaster.internal/ubuntu plucky/main ppc64el python3-cachetools all 5.3.3-1 [10.3 kB] 95s Get:92 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-pycryptodome ppc64el 3.20.0+dfsg-3build1 [1142 kB] 95s Get:93 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-keyrings.alt all 5.0.2-1 [16.6 kB] 95s Get:94 http://ftpmaster.internal/ubuntu plucky/main ppc64el libhttp-parser2.9 ppc64el 2.9.4-6build1 [24.4 kB] 95s Get:95 http://ftpmaster.internal/ubuntu plucky-proposed/main ppc64el libgit2-1.8 ppc64el 1.8.4+ds-1ubuntu1 [737 kB] 95s Get:96 http://ftpmaster.internal/ubuntu plucky-proposed/universe ppc64el python3-pygit2 ppc64el 1.16.0-2 [192 kB] 95s Get:97 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-iniconfig all 1.1.1-2 [6024 B] 95s Get:98 http://ftpmaster.internal/ubuntu plucky/main ppc64el python3-packaging all 24.2-1 [51.5 kB] 95s Get:99 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-pluggy all 1.5.0-1 [21.0 kB] 95s Get:100 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-pytest all 8.3.3-1 [251 kB] 95s Get:101 http://ftpmaster.internal/ubuntu plucky/main ppc64el libpython3.13-stdlib ppc64el 3.13.0-2 [2148 kB] 95s Get:102 http://ftpmaster.internal/ubuntu plucky/main ppc64el python3.13 ppc64el 3.13.0-2 [719 kB] 96s Get:103 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-coverage ppc64el 7.4.4+dfsg1-0ubuntu3 [151 kB] 96s Get:104 http://ftpmaster.internal/ubuntu plucky/universe ppc64el libjs-jquery-isonscreen all 1.2.0-1.1 [3244 B] 96s Get:105 http://ftpmaster.internal/ubuntu plucky/universe ppc64el libjs-jquery-metadata all 12-4 [6582 B] 96s Get:106 http://ftpmaster.internal/ubuntu plucky/universe ppc64el libjs-jquery-tablesorter all 1:2.31.3+dfsg1-4 [192 kB] 96s Get:107 http://ftpmaster.internal/ubuntu plucky/universe ppc64el libjs-jquery-throttle-debounce all 1.1+dfsg.1-2 [12.5 kB] 96s Get:108 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-pytest-cov all 5.0.0-1 [21.3 kB] 96s Get:109 http://ftpmaster.internal/ubuntu plucky/main ppc64el python3-tenacity all 8.5.0-0ubuntu1 [17.0 kB] 96s Get:110 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-py all 1.11.0-2 [72.7 kB] 96s Get:111 http://ftpmaster.internal/ubuntu plucky/universe ppc64el libnorm1t64 ppc64el 1.5.9+dfsg-3.1build1 [194 kB] 96s Get:112 http://ftpmaster.internal/ubuntu plucky/universe ppc64el libpgm-5.3-0t64 ppc64el 5.3.128~dfsg-2.1build1 [185 kB] 96s Get:113 http://ftpmaster.internal/ubuntu plucky/main ppc64el libsodium23 ppc64el 1.0.18-1build3 [150 kB] 96s Get:114 http://ftpmaster.internal/ubuntu plucky/universe ppc64el libzmq5 ppc64el 4.3.5-1build2 [297 kB] 97s Get:115 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-zmq ppc64el 24.0.1-5build2 [400 kB] 97s Get:116 http://ftpmaster.internal/ubuntu plucky/universe ppc64el git-ubuntu all 1.1-1 [152 kB] 97s Fetched 27.3 MB in 4s (7229 kB/s) 97s Selecting previously unselected package libpython3.13-minimal:ppc64el. 98s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 74178 files and directories currently installed.) 98s Preparing to unpack .../000-libpython3.13-minimal_3.13.0-2_ppc64el.deb ... 98s Unpacking libpython3.13-minimal:ppc64el (3.13.0-2) ... 98s Selecting previously unselected package python3.13-minimal. 98s Preparing to unpack .../001-python3.13-minimal_3.13.0-2_ppc64el.deb ... 98s Unpacking python3.13-minimal (3.13.0-2) ... 98s Selecting previously unselected package libjs-jquery. 98s Preparing to unpack .../002-libjs-jquery_3.6.1+dfsg+~3.5.14-1_all.deb ... 98s Unpacking libjs-jquery (3.6.1+dfsg+~3.5.14-1) ... 98s Selecting previously unselected package libjs-jquery-hotkeys. 98s Preparing to unpack .../003-libjs-jquery-hotkeys_0~20130707+git2d51e3a9+dfsg-2.1_all.deb ... 98s Unpacking libjs-jquery-hotkeys (0~20130707+git2d51e3a9+dfsg-2.1) ... 98s Selecting previously unselected package python3-distro-info. 98s Preparing to unpack .../004-python3-distro-info_1.12_all.deb ... 98s Unpacking python3-distro-info (1.12) ... 98s Selecting previously unselected package dctrl-tools. 98s Preparing to unpack .../005-dctrl-tools_2.24-3build3_ppc64el.deb ... 98s Unpacking dctrl-tools (2.24-3build3) ... 98s Selecting previously unselected package debian-archive-keyring. 98s Preparing to unpack .../006-debian-archive-keyring_2023.4ubuntu1_all.deb ... 98s Unpacking debian-archive-keyring (2023.4ubuntu1) ... 98s Selecting previously unselected package libfile-dirlist-perl. 98s Preparing to unpack .../007-libfile-dirlist-perl_0.05-3_all.deb ... 98s Unpacking libfile-dirlist-perl (0.05-3) ... 98s Selecting previously unselected package libfile-which-perl. 98s Preparing to unpack .../008-libfile-which-perl_1.27-2_all.deb ... 98s Unpacking libfile-which-perl (1.27-2) ... 98s Selecting previously unselected package libfile-homedir-perl. 98s Preparing to unpack .../009-libfile-homedir-perl_1.006-2_all.deb ... 98s Unpacking libfile-homedir-perl (1.006-2) ... 98s Selecting previously unselected package libfile-touch-perl. 98s Preparing to unpack .../010-libfile-touch-perl_0.12-2_all.deb ... 98s Unpacking libfile-touch-perl (0.12-2) ... 98s Selecting previously unselected package libio-pty-perl. 98s Preparing to unpack .../011-libio-pty-perl_1%3a1.20-1build3_ppc64el.deb ... 98s Unpacking libio-pty-perl (1:1.20-1build3) ... 98s Selecting previously unselected package libipc-run-perl. 98s Preparing to unpack .../012-libipc-run-perl_20231003.0-2_all.deb ... 98s Unpacking libipc-run-perl (20231003.0-2) ... 98s Selecting previously unselected package libclass-method-modifiers-perl. 98s Preparing to unpack .../013-libclass-method-modifiers-perl_2.15-1_all.deb ... 98s Unpacking libclass-method-modifiers-perl (2.15-1) ... 98s Selecting previously unselected package libclass-xsaccessor-perl. 98s Preparing to unpack .../014-libclass-xsaccessor-perl_1.19-4build5_ppc64el.deb ... 98s Unpacking libclass-xsaccessor-perl (1.19-4build5) ... 98s Selecting previously unselected package libb-hooks-op-check-perl:ppc64el. 98s Preparing to unpack .../015-libb-hooks-op-check-perl_0.22-3build2_ppc64el.deb ... 98s Unpacking libb-hooks-op-check-perl:ppc64el (0.22-3build2) ... 98s Selecting previously unselected package libdynaloader-functions-perl. 98s Preparing to unpack .../016-libdynaloader-functions-perl_0.004-1_all.deb ... 98s Unpacking libdynaloader-functions-perl (0.004-1) ... 98s Selecting previously unselected package libdevel-callchecker-perl:ppc64el. 98s Preparing to unpack .../017-libdevel-callchecker-perl_0.009-1build1_ppc64el.deb ... 98s Unpacking libdevel-callchecker-perl:ppc64el (0.009-1build1) ... 98s Selecting previously unselected package libparams-classify-perl:ppc64el. 98s Preparing to unpack .../018-libparams-classify-perl_0.015-2build6_ppc64el.deb ... 98s Unpacking libparams-classify-perl:ppc64el (0.015-2build6) ... 98s Selecting previously unselected package libmodule-runtime-perl. 98s Preparing to unpack .../019-libmodule-runtime-perl_0.016-2_all.deb ... 98s Unpacking libmodule-runtime-perl (0.016-2) ... 98s Selecting previously unselected package libimport-into-perl. 98s Preparing to unpack .../020-libimport-into-perl_1.002005-2_all.deb ... 98s Unpacking libimport-into-perl (1.002005-2) ... 98s Selecting previously unselected package librole-tiny-perl. 98s Preparing to unpack .../021-librole-tiny-perl_2.002004-1_all.deb ... 98s Unpacking librole-tiny-perl (2.002004-1) ... 98s Selecting previously unselected package libsub-quote-perl. 98s Preparing to unpack .../022-libsub-quote-perl_2.006008-1ubuntu1_all.deb ... 98s Unpacking libsub-quote-perl (2.006008-1ubuntu1) ... 98s Selecting previously unselected package libmoo-perl. 98s Preparing to unpack .../023-libmoo-perl_2.005005-1_all.deb ... 98s Unpacking libmoo-perl (2.005005-1) ... 98s Selecting previously unselected package libencode-locale-perl. 98s Preparing to unpack .../024-libencode-locale-perl_1.05-3_all.deb ... 98s Unpacking libencode-locale-perl (1.05-3) ... 98s Selecting previously unselected package libtimedate-perl. 98s Preparing to unpack .../025-libtimedate-perl_2.3300-2_all.deb ... 98s Unpacking libtimedate-perl (2.3300-2) ... 98s Selecting previously unselected package libhttp-date-perl. 98s Preparing to unpack .../026-libhttp-date-perl_6.06-1_all.deb ... 98s Unpacking libhttp-date-perl (6.06-1) ... 98s Selecting previously unselected package libfile-listing-perl. 98s Preparing to unpack .../027-libfile-listing-perl_6.16-1_all.deb ... 98s Unpacking libfile-listing-perl (6.16-1) ... 98s Selecting previously unselected package libhtml-tagset-perl. 98s Preparing to unpack .../028-libhtml-tagset-perl_3.24-1_all.deb ... 98s Unpacking libhtml-tagset-perl (3.24-1) ... 98s Selecting previously unselected package liburi-perl. 98s Preparing to unpack .../029-liburi-perl_5.30-1_all.deb ... 98s Unpacking liburi-perl (5.30-1) ... 98s Selecting previously unselected package libhtml-parser-perl:ppc64el. 98s Preparing to unpack .../030-libhtml-parser-perl_3.83-1build1_ppc64el.deb ... 98s Unpacking libhtml-parser-perl:ppc64el (3.83-1build1) ... 98s Selecting previously unselected package libhtml-tree-perl. 98s Preparing to unpack .../031-libhtml-tree-perl_5.07-3_all.deb ... 98s Unpacking libhtml-tree-perl (5.07-3) ... 98s Selecting previously unselected package libclone-perl:ppc64el. 98s Preparing to unpack .../032-libclone-perl_0.47-1_ppc64el.deb ... 98s Unpacking libclone-perl:ppc64el (0.47-1) ... 98s Selecting previously unselected package libio-html-perl. 98s Preparing to unpack .../033-libio-html-perl_1.004-3_all.deb ... 98s Unpacking libio-html-perl (1.004-3) ... 98s Selecting previously unselected package liblwp-mediatypes-perl. 98s Preparing to unpack .../034-liblwp-mediatypes-perl_6.04-2_all.deb ... 98s Unpacking liblwp-mediatypes-perl (6.04-2) ... 98s Selecting previously unselected package libhttp-message-perl. 98s Preparing to unpack .../035-libhttp-message-perl_7.00-2ubuntu1_all.deb ... 98s Unpacking libhttp-message-perl (7.00-2ubuntu1) ... 98s Selecting previously unselected package libhttp-cookies-perl. 98s Preparing to unpack .../036-libhttp-cookies-perl_6.11-1_all.deb ... 98s Unpacking libhttp-cookies-perl (6.11-1) ... 98s Selecting previously unselected package libhttp-negotiate-perl. 98s Preparing to unpack .../037-libhttp-negotiate-perl_6.01-2_all.deb ... 98s Unpacking libhttp-negotiate-perl (6.01-2) ... 98s Selecting previously unselected package perl-openssl-defaults:ppc64el. 99s Preparing to unpack .../038-perl-openssl-defaults_7build3_ppc64el.deb ... 99s Unpacking perl-openssl-defaults:ppc64el (7build3) ... 99s Selecting previously unselected package libnet-ssleay-perl:ppc64el. 99s Preparing to unpack .../039-libnet-ssleay-perl_1.94-2_ppc64el.deb ... 99s Unpacking libnet-ssleay-perl:ppc64el (1.94-2) ... 99s Selecting previously unselected package libio-socket-ssl-perl. 99s Preparing to unpack .../040-libio-socket-ssl-perl_2.089-1_all.deb ... 99s Unpacking libio-socket-ssl-perl (2.089-1) ... 99s Selecting previously unselected package libnet-http-perl. 99s Preparing to unpack .../041-libnet-http-perl_6.23-1_all.deb ... 99s Unpacking libnet-http-perl (6.23-1) ... 99s Selecting previously unselected package liblwp-protocol-https-perl. 99s Preparing to unpack .../042-liblwp-protocol-https-perl_6.14-1_all.deb ... 99s Unpacking liblwp-protocol-https-perl (6.14-1) ... 99s Selecting previously unselected package libtry-tiny-perl. 99s Preparing to unpack .../043-libtry-tiny-perl_0.32-1_all.deb ... 99s Unpacking libtry-tiny-perl (0.32-1) ... 99s Selecting previously unselected package libwww-robotrules-perl. 99s Preparing to unpack .../044-libwww-robotrules-perl_6.02-1_all.deb ... 99s Unpacking libwww-robotrules-perl (6.02-1) ... 99s Selecting previously unselected package libwww-perl. 99s Preparing to unpack .../045-libwww-perl_6.77-1_all.deb ... 99s Unpacking libwww-perl (6.77-1) ... 99s Selecting previously unselected package patchutils. 99s Preparing to unpack .../046-patchutils_0.4.2-1build3_ppc64el.deb ... 99s Unpacking patchutils (0.4.2-1build3) ... 99s Selecting previously unselected package wdiff. 99s Preparing to unpack .../047-wdiff_1.2.2-6build1_ppc64el.deb ... 99s Unpacking wdiff (1.2.2-6build1) ... 99s Selecting previously unselected package devscripts. 99s Preparing to unpack .../048-devscripts_2.24.4_all.deb ... 99s Unpacking devscripts (2.24.4) ... 99s Selecting previously unselected package diffstat. 99s Preparing to unpack .../049-diffstat_1.67-1_ppc64el.deb ... 99s Unpacking diffstat (1.67-1) ... 99s Selecting previously unselected package python3-debian. 99s Preparing to unpack .../050-python3-debian_0.1.49ubuntu3_all.deb ... 99s Unpacking python3-debian (0.1.49ubuntu3) ... 99s Selecting previously unselected package python3-gpg. 99s Preparing to unpack .../051-python3-gpg_1.24.0-2ubuntu1_ppc64el.deb ... 99s Unpacking python3-gpg (1.24.0-2ubuntu1) ... 99s Selecting previously unselected package python3-xdg. 99s Preparing to unpack .../052-python3-xdg_0.28-2_all.deb ... 99s Unpacking python3-xdg (0.28-2) ... 99s Selecting previously unselected package dput. 99s Preparing to unpack .../053-dput_1.2.4ubuntu1_all.deb ... 99s Unpacking dput (1.2.4ubuntu1) ... 99s Selecting previously unselected package libgomp1:ppc64el. 99s Preparing to unpack .../054-libgomp1_14.2.0-8ubuntu1_ppc64el.deb ... 99s Unpacking libgomp1:ppc64el (14.2.0-8ubuntu1) ... 99s Selecting previously unselected package gettext. 99s Preparing to unpack .../055-gettext_0.22.5-2_ppc64el.deb ... 99s Unpacking gettext (0.22.5-2) ... 99s Selecting previously unselected package liberror-perl. 99s Preparing to unpack .../056-liberror-perl_0.17029-2_all.deb ... 99s Unpacking liberror-perl (0.17029-2) ... 99s Selecting previously unselected package git-man. 99s Preparing to unpack .../057-git-man_1%3a2.45.2-1.2ubuntu1_all.deb ... 99s Unpacking git-man (1:2.45.2-1.2ubuntu1) ... 99s Selecting previously unselected package git. 99s Preparing to unpack .../058-git_1%3a2.45.2-1.2ubuntu1_ppc64el.deb ... 99s Unpacking git (1:2.45.2-1.2ubuntu1) ... 99s Selecting previously unselected package python3-dateutil. 99s Preparing to unpack .../059-python3-dateutil_2.9.0-3_all.deb ... 99s Unpacking python3-dateutil (2.9.0-3) ... 99s Selecting previously unselected package python3-importlib-metadata. 99s Preparing to unpack .../060-python3-importlib-metadata_8.5.0-1_all.deb ... 99s Unpacking python3-importlib-metadata (8.5.0-1) ... 99s Selecting previously unselected package git-buildpackage. 99s Preparing to unpack .../061-git-buildpackage_0.9.35_all.deb ... 99s Unpacking git-buildpackage (0.9.35) ... 99s Selecting previously unselected package libsys-cpuaffinity-perl. 99s Preparing to unpack .../062-libsys-cpuaffinity-perl_1.13~03-2build4_ppc64el.deb ... 99s Unpacking libsys-cpuaffinity-perl (1.13~03-2build4) ... 99s Selecting previously unselected package pbzip2. 99s Preparing to unpack .../063-pbzip2_1.1.13-1build1_ppc64el.deb ... 99s Unpacking pbzip2 (1.1.13-1build1) ... 99s Selecting previously unselected package pixz. 99s Preparing to unpack .../064-pixz_1.0.7-3_ppc64el.deb ... 99s Unpacking pixz (1.0.7-3) ... 99s Selecting previously unselected package libxdelta2t64:ppc64el. 99s Preparing to unpack .../065-libxdelta2t64_1.1.3-10.7_ppc64el.deb ... 99s Unpacking libxdelta2t64:ppc64el (1.1.3-10.7) ... 99s Selecting previously unselected package xdelta. 99s Preparing to unpack .../066-xdelta_1.1.3-10.7_ppc64el.deb ... 99s Unpacking xdelta (1.1.3-10.7) ... 99s Selecting previously unselected package xdelta3. 99s Preparing to unpack .../067-xdelta3_3.0.11-dfsg-1.2_ppc64el.deb ... 99s Unpacking xdelta3 (3.0.11-dfsg-1.2) ... 99s Selecting previously unselected package pristine-tar. 99s Preparing to unpack .../068-pristine-tar_1.50+nmu2build1_ppc64el.deb ... 99s Unpacking pristine-tar (1.50+nmu2build1) ... 99s Selecting previously unselected package quilt. 99s Preparing to unpack .../069-quilt_0.68-1_all.deb ... 99s Unpacking quilt (0.68-1) ... 99s Selecting previously unselected package python3-debianbts. 99s Preparing to unpack .../070-python3-debianbts_4.1.1_all.deb ... 99s Unpacking python3-debianbts (4.1.1) ... 100s Selecting previously unselected package python3-jeepney. 100s Preparing to unpack .../071-python3-jeepney_0.8.0-4_all.deb ... 100s Unpacking python3-jeepney (0.8.0-4) ... 100s Selecting previously unselected package python3-secretstorage. 100s Preparing to unpack .../072-python3-secretstorage_3.3.3-3_all.deb ... 100s Unpacking python3-secretstorage (3.3.3-3) ... 100s Selecting previously unselected package python3-jaraco.classes. 100s Preparing to unpack .../073-python3-jaraco.classes_3.4.0-1_all.deb ... 100s Unpacking python3-jaraco.classes (3.4.0-1) ... 100s Selecting previously unselected package python3-keyring. 100s Preparing to unpack .../074-python3-keyring_25.4.1-1_all.deb ... 100s Unpacking python3-keyring (25.4.1-1) ... 100s Selecting previously unselected package python3-launchpadlib-desktop. 100s Preparing to unpack .../075-python3-launchpadlib-desktop_2.0.0-1_all.deb ... 100s Unpacking python3-launchpadlib-desktop (2.0.0-1) ... 100s Selecting previously unselected package python3-ubuntutools. 100s Preparing to unpack .../076-python3-ubuntutools_0.203_all.deb ... 100s Unpacking python3-ubuntutools (0.203) ... 100s Selecting previously unselected package ubuntu-dev-tools. 100s Preparing to unpack .../077-ubuntu-dev-tools_0.203_all.deb ... 100s Unpacking ubuntu-dev-tools (0.203) ... 100s Selecting previously unselected package python3-astroid. 100s Preparing to unpack .../078-python3-astroid_3.3.5-1_all.deb ... 100s Unpacking python3-astroid (3.3.5-1) ... 100s Selecting previously unselected package python3-isort. 100s Preparing to unpack .../079-python3-isort_5.13.2-2_all.deb ... 100s Unpacking python3-isort (5.13.2-2) ... 100s Selecting previously unselected package python3-mypy-extensions. 100s Preparing to unpack .../080-python3-mypy-extensions_1.0.0-1_all.deb ... 100s Unpacking python3-mypy-extensions (1.0.0-1) ... 100s Selecting previously unselected package libjs-underscore. 100s Preparing to unpack .../081-libjs-underscore_1.13.4~dfsg+~1.11.4-3_all.deb ... 100s Unpacking libjs-underscore (1.13.4~dfsg+~1.11.4-3) ... 100s Selecting previously unselected package libjs-sphinxdoc. 100s Preparing to unpack .../082-libjs-sphinxdoc_7.4.7-4_all.deb ... 100s Unpacking libjs-sphinxdoc (7.4.7-4) ... 100s Selecting previously unselected package python3-logilab-common. 100s Preparing to unpack .../083-python3-logilab-common_2.0.0-1_all.deb ... 100s Unpacking python3-logilab-common (2.0.0-1) ... 100s Selecting previously unselected package python3-dill. 100s Preparing to unpack .../084-python3-dill_0.3.9-1_all.deb ... 100s Unpacking python3-dill (0.3.9-1) ... 100s Selecting previously unselected package python3-mccabe. 100s Preparing to unpack .../085-python3-mccabe_0.7.0-1_all.deb ... 100s Unpacking python3-mccabe (0.7.0-1) ... 100s Selecting previously unselected package python3-platformdirs. 100s Preparing to unpack .../086-python3-platformdirs_4.3.6-1_all.deb ... 100s Unpacking python3-platformdirs (4.3.6-1) ... 100s Selecting previously unselected package python3-tomlkit. 100s Preparing to unpack .../087-python3-tomlkit_0.13.2-1_all.deb ... 100s Unpacking python3-tomlkit (0.13.2-1) ... 100s Selecting previously unselected package pylint. 100s Preparing to unpack .../088-pylint_3.3.1-2_all.deb ... 100s Unpacking pylint (3.3.1-2) ... 100s Selecting previously unselected package python3-argcomplete. 100s Preparing to unpack .../089-python3-argcomplete_3.5.1-1ubuntu1_all.deb ... 100s Unpacking python3-argcomplete (3.5.1-1ubuntu1) ... 100s Selecting previously unselected package python3-cachetools. 100s Preparing to unpack .../090-python3-cachetools_5.3.3-1_all.deb ... 100s Unpacking python3-cachetools (5.3.3-1) ... 100s Selecting previously unselected package python3-pycryptodome. 100s Preparing to unpack .../091-python3-pycryptodome_3.20.0+dfsg-3build1_ppc64el.deb ... 100s Unpacking python3-pycryptodome (3.20.0+dfsg-3build1) ... 100s Selecting previously unselected package python3-keyrings.alt. 100s Preparing to unpack .../092-python3-keyrings.alt_5.0.2-1_all.deb ... 100s Unpacking python3-keyrings.alt (5.0.2-1) ... 100s Selecting previously unselected package libhttp-parser2.9:ppc64el. 100s Preparing to unpack .../093-libhttp-parser2.9_2.9.4-6build1_ppc64el.deb ... 100s Unpacking libhttp-parser2.9:ppc64el (2.9.4-6build1) ... 100s Selecting previously unselected package libgit2-1.8:ppc64el. 100s Preparing to unpack .../094-libgit2-1.8_1.8.4+ds-1ubuntu1_ppc64el.deb ... 100s Unpacking libgit2-1.8:ppc64el (1.8.4+ds-1ubuntu1) ... 100s Selecting previously unselected package python3-pygit2. 100s Preparing to unpack .../095-python3-pygit2_1.16.0-2_ppc64el.deb ... 100s Unpacking python3-pygit2 (1.16.0-2) ... 100s Selecting previously unselected package python3-iniconfig. 100s Preparing to unpack .../096-python3-iniconfig_1.1.1-2_all.deb ... 100s Unpacking python3-iniconfig (1.1.1-2) ... 100s Selecting previously unselected package python3-packaging. 100s Preparing to unpack .../097-python3-packaging_24.2-1_all.deb ... 100s Unpacking python3-packaging (24.2-1) ... 100s Selecting previously unselected package python3-pluggy. 100s Preparing to unpack .../098-python3-pluggy_1.5.0-1_all.deb ... 100s Unpacking python3-pluggy (1.5.0-1) ... 100s Selecting previously unselected package python3-pytest. 100s Preparing to unpack .../099-python3-pytest_8.3.3-1_all.deb ... 100s Unpacking python3-pytest (8.3.3-1) ... 100s Selecting previously unselected package libpython3.13-stdlib:ppc64el. 100s Preparing to unpack .../100-libpython3.13-stdlib_3.13.0-2_ppc64el.deb ... 100s Unpacking libpython3.13-stdlib:ppc64el (3.13.0-2) ... 100s Selecting previously unselected package python3.13. 100s Preparing to unpack .../101-python3.13_3.13.0-2_ppc64el.deb ... 100s Unpacking python3.13 (3.13.0-2) ... 100s Selecting previously unselected package python3-coverage. 100s Preparing to unpack .../102-python3-coverage_7.4.4+dfsg1-0ubuntu3_ppc64el.deb ... 100s Unpacking python3-coverage (7.4.4+dfsg1-0ubuntu3) ... 100s Selecting previously unselected package libjs-jquery-isonscreen. 100s Preparing to unpack .../103-libjs-jquery-isonscreen_1.2.0-1.1_all.deb ... 100s Unpacking libjs-jquery-isonscreen (1.2.0-1.1) ... 100s Selecting previously unselected package libjs-jquery-metadata. 100s Preparing to unpack .../104-libjs-jquery-metadata_12-4_all.deb ... 100s Unpacking libjs-jquery-metadata (12-4) ... 100s Selecting previously unselected package libjs-jquery-tablesorter. 100s Preparing to unpack .../105-libjs-jquery-tablesorter_1%3a2.31.3+dfsg1-4_all.deb ... 100s Unpacking libjs-jquery-tablesorter (1:2.31.3+dfsg1-4) ... 100s Selecting previously unselected package libjs-jquery-throttle-debounce. 100s Preparing to unpack .../106-libjs-jquery-throttle-debounce_1.1+dfsg.1-2_all.deb ... 100s Unpacking libjs-jquery-throttle-debounce (1.1+dfsg.1-2) ... 100s Selecting previously unselected package python3-pytest-cov. 100s Preparing to unpack .../107-python3-pytest-cov_5.0.0-1_all.deb ... 100s Unpacking python3-pytest-cov (5.0.0-1) ... 100s Selecting previously unselected package python3-tenacity. 100s Preparing to unpack .../108-python3-tenacity_8.5.0-0ubuntu1_all.deb ... 100s Unpacking python3-tenacity (8.5.0-0ubuntu1) ... 100s Selecting previously unselected package python3-py. 100s Preparing to unpack .../109-python3-py_1.11.0-2_all.deb ... 100s Unpacking python3-py (1.11.0-2) ... 100s Selecting previously unselected package libnorm1t64:ppc64el. 100s Preparing to unpack .../110-libnorm1t64_1.5.9+dfsg-3.1build1_ppc64el.deb ... 100s Unpacking libnorm1t64:ppc64el (1.5.9+dfsg-3.1build1) ... 100s Selecting previously unselected package libpgm-5.3-0t64:ppc64el. 100s Preparing to unpack .../111-libpgm-5.3-0t64_5.3.128~dfsg-2.1build1_ppc64el.deb ... 100s Unpacking libpgm-5.3-0t64:ppc64el (5.3.128~dfsg-2.1build1) ... 100s Selecting previously unselected package libsodium23:ppc64el. 100s Preparing to unpack .../112-libsodium23_1.0.18-1build3_ppc64el.deb ... 100s Unpacking libsodium23:ppc64el (1.0.18-1build3) ... 100s Selecting previously unselected package libzmq5:ppc64el. 100s Preparing to unpack .../113-libzmq5_4.3.5-1build2_ppc64el.deb ... 100s Unpacking libzmq5:ppc64el (4.3.5-1build2) ... 101s Selecting previously unselected package python3-zmq. 101s Preparing to unpack .../114-python3-zmq_24.0.1-5build2_ppc64el.deb ... 101s Unpacking python3-zmq (24.0.1-5build2) ... 101s Selecting previously unselected package git-ubuntu. 101s Preparing to unpack .../115-git-ubuntu_1.1-1_all.deb ... 101s Unpacking git-ubuntu (1.1-1) ... 101s Setting up python3-iniconfig (1.1.1-2) ... 101s Setting up libnorm1t64:ppc64el (1.5.9+dfsg-3.1build1) ... 101s Setting up wdiff (1.2.2-6build1) ... 101s Setting up libfile-which-perl (1.27-2) ... 101s Setting up libsodium23:ppc64el (1.0.18-1build3) ... 101s Setting up python3-jaraco.classes (3.4.0-1) ... 101s Setting up libxdelta2t64:ppc64el (1.1.3-10.7) ... 101s Setting up python3-importlib-metadata (8.5.0-1) ... 101s Setting up xdelta (1.1.3-10.7) ... 101s Setting up libsys-cpuaffinity-perl (1.13~03-2build4) ... 101s Setting up python3-py (1.11.0-2) ... 101s Setting up libdynaloader-functions-perl (0.004-1) ... 101s Setting up libclass-method-modifiers-perl (2.15-1) ... 101s Setting up libio-pty-perl (1:1.20-1build3) ... 101s Setting up python3-cachetools (5.3.3-1) ... 101s Setting up python3-debianbts (4.1.1) ... 101s Setting up libclone-perl:ppc64el (0.47-1) ... 101s Setting up libhtml-tagset-perl (3.24-1) ... 101s Setting up python3-mypy-extensions (1.0.0-1) ... 101s Setting up python3-pycryptodome (3.20.0+dfsg-3build1) ... 102s Setting up python3-tenacity (8.5.0-0ubuntu1) ... 102s Setting up liblwp-mediatypes-perl (6.04-2) ... 102s Setting up debian-archive-keyring (2023.4ubuntu1) ... 102s Setting up libtry-tiny-perl (0.32-1) ... 102s Setting up perl-openssl-defaults:ppc64el (7build3) ... 102s Setting up libencode-locale-perl (1.05-3) ... 102s Setting up libjs-jquery-throttle-debounce (1.1+dfsg.1-2) ... 102s Setting up libgomp1:ppc64el (14.2.0-8ubuntu1) ... 102s Setting up python3-xdg (0.28-2) ... 102s Setting up pbzip2 (1.1.13-1build1) ... 102s Setting up python3-platformdirs (4.3.6-1) ... 102s Setting up liberror-perl (0.17029-2) ... 102s Setting up libpython3.13-minimal:ppc64el (3.13.0-2) ... 102s Setting up patchutils (0.4.2-1build3) ... 102s Setting up libpgm-5.3-0t64:ppc64el (5.3.128~dfsg-2.1build1) ... 102s Setting up python3-packaging (24.2-1) ... 103s Setting up python3-gpg (1.24.0-2ubuntu1) ... 103s Setting up python3-dill (0.3.9-1) ... 103s Setting up python3-debian (0.1.49ubuntu3) ... 103s Setting up diffstat (1.67-1) ... 103s Setting up libio-html-perl (1.004-3) ... 103s Setting up libb-hooks-op-check-perl:ppc64el (0.22-3build2) ... 103s Setting up libipc-run-perl (20231003.0-2) ... 103s Setting up python3-jeepney (0.8.0-4) ... 103s Setting up python3-isort (5.13.2-2) ... 103s Setting up python3-pluggy (1.5.0-1) ... 104s Setting up libtimedate-perl (2.3300-2) ... 104s Setting up python3-astroid (3.3.5-1) ... 104s Setting up xdelta3 (3.0.11-dfsg-1.2) ... 104s Setting up pixz (1.0.7-3) ... 104s Setting up librole-tiny-perl (2.002004-1) ... 104s Setting up python3.13-minimal (3.13.0-2) ... 105s Setting up git-man (1:2.45.2-1.2ubuntu1) ... 105s Setting up python3-dateutil (2.9.0-3) ... 105s Setting up python3-mccabe (0.7.0-1) ... 105s Setting up libsub-quote-perl (2.006008-1ubuntu1) ... 105s Setting up libclass-xsaccessor-perl (1.19-4build5) ... 105s Setting up libjs-jquery (3.6.1+dfsg+~3.5.14-1) ... 105s Setting up libfile-dirlist-perl (0.05-3) ... 105s Setting up libjs-jquery-hotkeys (0~20130707+git2d51e3a9+dfsg-2.1) ... 105s Setting up python3-argcomplete (3.5.1-1ubuntu1) ... 105s Setting up libfile-homedir-perl (1.006-2) ... 105s Setting up python3-tomlkit (0.13.2-1) ... 106s Setting up python3-distro-info (1.12) ... 106s Setting up libpython3.13-stdlib:ppc64el (3.13.0-2) ... 106s Setting up liburi-perl (5.30-1) ... 106s Setting up pristine-tar (1.50+nmu2build1) ... 106s Setting up libfile-touch-perl (0.12-2) ... 106s Setting up dctrl-tools (2.24-3build3) ... 106s Setting up libhttp-parser2.9:ppc64el (2.9.4-6build1) ... 106s Setting up libjs-underscore (1.13.4~dfsg+~1.11.4-3) ... 106s Setting up libnet-ssleay-perl:ppc64el (1.94-2) ... 106s Setting up libhttp-date-perl (6.06-1) ... 106s Setting up gettext (0.22.5-2) ... 106s Setting up libfile-listing-perl (6.16-1) ... 106s Setting up libzmq5:ppc64el (4.3.5-1build2) ... 106s Setting up python3.13 (3.13.0-2) ... 107s Setting up python3-pytest (8.3.3-1) ... 107s Setting up libnet-http-perl (6.23-1) ... 107s Setting up python3-coverage (7.4.4+dfsg1-0ubuntu3) ... 107s Setting up quilt (0.68-1) ... 107s Setting up libdevel-callchecker-perl:ppc64el (0.009-1build1) ... 107s Setting up dput (1.2.4ubuntu1) ... 108s Setting up python3-secretstorage (3.3.3-3) ... 108s Setting up python3-zmq (24.0.1-5build2) ... 108s Setting up libjs-jquery-metadata (12-4) ... 108s Setting up libgit2-1.8:ppc64el (1.8.4+ds-1ubuntu1) ... 108s Setting up libjs-jquery-isonscreen (1.2.0-1.1) ... 108s Setting up git (1:2.45.2-1.2ubuntu1) ... 108s Setting up libjs-sphinxdoc (7.4.7-4) ... 108s Setting up libwww-robotrules-perl (6.02-1) ... 108s Setting up libjs-jquery-tablesorter (1:2.31.3+dfsg1-4) ... 108s Setting up libhtml-parser-perl:ppc64el (3.83-1build1) ... 108s Setting up python3-keyring (25.4.1-1) ... 108s Setting up libio-socket-ssl-perl (2.089-1) ... 108s Setting up libhttp-message-perl (7.00-2ubuntu1) ... 108s Setting up libhttp-negotiate-perl (6.01-2) ... 108s Setting up libhttp-cookies-perl (6.11-1) ... 108s Setting up python3-logilab-common (2.0.0-1) ... 108s Setting up python3-pygit2 (1.16.0-2) ... 108s Setting up libhtml-tree-perl (5.07-3) ... 108s Setting up libparams-classify-perl:ppc64el (0.015-2build6) ... 108s Setting up python3-pytest-cov (5.0.0-1) ... 109s Setting up libmodule-runtime-perl (0.016-2) ... 109s Setting up python3-launchpadlib-desktop (2.0.0-1) ... 109s Setting up python3-keyrings.alt (5.0.2-1) ... 109s Setting up pylint (3.3.1-2) ... 109s Setting up libimport-into-perl (1.002005-2) ... 109s Setting up libmoo-perl (2.005005-1) ... 109s Setting up python3-ubuntutools (0.203) ... 109s Setting up liblwp-protocol-https-perl (6.14-1) ... 109s Setting up libwww-perl (6.77-1) ... 109s Setting up devscripts (2.24.4) ... 110s Setting up git-buildpackage (0.9.35) ... 110s Setting up ubuntu-dev-tools (0.203) ... 110s Setting up git-ubuntu (1.1-1) ... 110s Processing triggers for libc-bin (2.40-1ubuntu3) ... 110s Processing triggers for systemd (256.5-2ubuntu4) ... 110s Processing triggers for man-db (2.13.0-1) ... 112s Processing triggers for install-info (7.1.1-1) ... 113s autopkgtest [10:46:31]: test self-test: TEST_SYSTEM_TREE=1 /usr/share/git-ubuntu/self-test 113s autopkgtest [10:46:31]: test self-test: [----------------------- 113s Testing git-ubuntu system installation. 113s Testing tree in /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu 113s Working dir /tmp/autopkgtest.tWFg1I/build.9Ml/src 127s pylint passed! 136s ============================= test session starts ============================== 136s platform linux -- Python 3.12.7, pytest-8.3.3, pluggy-1.5.0 136s rootdir: /tmp/autopkgtest.tWFg1I/build.9Ml/src 136s configfile: pytest.ini 136s plugins: typeguard-4.4.1, cov-5.0.0 136s collected 459 items 136s 136s gitubuntu/build.py ..... [ 1%] 138s gitubuntu/git_repository_test.py ....................................... [ 9%] 153s ...FFFFF.FFF...........................F.FFFFFFF.FFF.......FFFFFFFFFF [ 24%] 153s gitubuntu/importer_service_test.py ..................................... [ 32%] 153s ..... [ 33%] 153s gitubuntu/importer_service_worker_test.py ... [ 34%] 165s gitubuntu/importer_tag_test.py FFFFFFFFFxF [ 36%] 184s gitubuntu/importer_test.py .......FF.FFFFFFFFFFF.FFF.FFF..FFFFFFFFFFFFFF [ 46%] 201s FFFFxx..FF.................................................F....FFFF. [ 61%] 202s gitubuntu/integration_test.py ...............Fsss [ 65%] 202s gitubuntu/prepare_upload_test.py .............. [ 68%] 203s gitubuntu/repo_builder_test.py .........FF.F................ [ 75%] 203s gitubuntu/rich_history_test.py FFF.FFFF [ 76%] 209s gitubuntu/source_builder_test.py .FF.......FFFFFFFFF.. [ 81%] 210s gitubuntu/source_information_test.py ................................... [ 89%] 210s ... [ 89%] 210s gitubuntu/versioning.py ............................................... [100%] 210s 210s =================================== FAILURES =================================== 210s ___________________ test_follow_symlinks_to_blob[0] ____________________ 210s 210s pygit2_repo = pygit2.Repository('/tmp/tmpmspixe4f/.git/') 210s tree_func = at 0x637915594180> 210s 210s @pytest.mark.parametrize('tree_func', [ 210s # The tree_func parameter is a function that accepts a mock Blob that is to 210s # represent the changelog blob itself and returns a mock Tree with the mock 210s # Blob embedded somewhere within it. The test function can then ensure that 210s # follow_symlinks_to_blob can correctly find the changelog Blob given the 210s # Tree. 210s 210s # Of course this is only expected to work if, after checking out the Tree, 210s # "cat debian/changelog" would work. But this allows us to test the various 210s # permutations of symlink following in Trees that _are_ valid. 210s 210s # Simple case 210s lambda b: Tree({ 210s 'debian': Tree({'changelog': b}), 210s }), 210s 210s # Symlink in debian/ 210s lambda b: Tree({ 210s 'debian': Tree({ 210s 'changelog.real': b, 210s 'changelog': Symlink('changelog.real'), 210s }), 210s }), 210s 210s # Symlink to parent directory 210s lambda b: Tree({ 210s 'changelog': b, 210s 'debian': Tree({ 210s 'changelog': Symlink('../changelog'), 210s }) 210s }), 210s 210s # Symlink to subdirectory 210s lambda b: Tree({ 210s 'debian': Tree({ 210s 'changelog': Symlink('subdirectory/changelog'), 210s 'subdirectory': Tree({'changelog': b}), 210s }) 210s }), 210s 210s # debian/ itself is a symlink to a different directory 210s lambda b: Tree({ 210s 'pkg': Tree({'changelog': b}), 210s 'debian': Symlink('pkg'), 210s }) 210s ]) 210s def test_follow_symlinks_to_blob(pygit2_repo, tree_func): 210s blob = Blob(b'') 210s blob_id = blob.write(pygit2_repo) 210s tree = pygit2_repo.get(tree_func(blob).write(pygit2_repo)) 210s > result_blob = target.follow_symlinks_to_blob( 210s pygit2_repo, 210s tree, 210s 'debian/changelog', 210s ) 210s 210s gitubuntu/git_repository_test.py:342: 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 210s return _follow_symlinks_to_blob( 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s 210s repo = pygit2.Repository('/tmp/tmpmspixe4f/.git/') 210s top_tree_object = 210s search_path = 'debian/changelog' 210s _rel_tree = 210s _rel_path = '' 210s 210s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 210s _rel_tree=None, _rel_path='' 210s ): 210s '''Recursively follow a path down a tree, following symlinks, to find blob 210s 210s repo: pygit2.Repository object 210s top_tree: pygit2.Tree object of the top of the tree structure 210s search_path: '/'-separated path string of blob to find 210s _rel_tree: (internal) which tree to look further into 210s _rel_path: (internal) the path we are in so far 210s ''' 210s 210s NORMAL_BLOB_MODES = set([ 210s pygit2.GIT_FILEMODE_BLOB, 210s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 210s ]) 210s 210s _rel_tree = _rel_tree or top_tree_object 210s head, tail = posixpath.split(search_path) 210s 210s # A traditional functional split would put a single entry in head with tail 210s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 210s # to make it appear to have traditional semantics. 210s if not head: 210s head = tail 210s tail = None 210s 210s entry = _rel_tree[head] 210s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 210s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 210s 210s gitubuntu/git_repository.py:68: AttributeError 210s ___________________ test_follow_symlinks_to_blob[1] ____________________ 210s 210s pygit2_repo = pygit2.Repository('/tmp/tmpqumr7qpc/.git/') 210s tree_func = at 0x637915594220> 210s 210s @pytest.mark.parametrize('tree_func', [ 210s # The tree_func parameter is a function that accepts a mock Blob that is to 210s # represent the changelog blob itself and returns a mock Tree with the mock 210s # Blob embedded somewhere within it. The test function can then ensure that 210s # follow_symlinks_to_blob can correctly find the changelog Blob given the 210s # Tree. 210s 210s # Of course this is only expected to work if, after checking out the Tree, 210s # "cat debian/changelog" would work. But this allows us to test the various 210s # permutations of symlink following in Trees that _are_ valid. 210s 210s # Simple case 210s lambda b: Tree({ 210s 'debian': Tree({'changelog': b}), 210s }), 210s 210s # Symlink in debian/ 210s lambda b: Tree({ 210s 'debian': Tree({ 210s 'changelog.real': b, 210s 'changelog': Symlink('changelog.real'), 210s }), 210s }), 210s 210s # Symlink to parent directory 210s lambda b: Tree({ 210s 'changelog': b, 210s 'debian': Tree({ 210s 'changelog': Symlink('../changelog'), 210s }) 210s }), 210s 210s # Symlink to subdirectory 210s lambda b: Tree({ 210s 'debian': Tree({ 210s 'changelog': Symlink('subdirectory/changelog'), 210s 'subdirectory': Tree({'changelog': b}), 210s }) 210s }), 210s 210s # debian/ itself is a symlink to a different directory 210s lambda b: Tree({ 210s 'pkg': Tree({'changelog': b}), 210s 'debian': Symlink('pkg'), 210s }) 210s ]) 210s def test_follow_symlinks_to_blob(pygit2_repo, tree_func): 210s blob = Blob(b'') 210s blob_id = blob.write(pygit2_repo) 210s tree = pygit2_repo.get(tree_func(blob).write(pygit2_repo)) 210s > result_blob = target.follow_symlinks_to_blob( 210s pygit2_repo, 210s tree, 210s 'debian/changelog', 210s ) 210s 210s gitubuntu/git_repository_test.py:342: 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 210s return _follow_symlinks_to_blob( 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s 210s repo = pygit2.Repository('/tmp/tmpqumr7qpc/.git/') 210s top_tree_object = 210s search_path = 'debian/changelog' 210s _rel_tree = 210s _rel_path = '' 210s 210s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 210s _rel_tree=None, _rel_path='' 210s ): 210s '''Recursively follow a path down a tree, following symlinks, to find blob 210s 210s repo: pygit2.Repository object 210s top_tree: pygit2.Tree object of the top of the tree structure 210s search_path: '/'-separated path string of blob to find 210s _rel_tree: (internal) which tree to look further into 210s _rel_path: (internal) the path we are in so far 210s ''' 210s 210s NORMAL_BLOB_MODES = set([ 210s pygit2.GIT_FILEMODE_BLOB, 210s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 210s ]) 210s 210s _rel_tree = _rel_tree or top_tree_object 210s head, tail = posixpath.split(search_path) 210s 210s # A traditional functional split would put a single entry in head with tail 210s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 210s # to make it appear to have traditional semantics. 210s if not head: 210s head = tail 210s tail = None 210s 210s entry = _rel_tree[head] 210s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 210s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 210s 210s gitubuntu/git_repository.py:68: AttributeError 210s ___________________ test_follow_symlinks_to_blob[2] ____________________ 210s 210s pygit2_repo = pygit2.Repository('/tmp/tmpqsy6_ae_/.git/') 210s tree_func = at 0x6379155942c0> 210s 210s @pytest.mark.parametrize('tree_func', [ 210s # The tree_func parameter is a function that accepts a mock Blob that is to 210s # represent the changelog blob itself and returns a mock Tree with the mock 210s # Blob embedded somewhere within it. The test function can then ensure that 210s # follow_symlinks_to_blob can correctly find the changelog Blob given the 210s # Tree. 210s 210s # Of course this is only expected to work if, after checking out the Tree, 210s # "cat debian/changelog" would work. But this allows us to test the various 210s # permutations of symlink following in Trees that _are_ valid. 210s 210s # Simple case 210s lambda b: Tree({ 210s 'debian': Tree({'changelog': b}), 210s }), 210s 210s # Symlink in debian/ 210s lambda b: Tree({ 210s 'debian': Tree({ 210s 'changelog.real': b, 210s 'changelog': Symlink('changelog.real'), 210s }), 210s }), 210s 210s # Symlink to parent directory 210s lambda b: Tree({ 210s 'changelog': b, 210s 'debian': Tree({ 210s 'changelog': Symlink('../changelog'), 210s }) 210s }), 210s 210s # Symlink to subdirectory 210s lambda b: Tree({ 210s 'debian': Tree({ 210s 'changelog': Symlink('subdirectory/changelog'), 210s 'subdirectory': Tree({'changelog': b}), 210s }) 210s }), 210s 210s # debian/ itself is a symlink to a different directory 210s lambda b: Tree({ 210s 'pkg': Tree({'changelog': b}), 210s 'debian': Symlink('pkg'), 210s }) 210s ]) 210s def test_follow_symlinks_to_blob(pygit2_repo, tree_func): 210s blob = Blob(b'') 210s blob_id = blob.write(pygit2_repo) 210s tree = pygit2_repo.get(tree_func(blob).write(pygit2_repo)) 210s > result_blob = target.follow_symlinks_to_blob( 210s pygit2_repo, 210s tree, 210s 'debian/changelog', 210s ) 210s 210s gitubuntu/git_repository_test.py:342: 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 210s return _follow_symlinks_to_blob( 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s 210s repo = pygit2.Repository('/tmp/tmpqsy6_ae_/.git/') 210s top_tree_object = 210s search_path = 'debian/changelog' 210s _rel_tree = 210s _rel_path = '' 210s 210s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 210s _rel_tree=None, _rel_path='' 210s ): 210s '''Recursively follow a path down a tree, following symlinks, to find blob 210s 210s repo: pygit2.Repository object 210s top_tree: pygit2.Tree object of the top of the tree structure 210s search_path: '/'-separated path string of blob to find 210s _rel_tree: (internal) which tree to look further into 210s _rel_path: (internal) the path we are in so far 210s ''' 210s 210s NORMAL_BLOB_MODES = set([ 210s pygit2.GIT_FILEMODE_BLOB, 210s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 210s ]) 210s 210s _rel_tree = _rel_tree or top_tree_object 210s head, tail = posixpath.split(search_path) 210s 210s # A traditional functional split would put a single entry in head with tail 210s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 210s # to make it appear to have traditional semantics. 210s if not head: 210s head = tail 210s tail = None 210s 210s entry = _rel_tree[head] 210s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 210s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 210s 210s gitubuntu/git_repository.py:68: AttributeError 210s ___________________ test_follow_symlinks_to_blob[3] ____________________ 210s 210s pygit2_repo = pygit2.Repository('/tmp/tmpkc33dqug/.git/') 210s tree_func = at 0x637915594360> 210s 210s @pytest.mark.parametrize('tree_func', [ 210s # The tree_func parameter is a function that accepts a mock Blob that is to 210s # represent the changelog blob itself and returns a mock Tree with the mock 210s # Blob embedded somewhere within it. The test function can then ensure that 210s # follow_symlinks_to_blob can correctly find the changelog Blob given the 210s # Tree. 210s 210s # Of course this is only expected to work if, after checking out the Tree, 210s # "cat debian/changelog" would work. But this allows us to test the various 210s # permutations of symlink following in Trees that _are_ valid. 210s 210s # Simple case 210s lambda b: Tree({ 210s 'debian': Tree({'changelog': b}), 210s }), 210s 210s # Symlink in debian/ 210s lambda b: Tree({ 210s 'debian': Tree({ 210s 'changelog.real': b, 210s 'changelog': Symlink('changelog.real'), 210s }), 210s }), 210s 210s # Symlink to parent directory 210s lambda b: Tree({ 210s 'changelog': b, 210s 'debian': Tree({ 210s 'changelog': Symlink('../changelog'), 210s }) 210s }), 210s 210s # Symlink to subdirectory 210s lambda b: Tree({ 210s 'debian': Tree({ 210s 'changelog': Symlink('subdirectory/changelog'), 210s 'subdirectory': Tree({'changelog': b}), 210s }) 210s }), 210s 210s # debian/ itself is a symlink to a different directory 210s lambda b: Tree({ 210s 'pkg': Tree({'changelog': b}), 210s 'debian': Symlink('pkg'), 210s }) 210s ]) 210s def test_follow_symlinks_to_blob(pygit2_repo, tree_func): 210s blob = Blob(b'') 210s blob_id = blob.write(pygit2_repo) 210s tree = pygit2_repo.get(tree_func(blob).write(pygit2_repo)) 210s > result_blob = target.follow_symlinks_to_blob( 210s pygit2_repo, 210s tree, 210s 'debian/changelog', 210s ) 210s 210s gitubuntu/git_repository_test.py:342: 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 210s return _follow_symlinks_to_blob( 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s 210s repo = pygit2.Repository('/tmp/tmpkc33dqug/.git/') 210s top_tree_object = 210s search_path = 'debian/changelog' 210s _rel_tree = 210s _rel_path = '' 210s 210s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 210s _rel_tree=None, _rel_path='' 210s ): 210s '''Recursively follow a path down a tree, following symlinks, to find blob 210s 210s repo: pygit2.Repository object 210s top_tree: pygit2.Tree object of the top of the tree structure 210s search_path: '/'-separated path string of blob to find 210s _rel_tree: (internal) which tree to look further into 210s _rel_path: (internal) the path we are in so far 210s ''' 210s 210s NORMAL_BLOB_MODES = set([ 210s pygit2.GIT_FILEMODE_BLOB, 210s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 210s ]) 210s 210s _rel_tree = _rel_tree or top_tree_object 210s head, tail = posixpath.split(search_path) 210s 210s # A traditional functional split would put a single entry in head with tail 210s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 210s # to make it appear to have traditional semantics. 210s if not head: 210s head = tail 210s tail = None 210s 210s entry = _rel_tree[head] 210s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 210s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 210s 210s gitubuntu/git_repository.py:68: AttributeError 210s ___________________ test_follow_symlinks_to_blob[4] ____________________ 210s 210s pygit2_repo = pygit2.Repository('/tmp/tmp2244dd9c/.git/') 210s tree_func = at 0x637915594400> 210s 210s @pytest.mark.parametrize('tree_func', [ 210s # The tree_func parameter is a function that accepts a mock Blob that is to 210s # represent the changelog blob itself and returns a mock Tree with the mock 210s # Blob embedded somewhere within it. The test function can then ensure that 210s # follow_symlinks_to_blob can correctly find the changelog Blob given the 210s # Tree. 210s 210s # Of course this is only expected to work if, after checking out the Tree, 210s # "cat debian/changelog" would work. But this allows us to test the various 210s # permutations of symlink following in Trees that _are_ valid. 210s 210s # Simple case 210s lambda b: Tree({ 210s 'debian': Tree({'changelog': b}), 210s }), 210s 210s # Symlink in debian/ 210s lambda b: Tree({ 210s 'debian': Tree({ 210s 'changelog.real': b, 210s 'changelog': Symlink('changelog.real'), 210s }), 210s }), 210s 210s # Symlink to parent directory 210s lambda b: Tree({ 210s 'changelog': b, 210s 'debian': Tree({ 210s 'changelog': Symlink('../changelog'), 210s }) 210s }), 210s 210s # Symlink to subdirectory 210s lambda b: Tree({ 210s 'debian': Tree({ 210s 'changelog': Symlink('subdirectory/changelog'), 210s 'subdirectory': Tree({'changelog': b}), 210s }) 210s }), 210s 210s # debian/ itself is a symlink to a different directory 210s lambda b: Tree({ 210s 'pkg': Tree({'changelog': b}), 210s 'debian': Symlink('pkg'), 210s }) 210s ]) 210s def test_follow_symlinks_to_blob(pygit2_repo, tree_func): 210s blob = Blob(b'') 210s blob_id = blob.write(pygit2_repo) 210s tree = pygit2_repo.get(tree_func(blob).write(pygit2_repo)) 210s > result_blob = target.follow_symlinks_to_blob( 210s pygit2_repo, 210s tree, 210s 'debian/changelog', 210s ) 210s 210s gitubuntu/git_repository_test.py:342: 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 210s return _follow_symlinks_to_blob( 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s 210s repo = pygit2.Repository('/tmp/tmp2244dd9c/.git/') 210s top_tree_object = 210s search_path = 'debian/changelog' 210s _rel_tree = 210s _rel_path = '' 210s 210s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 210s _rel_tree=None, _rel_path='' 210s ): 210s '''Recursively follow a path down a tree, following symlinks, to find blob 210s 210s repo: pygit2.Repository object 210s top_tree: pygit2.Tree object of the top of the tree structure 210s search_path: '/'-separated path string of blob to find 210s _rel_tree: (internal) which tree to look further into 210s _rel_path: (internal) the path we are in so far 210s ''' 210s 210s NORMAL_BLOB_MODES = set([ 210s pygit2.GIT_FILEMODE_BLOB, 210s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 210s ]) 210s 210s _rel_tree = _rel_tree or top_tree_object 210s head, tail = posixpath.split(search_path) 210s 210s # A traditional functional split would put a single entry in head with tail 210s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 210s # to make it appear to have traditional semantics. 210s if not head: 210s head = tail 210s tail = None 210s 210s entry = _rel_tree[head] 210s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 210s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 210s 210s gitubuntu/git_repository.py:68: AttributeError 210s ________________ test_follow_symlinks_to_blob_not_found[tree1] _________________ 210s 210s pygit2_repo = pygit2.Repository('/tmp/tmpve2psqdz/.git/') 210s tree = 210s 210s @pytest.mark.parametrize('tree', [ 210s Tree({}), 210s Tree({'debian': Tree({})}), 210s Tree({'debian': Tree({'changelog': Symlink('other')})}), 210s Tree({'debian': Tree({'changelog': Symlink('../other')})}), 210s ]) 210s def test_follow_symlinks_to_blob_not_found(pygit2_repo, tree): 210s pygit2_tree = pygit2_repo.get(tree.write(pygit2_repo)) 210s with pytest.raises(KeyError): 210s > target.follow_symlinks_to_blob( 210s pygit2_repo, 210s pygit2_tree, 210s 'debian/changelog', 210s ) 210s 210s gitubuntu/git_repository_test.py:359: 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 210s return _follow_symlinks_to_blob( 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s 210s repo = pygit2.Repository('/tmp/tmpve2psqdz/.git/') 210s top_tree_object = 210s search_path = 'debian/changelog' 210s _rel_tree = 210s _rel_path = '' 210s 210s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 210s _rel_tree=None, _rel_path='' 210s ): 210s '''Recursively follow a path down a tree, following symlinks, to find blob 210s 210s repo: pygit2.Repository object 210s top_tree: pygit2.Tree object of the top of the tree structure 210s search_path: '/'-separated path string of blob to find 210s _rel_tree: (internal) which tree to look further into 210s _rel_path: (internal) the path we are in so far 210s ''' 210s 210s NORMAL_BLOB_MODES = set([ 210s pygit2.GIT_FILEMODE_BLOB, 210s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 210s ]) 210s 210s _rel_tree = _rel_tree or top_tree_object 210s head, tail = posixpath.split(search_path) 210s 210s # A traditional functional split would put a single entry in head with tail 210s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 210s # to make it appear to have traditional semantics. 210s if not head: 210s head = tail 210s tail = None 210s 210s entry = _rel_tree[head] 210s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 210s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 210s 210s gitubuntu/git_repository.py:68: AttributeError 210s ________________ test_follow_symlinks_to_blob_not_found[tree2] _________________ 210s 210s pygit2_repo = pygit2.Repository('/tmp/tmpwhqwacl7/.git/') 210s tree = 210s 210s @pytest.mark.parametrize('tree', [ 210s Tree({}), 210s Tree({'debian': Tree({})}), 210s Tree({'debian': Tree({'changelog': Symlink('other')})}), 210s Tree({'debian': Tree({'changelog': Symlink('../other')})}), 210s ]) 210s def test_follow_symlinks_to_blob_not_found(pygit2_repo, tree): 210s pygit2_tree = pygit2_repo.get(tree.write(pygit2_repo)) 210s with pytest.raises(KeyError): 210s > target.follow_symlinks_to_blob( 210s pygit2_repo, 210s pygit2_tree, 210s 'debian/changelog', 210s ) 210s 210s gitubuntu/git_repository_test.py:359: 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 210s return _follow_symlinks_to_blob( 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s 210s repo = pygit2.Repository('/tmp/tmpwhqwacl7/.git/') 210s top_tree_object = 210s search_path = 'debian/changelog' 210s _rel_tree = 210s _rel_path = '' 210s 210s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 210s _rel_tree=None, _rel_path='' 210s ): 210s '''Recursively follow a path down a tree, following symlinks, to find blob 210s 210s repo: pygit2.Repository object 210s top_tree: pygit2.Tree object of the top of the tree structure 210s search_path: '/'-separated path string of blob to find 210s _rel_tree: (internal) which tree to look further into 210s _rel_path: (internal) the path we are in so far 210s ''' 210s 210s NORMAL_BLOB_MODES = set([ 210s pygit2.GIT_FILEMODE_BLOB, 210s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 210s ]) 210s 210s _rel_tree = _rel_tree or top_tree_object 210s head, tail = posixpath.split(search_path) 210s 210s # A traditional functional split would put a single entry in head with tail 210s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 210s # to make it appear to have traditional semantics. 210s if not head: 210s head = tail 210s tail = None 210s 210s entry = _rel_tree[head] 210s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 210s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 210s 210s gitubuntu/git_repository.py:68: AttributeError 210s ________________ test_follow_symlinks_to_blob_not_found[tree3] _________________ 210s 210s pygit2_repo = pygit2.Repository('/tmp/tmp4me_vz5b/.git/') 210s tree = 210s 210s @pytest.mark.parametrize('tree', [ 210s Tree({}), 210s Tree({'debian': Tree({})}), 210s Tree({'debian': Tree({'changelog': Symlink('other')})}), 210s Tree({'debian': Tree({'changelog': Symlink('../other')})}), 210s ]) 210s def test_follow_symlinks_to_blob_not_found(pygit2_repo, tree): 210s pygit2_tree = pygit2_repo.get(tree.write(pygit2_repo)) 210s with pytest.raises(KeyError): 210s > target.follow_symlinks_to_blob( 210s pygit2_repo, 210s pygit2_tree, 210s 'debian/changelog', 210s ) 210s 210s gitubuntu/git_repository_test.py:359: 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 210s return _follow_symlinks_to_blob( 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s 210s repo = pygit2.Repository('/tmp/tmp4me_vz5b/.git/') 210s top_tree_object = 210s search_path = 'debian/changelog' 210s _rel_tree = 210s _rel_path = '' 210s 210s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 210s _rel_tree=None, _rel_path='' 210s ): 210s '''Recursively follow a path down a tree, following symlinks, to find blob 210s 210s repo: pygit2.Repository object 210s top_tree: pygit2.Tree object of the top of the tree structure 210s search_path: '/'-separated path string of blob to find 210s _rel_tree: (internal) which tree to look further into 210s _rel_path: (internal) the path we are in so far 210s ''' 210s 210s NORMAL_BLOB_MODES = set([ 210s pygit2.GIT_FILEMODE_BLOB, 210s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 210s ]) 210s 210s _rel_tree = _rel_tree or top_tree_object 210s head, tail = posixpath.split(search_path) 210s 210s # A traditional functional split would put a single entry in head with tail 210s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 210s # to make it appear to have traditional semantics. 210s if not head: 210s head = tail 210s tail = None 210s 210s entry = _rel_tree[head] 210s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 210s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 210s 210s gitubuntu/git_repository.py:68: AttributeError 210s _________________________ test_git_escape_dir_to_tree __________________________ 210s 210s pygit2_repo = pygit2.Repository('/tmp/tmpf_cv1cfd/.git/') 210s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_git_escape_dir_to_tree0') 210s 210s def test_git_escape_dir_to_tree(pygit2_repo, tmpdir): 210s tmpdir.mkdir('.git') 210s > tree_hash = target.GitUbuntuRepository.dir_to_tree( 210s pygit2_repo, 210s str(tmpdir), 210s escape=True, 210s ) 210s 210s gitubuntu/git_repository_test.py:668: 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s gitubuntu/git_repository.py:2463: in dir_to_tree 210s replacement_oid = cls._add_missing_tree_dirs( 210s gitubuntu/git_repository.py:2397: in _add_missing_tree_dirs 210s tree_builder = cls._create_replacement_tree_builder( 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s 210s cls = 210s repo = pygit2.Repository('/tmp/tmpf_cv1cfd/.git/') 210s treeish = 210s sub_path = '' 210s 210s @classmethod 210s def _create_replacement_tree_builder(cls, repo, treeish, sub_path): 210s '''Create a replacement TreeBuilder 210s 210s Create a TreeBuilder based on an existing repository, top-level 210s tree-ish and path inside that tree. 210s 210s A sub_path of '' is taken to mean a request for a replacement 210s TreeBuilder for the top level tree. 210s 210s Returns a TreeBuilder object pre-populated with the previous contents. 210s If the path did not previously exist in the tree-ish, then return an 210s empty TreeBuilder instead. 210s ''' 210s 210s > tree = treeish.peel(pygit2.GIT_OBJ_TREE) 210s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 210s 210s gitubuntu/git_repository.py:2331: AttributeError 210s ______ test_determine_quilt_series_path[tree_data1-debian/patches/series] ______ 210s 210s pygit2_repo = pygit2.Repository('/tmp/tmpj_v8671o/.git/') 210s tree_data = 210s expected_path = 'debian/patches/series' 210s 210s @pytest.mark.parametrize('tree_data,expected_path', [ 210s # Empty tree -> default 210s (Tree({}), 'debian/patches/series'), 210s 210s # Empty debian/patches directory -> default 210s (Tree({'debian': Tree({'patches': Tree({})})}), 'debian/patches/series'), 210s 210s # Only debian/patches/series -> that one 210s ( 210s Tree({'debian': Tree({'patches': Tree({'series': Blob(b'')})})}), 210s 'debian/patches/series', 210s ), 210s 210s # Only debian/patches/debian.series -> that one 210s ( 210s Tree({'debian': Tree({'patches': Tree({ 210s 'debian.series': Blob(b'') 210s })})}), 210s 'debian/patches/debian.series', 210s ), 210s 210s # Both -> debian.series 210s ( 210s Tree({'debian': Tree({'patches': Tree({ 210s 'debian.series': Blob(b''), 210s 'series': Blob(b''), 210s })})}), 210s 'debian/patches/debian.series', 210s ), 210s ]) 210s def test_determine_quilt_series_path(pygit2_repo, tree_data, expected_path): 210s tree_obj = pygit2_repo.get(tree_data.write(pygit2_repo)) 210s > path = target.determine_quilt_series_path(pygit2_repo, tree_obj) 210s 210s gitubuntu/git_repository_test.py:708: 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s gitubuntu/git_repository.py:991: in determine_quilt_series_path 210s blob = follow_symlinks_to_blob( 210s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 210s return _follow_symlinks_to_blob( 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s 210s repo = pygit2.Repository('/tmp/tmpj_v8671o/.git/') 210s top_tree_object = 210s search_path = 'debian/patches/debian.series' 210s _rel_tree = 210s _rel_path = '' 210s 210s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 210s _rel_tree=None, _rel_path='' 210s ): 210s '''Recursively follow a path down a tree, following symlinks, to find blob 210s 210s repo: pygit2.Repository object 210s top_tree: pygit2.Tree object of the top of the tree structure 210s search_path: '/'-separated path string of blob to find 210s _rel_tree: (internal) which tree to look further into 210s _rel_path: (internal) the path we are in so far 210s ''' 210s 210s NORMAL_BLOB_MODES = set([ 210s pygit2.GIT_FILEMODE_BLOB, 210s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 210s ]) 210s 210s _rel_tree = _rel_tree or top_tree_object 210s head, tail = posixpath.split(search_path) 210s 210s # A traditional functional split would put a single entry in head with tail 210s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 210s # to make it appear to have traditional semantics. 210s if not head: 210s head = tail 210s tail = None 210s 210s entry = _rel_tree[head] 210s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 210s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 210s 210s gitubuntu/git_repository.py:68: AttributeError 210s ______ test_determine_quilt_series_path[tree_data2-debian/patches/series] ______ 210s 210s pygit2_repo = pygit2.Repository('/tmp/tmp32tc3o8l/.git/') 210s tree_data = 210s expected_path = 'debian/patches/series' 210s 210s @pytest.mark.parametrize('tree_data,expected_path', [ 210s # Empty tree -> default 210s (Tree({}), 'debian/patches/series'), 210s 210s # Empty debian/patches directory -> default 210s (Tree({'debian': Tree({'patches': Tree({})})}), 'debian/patches/series'), 210s 210s # Only debian/patches/series -> that one 210s ( 210s Tree({'debian': Tree({'patches': Tree({'series': Blob(b'')})})}), 210s 'debian/patches/series', 210s ), 210s 210s # Only debian/patches/debian.series -> that one 210s ( 210s Tree({'debian': Tree({'patches': Tree({ 210s 'debian.series': Blob(b'') 210s })})}), 210s 'debian/patches/debian.series', 210s ), 210s 210s # Both -> debian.series 210s ( 210s Tree({'debian': Tree({'patches': Tree({ 210s 'debian.series': Blob(b''), 210s 'series': Blob(b''), 210s })})}), 210s 'debian/patches/debian.series', 210s ), 210s ]) 210s def test_determine_quilt_series_path(pygit2_repo, tree_data, expected_path): 210s tree_obj = pygit2_repo.get(tree_data.write(pygit2_repo)) 210s > path = target.determine_quilt_series_path(pygit2_repo, tree_obj) 210s 210s gitubuntu/git_repository_test.py:708: 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s gitubuntu/git_repository.py:991: in determine_quilt_series_path 210s blob = follow_symlinks_to_blob( 210s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 210s return _follow_symlinks_to_blob( 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s 210s repo = pygit2.Repository('/tmp/tmp32tc3o8l/.git/') 210s top_tree_object = 210s search_path = 'debian/patches/debian.series' 210s _rel_tree = 210s _rel_path = '' 210s 210s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 210s _rel_tree=None, _rel_path='' 210s ): 210s '''Recursively follow a path down a tree, following symlinks, to find blob 210s 210s repo: pygit2.Repository object 210s top_tree: pygit2.Tree object of the top of the tree structure 210s search_path: '/'-separated path string of blob to find 210s _rel_tree: (internal) which tree to look further into 210s _rel_path: (internal) the path we are in so far 210s ''' 210s 210s NORMAL_BLOB_MODES = set([ 210s pygit2.GIT_FILEMODE_BLOB, 210s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 210s ]) 210s 210s _rel_tree = _rel_tree or top_tree_object 210s head, tail = posixpath.split(search_path) 210s 210s # A traditional functional split would put a single entry in head with tail 210s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 210s # to make it appear to have traditional semantics. 210s if not head: 210s head = tail 210s tail = None 210s 210s entry = _rel_tree[head] 210s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 210s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 210s 210s gitubuntu/git_repository.py:68: AttributeError 210s __ test_determine_quilt_series_path[tree_data3-debian/patches/debian.series] ___ 210s 210s pygit2_repo = pygit2.Repository('/tmp/tmpibz5vaun/.git/') 210s tree_data = 210s expected_path = 'debian/patches/debian.series' 210s 210s @pytest.mark.parametrize('tree_data,expected_path', [ 210s # Empty tree -> default 210s (Tree({}), 'debian/patches/series'), 210s 210s # Empty debian/patches directory -> default 210s (Tree({'debian': Tree({'patches': Tree({})})}), 'debian/patches/series'), 210s 210s # Only debian/patches/series -> that one 210s ( 210s Tree({'debian': Tree({'patches': Tree({'series': Blob(b'')})})}), 210s 'debian/patches/series', 210s ), 210s 210s # Only debian/patches/debian.series -> that one 210s ( 210s Tree({'debian': Tree({'patches': Tree({ 210s 'debian.series': Blob(b'') 210s })})}), 210s 'debian/patches/debian.series', 210s ), 210s 210s # Both -> debian.series 210s ( 210s Tree({'debian': Tree({'patches': Tree({ 210s 'debian.series': Blob(b''), 210s 'series': Blob(b''), 210s })})}), 210s 'debian/patches/debian.series', 210s ), 210s ]) 210s def test_determine_quilt_series_path(pygit2_repo, tree_data, expected_path): 210s tree_obj = pygit2_repo.get(tree_data.write(pygit2_repo)) 210s > path = target.determine_quilt_series_path(pygit2_repo, tree_obj) 210s 210s gitubuntu/git_repository_test.py:708: 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s gitubuntu/git_repository.py:991: in determine_quilt_series_path 210s blob = follow_symlinks_to_blob( 210s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 210s return _follow_symlinks_to_blob( 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s 210s repo = pygit2.Repository('/tmp/tmpibz5vaun/.git/') 210s top_tree_object = 210s search_path = 'debian/patches/debian.series' 210s _rel_tree = 210s _rel_path = '' 210s 210s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 210s _rel_tree=None, _rel_path='' 210s ): 210s '''Recursively follow a path down a tree, following symlinks, to find blob 210s 210s repo: pygit2.Repository object 210s top_tree: pygit2.Tree object of the top of the tree structure 210s search_path: '/'-separated path string of blob to find 210s _rel_tree: (internal) which tree to look further into 210s _rel_path: (internal) the path we are in so far 210s ''' 210s 210s NORMAL_BLOB_MODES = set([ 210s pygit2.GIT_FILEMODE_BLOB, 210s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 210s ]) 210s 210s _rel_tree = _rel_tree or top_tree_object 210s head, tail = posixpath.split(search_path) 210s 210s # A traditional functional split would put a single entry in head with tail 210s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 210s # to make it appear to have traditional semantics. 210s if not head: 210s head = tail 210s tail = None 210s 210s entry = _rel_tree[head] 210s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 210s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 210s 210s gitubuntu/git_repository.py:68: AttributeError 210s __ test_determine_quilt_series_path[tree_data4-debian/patches/debian.series] ___ 210s 210s pygit2_repo = pygit2.Repository('/tmp/tmpcrcupb23/.git/') 210s tree_data = 210s expected_path = 'debian/patches/debian.series' 210s 210s @pytest.mark.parametrize('tree_data,expected_path', [ 210s # Empty tree -> default 210s (Tree({}), 'debian/patches/series'), 210s 210s # Empty debian/patches directory -> default 210s (Tree({'debian': Tree({'patches': Tree({})})}), 'debian/patches/series'), 210s 210s # Only debian/patches/series -> that one 210s ( 210s Tree({'debian': Tree({'patches': Tree({'series': Blob(b'')})})}), 210s 'debian/patches/series', 210s ), 210s 210s # Only debian/patches/debian.series -> that one 210s ( 210s Tree({'debian': Tree({'patches': Tree({ 210s 'debian.series': Blob(b'') 210s })})}), 210s 'debian/patches/debian.series', 210s ), 210s 210s # Both -> debian.series 210s ( 210s Tree({'debian': Tree({'patches': Tree({ 210s 'debian.series': Blob(b''), 210s 'series': Blob(b''), 210s })})}), 210s 'debian/patches/debian.series', 210s ), 210s ]) 210s def test_determine_quilt_series_path(pygit2_repo, tree_data, expected_path): 210s tree_obj = pygit2_repo.get(tree_data.write(pygit2_repo)) 210s > path = target.determine_quilt_series_path(pygit2_repo, tree_obj) 210s 210s gitubuntu/git_repository_test.py:708: 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s gitubuntu/git_repository.py:991: in determine_quilt_series_path 210s blob = follow_symlinks_to_blob( 210s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 210s return _follow_symlinks_to_blob( 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s 210s repo = pygit2.Repository('/tmp/tmpcrcupb23/.git/') 210s top_tree_object = 210s search_path = 'debian/patches/debian.series' 210s _rel_tree = 210s _rel_path = '' 210s 210s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 210s _rel_tree=None, _rel_path='' 210s ): 210s '''Recursively follow a path down a tree, following symlinks, to find blob 210s 210s repo: pygit2.Repository object 210s top_tree: pygit2.Tree object of the top of the tree structure 210s search_path: '/'-separated path string of blob to find 210s _rel_tree: (internal) which tree to look further into 210s _rel_path: (internal) the path we are in so far 210s ''' 210s 210s NORMAL_BLOB_MODES = set([ 210s pygit2.GIT_FILEMODE_BLOB, 210s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 210s ]) 210s 210s _rel_tree = _rel_tree or top_tree_object 210s head, tail = posixpath.split(search_path) 210s 210s # A traditional functional split would put a single entry in head with tail 210s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 210s # to make it appear to have traditional semantics. 210s if not head: 210s head = tail 210s tail = None 210s 210s entry = _rel_tree[head] 210s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 210s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 210s 210s gitubuntu/git_repository.py:68: AttributeError 210s ________________________________ test_quilt_env ________________________________ 210s 210s pygit2_repo = pygit2.Repository('/tmp/tmp1edvrz08/.git/') 210s 210s def test_quilt_env(pygit2_repo): 210s tree_builder = Tree({'debian': 210s Tree({'patches': Tree({'debian.series': Blob(b'')})}) 210s }) 210s tree_obj = pygit2_repo.get(tree_builder.write(pygit2_repo)) 210s > env = target.quilt_env(pygit2_repo, tree_obj) 210s 210s gitubuntu/git_repository_test.py:717: 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s gitubuntu/git_repository.py:1022: in quilt_env 210s 'QUILT_SERIES': determine_quilt_series_path(pygit2_repo, treeish), 210s gitubuntu/git_repository.py:991: in determine_quilt_series_path 210s blob = follow_symlinks_to_blob( 210s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 210s return _follow_symlinks_to_blob( 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s 210s repo = pygit2.Repository('/tmp/tmp1edvrz08/.git/') 210s top_tree_object = 210s search_path = 'debian/patches/debian.series' 210s _rel_tree = 210s _rel_path = '' 210s 210s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 210s _rel_tree=None, _rel_path='' 210s ): 210s '''Recursively follow a path down a tree, following symlinks, to find blob 210s 210s repo: pygit2.Repository object 210s top_tree: pygit2.Tree object of the top of the tree structure 210s search_path: '/'-separated path string of blob to find 210s _rel_tree: (internal) which tree to look further into 210s _rel_path: (internal) the path we are in so far 210s ''' 210s 210s NORMAL_BLOB_MODES = set([ 210s pygit2.GIT_FILEMODE_BLOB, 210s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 210s ]) 210s 210s _rel_tree = _rel_tree or top_tree_object 210s head, tail = posixpath.split(search_path) 210s 210s # A traditional functional split would put a single entry in head with tail 210s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 210s # to make it appear to have traditional semantics. 210s if not head: 210s head = tail 210s tail = None 210s 210s entry = _rel_tree[head] 210s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 210s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 210s 210s gitubuntu/git_repository.py:68: AttributeError 210s _____________________________ test_repo_quilt_env ______________________________ 210s 210s repo = 210s 210s def test_repo_quilt_env(repo): 210s tree_builder = Tree({'debian': 210s Tree({'patches': Tree({'debian.series': Blob(b'')})}) 210s }) 210s tree_obj = repo.raw_repo.get(tree_builder.write(repo.raw_repo)) 210s > env = repo.quilt_env(tree_obj) 210s 210s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository_test.py:732: 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:2575: in quilt_env 210s env.update(quilt_env(self.raw_repo, treeish)) 210s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:1022: in quilt_env 210s 'QUILT_SERIES': determine_quilt_series_path(pygit2_repo, treeish), 210s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:991: in determine_quilt_series_path 210s blob = follow_symlinks_to_blob( 210s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 210s return _follow_symlinks_to_blob( 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s 210s repo = pygit2.Repository('/tmp/tmp_r3ct1y0/.git/') 210s top_tree_object = 210s search_path = 'debian/patches/debian.series' 210s _rel_tree = 210s _rel_path = '' 210s 210s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 210s _rel_tree=None, _rel_path='' 210s ): 210s '''Recursively follow a path down a tree, following symlinks, to find blob 210s 210s repo: pygit2.Repository object 210s top_tree: pygit2.Tree object of the top of the tree structure 210s search_path: '/'-separated path string of blob to find 210s _rel_tree: (internal) which tree to look further into 210s _rel_path: (internal) the path we are in so far 210s ''' 210s 210s NORMAL_BLOB_MODES = set([ 210s pygit2.GIT_FILEMODE_BLOB, 210s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 210s ]) 210s 210s _rel_tree = _rel_tree or top_tree_object 210s head, tail = posixpath.split(search_path) 210s 210s # A traditional functional split would put a single entry in head with tail 210s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 210s # to make it appear to have traditional semantics. 210s if not head: 210s head = tail 210s tail = None 210s 210s entry = _rel_tree[head] 210s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 210s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 210s 210s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:68: AttributeError 210s _____________________ test_repo_quilt_env_from_treeish_str _____________________ 210s 210s repo = 210s 210s def test_repo_quilt_env_from_treeish_str(repo): 210s tree_builder = Tree({'debian': 210s Tree({'patches': Tree({'debian.series': Blob(b'')})}) 210s }) 210s tree_obj = repo.raw_repo.get(tree_builder.write(repo.raw_repo)) 210s > env = repo.quilt_env_from_treeish_str(str(tree_obj.id)) 210s 210s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository_test.py:757: 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:2589: in quilt_env_from_treeish_str 210s return self.quilt_env(self.raw_repo.get(treeish_str)) 210s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:2575: in quilt_env 210s env.update(quilt_env(self.raw_repo, treeish)) 210s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:1022: in quilt_env 210s 'QUILT_SERIES': determine_quilt_series_path(pygit2_repo, treeish), 210s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:991: in determine_quilt_series_path 210s blob = follow_symlinks_to_blob( 210s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 210s return _follow_symlinks_to_blob( 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s 210s repo = pygit2.Repository('/tmp/tmpupt9i860/.git/') 210s top_tree_object = 210s search_path = 'debian/patches/debian.series' 210s _rel_tree = 210s _rel_path = '' 210s 210s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 210s _rel_tree=None, _rel_path='' 210s ): 210s '''Recursively follow a path down a tree, following symlinks, to find blob 210s 210s repo: pygit2.Repository object 210s top_tree: pygit2.Tree object of the top of the tree structure 210s search_path: '/'-separated path string of blob to find 210s _rel_tree: (internal) which tree to look further into 210s _rel_path: (internal) the path we are in so far 210s ''' 210s 210s NORMAL_BLOB_MODES = set([ 210s pygit2.GIT_FILEMODE_BLOB, 210s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 210s ]) 210s 210s _rel_tree = _rel_tree or top_tree_object 210s head, tail = posixpath.split(search_path) 210s 210s # A traditional functional split would put a single entry in head with tail 210s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 210s # to make it appear to have traditional semantics. 210s if not head: 210s head = tail 210s tail = None 210s 210s entry = _rel_tree[head] 210s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 210s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 210s 210s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:68: AttributeError 210s _ test_repo_find_ubuntu_merge[Common case-input_data0-pkg/import/1-1ubuntu1-pkg/import/2-1-pkg/import/1-1] _ 210s 210s description = 'Common case' 210s repo = 210s input_data = 210s old_ubuntu = 'pkg/import/1-1ubuntu1', new_debian = 'pkg/import/2-1' 210s expected = 'pkg/import/1-1' 210s 210s @pytest.mark.parametrize( 210s 'description, input_data, old_ubuntu, new_debian, expected', 210s [ 210s ( 210s 'Common case', 210s Repo( 210s commits=[ 210s Commit.from_spec( 210s name='old/debian' 210s ), 210s Commit.from_spec( 210s parents=[Placeholder('old/debian')], 210s name='old/ubuntu', 210s changelog_versions=['1-1ubuntu1', '1-1'], 210s ), 210s Commit.from_spec( 210s parents=[Placeholder('old/debian')], 210s name='new/debian', 210s changelog_versions=['2-1', '1-1'], 210s ), 210s ], 210s tags={ 210s 'pkg/import/1-1': Placeholder('old/debian'), 210s 'pkg/import/1-1ubuntu1': Placeholder('old/ubuntu'), 210s 'pkg/import/2-1': Placeholder('new/debian'), 210s }, 210s ), 210s 'pkg/import/1-1ubuntu1', 210s 'pkg/import/2-1', 210s 'pkg/import/1-1', 210s ), 210s ( 210s 'Ubuntu delta based on a NMU', 210s Repo( 210s commits=[ 210s Commit.from_spec( 210s name='fork_point' 210s ), 210s Commit.from_spec( 210s parents=[Placeholder('fork_point')], 210s name='old/debian', 210s changelog_versions=['1-1.1', '1-1'], 210s ), 210s Commit.from_spec( 210s parents=[Placeholder('old/debian')], 210s name='old/ubuntu', 210s changelog_versions=['1-1.1ubuntu1', '1-1.1', '1-1'], 210s ), 210s Commit.from_spec( 210s parents=[Placeholder('fork_point')], 210s name='new/debian', 210s changelog_versions=['2-1', '1-1'], 210s ), 210s ], 210s tags={ 210s 'pkg/import/1-1': Placeholder('fork_point'), 210s 'pkg/import/1-1.1': Placeholder('old/debian'), 210s 'pkg/import/1-1.1ubuntu1': Placeholder('old/ubuntu'), 210s 'pkg/import/2-1': Placeholder('new/debian'), 210s }, 210s ), 210s 'pkg/import/1-1.1ubuntu1', 210s 'pkg/import/2-1', 210s 'pkg/import/1-1.1', 210s ), 210s ( 210s 'Ubuntu upstream version head of Debian', 210s Repo( 210s commits=[ 210s Commit.from_spec( 210s name='old/debian' 210s ), 210s Commit.from_spec( 210s parents=[Placeholder('old/debian')], 210s name='mid_ubuntu', 210s changelog_versions=['1-1ubuntu1', '1-1'], 210s ), 210s Commit.from_spec( 210s parents=[Placeholder('mid_ubuntu')], 210s name='old/ubuntu', 210s changelog_versions=['2-0ubuntu1', '1-1ubuntu1', '1-1'], 210s ), 210s Commit.from_spec( 210s parents=[Placeholder('old/debian')], 210s name='new/debian', 210s changelog_versions=['3-1', '1-1'], 210s ), 210s ], 210s tags={ 210s 'pkg/import/1-1': Placeholder('old/debian'), 210s 'pkg/import/1-1ubuntu1': Placeholder('mid_ubuntu'), 210s 'pkg/import/2-0ubuntu1': Placeholder('old/ubuntu'), 210s 'pkg/import/3-1': Placeholder('new/debian'), 210s }, 210s ), 210s 'pkg/import/2-0ubuntu1', 210s 'pkg/import/3-1', 210s 'pkg/import/1-1', 210s ), 210s ], 210s ) 210s def test_repo_find_ubuntu_merge( 210s description, 210s repo, 210s input_data, 210s old_ubuntu, 210s new_debian, 210s expected, 210s ): 210s > input_data.write(repo.raw_repo) 210s 210s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository_test.py:889: 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s 210s self = 210s repo = pygit2.Repository('/tmp/tmpfeb6wk_l/.git/'), record = {} 210s 210s def write(self, repo, record=None): 210s replace_placeholders(self) 210s record = record or dict() 210s written_commits = [ 210s commit.write(repo=repo, record=record) 210s for commit 210s in self.commit_list 210s ] 210s for name, target in self.branches.items(): 210s repo.create_branch( 210s name, 210s repo.get(target.write(repo)).peel(pygit2.Commit), 210s ) 210s for name, target in self.tags.items(): 210s repo.create_tag( 210s name, 210s target.write(repo), 210s > pygit2.GIT_OBJ_COMMIT, 210s self.tagger.signature, 210s 'Tag message', 210s ) 210s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 210s 210s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 210s ----------------------------- Captured stdout call ----------------------------- 210s dpkg-source: info: using source format '3.0 (quilt)' 210s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 210s dpkg-source: info: using source format '3.0 (quilt)' 210s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1ubuntu1.debian.tar.xz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1ubuntu1.dsc 210s dpkg-source: info: using source format '3.0 (quilt)' 210s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 210s dpkg-source: info: using source format '3.0 (quilt)' 210s dpkg-source: info: building source-builder-package using existing ./source-builder-package_2.orig.tar.gz 210s dpkg-source: info: building source-builder-package in source-builder-package_2-1.debian.tar.xz 210s dpkg-source: info: building source-builder-package in source-builder-package_2-1.dsc 210s dpkg-source: info: using source format '3.0 (quilt)' 210s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 210s dpkg-source: info: using source format '3.0 (quilt)' 210s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 210s ----------------------------- Captured stderr call ----------------------------- 210s dpkg-source: warning: missing information for output field Standards-Version 210s dpkg-source: warning: Version number suggests Ubuntu changes, but there is no XSBC-Original-Maintainer field 210s dpkg-source: warning: missing information for output field Standards-Version 210s dpkg-source: warning: missing information for output field Standards-Version 210s dpkg-source: warning: missing information for output field Standards-Version 210s dpkg-source: warning: missing information for output field Standards-Version 210s dpkg-source: warning: missing information for output field Standards-Version 210s _ test_repo_find_ubuntu_merge[Ubuntu delta based on a NMU-input_data1-pkg/import/1-1.1ubuntu1-pkg/import/2-1-pkg/import/1-1.1] _ 210s 210s description = 'Ubuntu delta based on a NMU' 210s repo = 210s input_data = 210s old_ubuntu = 'pkg/import/1-1.1ubuntu1', new_debian = 'pkg/import/2-1' 210s expected = 'pkg/import/1-1.1' 210s 210s @pytest.mark.parametrize( 210s 'description, input_data, old_ubuntu, new_debian, expected', 210s [ 210s ( 210s 'Common case', 210s Repo( 210s commits=[ 210s Commit.from_spec( 210s name='old/debian' 210s ), 210s Commit.from_spec( 210s parents=[Placeholder('old/debian')], 210s name='old/ubuntu', 210s changelog_versions=['1-1ubuntu1', '1-1'], 210s ), 210s Commit.from_spec( 210s parents=[Placeholder('old/debian')], 210s name='new/debian', 210s changelog_versions=['2-1', '1-1'], 210s ), 210s ], 210s tags={ 210s 'pkg/import/1-1': Placeholder('old/debian'), 210s 'pkg/import/1-1ubuntu1': Placeholder('old/ubuntu'), 210s 'pkg/import/2-1': Placeholder('new/debian'), 210s }, 210s ), 210s 'pkg/import/1-1ubuntu1', 210s 'pkg/import/2-1', 210s 'pkg/import/1-1', 210s ), 210s ( 210s 'Ubuntu delta based on a NMU', 210s Repo( 210s commits=[ 210s Commit.from_spec( 210s name='fork_point' 210s ), 210s Commit.from_spec( 210s parents=[Placeholder('fork_point')], 210s name='old/debian', 210s changelog_versions=['1-1.1', '1-1'], 210s ), 210s Commit.from_spec( 210s parents=[Placeholder('old/debian')], 210s name='old/ubuntu', 210s changelog_versions=['1-1.1ubuntu1', '1-1.1', '1-1'], 210s ), 210s Commit.from_spec( 210s parents=[Placeholder('fork_point')], 210s name='new/debian', 210s changelog_versions=['2-1', '1-1'], 210s ), 210s ], 210s tags={ 210s 'pkg/import/1-1': Placeholder('fork_point'), 210s 'pkg/import/1-1.1': Placeholder('old/debian'), 210s 'pkg/import/1-1.1ubuntu1': Placeholder('old/ubuntu'), 210s 'pkg/import/2-1': Placeholder('new/debian'), 210s }, 210s ), 210s 'pkg/import/1-1.1ubuntu1', 210s 'pkg/import/2-1', 210s 'pkg/import/1-1.1', 210s ), 210s ( 210s 'Ubuntu upstream version head of Debian', 210s Repo( 210s commits=[ 210s Commit.from_spec( 210s name='old/debian' 210s ), 210s Commit.from_spec( 210s parents=[Placeholder('old/debian')], 210s name='mid_ubuntu', 210s changelog_versions=['1-1ubuntu1', '1-1'], 210s ), 210s Commit.from_spec( 210s parents=[Placeholder('mid_ubuntu')], 210s name='old/ubuntu', 210s changelog_versions=['2-0ubuntu1', '1-1ubuntu1', '1-1'], 210s ), 210s Commit.from_spec( 210s parents=[Placeholder('old/debian')], 210s name='new/debian', 210s changelog_versions=['3-1', '1-1'], 210s ), 210s ], 210s tags={ 210s 'pkg/import/1-1': Placeholder('old/debian'), 210s 'pkg/import/1-1ubuntu1': Placeholder('mid_ubuntu'), 210s 'pkg/import/2-0ubuntu1': Placeholder('old/ubuntu'), 210s 'pkg/import/3-1': Placeholder('new/debian'), 210s }, 210s ), 210s 'pkg/import/2-0ubuntu1', 210s 'pkg/import/3-1', 210s 'pkg/import/1-1', 210s ), 210s ], 210s ) 210s def test_repo_find_ubuntu_merge( 210s description, 210s repo, 210s input_data, 210s old_ubuntu, 210s new_debian, 210s expected, 210s ): 210s > input_data.write(repo.raw_repo) 210s 210s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository_test.py:889: 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s 210s self = 210s repo = pygit2.Repository('/tmp/tmp453htk0_/.git/'), record = {} 210s 210s def write(self, repo, record=None): 210s replace_placeholders(self) 210s record = record or dict() 210s written_commits = [ 210s commit.write(repo=repo, record=record) 210s for commit 210s in self.commit_list 210s ] 210s for name, target in self.branches.items(): 210s repo.create_branch( 210s name, 210s repo.get(target.write(repo)).peel(pygit2.Commit), 210s ) 210s for name, target in self.tags.items(): 210s repo.create_tag( 210s name, 210s target.write(repo), 210s > pygit2.GIT_OBJ_COMMIT, 210s self.tagger.signature, 210s 'Tag message', 210s ) 210s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 210s 210s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 210s ----------------------------- Captured stdout call ----------------------------- 210s dpkg-source: info: using source format '3.0 (quilt)' 210s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 210s dpkg-source: info: using source format '3.0 (quilt)' 210s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.1.debian.tar.xz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.1.dsc 210s dpkg-source: info: using source format '3.0 (quilt)' 210s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 210s dpkg-source: info: using source format '3.0 (quilt)' 210s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.1ubuntu1.debian.tar.xz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.1ubuntu1.dsc 210s dpkg-source: info: using source format '3.0 (quilt)' 210s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.1.debian.tar.xz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.1.dsc 210s dpkg-source: info: using source format '3.0 (quilt)' 210s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 210s dpkg-source: info: using source format '3.0 (quilt)' 210s dpkg-source: info: building source-builder-package using existing ./source-builder-package_2.orig.tar.gz 210s dpkg-source: info: building source-builder-package in source-builder-package_2-1.debian.tar.xz 210s dpkg-source: info: building source-builder-package in source-builder-package_2-1.dsc 210s dpkg-source: info: using source format '3.0 (quilt)' 210s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 210s dpkg-source: info: using source format '3.0 (quilt)' 210s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 210s ----------------------------- Captured stderr call ----------------------------- 210s dpkg-source: warning: missing information for output field Standards-Version 210s dpkg-source: warning: missing information for output field Standards-Version 210s dpkg-source: warning: missing information for output field Standards-Version 210s dpkg-source: warning: Version number suggests Ubuntu changes, but there is no XSBC-Original-Maintainer field 210s dpkg-source: warning: missing information for output field Standards-Version 210s dpkg-source: warning: missing information for output field Standards-Version 210s dpkg-source: warning: missing information for output field Standards-Version 210s dpkg-source: warning: missing information for output field Standards-Version 210s dpkg-source: warning: missing information for output field Standards-Version 210s dpkg-source: warning: missing information for output field Standards-Version 210s _ test_repo_find_ubuntu_merge[Ubuntu upstream version head of Debian-input_data2-pkg/import/2-0ubuntu1-pkg/import/3-1-pkg/import/1-1] _ 210s 210s description = 'Ubuntu upstream version head of Debian' 210s repo = 210s input_data = 210s old_ubuntu = 'pkg/import/2-0ubuntu1', new_debian = 'pkg/import/3-1' 210s expected = 'pkg/import/1-1' 210s 210s @pytest.mark.parametrize( 210s 'description, input_data, old_ubuntu, new_debian, expected', 210s [ 210s ( 210s 'Common case', 210s Repo( 210s commits=[ 210s Commit.from_spec( 210s name='old/debian' 210s ), 210s Commit.from_spec( 210s parents=[Placeholder('old/debian')], 210s name='old/ubuntu', 210s changelog_versions=['1-1ubuntu1', '1-1'], 210s ), 210s Commit.from_spec( 210s parents=[Placeholder('old/debian')], 210s name='new/debian', 210s changelog_versions=['2-1', '1-1'], 210s ), 210s ], 210s tags={ 210s 'pkg/import/1-1': Placeholder('old/debian'), 210s 'pkg/import/1-1ubuntu1': Placeholder('old/ubuntu'), 210s 'pkg/import/2-1': Placeholder('new/debian'), 210s }, 210s ), 210s 'pkg/import/1-1ubuntu1', 210s 'pkg/import/2-1', 210s 'pkg/import/1-1', 210s ), 210s ( 210s 'Ubuntu delta based on a NMU', 210s Repo( 210s commits=[ 210s Commit.from_spec( 210s name='fork_point' 210s ), 210s Commit.from_spec( 210s parents=[Placeholder('fork_point')], 210s name='old/debian', 210s changelog_versions=['1-1.1', '1-1'], 210s ), 210s Commit.from_spec( 210s parents=[Placeholder('old/debian')], 210s name='old/ubuntu', 210s changelog_versions=['1-1.1ubuntu1', '1-1.1', '1-1'], 210s ), 210s Commit.from_spec( 210s parents=[Placeholder('fork_point')], 210s name='new/debian', 210s changelog_versions=['2-1', '1-1'], 210s ), 210s ], 210s tags={ 210s 'pkg/import/1-1': Placeholder('fork_point'), 210s 'pkg/import/1-1.1': Placeholder('old/debian'), 210s 'pkg/import/1-1.1ubuntu1': Placeholder('old/ubuntu'), 210s 'pkg/import/2-1': Placeholder('new/debian'), 210s }, 210s ), 210s 'pkg/import/1-1.1ubuntu1', 210s 'pkg/import/2-1', 210s 'pkg/import/1-1.1', 210s ), 210s ( 210s 'Ubuntu upstream version head of Debian', 210s Repo( 210s commits=[ 210s Commit.from_spec( 210s name='old/debian' 210s ), 210s Commit.from_spec( 210s parents=[Placeholder('old/debian')], 210s name='mid_ubuntu', 210s changelog_versions=['1-1ubuntu1', '1-1'], 210s ), 210s Commit.from_spec( 210s parents=[Placeholder('mid_ubuntu')], 210s name='old/ubuntu', 210s changelog_versions=['2-0ubuntu1', '1-1ubuntu1', '1-1'], 210s ), 210s Commit.from_spec( 210s parents=[Placeholder('old/debian')], 210s name='new/debian', 210s changelog_versions=['3-1', '1-1'], 210s ), 210s ], 210s tags={ 210s 'pkg/import/1-1': Placeholder('old/debian'), 210s 'pkg/import/1-1ubuntu1': Placeholder('mid_ubuntu'), 210s 'pkg/import/2-0ubuntu1': Placeholder('old/ubuntu'), 210s 'pkg/import/3-1': Placeholder('new/debian'), 210s }, 210s ), 210s 'pkg/import/2-0ubuntu1', 210s 'pkg/import/3-1', 210s 'pkg/import/1-1', 210s ), 210s ], 210s ) 210s def test_repo_find_ubuntu_merge( 210s description, 210s repo, 210s input_data, 210s old_ubuntu, 210s new_debian, 210s expected, 210s ): 210s > input_data.write(repo.raw_repo) 210s 210s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository_test.py:889: 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s 210s self = 210s repo = pygit2.Repository('/tmp/tmpogrlvvqh/.git/'), record = {} 210s 210s def write(self, repo, record=None): 210s replace_placeholders(self) 210s record = record or dict() 210s written_commits = [ 210s commit.write(repo=repo, record=record) 210s for commit 210s in self.commit_list 210s ] 210s for name, target in self.branches.items(): 210s repo.create_branch( 210s name, 210s repo.get(target.write(repo)).peel(pygit2.Commit), 210s ) 210s for name, target in self.tags.items(): 210s repo.create_tag( 210s name, 210s target.write(repo), 210s > pygit2.GIT_OBJ_COMMIT, 210s self.tagger.signature, 210s 'Tag message', 210s ) 210s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 210s 210s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 210s ----------------------------- Captured stdout call ----------------------------- 210s dpkg-source: info: using source format '3.0 (quilt)' 210s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 210s dpkg-source: info: using source format '3.0 (quilt)' 210s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1ubuntu1.debian.tar.xz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1ubuntu1.dsc 210s dpkg-source: info: using source format '3.0 (quilt)' 210s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 210s dpkg-source: info: using source format '3.0 (quilt)' 210s dpkg-source: info: building source-builder-package using existing ./source-builder-package_2.orig.tar.gz 210s dpkg-source: info: building source-builder-package in source-builder-package_2-0ubuntu1.debian.tar.xz 210s dpkg-source: info: building source-builder-package in source-builder-package_2-0ubuntu1.dsc 210s dpkg-source: info: using source format '3.0 (quilt)' 210s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1ubuntu1.debian.tar.xz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1ubuntu1.dsc 210s dpkg-source: info: using source format '3.0 (quilt)' 210s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 210s dpkg-source: info: using source format '3.0 (quilt)' 210s dpkg-source: info: building source-builder-package using existing ./source-builder-package_3.orig.tar.gz 210s dpkg-source: info: building source-builder-package in source-builder-package_3-1.debian.tar.xz 210s dpkg-source: info: building source-builder-package in source-builder-package_3-1.dsc 210s dpkg-source: info: using source format '3.0 (quilt)' 210s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 210s dpkg-source: info: using source format '3.0 (quilt)' 210s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 210s ----------------------------- Captured stderr call ----------------------------- 210s dpkg-source: warning: missing information for output field Standards-Version 210s dpkg-source: warning: Version number suggests Ubuntu changes, but there is no XSBC-Original-Maintainer field 210s dpkg-source: warning: missing information for output field Standards-Version 210s dpkg-source: warning: missing information for output field Standards-Version 210s dpkg-source: warning: Version number suggests Ubuntu changes, but there is no XSBC-Original-Maintainer field 210s dpkg-source: warning: missing information for output field Standards-Version 210s dpkg-source: warning: Version number suggests Ubuntu changes, but there is no XSBC-Original-Maintainer field 210s dpkg-source: warning: missing information for output field Standards-Version 210s dpkg-source: warning: missing information for output field Standards-Version 210s dpkg-source: warning: missing information for output field Standards-Version 210s dpkg-source: warning: missing information for output field Standards-Version 210s dpkg-source: warning: missing information for output field Standards-Version 210s _______________________________ test_commit_tree _______________________________ 210s 210s repo = 210s 210s def test_commit_tree(repo): 210s # Construct a repository with an initial commit on the master branch so 210s # that we can verify later parentage and lack of branch movement 210s parent_commit_oid = Repo( 210s commits=[Commit(name='master')], 210s branches={'master': Placeholder('master')} 210s ).write(repo.raw_repo) 210s repo.raw_repo.lookup_reference('HEAD').set_target('refs/heads/master') 210s 210s # Construct a tree inside the repository with a debian/changelog in it to 210s # feed to the method under test 210s test_changelog_path = os.path.join( 210s pkg_resources.resource_filename('gitubuntu', 'changelog_tests'), 210s 'test_date_1', 210s ) 210s with open(test_changelog_path, 'rb') as f: 210s test_changelog_bytes = f.read() 210s test_changelog_blob = Blob(test_changelog_bytes) 210s source_tree = Tree({'debian': Tree({'changelog': test_changelog_blob})}) 210s source_tree_oid = source_tree.write(repo.raw_repo) 210s 210s # Call the method under test 210s > commit_oid = repo.commit_source_tree( 210s tree=source_tree_oid, 210s parents=[parent_commit_oid], 210s log_message='test_commit_msg', 210s commit_date=datetime.datetime( 210s 1971, # year 210s 2, # month 210s 3, # day 210s 4, # hours 210s 5, # minutes 210s 6, # seconds 210s 7, # milliseconds (this should get truncated down to 0) 210s datetime.timezone(datetime.timedelta(hours=-8)) 210s ), 210s ) 210s 210s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository_test.py:993: 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:2299: in commit_source_tree 210s changelog = self.get_changelog_from_treeish(str(tree)) 210s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 210s return Changelog.from_treeish( 210s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:569: in from_treeish 210s blob = follow_symlinks_to_blob( 210s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 210s return _follow_symlinks_to_blob( 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s 210s repo = pygit2.Repository('/tmp/tmpw0fpg2yc/.git/') 210s top_tree_object = 210s search_path = 'debian/changelog' 210s _rel_tree = 210s _rel_path = '' 210s 210s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 210s _rel_tree=None, _rel_path='' 210s ): 210s '''Recursively follow a path down a tree, following symlinks, to find blob 210s 210s repo: pygit2.Repository object 210s top_tree: pygit2.Tree object of the top of the tree structure 210s search_path: '/'-separated path string of blob to find 210s _rel_tree: (internal) which tree to look further into 210s _rel_path: (internal) the path we are in so far 210s ''' 210s 210s NORMAL_BLOB_MODES = set([ 210s pygit2.GIT_FILEMODE_BLOB, 210s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 210s ]) 210s 210s _rel_tree = _rel_tree or top_tree_object 210s head, tail = posixpath.split(search_path) 210s 210s # A traditional functional split would put a single entry in head with tail 210s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 210s # to make it appear to have traditional semantics. 210s if not head: 210s head = tail 210s tail = None 210s 210s entry = _rel_tree[head] 210s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 210s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 210s 210s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:68: AttributeError 210s _____________________ test_descendant_of[root-root-False] ______________________ 210s 210s pygit2_repo = pygit2.Repository('/tmp/tmp5bjryzbf/.git/'), a = 'root' 210s b = 'root', expected = False 210s 210s @pytest.mark.parametrize(['a', 'b', 'expected'], 210s [ 210s ('root', 'root', False), 210s ('child1', 'root', True), 210s ('root', 'child1', False), 210s ('grandchild1', 'root', True), 210s ('child1', 'child2', False), 210s ('root', 'disjoint', False), 210s ] 210s ) 210s def test_descendant_of(pygit2_repo, a, b, expected): 210s """ 210s General test for pygit2.Repository.descendant_of(). 210s 210s This test was formerly for a temporary alternative implementation of 210s pygit2.Repository.descendant_of() in our GitUbuntuRepository wrapper for 210s use until we updated our pinning to use a newer version of pygit2 that 210s included the pygit2.Repository.descendant_of() method. After the pinning 210s was removed and this implementation replacement took place, we kept the 210s test to ensure that actual behaviour did not change. 210s 210s This unit tests validate_upload_tag() for various parameterized cases. The 210s paramater sets assume the repository structure encoded in the Repo() call 210s below. 210s 210s :param pygit2.Repository pygit2_repo: fixture providing a temporary 210s pygit2.Repository instance to use 210s :param str a: tag name of the first commit to pass to descendant_of() 210s :param str b: tag name of the second commit to pass to descendant_of() 210s :param bool expected: the expected result of descendant_of() 210s """ 210s Repo( 210s # Unique message parameters are used in each entry here in order to 210s # ensure that otherwise-identical commits do not end up being the same 210s # commit (with the same hash, etc). 210s commits=[ 210s Commit(name='root', message='1'), 210s Commit(name='child1', parents=[Placeholder('root')], message='2'), 210s Commit(name='child2', parents=[Placeholder('root')], message='3'), 210s Commit( 210s name='grandchild1', 210s parents=[Placeholder('child1')], 210s message='4' 210s ), 210s Commit(name='disjoint', message='5'), 210s ], 210s tags={ 210s 'root': Placeholder('root'), 210s 'child1': Placeholder('child1'), 210s 'child2': Placeholder('child2'), 210s 'grandchild1': Placeholder('grandchild1'), 210s 'disjoint': Placeholder('disjoint'), 210s } 210s > ).write(pygit2_repo) 210s 210s gitubuntu/git_repository_test.py:1099: 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s 210s self = 210s repo = pygit2.Repository('/tmp/tmp5bjryzbf/.git/'), record = {} 210s 210s def write(self, repo, record=None): 210s replace_placeholders(self) 210s record = record or dict() 210s written_commits = [ 210s commit.write(repo=repo, record=record) 210s for commit 210s in self.commit_list 210s ] 210s for name, target in self.branches.items(): 210s repo.create_branch( 210s name, 210s repo.get(target.write(repo)).peel(pygit2.Commit), 210s ) 210s for name, target in self.tags.items(): 210s repo.create_tag( 210s name, 210s target.write(repo), 210s > pygit2.GIT_OBJ_COMMIT, 210s self.tagger.signature, 210s 'Tag message', 210s ) 210s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 210s 210s gitubuntu/repo_builder.py:389: AttributeError 210s _____________________ test_descendant_of[child1-root-True] _____________________ 210s 210s pygit2_repo = pygit2.Repository('/tmp/tmp9ebk6eg9/.git/'), a = 'child1' 210s b = 'root', expected = True 210s 210s @pytest.mark.parametrize(['a', 'b', 'expected'], 210s [ 210s ('root', 'root', False), 210s ('child1', 'root', True), 210s ('root', 'child1', False), 210s ('grandchild1', 'root', True), 210s ('child1', 'child2', False), 210s ('root', 'disjoint', False), 210s ] 210s ) 210s def test_descendant_of(pygit2_repo, a, b, expected): 210s """ 210s General test for pygit2.Repository.descendant_of(). 210s 210s This test was formerly for a temporary alternative implementation of 210s pygit2.Repository.descendant_of() in our GitUbuntuRepository wrapper for 210s use until we updated our pinning to use a newer version of pygit2 that 210s included the pygit2.Repository.descendant_of() method. After the pinning 210s was removed and this implementation replacement took place, we kept the 210s test to ensure that actual behaviour did not change. 210s 210s This unit tests validate_upload_tag() for various parameterized cases. The 210s paramater sets assume the repository structure encoded in the Repo() call 210s below. 210s 210s :param pygit2.Repository pygit2_repo: fixture providing a temporary 210s pygit2.Repository instance to use 210s :param str a: tag name of the first commit to pass to descendant_of() 210s :param str b: tag name of the second commit to pass to descendant_of() 210s :param bool expected: the expected result of descendant_of() 210s """ 210s Repo( 210s # Unique message parameters are used in each entry here in order to 210s # ensure that otherwise-identical commits do not end up being the same 210s # commit (with the same hash, etc). 210s commits=[ 210s Commit(name='root', message='1'), 210s Commit(name='child1', parents=[Placeholder('root')], message='2'), 210s Commit(name='child2', parents=[Placeholder('root')], message='3'), 210s Commit( 210s name='grandchild1', 210s parents=[Placeholder('child1')], 210s message='4' 210s ), 210s Commit(name='disjoint', message='5'), 210s ], 210s tags={ 210s 'root': Placeholder('root'), 210s 'child1': Placeholder('child1'), 210s 'child2': Placeholder('child2'), 210s 'grandchild1': Placeholder('grandchild1'), 210s 'disjoint': Placeholder('disjoint'), 210s } 210s > ).write(pygit2_repo) 210s 210s gitubuntu/git_repository_test.py:1099: 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s 210s self = 210s repo = pygit2.Repository('/tmp/tmp9ebk6eg9/.git/'), record = {} 210s 210s def write(self, repo, record=None): 210s replace_placeholders(self) 210s record = record or dict() 210s written_commits = [ 210s commit.write(repo=repo, record=record) 210s for commit 210s in self.commit_list 210s ] 210s for name, target in self.branches.items(): 210s repo.create_branch( 210s name, 210s repo.get(target.write(repo)).peel(pygit2.Commit), 210s ) 210s for name, target in self.tags.items(): 210s repo.create_tag( 210s name, 210s target.write(repo), 210s > pygit2.GIT_OBJ_COMMIT, 210s self.tagger.signature, 210s 'Tag message', 210s ) 210s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 210s 210s gitubuntu/repo_builder.py:389: AttributeError 210s ____________________ test_descendant_of[root-child1-False] _____________________ 210s 210s pygit2_repo = pygit2.Repository('/tmp/tmpcutjwui4/.git/'), a = 'root' 210s b = 'child1', expected = False 210s 210s @pytest.mark.parametrize(['a', 'b', 'expected'], 210s [ 210s ('root', 'root', False), 210s ('child1', 'root', True), 210s ('root', 'child1', False), 210s ('grandchild1', 'root', True), 210s ('child1', 'child2', False), 210s ('root', 'disjoint', False), 210s ] 210s ) 210s def test_descendant_of(pygit2_repo, a, b, expected): 210s """ 210s General test for pygit2.Repository.descendant_of(). 210s 210s This test was formerly for a temporary alternative implementation of 210s pygit2.Repository.descendant_of() in our GitUbuntuRepository wrapper for 210s use until we updated our pinning to use a newer version of pygit2 that 210s included the pygit2.Repository.descendant_of() method. After the pinning 210s was removed and this implementation replacement took place, we kept the 210s test to ensure that actual behaviour did not change. 210s 210s This unit tests validate_upload_tag() for various parameterized cases. The 210s paramater sets assume the repository structure encoded in the Repo() call 210s below. 210s 210s :param pygit2.Repository pygit2_repo: fixture providing a temporary 210s pygit2.Repository instance to use 210s :param str a: tag name of the first commit to pass to descendant_of() 210s :param str b: tag name of the second commit to pass to descendant_of() 210s :param bool expected: the expected result of descendant_of() 210s """ 210s Repo( 210s # Unique message parameters are used in each entry here in order to 210s # ensure that otherwise-identical commits do not end up being the same 210s # commit (with the same hash, etc). 210s commits=[ 210s Commit(name='root', message='1'), 210s Commit(name='child1', parents=[Placeholder('root')], message='2'), 210s Commit(name='child2', parents=[Placeholder('root')], message='3'), 210s Commit( 210s name='grandchild1', 210s parents=[Placeholder('child1')], 210s message='4' 210s ), 210s Commit(name='disjoint', message='5'), 210s ], 210s tags={ 210s 'root': Placeholder('root'), 210s 'child1': Placeholder('child1'), 210s 'child2': Placeholder('child2'), 210s 'grandchild1': Placeholder('grandchild1'), 210s 'disjoint': Placeholder('disjoint'), 210s } 210s > ).write(pygit2_repo) 210s 210s gitubuntu/git_repository_test.py:1099: 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s 210s self = 210s repo = pygit2.Repository('/tmp/tmpcutjwui4/.git/'), record = {} 210s 210s def write(self, repo, record=None): 210s replace_placeholders(self) 210s record = record or dict() 210s written_commits = [ 210s commit.write(repo=repo, record=record) 210s for commit 210s in self.commit_list 210s ] 210s for name, target in self.branches.items(): 210s repo.create_branch( 210s name, 210s repo.get(target.write(repo)).peel(pygit2.Commit), 210s ) 210s for name, target in self.tags.items(): 210s repo.create_tag( 210s name, 210s target.write(repo), 210s > pygit2.GIT_OBJ_COMMIT, 210s self.tagger.signature, 210s 'Tag message', 210s ) 210s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 210s 210s gitubuntu/repo_builder.py:389: AttributeError 210s __________________ test_descendant_of[grandchild1-root-True] ___________________ 210s 210s pygit2_repo = pygit2.Repository('/tmp/tmpnb34bhmf/.git/'), a = 'grandchild1' 210s b = 'root', expected = True 210s 210s @pytest.mark.parametrize(['a', 'b', 'expected'], 210s [ 210s ('root', 'root', False), 210s ('child1', 'root', True), 210s ('root', 'child1', False), 210s ('grandchild1', 'root', True), 210s ('child1', 'child2', False), 210s ('root', 'disjoint', False), 210s ] 210s ) 210s def test_descendant_of(pygit2_repo, a, b, expected): 210s """ 210s General test for pygit2.Repository.descendant_of(). 210s 210s This test was formerly for a temporary alternative implementation of 210s pygit2.Repository.descendant_of() in our GitUbuntuRepository wrapper for 210s use until we updated our pinning to use a newer version of pygit2 that 210s included the pygit2.Repository.descendant_of() method. After the pinning 210s was removed and this implementation replacement took place, we kept the 210s test to ensure that actual behaviour did not change. 210s 210s This unit tests validate_upload_tag() for various parameterized cases. The 210s paramater sets assume the repository structure encoded in the Repo() call 210s below. 210s 210s :param pygit2.Repository pygit2_repo: fixture providing a temporary 210s pygit2.Repository instance to use 210s :param str a: tag name of the first commit to pass to descendant_of() 210s :param str b: tag name of the second commit to pass to descendant_of() 210s :param bool expected: the expected result of descendant_of() 210s """ 210s Repo( 210s # Unique message parameters are used in each entry here in order to 210s # ensure that otherwise-identical commits do not end up being the same 210s # commit (with the same hash, etc). 210s commits=[ 210s Commit(name='root', message='1'), 210s Commit(name='child1', parents=[Placeholder('root')], message='2'), 210s Commit(name='child2', parents=[Placeholder('root')], message='3'), 210s Commit( 210s name='grandchild1', 210s parents=[Placeholder('child1')], 210s message='4' 210s ), 210s Commit(name='disjoint', message='5'), 210s ], 210s tags={ 210s 'root': Placeholder('root'), 210s 'child1': Placeholder('child1'), 210s 'child2': Placeholder('child2'), 210s 'grandchild1': Placeholder('grandchild1'), 210s 'disjoint': Placeholder('disjoint'), 210s } 210s > ).write(pygit2_repo) 210s 210s gitubuntu/git_repository_test.py:1099: 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s 210s self = 210s repo = pygit2.Repository('/tmp/tmpnb34bhmf/.git/'), record = {} 210s 210s def write(self, repo, record=None): 210s replace_placeholders(self) 210s record = record or dict() 210s written_commits = [ 210s commit.write(repo=repo, record=record) 210s for commit 210s in self.commit_list 210s ] 210s for name, target in self.branches.items(): 210s repo.create_branch( 210s name, 210s repo.get(target.write(repo)).peel(pygit2.Commit), 210s ) 210s for name, target in self.tags.items(): 210s repo.create_tag( 210s name, 210s target.write(repo), 210s > pygit2.GIT_OBJ_COMMIT, 210s self.tagger.signature, 210s 'Tag message', 210s ) 210s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 210s 210s gitubuntu/repo_builder.py:389: AttributeError 210s ___________________ test_descendant_of[child1-child2-False] ____________________ 210s 210s pygit2_repo = pygit2.Repository('/tmp/tmpk03vs_kg/.git/'), a = 'child1' 210s b = 'child2', expected = False 210s 210s @pytest.mark.parametrize(['a', 'b', 'expected'], 210s [ 210s ('root', 'root', False), 210s ('child1', 'root', True), 210s ('root', 'child1', False), 210s ('grandchild1', 'root', True), 210s ('child1', 'child2', False), 210s ('root', 'disjoint', False), 210s ] 210s ) 210s def test_descendant_of(pygit2_repo, a, b, expected): 210s """ 210s General test for pygit2.Repository.descendant_of(). 210s 210s This test was formerly for a temporary alternative implementation of 210s pygit2.Repository.descendant_of() in our GitUbuntuRepository wrapper for 210s use until we updated our pinning to use a newer version of pygit2 that 210s included the pygit2.Repository.descendant_of() method. After the pinning 210s was removed and this implementation replacement took place, we kept the 210s test to ensure that actual behaviour did not change. 210s 210s This unit tests validate_upload_tag() for various parameterized cases. The 210s paramater sets assume the repository structure encoded in the Repo() call 210s below. 210s 210s :param pygit2.Repository pygit2_repo: fixture providing a temporary 210s pygit2.Repository instance to use 210s :param str a: tag name of the first commit to pass to descendant_of() 210s :param str b: tag name of the second commit to pass to descendant_of() 210s :param bool expected: the expected result of descendant_of() 210s """ 210s Repo( 210s # Unique message parameters are used in each entry here in order to 210s # ensure that otherwise-identical commits do not end up being the same 210s # commit (with the same hash, etc). 210s commits=[ 210s Commit(name='root', message='1'), 210s Commit(name='child1', parents=[Placeholder('root')], message='2'), 210s Commit(name='child2', parents=[Placeholder('root')], message='3'), 210s Commit( 210s name='grandchild1', 210s parents=[Placeholder('child1')], 210s message='4' 210s ), 210s Commit(name='disjoint', message='5'), 210s ], 210s tags={ 210s 'root': Placeholder('root'), 210s 'child1': Placeholder('child1'), 210s 'child2': Placeholder('child2'), 210s 'grandchild1': Placeholder('grandchild1'), 210s 'disjoint': Placeholder('disjoint'), 210s } 210s > ).write(pygit2_repo) 210s 210s gitubuntu/git_repository_test.py:1099: 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s 210s self = 210s repo = pygit2.Repository('/tmp/tmpk03vs_kg/.git/'), record = {} 210s 210s def write(self, repo, record=None): 210s replace_placeholders(self) 210s record = record or dict() 210s written_commits = [ 210s commit.write(repo=repo, record=record) 210s for commit 210s in self.commit_list 210s ] 210s for name, target in self.branches.items(): 210s repo.create_branch( 210s name, 210s repo.get(target.write(repo)).peel(pygit2.Commit), 210s ) 210s for name, target in self.tags.items(): 210s repo.create_tag( 210s name, 210s target.write(repo), 210s > pygit2.GIT_OBJ_COMMIT, 210s self.tagger.signature, 210s 'Tag message', 210s ) 210s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 210s 210s gitubuntu/repo_builder.py:389: AttributeError 210s ___________________ test_descendant_of[root-disjoint-False] ____________________ 210s 210s pygit2_repo = pygit2.Repository('/tmp/tmpjmcjs1qz/.git/'), a = 'root' 210s b = 'disjoint', expected = False 210s 210s @pytest.mark.parametrize(['a', 'b', 'expected'], 210s [ 210s ('root', 'root', False), 210s ('child1', 'root', True), 210s ('root', 'child1', False), 210s ('grandchild1', 'root', True), 210s ('child1', 'child2', False), 210s ('root', 'disjoint', False), 210s ] 210s ) 210s def test_descendant_of(pygit2_repo, a, b, expected): 210s """ 210s General test for pygit2.Repository.descendant_of(). 210s 210s This test was formerly for a temporary alternative implementation of 210s pygit2.Repository.descendant_of() in our GitUbuntuRepository wrapper for 210s use until we updated our pinning to use a newer version of pygit2 that 210s included the pygit2.Repository.descendant_of() method. After the pinning 210s was removed and this implementation replacement took place, we kept the 210s test to ensure that actual behaviour did not change. 210s 210s This unit tests validate_upload_tag() for various parameterized cases. The 210s paramater sets assume the repository structure encoded in the Repo() call 210s below. 210s 210s :param pygit2.Repository pygit2_repo: fixture providing a temporary 210s pygit2.Repository instance to use 210s :param str a: tag name of the first commit to pass to descendant_of() 210s :param str b: tag name of the second commit to pass to descendant_of() 210s :param bool expected: the expected result of descendant_of() 210s """ 210s Repo( 210s # Unique message parameters are used in each entry here in order to 210s # ensure that otherwise-identical commits do not end up being the same 210s # commit (with the same hash, etc). 210s commits=[ 210s Commit(name='root', message='1'), 210s Commit(name='child1', parents=[Placeholder('root')], message='2'), 210s Commit(name='child2', parents=[Placeholder('root')], message='3'), 210s Commit( 210s name='grandchild1', 210s parents=[Placeholder('child1')], 210s message='4' 210s ), 210s Commit(name='disjoint', message='5'), 210s ], 210s tags={ 210s 'root': Placeholder('root'), 210s 'child1': Placeholder('child1'), 210s 'child2': Placeholder('child2'), 210s 'grandchild1': Placeholder('grandchild1'), 210s 'disjoint': Placeholder('disjoint'), 210s } 210s > ).write(pygit2_repo) 210s 210s gitubuntu/git_repository_test.py:1099: 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s 210s self = 210s repo = pygit2.Repository('/tmp/tmpjmcjs1qz/.git/'), record = {} 210s 210s def write(self, repo, record=None): 210s replace_placeholders(self) 210s record = record or dict() 210s written_commits = [ 210s commit.write(repo=repo, record=record) 210s for commit 210s in self.commit_list 210s ] 210s for name, target in self.branches.items(): 210s repo.create_branch( 210s name, 210s repo.get(target.write(repo)).peel(pygit2.Commit), 210s ) 210s for name, target in self.tags.items(): 210s repo.create_tag( 210s name, 210s target.write(repo), 210s > pygit2.GIT_OBJ_COMMIT, 210s self.tagger.signature, 210s 'Tag message', 210s ) 210s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 210s 210s gitubuntu/repo_builder.py:389: AttributeError 210s _______________________________ test_create_tag ________________________________ 210s 210s repo = 210s 210s def test_create_tag(repo): 210s """create_tag() should create a tag 210s 210s :param GitUbuntuRepository repo: fixture providing a temporary 210s GitUbuntuRepository instance to use 210s """ 210s Repo( 210s commits=[Commit(name='root')], 210s tags={'root': Placeholder('root')}, 210s > ).write(repo.raw_repo) 210s 210s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository_test.py:1127: 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s 210s self = 210s repo = pygit2.Repository('/tmp/tmpvt9b9alj/.git/'), record = {} 210s 210s def write(self, repo, record=None): 210s replace_placeholders(self) 210s record = record or dict() 210s written_commits = [ 210s commit.write(repo=repo, record=record) 210s for commit 210s in self.commit_list 210s ] 210s for name, target in self.branches.items(): 210s repo.create_branch( 210s name, 210s repo.get(target.write(repo)).peel(pygit2.Commit), 210s ) 210s for name, target in self.tags.items(): 210s repo.create_tag( 210s name, 210s target.write(repo), 210s > pygit2.GIT_OBJ_COMMIT, 210s self.tagger.signature, 210s 'Tag message', 210s ) 210s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 210s 210s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 210s __________________________ test_get_all_reimport_tags __________________________ 210s 210s repo = 210s 210s def test_get_all_reimport_tags(repo): 210s """get_all_reimport_tags() should return only matching reimport tags 210s 210s :param GitUbuntuRepository repo: fixture providing a temporary 210s GitUbuntuRepository instance to use 210s """ 210s Repo( 210s commits=[Commit(name='root')], 210s tags={ 210s 'importer/reimport/import/1/0': Placeholder('root'), 210s 'importer/reimport/import/1/1': Placeholder('root'), 210s 210s # This entry must not be identified as one of version 1's reimport 210s # tags, even though it shares the same base prefix. 210s 'importer/reimport/import/11/0': Placeholder('root'), 210s }, 210s > ).write(repo.raw_repo) 210s 210s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository_test.py:1165: 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s 210s self = 210s repo = pygit2.Repository('/tmp/tmp5gqcdwuo/.git/'), record = {} 210s 210s def write(self, repo, record=None): 210s replace_placeholders(self) 210s record = record or dict() 210s written_commits = [ 210s commit.write(repo=repo, record=record) 210s for commit 210s in self.commit_list 210s ] 210s for name, target in self.branches.items(): 210s repo.create_branch( 210s name, 210s repo.get(target.write(repo)).peel(pygit2.Commit), 210s ) 210s for name, target in self.tags.items(): 210s repo.create_tag( 210s name, 210s target.write(repo), 210s > pygit2.GIT_OBJ_COMMIT, 210s self.tagger.signature, 210s 'Tag message', 210s ) 210s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 210s 210s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 210s ______________________________ test_get_head_info ______________________________ 210s 210s repo = 210s 210s def test_get_head_info(repo): 210s """get_head_info() extracts expected commit and version info from the head 210s commit 210s """ 210s Repo( 210s commits=[ 210s Commit(name='foo', tree=SourceTree(source=Source())), 210s ], 210s branches={ 210s 'importer/ubuntu/foo': Placeholder('foo'), 210s 'importer/debian/bar': Placeholder('foo'), 210s 'other/ubuntu/baz': Placeholder('foo'), 210s }, 210s ).write(repo.raw_repo) 210s foo_commit_id = ( 210s repo.raw_repo 210s .lookup_reference('refs/heads/importer/ubuntu/foo') 210s .peel(pygit2.Commit).id 210s ) 210s > assert repo.get_head_info('ubuntu', 'importer') == { 210s 'importer/ubuntu/foo': HeadInfoItem( 210s version='1-1', 210s commit_time=0, 210s commit_id=foo_commit_id, 210s ), 210s } 210s 210s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository_test.py:1193: 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:1952: in get_head_info 210s self.get_changelog_versions_from_treeish(str(head.peel().id)) 210s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:1888: in get_changelog_versions_from_treeish 210s changelog = self.get_changelog_from_treeish(treeish_string) 210s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 210s return Changelog.from_treeish( 210s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:569: in from_treeish 210s blob = follow_symlinks_to_blob( 210s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 210s return _follow_symlinks_to_blob( 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s 210s repo = pygit2.Repository('/tmp/tmpx907n3fq/.git/') 210s top_tree_object = 210s search_path = 'debian/changelog' 210s _rel_tree = 210s _rel_path = '' 210s 210s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 210s _rel_tree=None, _rel_path='' 210s ): 210s '''Recursively follow a path down a tree, following symlinks, to find blob 210s 210s repo: pygit2.Repository object 210s top_tree: pygit2.Tree object of the top of the tree structure 210s search_path: '/'-separated path string of blob to find 210s _rel_tree: (internal) which tree to look further into 210s _rel_path: (internal) the path we are in so far 210s ''' 210s 210s NORMAL_BLOB_MODES = set([ 210s pygit2.GIT_FILEMODE_BLOB, 210s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 210s ]) 210s 210s _rel_tree = _rel_tree or top_tree_object 210s head, tail = posixpath.split(search_path) 210s 210s # A traditional functional split would put a single entry in head with tail 210s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 210s # to make it appear to have traditional semantics. 210s if not head: 210s head = tail 210s tail = None 210s 210s entry = _rel_tree[head] 210s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 210s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 210s 210s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:68: AttributeError 210s ----------------------------- Captured stdout call ----------------------------- 210s dpkg-source: info: using source format '3.0 (quilt)' 210s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 210s dpkg-source: info: using source format '3.0 (quilt)' 210s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 210s dpkg-source: info: using source format '3.0 (quilt)' 210s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 210s dpkg-source: info: using source format '3.0 (quilt)' 210s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 210s ----------------------------- Captured stderr call ----------------------------- 210s dpkg-source: warning: missing information for output field Standards-Version 210s dpkg-source: warning: missing information for output field Standards-Version 210s dpkg-source: warning: missing information for output field Standards-Version 210s dpkg-source: warning: missing information for output field Standards-Version 210s _ test_import_unapplied_spi_tags[input_repo0-expected_output_refs0-validation_repo_delta0-validation_repo_expected_identical_refs0-True] _ 210s 210s get_import_commit_msg_mock = 210s get_import_tag_msg_mock = 210s repo = 210s input_repo = 210s expected_output_refs = ['refs/heads/do-not-push', 'refs/tags/importer/upstream/ubuntu/1.gz', 'refs/heads/importer/importer/ubuntu/dsc', 'refs/heads/importer/importer/ubuntu/pristine-tar'] 210s validation_repo_delta = {'update_branches': {'importer/ubuntu/trusty': }} 210s validation_repo_expected_identical_refs = ['refs/heads/importer/ubuntu/trusty-proposed', 'refs/heads/importer/ubuntu/trusty', 'refs/tags/importer/import/1-1'] 210s reuse = True 210s 210s @pytest.mark.parametrize( 210s [ 210s 'input_repo', 210s 'expected_output_refs', 210s 'validation_repo_delta', 210s 'validation_repo_expected_identical_refs', 210s 'reuse', 210s ], 210s [ 210s # 1) An existing import tag (or reimport tag) with the same Git tree 210s # - Reuse import tag 210s pytest.param( 210s # input_repo: 210s repo_builder.Repo( 210s commits=[Commit.from_spec(name='import')], 210s branches={ 210s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 210s }, 210s tags={'importer/import/1-1': Placeholder('import')}, 210s ), 210s # expected_output_refs: 210s [ 210s 'refs/heads/do-not-push', 210s 'refs/tags/importer/upstream/ubuntu/1.gz', 210s 'refs/heads/importer/importer/ubuntu/dsc', 210s 'refs/heads/importer/importer/ubuntu/pristine-tar', 210s ], 210s # validation_repo_delta: 210s { 210s 'update_branches': { 210s 'importer/ubuntu/trusty': Placeholder('import'), 210s }, 210s }, 210s # validation_repo_expected_identical_refs: 210s [ 210s 'refs/heads/importer/ubuntu/trusty-proposed', 210s 'refs/heads/importer/ubuntu/trusty', 210s 'refs/tags/importer/import/1-1', 210s ], 210s # reuse: 210s True, 210s ), 210s pytest.param( 210s # input_repo: 210s repo_builder.Repo( 210s commits=[ 210s Commit.from_spec( 210s name='import', 210s mutate='import tag contents', 210s ), 210s Commit.from_spec(name='reimport'), 210s ], 210s branches={ 210s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 210s }, 210s tags={ 210s 'importer/import/1-1': Placeholder('import'), 210s 'importer/reimport/import/1-1/0': Placeholder('import'), 210s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 210s }, 210s ), 210s # expected_output_refs: 210s [ 210s 'refs/heads/do-not-push', 210s 'refs/tags/importer/upstream/ubuntu/1.gz', 210s 'refs/heads/importer/importer/ubuntu/dsc', 210s 'refs/heads/importer/importer/ubuntu/pristine-tar', 210s ], 210s # validation_repo_delta: 210s { 210s 'update_branches': { 210s 'importer/ubuntu/trusty': Placeholder('reimport'), 210s }, 210s }, 210s # validation_repo_expected_identical_refs: 210s [ 210s 'refs/heads/importer/ubuntu/trusty-proposed', 210s 'refs/heads/importer/ubuntu/trusty', 210s 'refs/tags/importer/import/1-1', 210s 'refs/tags/importer/reimport/import/1-1/0', 210s 'refs/tags/importer/reimport/import/1-1/1', 210s ], 210s # reuse: 210s True, 210s ), 210s 210s # 2) An existing import tag with a different Git tree and an existing 210s # upload tag with the same Git tree 210s # - Reuse upload tag, create reimport tag 210s pytest.param( 210s # input_repo: 210s repo_builder.Repo( 210s commits=[ 210s Commit.from_spec( 210s name='import', 210s mutate='The import tag contents', 210s ), 210s Commit.from_spec(name='upload'), 210s ], 210s branches={ 210s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 210s }, 210s tags={ 210s 'importer/import/1-1': Placeholder('import'), 210s 'importer/upload/1-1': Placeholder('upload'), 210s }, 210s ), 210s # expected_output_refs: 210s [ 210s 'refs/heads/do-not-push', 210s 'refs/tags/importer/upstream/ubuntu/1.gz', 210s 'refs/heads/importer/importer/ubuntu/dsc', 210s 'refs/heads/importer/importer/ubuntu/pristine-tar', 210s 'refs/notes/importer/importer', 210s ], 210s # validation_repo_delta: 210s { 210s 'update_tags': { 210s 'importer/reimport/import/1-1/0': Placeholder('import'), 210s 'importer/reimport/import/1-1/1': Placeholder('upload'), 210s }, 210s 'update_branches': { 210s 'importer/ubuntu/trusty': Placeholder('upload'), 210s }, 210s }, 210s # validation_repo_expected_identical_refs: 210s [ 210s 'refs/heads/importer/ubuntu/trusty-proposed', 210s 'refs/heads/importer/ubuntu/trusty', 210s 'refs/tags/importer/import/1-1', 210s 'refs/tags/importer/upload/1-1', 210s 'refs/tags/importer/reimport/import/1-1/0', 210s 'refs/tags/importer/reimport/import/1-1/1', 210s ], 210s # reuse: 210s True, 210s ), 210s 210s # 3) An existing import tag with a different Git tree and an existing 210s # upload tag with a different Git tree 210s # - Create reimport tag 210s pytest.param( 210s # input_repo: 210s repo_builder.Repo( 210s commits=[ 210s Commit.from_spec( 210s name='import', 210s mutate='The import tag contents', 210s ), 210s Commit.from_spec( 210s name='upload', 210s mutate='The upload tag contents', 210s ), 210s ], 210s branches={ 210s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 210s }, 210s tags={ 210s 'importer/import/1-1': Placeholder('import'), 210s 'importer/upload/1-1': Placeholder('upload'), 210s }, 210s ), 210s # expected_output_refs: 210s [ 210s 'refs/heads/do-not-push', 210s 'refs/tags/importer/upstream/ubuntu/1.gz', 210s 'refs/heads/importer/importer/ubuntu/dsc', 210s 'refs/heads/importer/importer/ubuntu/pristine-tar', 210s 'refs/notes/importer/changelog', 210s 'refs/notes/importer/importer', 210s ], 210s # validation_repo_delta: 210s { 210s 'add_commits': [Commit.from_spec( 210s name='reimport', 210s message='Test commit (new)', 210s )], 210s 'update_tags': { 210s 'importer/reimport/import/1-1/0': Placeholder('import'), 210s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 210s }, 210s 'update_branches': { 210s 'importer/ubuntu/trusty': Placeholder('reimport'), 210s }, 210s }, 210s # validation_repo_expected_identical_refs: 210s [ 210s 'refs/heads/importer/ubuntu/trusty-proposed', 210s 'refs/heads/importer/ubuntu/trusty', 210s 'refs/tags/importer/import/1-1', 210s 'refs/tags/importer/upload/1-1', 210s 'refs/tags/importer/reimport/import/1-1/0', 210s 'refs/tags/importer/reimport/import/1-1/1', 210s ], 210s # reuse: 210s False, 210s ), 210s 210s # 4) An existing import tag with a different Git tree and no upload tag 210s # - Create reimport tag 210s pytest.param( 210s # input_repo: 210s repo_builder.Repo( 210s commits=[ 210s Commit.from_spec( 210s name='import', 210s mutate='The import tag contents', 210s ), 210s ], 210s branches={ 210s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 210s }, 210s tags={'importer/import/1-1': Placeholder('import')}, 210s ), 210s # expected_output_refs: 210s [ 210s 'refs/heads/do-not-push', 210s 'refs/tags/importer/upstream/ubuntu/1.gz', 210s 'refs/heads/importer/importer/ubuntu/dsc', 210s 'refs/heads/importer/importer/ubuntu/pristine-tar', 210s 'refs/notes/importer/changelog', 210s 'refs/notes/importer/importer', 210s ], 210s # validation_repo_delta: 210s { 210s 'add_commits': [Commit.from_spec( 210s name='reimport', 210s message='Test commit (new)', 210s )], 210s 'update_tags': { 210s 'importer/reimport/import/1-1/0': Placeholder('import'), 210s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 210s }, 210s 'update_branches': { 210s 'importer/ubuntu/trusty': Placeholder('reimport'), 210s }, 210s }, 210s # validation_repo_expected_identical_refs: 210s [ 210s 'refs/heads/importer/ubuntu/trusty-proposed', 210s 'refs/heads/importer/ubuntu/trusty', 210s 'refs/tags/importer/import/1-1', 210s 'refs/tags/importer/reimport/import/1-1/0', 210s 'refs/tags/importer/reimport/import/1-1/1', 210s ], 210s # reuse: 210s False, 210s ), 210s 210s # 5) No import tag and an existing upload tag with the same Git tree 210s # - Reuse upload tag, create import tag 210s pytest.param( 210s # input_repo: 210s repo_builder.Repo( 210s commits=[Commit.from_spec(name='upload')], 210s tags={'importer/upload/1-1': Placeholder('upload')}, 210s ), 210s # expected_output_refs: 210s [ 210s 'refs/heads/do-not-push', 210s 'refs/tags/importer/upstream/ubuntu/1.gz', 210s 'refs/heads/importer/importer/ubuntu/dsc', 210s 'refs/heads/importer/importer/ubuntu/pristine-tar', 210s 'refs/notes/importer/importer', 210s ], 210s # validation_repo_delta: 210s { 210s 'update_tags': { 210s 'importer/import/1-1': Placeholder('upload'), 210s }, 210s 'update_branches': { 210s 'importer/ubuntu/trusty': Placeholder('upload'), 210s }, 210s }, 210s # validation_repo_expected_identical_refs: 210s [ 210s 'refs/heads/importer/ubuntu/trusty', 210s 'refs/tags/importer/import/1-1', 210s 'refs/tags/importer/upload/1-1', 210s ], 210s # reuse: 210s True, 210s ), 210s 210s # 6) No import tag and an existing upload tag with a different Git tree 210s # - Create import tag 210s pytest.param( 210s # input_repo: 210s repo_builder.Repo( 210s commits=[ 210s Commit.from_spec( 210s name='upload', 210s mutate='The upload tag contents', 210s ), 210s ], 210s tags={'importer/upload/1-1': Placeholder('upload')}, 210s ), 210s # expected_output_refs: 210s [ 210s 'refs/heads/do-not-push', 210s 'refs/tags/importer/upstream/ubuntu/1.gz', 210s 'refs/heads/importer/importer/ubuntu/dsc', 210s 'refs/heads/importer/importer/ubuntu/pristine-tar', 210s 'refs/notes/importer/changelog', 210s 'refs/notes/importer/importer', 210s ], 210s # validation_repo_delta: 210s { 210s 'add_commits': [ 210s Commit.from_spec( 210s name='publish', 210s message='Test commit (new)', 210s ), 210s ], 210s 'update_tags': { 210s 'importer/import/1-1': Placeholder('publish'), 210s }, 210s 'update_branches': { 210s 'importer/ubuntu/trusty': Placeholder('publish'), 210s }, 210s }, 210s # validation_repo_expected_identical_refs: 210s [ 210s 'refs/heads/importer/ubuntu/trusty', 210s 'refs/tags/importer/import/1-1', 210s 'refs/tags/importer/upload/1-1', 210s ], 210s # reuse: 210s False, 210s ), 210s 210s # 7) No import tags or upload tags 210s # - Create import tag 210s pytest.param( 210s # input_repo: 210s repo_builder.Repo(), 210s # expected_output_refs: 210s [ 210s 'refs/heads/do-not-push', 210s 'refs/tags/importer/upstream/ubuntu/1.gz', 210s 'refs/heads/importer/importer/ubuntu/dsc', 210s 'refs/heads/importer/importer/ubuntu/pristine-tar', 210s 'refs/notes/importer/changelog', 210s 'refs/notes/importer/importer', 210s ], 210s # validation_repo_delta: 210s { 210s 'add_commits': [ 210s Commit.from_spec( 210s name='publish', 210s message='Test commit (new)', 210s ), 210s ], 210s 'update_tags': { 210s 'importer/import/1-1': Placeholder('publish'), 210s }, 210s 'update_branches': { 210s 'importer/ubuntu/trusty': Placeholder('publish'), 210s }, 210s }, 210s # validation_repo_expected_identical_refs: 210s [ 210s 'refs/heads/importer/ubuntu/trusty', 210s 'refs/tags/importer/import/1-1' 210s ], 210s # reuse: 210s False, 210s ), 210s ] 210s ) 210s @patch('gitubuntu.importer.get_import_tag_msg') 210s @patch('gitubuntu.importer.get_import_commit_msg') 210s def test_import_unapplied_spi_tags( 210s get_import_commit_msg_mock, 210s get_import_tag_msg_mock, 210s repo, 210s input_repo, 210s expected_output_refs, 210s validation_repo_delta, 210s validation_repo_expected_identical_refs, 210s reuse, 210s ): 210s """Test that unapplied tags are correctly created, adjusted and/or reused 210s 210s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 210s that determines the commit message to use for a given import 210s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 210s that determines the tag message to use for a given import 210s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 210s temporary output repository 210s :param repo_builder.Repo input_repo: input repository data 210s :param list(str) expected_output_refs: refs that must exist in the output 210s repository 210s :param dict validation_repo_delta: how to transform the input 210s repository into a "validation repository", expressed as a dict to 210s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 210s input repository. The validation repository is then used for the 210s purposes of comparison against the output repository. 210s :param list(str) validation_repo_expected_identical_refs: refs that must be 210s identical between the validation repository and the output repository 210s :param bool reuse: if set, the output ref importer/ubuntu/trusty must be 210s one supplied by the input repository (assumed to have a commit message 210s of "Test commit") and not one created by the importer in this run 210s (arranged by this test to have a different commit message) 210s 210s The input repository data is written into the output repository and then a 210s fake non-native source package publication of version 1-1 in the Trusty 210s release pocket is imported into it by calling import_unapplied_spi() 210s directly. expected_output_refs, validation_repo_expected_identical_refs and 210s reuse are then asserted. It is further asserted that no other refs exist in 210s the output repository except for those listed in expected_output_refs and 210s validation_repo_expected_identical_refs. 210s """ 210s # Match the repo_builder objects 210s get_import_tag_msg_mock.return_value = 'Test tag' 210s # Importantly, the following commit message must not be the same as the 210s # commit messages used by the test input repository commits, so that we can 210s # later detect the difference between commits that were already there and 210s # new commits created by the importer for the purposes of asserting the 210s # reuse parameter correctly. 210s get_import_commit_msg_mock.return_value = b'Test commit (new)' 210s 210s > input_repo.write(repo.raw_repo) 210s 210s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_tag_test.py:463: 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s 210s self = 210s repo = pygit2.Repository('/tmp/tmpxewpq25v/.git/'), record = {} 210s 210s def write(self, repo, record=None): 210s replace_placeholders(self) 210s record = record or dict() 210s written_commits = [ 210s commit.write(repo=repo, record=record) 210s for commit 210s in self.commit_list 210s ] 210s for name, target in self.branches.items(): 210s repo.create_branch( 210s name, 210s repo.get(target.write(repo)).peel(pygit2.Commit), 210s ) 210s for name, target in self.tags.items(): 210s repo.create_tag( 210s name, 210s target.write(repo), 210s > pygit2.GIT_OBJ_COMMIT, 210s self.tagger.signature, 210s 'Tag message', 210s ) 210s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 210s 210s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 210s ----------------------------- Captured stdout call ----------------------------- 210s dpkg-source: info: using source format '3.0 (quilt)' 210s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 210s dpkg-source: info: using source format '3.0 (quilt)' 210s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 210s dpkg-source: info: using source format '3.0 (quilt)' 210s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 210s ----------------------------- Captured stderr call ----------------------------- 210s dpkg-source: warning: missing information for output field Standards-Version 210s dpkg-source: warning: missing information for output field Standards-Version 210s dpkg-source: warning: missing information for output field Standards-Version 210s _ test_import_unapplied_spi_tags[input_repo1-expected_output_refs1-validation_repo_delta1-validation_repo_expected_identical_refs1-True] _ 210s 210s get_import_commit_msg_mock = 210s get_import_tag_msg_mock = 210s repo = 210s input_repo = 210s expected_output_refs = ['refs/heads/do-not-push', 'refs/tags/importer/upstream/ubuntu/1.gz', 'refs/heads/importer/importer/ubuntu/dsc', 'refs/heads/importer/importer/ubuntu/pristine-tar'] 210s validation_repo_delta = {'update_branches': {'importer/ubuntu/trusty': }} 210s validation_repo_expected_identical_refs = ['refs/heads/importer/ubuntu/trusty-proposed', 'refs/heads/importer/ubuntu/trusty', 'refs/tags/importer/import/1-1', 'refs/tags/importer/reimport/import/1-1/0', 'refs/tags/importer/reimport/import/1-1/1'] 210s reuse = True 210s 210s @pytest.mark.parametrize( 210s [ 210s 'input_repo', 210s 'expected_output_refs', 210s 'validation_repo_delta', 210s 'validation_repo_expected_identical_refs', 210s 'reuse', 210s ], 210s [ 210s # 1) An existing import tag (or reimport tag) with the same Git tree 210s # - Reuse import tag 210s pytest.param( 210s # input_repo: 210s repo_builder.Repo( 210s commits=[Commit.from_spec(name='import')], 210s branches={ 210s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 210s }, 210s tags={'importer/import/1-1': Placeholder('import')}, 210s ), 210s # expected_output_refs: 210s [ 210s 'refs/heads/do-not-push', 210s 'refs/tags/importer/upstream/ubuntu/1.gz', 210s 'refs/heads/importer/importer/ubuntu/dsc', 210s 'refs/heads/importer/importer/ubuntu/pristine-tar', 210s ], 210s # validation_repo_delta: 210s { 210s 'update_branches': { 210s 'importer/ubuntu/trusty': Placeholder('import'), 210s }, 210s }, 210s # validation_repo_expected_identical_refs: 210s [ 210s 'refs/heads/importer/ubuntu/trusty-proposed', 210s 'refs/heads/importer/ubuntu/trusty', 210s 'refs/tags/importer/import/1-1', 210s ], 210s # reuse: 210s True, 210s ), 210s pytest.param( 210s # input_repo: 210s repo_builder.Repo( 210s commits=[ 210s Commit.from_spec( 210s name='import', 210s mutate='import tag contents', 210s ), 210s Commit.from_spec(name='reimport'), 210s ], 210s branches={ 210s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 210s }, 210s tags={ 210s 'importer/import/1-1': Placeholder('import'), 210s 'importer/reimport/import/1-1/0': Placeholder('import'), 210s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 210s }, 210s ), 210s # expected_output_refs: 210s [ 210s 'refs/heads/do-not-push', 210s 'refs/tags/importer/upstream/ubuntu/1.gz', 210s 'refs/heads/importer/importer/ubuntu/dsc', 210s 'refs/heads/importer/importer/ubuntu/pristine-tar', 210s ], 210s # validation_repo_delta: 210s { 210s 'update_branches': { 210s 'importer/ubuntu/trusty': Placeholder('reimport'), 210s }, 210s }, 210s # validation_repo_expected_identical_refs: 210s [ 210s 'refs/heads/importer/ubuntu/trusty-proposed', 210s 'refs/heads/importer/ubuntu/trusty', 210s 'refs/tags/importer/import/1-1', 210s 'refs/tags/importer/reimport/import/1-1/0', 210s 'refs/tags/importer/reimport/import/1-1/1', 210s ], 210s # reuse: 210s True, 210s ), 210s 210s # 2) An existing import tag with a different Git tree and an existing 210s # upload tag with the same Git tree 210s # - Reuse upload tag, create reimport tag 210s pytest.param( 210s # input_repo: 210s repo_builder.Repo( 210s commits=[ 210s Commit.from_spec( 210s name='import', 210s mutate='The import tag contents', 210s ), 210s Commit.from_spec(name='upload'), 210s ], 210s branches={ 210s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 210s }, 210s tags={ 210s 'importer/import/1-1': Placeholder('import'), 210s 'importer/upload/1-1': Placeholder('upload'), 210s }, 210s ), 210s # expected_output_refs: 210s [ 210s 'refs/heads/do-not-push', 210s 'refs/tags/importer/upstream/ubuntu/1.gz', 210s 'refs/heads/importer/importer/ubuntu/dsc', 210s 'refs/heads/importer/importer/ubuntu/pristine-tar', 210s 'refs/notes/importer/importer', 210s ], 210s # validation_repo_delta: 210s { 210s 'update_tags': { 210s 'importer/reimport/import/1-1/0': Placeholder('import'), 210s 'importer/reimport/import/1-1/1': Placeholder('upload'), 210s }, 210s 'update_branches': { 210s 'importer/ubuntu/trusty': Placeholder('upload'), 210s }, 210s }, 210s # validation_repo_expected_identical_refs: 210s [ 210s 'refs/heads/importer/ubuntu/trusty-proposed', 210s 'refs/heads/importer/ubuntu/trusty', 210s 'refs/tags/importer/import/1-1', 210s 'refs/tags/importer/upload/1-1', 210s 'refs/tags/importer/reimport/import/1-1/0', 210s 'refs/tags/importer/reimport/import/1-1/1', 210s ], 210s # reuse: 210s True, 210s ), 210s 210s # 3) An existing import tag with a different Git tree and an existing 210s # upload tag with a different Git tree 210s # - Create reimport tag 210s pytest.param( 210s # input_repo: 210s repo_builder.Repo( 210s commits=[ 210s Commit.from_spec( 210s name='import', 210s mutate='The import tag contents', 210s ), 210s Commit.from_spec( 210s name='upload', 210s mutate='The upload tag contents', 210s ), 210s ], 210s branches={ 210s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 210s }, 210s tags={ 210s 'importer/import/1-1': Placeholder('import'), 210s 'importer/upload/1-1': Placeholder('upload'), 210s }, 210s ), 210s # expected_output_refs: 210s [ 210s 'refs/heads/do-not-push', 210s 'refs/tags/importer/upstream/ubuntu/1.gz', 210s 'refs/heads/importer/importer/ubuntu/dsc', 210s 'refs/heads/importer/importer/ubuntu/pristine-tar', 210s 'refs/notes/importer/changelog', 210s 'refs/notes/importer/importer', 210s ], 210s # validation_repo_delta: 210s { 210s 'add_commits': [Commit.from_spec( 210s name='reimport', 210s message='Test commit (new)', 210s )], 210s 'update_tags': { 210s 'importer/reimport/import/1-1/0': Placeholder('import'), 210s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 210s }, 210s 'update_branches': { 210s 'importer/ubuntu/trusty': Placeholder('reimport'), 210s }, 210s }, 210s # validation_repo_expected_identical_refs: 210s [ 210s 'refs/heads/importer/ubuntu/trusty-proposed', 210s 'refs/heads/importer/ubuntu/trusty', 210s 'refs/tags/importer/import/1-1', 210s 'refs/tags/importer/upload/1-1', 210s 'refs/tags/importer/reimport/import/1-1/0', 210s 'refs/tags/importer/reimport/import/1-1/1', 210s ], 210s # reuse: 210s False, 210s ), 210s 210s # 4) An existing import tag with a different Git tree and no upload tag 210s # - Create reimport tag 210s pytest.param( 210s # input_repo: 210s repo_builder.Repo( 210s commits=[ 210s Commit.from_spec( 210s name='import', 210s mutate='The import tag contents', 210s ), 210s ], 210s branches={ 210s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 210s }, 210s tags={'importer/import/1-1': Placeholder('import')}, 210s ), 210s # expected_output_refs: 210s [ 210s 'refs/heads/do-not-push', 210s 'refs/tags/importer/upstream/ubuntu/1.gz', 210s 'refs/heads/importer/importer/ubuntu/dsc', 210s 'refs/heads/importer/importer/ubuntu/pristine-tar', 210s 'refs/notes/importer/changelog', 210s 'refs/notes/importer/importer', 210s ], 210s # validation_repo_delta: 210s { 210s 'add_commits': [Commit.from_spec( 210s name='reimport', 210s message='Test commit (new)', 210s )], 210s 'update_tags': { 210s 'importer/reimport/import/1-1/0': Placeholder('import'), 210s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 210s }, 210s 'update_branches': { 210s 'importer/ubuntu/trusty': Placeholder('reimport'), 210s }, 210s }, 210s # validation_repo_expected_identical_refs: 210s [ 210s 'refs/heads/importer/ubuntu/trusty-proposed', 210s 'refs/heads/importer/ubuntu/trusty', 210s 'refs/tags/importer/import/1-1', 210s 'refs/tags/importer/reimport/import/1-1/0', 210s 'refs/tags/importer/reimport/import/1-1/1', 210s ], 210s # reuse: 210s False, 210s ), 210s 210s # 5) No import tag and an existing upload tag with the same Git tree 210s # - Reuse upload tag, create import tag 210s pytest.param( 210s # input_repo: 210s repo_builder.Repo( 210s commits=[Commit.from_spec(name='upload')], 210s tags={'importer/upload/1-1': Placeholder('upload')}, 210s ), 210s # expected_output_refs: 210s [ 210s 'refs/heads/do-not-push', 210s 'refs/tags/importer/upstream/ubuntu/1.gz', 210s 'refs/heads/importer/importer/ubuntu/dsc', 210s 'refs/heads/importer/importer/ubuntu/pristine-tar', 210s 'refs/notes/importer/importer', 210s ], 210s # validation_repo_delta: 210s { 210s 'update_tags': { 210s 'importer/import/1-1': Placeholder('upload'), 210s }, 210s 'update_branches': { 210s 'importer/ubuntu/trusty': Placeholder('upload'), 210s }, 210s }, 210s # validation_repo_expected_identical_refs: 210s [ 210s 'refs/heads/importer/ubuntu/trusty', 210s 'refs/tags/importer/import/1-1', 210s 'refs/tags/importer/upload/1-1', 210s ], 210s # reuse: 210s True, 210s ), 210s 210s # 6) No import tag and an existing upload tag with a different Git tree 210s # - Create import tag 210s pytest.param( 210s # input_repo: 210s repo_builder.Repo( 210s commits=[ 210s Commit.from_spec( 210s name='upload', 210s mutate='The upload tag contents', 210s ), 210s ], 210s tags={'importer/upload/1-1': Placeholder('upload')}, 210s ), 210s # expected_output_refs: 210s [ 210s 'refs/heads/do-not-push', 210s 'refs/tags/importer/upstream/ubuntu/1.gz', 210s 'refs/heads/importer/importer/ubuntu/dsc', 210s 'refs/heads/importer/importer/ubuntu/pristine-tar', 210s 'refs/notes/importer/changelog', 210s 'refs/notes/importer/importer', 210s ], 210s # validation_repo_delta: 210s { 210s 'add_commits': [ 210s Commit.from_spec( 210s name='publish', 210s message='Test commit (new)', 210s ), 210s ], 210s 'update_tags': { 210s 'importer/import/1-1': Placeholder('publish'), 210s }, 210s 'update_branches': { 210s 'importer/ubuntu/trusty': Placeholder('publish'), 210s }, 210s }, 210s # validation_repo_expected_identical_refs: 210s [ 210s 'refs/heads/importer/ubuntu/trusty', 210s 'refs/tags/importer/import/1-1', 210s 'refs/tags/importer/upload/1-1', 210s ], 210s # reuse: 210s False, 210s ), 210s 210s # 7) No import tags or upload tags 210s # - Create import tag 210s pytest.param( 210s # input_repo: 210s repo_builder.Repo(), 210s # expected_output_refs: 210s [ 210s 'refs/heads/do-not-push', 210s 'refs/tags/importer/upstream/ubuntu/1.gz', 210s 'refs/heads/importer/importer/ubuntu/dsc', 210s 'refs/heads/importer/importer/ubuntu/pristine-tar', 210s 'refs/notes/importer/changelog', 210s 'refs/notes/importer/importer', 210s ], 210s # validation_repo_delta: 210s { 210s 'add_commits': [ 210s Commit.from_spec( 210s name='publish', 210s message='Test commit (new)', 210s ), 210s ], 210s 'update_tags': { 210s 'importer/import/1-1': Placeholder('publish'), 210s }, 210s 'update_branches': { 210s 'importer/ubuntu/trusty': Placeholder('publish'), 210s }, 210s }, 210s # validation_repo_expected_identical_refs: 210s [ 210s 'refs/heads/importer/ubuntu/trusty', 210s 'refs/tags/importer/import/1-1' 210s ], 210s # reuse: 210s False, 210s ), 210s ] 210s ) 210s @patch('gitubuntu.importer.get_import_tag_msg') 210s @patch('gitubuntu.importer.get_import_commit_msg') 210s def test_import_unapplied_spi_tags( 210s get_import_commit_msg_mock, 210s get_import_tag_msg_mock, 210s repo, 210s input_repo, 210s expected_output_refs, 210s validation_repo_delta, 210s validation_repo_expected_identical_refs, 210s reuse, 210s ): 210s """Test that unapplied tags are correctly created, adjusted and/or reused 210s 210s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 210s that determines the commit message to use for a given import 210s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 210s that determines the tag message to use for a given import 210s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 210s temporary output repository 210s :param repo_builder.Repo input_repo: input repository data 210s :param list(str) expected_output_refs: refs that must exist in the output 210s repository 210s :param dict validation_repo_delta: how to transform the input 210s repository into a "validation repository", expressed as a dict to 210s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 210s input repository. The validation repository is then used for the 210s purposes of comparison against the output repository. 210s :param list(str) validation_repo_expected_identical_refs: refs that must be 210s identical between the validation repository and the output repository 210s :param bool reuse: if set, the output ref importer/ubuntu/trusty must be 210s one supplied by the input repository (assumed to have a commit message 210s of "Test commit") and not one created by the importer in this run 210s (arranged by this test to have a different commit message) 210s 210s The input repository data is written into the output repository and then a 210s fake non-native source package publication of version 1-1 in the Trusty 210s release pocket is imported into it by calling import_unapplied_spi() 210s directly. expected_output_refs, validation_repo_expected_identical_refs and 210s reuse are then asserted. It is further asserted that no other refs exist in 210s the output repository except for those listed in expected_output_refs and 210s validation_repo_expected_identical_refs. 210s """ 210s # Match the repo_builder objects 210s get_import_tag_msg_mock.return_value = 'Test tag' 210s # Importantly, the following commit message must not be the same as the 210s # commit messages used by the test input repository commits, so that we can 210s # later detect the difference between commits that were already there and 210s # new commits created by the importer for the purposes of asserting the 210s # reuse parameter correctly. 210s get_import_commit_msg_mock.return_value = b'Test commit (new)' 210s 210s > input_repo.write(repo.raw_repo) 210s 210s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_tag_test.py:463: 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s 210s self = 210s repo = pygit2.Repository('/tmp/tmpf48c1gca/.git/'), record = {} 210s 210s def write(self, repo, record=None): 210s replace_placeholders(self) 210s record = record or dict() 210s written_commits = [ 210s commit.write(repo=repo, record=record) 210s for commit 210s in self.commit_list 210s ] 210s for name, target in self.branches.items(): 210s repo.create_branch( 210s name, 210s repo.get(target.write(repo)).peel(pygit2.Commit), 210s ) 210s for name, target in self.tags.items(): 210s repo.create_tag( 210s name, 210s target.write(repo), 210s > pygit2.GIT_OBJ_COMMIT, 210s self.tagger.signature, 210s 'Tag message', 210s ) 210s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 210s 210s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 210s ----------------------------- Captured stdout call ----------------------------- 210s dpkg-source: info: using source format '3.0 (quilt)' 210s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 210s dpkg-source: info: using source format '3.0 (quilt)' 210s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 210s dpkg-source: info: using source format '3.0 (quilt)' 210s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 210s dpkg-source: info: using source format '3.0 (quilt)' 210s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 210s ----------------------------- Captured stderr call ----------------------------- 210s dpkg-source: warning: missing information for output field Standards-Version 210s dpkg-source: warning: missing information for output field Standards-Version 210s dpkg-source: warning: missing information for output field Standards-Version 210s dpkg-source: warning: missing information for output field Standards-Version 210s _ test_import_unapplied_spi_tags[input_repo2-expected_output_refs2-validation_repo_delta2-validation_repo_expected_identical_refs2-True] _ 210s 210s get_import_commit_msg_mock = 210s get_import_tag_msg_mock = 210s repo = 210s input_repo = 210s expected_output_refs = ['refs/heads/do-not-push', 'refs/tags/importer/upstream/ubuntu/1.gz', 'refs/heads/importer/importer/ubuntu/dsc', 'refs/heads/importer/importer/ubuntu/pristine-tar', 'refs/notes/importer/importer'] 210s validation_repo_delta = {'update_branches': {'importer/ubuntu/trusty': }, 'update...t at 0x637914a57230>, 'importer/reimport/import/1-1/1': }} 210s validation_repo_expected_identical_refs = ['refs/heads/importer/ubuntu/trusty-proposed', 'refs/heads/importer/ubuntu/trusty', 'refs/tags/importer/import/1-1', 'refs/tags/importer/upload/1-1', 'refs/tags/importer/reimport/import/1-1/0', 'refs/tags/importer/reimport/import/1-1/1'] 210s reuse = True 210s 210s @pytest.mark.parametrize( 210s [ 210s 'input_repo', 210s 'expected_output_refs', 210s 'validation_repo_delta', 210s 'validation_repo_expected_identical_refs', 210s 'reuse', 210s ], 210s [ 210s # 1) An existing import tag (or reimport tag) with the same Git tree 210s # - Reuse import tag 210s pytest.param( 210s # input_repo: 210s repo_builder.Repo( 210s commits=[Commit.from_spec(name='import')], 210s branches={ 210s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 210s }, 210s tags={'importer/import/1-1': Placeholder('import')}, 210s ), 210s # expected_output_refs: 210s [ 210s 'refs/heads/do-not-push', 210s 'refs/tags/importer/upstream/ubuntu/1.gz', 210s 'refs/heads/importer/importer/ubuntu/dsc', 210s 'refs/heads/importer/importer/ubuntu/pristine-tar', 210s ], 210s # validation_repo_delta: 210s { 210s 'update_branches': { 210s 'importer/ubuntu/trusty': Placeholder('import'), 210s }, 210s }, 210s # validation_repo_expected_identical_refs: 210s [ 210s 'refs/heads/importer/ubuntu/trusty-proposed', 210s 'refs/heads/importer/ubuntu/trusty', 210s 'refs/tags/importer/import/1-1', 210s ], 210s # reuse: 210s True, 210s ), 210s pytest.param( 210s # input_repo: 210s repo_builder.Repo( 210s commits=[ 210s Commit.from_spec( 210s name='import', 210s mutate='import tag contents', 210s ), 210s Commit.from_spec(name='reimport'), 210s ], 210s branches={ 210s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 210s }, 210s tags={ 210s 'importer/import/1-1': Placeholder('import'), 210s 'importer/reimport/import/1-1/0': Placeholder('import'), 210s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 210s }, 210s ), 210s # expected_output_refs: 210s [ 210s 'refs/heads/do-not-push', 210s 'refs/tags/importer/upstream/ubuntu/1.gz', 210s 'refs/heads/importer/importer/ubuntu/dsc', 210s 'refs/heads/importer/importer/ubuntu/pristine-tar', 210s ], 210s # validation_repo_delta: 210s { 210s 'update_branches': { 210s 'importer/ubuntu/trusty': Placeholder('reimport'), 210s }, 210s }, 210s # validation_repo_expected_identical_refs: 210s [ 210s 'refs/heads/importer/ubuntu/trusty-proposed', 210s 'refs/heads/importer/ubuntu/trusty', 210s 'refs/tags/importer/import/1-1', 210s 'refs/tags/importer/reimport/import/1-1/0', 210s 'refs/tags/importer/reimport/import/1-1/1', 210s ], 210s # reuse: 210s True, 210s ), 210s 210s # 2) An existing import tag with a different Git tree and an existing 210s # upload tag with the same Git tree 210s # - Reuse upload tag, create reimport tag 210s pytest.param( 210s # input_repo: 210s repo_builder.Repo( 210s commits=[ 210s Commit.from_spec( 210s name='import', 210s mutate='The import tag contents', 210s ), 210s Commit.from_spec(name='upload'), 210s ], 210s branches={ 210s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 210s }, 210s tags={ 210s 'importer/import/1-1': Placeholder('import'), 210s 'importer/upload/1-1': Placeholder('upload'), 210s }, 210s ), 210s # expected_output_refs: 210s [ 210s 'refs/heads/do-not-push', 210s 'refs/tags/importer/upstream/ubuntu/1.gz', 210s 'refs/heads/importer/importer/ubuntu/dsc', 210s 'refs/heads/importer/importer/ubuntu/pristine-tar', 210s 'refs/notes/importer/importer', 210s ], 210s # validation_repo_delta: 210s { 210s 'update_tags': { 210s 'importer/reimport/import/1-1/0': Placeholder('import'), 210s 'importer/reimport/import/1-1/1': Placeholder('upload'), 210s }, 210s 'update_branches': { 210s 'importer/ubuntu/trusty': Placeholder('upload'), 210s }, 210s }, 210s # validation_repo_expected_identical_refs: 210s [ 210s 'refs/heads/importer/ubuntu/trusty-proposed', 210s 'refs/heads/importer/ubuntu/trusty', 210s 'refs/tags/importer/import/1-1', 210s 'refs/tags/importer/upload/1-1', 210s 'refs/tags/importer/reimport/import/1-1/0', 210s 'refs/tags/importer/reimport/import/1-1/1', 210s ], 210s # reuse: 210s True, 210s ), 210s 210s # 3) An existing import tag with a different Git tree and an existing 210s # upload tag with a different Git tree 210s # - Create reimport tag 210s pytest.param( 210s # input_repo: 210s repo_builder.Repo( 210s commits=[ 210s Commit.from_spec( 210s name='import', 210s mutate='The import tag contents', 210s ), 210s Commit.from_spec( 210s name='upload', 210s mutate='The upload tag contents', 210s ), 210s ], 210s branches={ 210s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 210s }, 210s tags={ 210s 'importer/import/1-1': Placeholder('import'), 210s 'importer/upload/1-1': Placeholder('upload'), 210s }, 210s ), 210s # expected_output_refs: 210s [ 210s 'refs/heads/do-not-push', 210s 'refs/tags/importer/upstream/ubuntu/1.gz', 210s 'refs/heads/importer/importer/ubuntu/dsc', 210s 'refs/heads/importer/importer/ubuntu/pristine-tar', 210s 'refs/notes/importer/changelog', 210s 'refs/notes/importer/importer', 210s ], 210s # validation_repo_delta: 210s { 210s 'add_commits': [Commit.from_spec( 210s name='reimport', 210s message='Test commit (new)', 210s )], 210s 'update_tags': { 210s 'importer/reimport/import/1-1/0': Placeholder('import'), 210s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 210s }, 210s 'update_branches': { 210s 'importer/ubuntu/trusty': Placeholder('reimport'), 210s }, 210s }, 210s # validation_repo_expected_identical_refs: 210s [ 210s 'refs/heads/importer/ubuntu/trusty-proposed', 210s 'refs/heads/importer/ubuntu/trusty', 210s 'refs/tags/importer/import/1-1', 210s 'refs/tags/importer/upload/1-1', 210s 'refs/tags/importer/reimport/import/1-1/0', 210s 'refs/tags/importer/reimport/import/1-1/1', 210s ], 210s # reuse: 210s False, 210s ), 210s 210s # 4) An existing import tag with a different Git tree and no upload tag 210s # - Create reimport tag 210s pytest.param( 210s # input_repo: 210s repo_builder.Repo( 210s commits=[ 210s Commit.from_spec( 210s name='import', 210s mutate='The import tag contents', 210s ), 210s ], 210s branches={ 210s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 210s }, 210s tags={'importer/import/1-1': Placeholder('import')}, 210s ), 210s # expected_output_refs: 210s [ 210s 'refs/heads/do-not-push', 210s 'refs/tags/importer/upstream/ubuntu/1.gz', 210s 'refs/heads/importer/importer/ubuntu/dsc', 210s 'refs/heads/importer/importer/ubuntu/pristine-tar', 210s 'refs/notes/importer/changelog', 210s 'refs/notes/importer/importer', 210s ], 210s # validation_repo_delta: 210s { 210s 'add_commits': [Commit.from_spec( 210s name='reimport', 210s message='Test commit (new)', 210s )], 210s 'update_tags': { 210s 'importer/reimport/import/1-1/0': Placeholder('import'), 210s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 210s }, 210s 'update_branches': { 210s 'importer/ubuntu/trusty': Placeholder('reimport'), 210s }, 210s }, 210s # validation_repo_expected_identical_refs: 210s [ 210s 'refs/heads/importer/ubuntu/trusty-proposed', 210s 'refs/heads/importer/ubuntu/trusty', 210s 'refs/tags/importer/import/1-1', 210s 'refs/tags/importer/reimport/import/1-1/0', 210s 'refs/tags/importer/reimport/import/1-1/1', 210s ], 210s # reuse: 210s False, 210s ), 210s 210s # 5) No import tag and an existing upload tag with the same Git tree 210s # - Reuse upload tag, create import tag 210s pytest.param( 210s # input_repo: 210s repo_builder.Repo( 210s commits=[Commit.from_spec(name='upload')], 210s tags={'importer/upload/1-1': Placeholder('upload')}, 210s ), 210s # expected_output_refs: 210s [ 210s 'refs/heads/do-not-push', 210s 'refs/tags/importer/upstream/ubuntu/1.gz', 210s 'refs/heads/importer/importer/ubuntu/dsc', 210s 'refs/heads/importer/importer/ubuntu/pristine-tar', 210s 'refs/notes/importer/importer', 210s ], 210s # validation_repo_delta: 210s { 210s 'update_tags': { 210s 'importer/import/1-1': Placeholder('upload'), 210s }, 210s 'update_branches': { 210s 'importer/ubuntu/trusty': Placeholder('upload'), 210s }, 210s }, 210s # validation_repo_expected_identical_refs: 210s [ 210s 'refs/heads/importer/ubuntu/trusty', 210s 'refs/tags/importer/import/1-1', 210s 'refs/tags/importer/upload/1-1', 210s ], 210s # reuse: 210s True, 210s ), 210s 210s # 6) No import tag and an existing upload tag with a different Git tree 210s # - Create import tag 210s pytest.param( 210s # input_repo: 210s repo_builder.Repo( 210s commits=[ 210s Commit.from_spec( 210s name='upload', 210s mutate='The upload tag contents', 210s ), 210s ], 210s tags={'importer/upload/1-1': Placeholder('upload')}, 210s ), 210s # expected_output_refs: 210s [ 210s 'refs/heads/do-not-push', 210s 'refs/tags/importer/upstream/ubuntu/1.gz', 210s 'refs/heads/importer/importer/ubuntu/dsc', 210s 'refs/heads/importer/importer/ubuntu/pristine-tar', 210s 'refs/notes/importer/changelog', 210s 'refs/notes/importer/importer', 210s ], 210s # validation_repo_delta: 210s { 210s 'add_commits': [ 210s Commit.from_spec( 210s name='publish', 210s message='Test commit (new)', 210s ), 210s ], 210s 'update_tags': { 210s 'importer/import/1-1': Placeholder('publish'), 210s }, 210s 'update_branches': { 210s 'importer/ubuntu/trusty': Placeholder('publish'), 210s }, 210s }, 210s # validation_repo_expected_identical_refs: 210s [ 210s 'refs/heads/importer/ubuntu/trusty', 210s 'refs/tags/importer/import/1-1', 210s 'refs/tags/importer/upload/1-1', 210s ], 210s # reuse: 210s False, 210s ), 210s 210s # 7) No import tags or upload tags 210s # - Create import tag 210s pytest.param( 210s # input_repo: 210s repo_builder.Repo(), 210s # expected_output_refs: 210s [ 210s 'refs/heads/do-not-push', 210s 'refs/tags/importer/upstream/ubuntu/1.gz', 210s 'refs/heads/importer/importer/ubuntu/dsc', 210s 'refs/heads/importer/importer/ubuntu/pristine-tar', 210s 'refs/notes/importer/changelog', 210s 'refs/notes/importer/importer', 210s ], 210s # validation_repo_delta: 210s { 210s 'add_commits': [ 210s Commit.from_spec( 210s name='publish', 210s message='Test commit (new)', 210s ), 210s ], 210s 'update_tags': { 210s 'importer/import/1-1': Placeholder('publish'), 210s }, 210s 'update_branches': { 210s 'importer/ubuntu/trusty': Placeholder('publish'), 210s }, 210s }, 210s # validation_repo_expected_identical_refs: 210s [ 210s 'refs/heads/importer/ubuntu/trusty', 210s 'refs/tags/importer/import/1-1' 210s ], 210s # reuse: 210s False, 210s ), 210s ] 210s ) 210s @patch('gitubuntu.importer.get_import_tag_msg') 210s @patch('gitubuntu.importer.get_import_commit_msg') 210s def test_import_unapplied_spi_tags( 210s get_import_commit_msg_mock, 210s get_import_tag_msg_mock, 210s repo, 210s input_repo, 210s expected_output_refs, 210s validation_repo_delta, 210s validation_repo_expected_identical_refs, 210s reuse, 210s ): 210s """Test that unapplied tags are correctly created, adjusted and/or reused 210s 210s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 210s that determines the commit message to use for a given import 210s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 210s that determines the tag message to use for a given import 210s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 210s temporary output repository 210s :param repo_builder.Repo input_repo: input repository data 210s :param list(str) expected_output_refs: refs that must exist in the output 210s repository 210s :param dict validation_repo_delta: how to transform the input 210s repository into a "validation repository", expressed as a dict to 210s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 210s input repository. The validation repository is then used for the 210s purposes of comparison against the output repository. 210s :param list(str) validation_repo_expected_identical_refs: refs that must be 210s identical between the validation repository and the output repository 210s :param bool reuse: if set, the output ref importer/ubuntu/trusty must be 210s one supplied by the input repository (assumed to have a commit message 210s of "Test commit") and not one created by the importer in this run 210s (arranged by this test to have a different commit message) 210s 210s The input repository data is written into the output repository and then a 210s fake non-native source package publication of version 1-1 in the Trusty 210s release pocket is imported into it by calling import_unapplied_spi() 210s directly. expected_output_refs, validation_repo_expected_identical_refs and 210s reuse are then asserted. It is further asserted that no other refs exist in 210s the output repository except for those listed in expected_output_refs and 210s validation_repo_expected_identical_refs. 210s """ 210s # Match the repo_builder objects 210s get_import_tag_msg_mock.return_value = 'Test tag' 210s # Importantly, the following commit message must not be the same as the 210s # commit messages used by the test input repository commits, so that we can 210s # later detect the difference between commits that were already there and 210s # new commits created by the importer for the purposes of asserting the 210s # reuse parameter correctly. 210s get_import_commit_msg_mock.return_value = b'Test commit (new)' 210s 210s > input_repo.write(repo.raw_repo) 210s 210s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_tag_test.py:463: 210s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 210s 210s self = 210s repo = pygit2.Repository('/tmp/tmpek_aaf28/.git/'), record = {} 210s 210s def write(self, repo, record=None): 210s replace_placeholders(self) 210s record = record or dict() 210s written_commits = [ 210s commit.write(repo=repo, record=record) 210s for commit 210s in self.commit_list 210s ] 210s for name, target in self.branches.items(): 210s repo.create_branch( 210s name, 210s repo.get(target.write(repo)).peel(pygit2.Commit), 210s ) 210s for name, target in self.tags.items(): 210s repo.create_tag( 210s name, 210s target.write(repo), 210s > pygit2.GIT_OBJ_COMMIT, 210s self.tagger.signature, 210s 'Tag message', 210s ) 210s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 210s 210s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 210s ----------------------------- Captured stdout call ----------------------------- 210s dpkg-source: info: using source format '3.0 (quilt)' 210s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 210s dpkg-source: info: using source format '3.0 (quilt)' 210s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 210s dpkg-source: info: using source format '3.0 (quilt)' 210s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 210s dpkg-source: info: using source format '3.0 (quilt)' 210s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 210s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s _ test_import_unapplied_spi_tags[input_repo3-expected_output_refs3-validation_repo_delta3-validation_repo_expected_identical_refs3-False] _ 211s 211s get_import_commit_msg_mock = 211s get_import_tag_msg_mock = 211s repo = 211s input_repo = 211s expected_output_refs = ['refs/heads/do-not-push', 'refs/tags/importer/upstream/ubuntu/1.gz', 'refs/heads/importer/importer/ubuntu/dsc', 'refs/heads/importer/importer/ubuntu/pristine-tar', 'refs/notes/importer/changelog', 'refs/notes/importer/importer'] 211s validation_repo_delta = {'add_commits': [], 'update_branches': {'importer/ubuntu/trust...t at 0x637914a578c0>, 'importer/reimport/import/1-1/1': }} 211s validation_repo_expected_identical_refs = ['refs/heads/importer/ubuntu/trusty-proposed', 'refs/heads/importer/ubuntu/trusty', 'refs/tags/importer/import/1-1', 'refs/tags/importer/upload/1-1', 'refs/tags/importer/reimport/import/1-1/0', 'refs/tags/importer/reimport/import/1-1/1'] 211s reuse = False 211s 211s @pytest.mark.parametrize( 211s [ 211s 'input_repo', 211s 'expected_output_refs', 211s 'validation_repo_delta', 211s 'validation_repo_expected_identical_refs', 211s 'reuse', 211s ], 211s [ 211s # 1) An existing import tag (or reimport tag) with the same Git tree 211s # - Reuse import tag 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo( 211s commits=[Commit.from_spec(name='import')], 211s branches={ 211s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 211s }, 211s tags={'importer/import/1-1': Placeholder('import')}, 211s ), 211s # expected_output_refs: 211s [ 211s 'refs/heads/do-not-push', 211s 'refs/tags/importer/upstream/ubuntu/1.gz', 211s 'refs/heads/importer/importer/ubuntu/dsc', 211s 'refs/heads/importer/importer/ubuntu/pristine-tar', 211s ], 211s # validation_repo_delta: 211s { 211s 'update_branches': { 211s 'importer/ubuntu/trusty': Placeholder('import'), 211s }, 211s }, 211s # validation_repo_expected_identical_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty-proposed', 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1', 211s ], 211s # reuse: 211s True, 211s ), 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo( 211s commits=[ 211s Commit.from_spec( 211s name='import', 211s mutate='import tag contents', 211s ), 211s Commit.from_spec(name='reimport'), 211s ], 211s branches={ 211s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 211s }, 211s tags={ 211s 'importer/import/1-1': Placeholder('import'), 211s 'importer/reimport/import/1-1/0': Placeholder('import'), 211s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 211s }, 211s ), 211s # expected_output_refs: 211s [ 211s 'refs/heads/do-not-push', 211s 'refs/tags/importer/upstream/ubuntu/1.gz', 211s 'refs/heads/importer/importer/ubuntu/dsc', 211s 'refs/heads/importer/importer/ubuntu/pristine-tar', 211s ], 211s # validation_repo_delta: 211s { 211s 'update_branches': { 211s 'importer/ubuntu/trusty': Placeholder('reimport'), 211s }, 211s }, 211s # validation_repo_expected_identical_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty-proposed', 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/reimport/import/1-1/0', 211s 'refs/tags/importer/reimport/import/1-1/1', 211s ], 211s # reuse: 211s True, 211s ), 211s 211s # 2) An existing import tag with a different Git tree and an existing 211s # upload tag with the same Git tree 211s # - Reuse upload tag, create reimport tag 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo( 211s commits=[ 211s Commit.from_spec( 211s name='import', 211s mutate='The import tag contents', 211s ), 211s Commit.from_spec(name='upload'), 211s ], 211s branches={ 211s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 211s }, 211s tags={ 211s 'importer/import/1-1': Placeholder('import'), 211s 'importer/upload/1-1': Placeholder('upload'), 211s }, 211s ), 211s # expected_output_refs: 211s [ 211s 'refs/heads/do-not-push', 211s 'refs/tags/importer/upstream/ubuntu/1.gz', 211s 'refs/heads/importer/importer/ubuntu/dsc', 211s 'refs/heads/importer/importer/ubuntu/pristine-tar', 211s 'refs/notes/importer/importer', 211s ], 211s # validation_repo_delta: 211s { 211s 'update_tags': { 211s 'importer/reimport/import/1-1/0': Placeholder('import'), 211s 'importer/reimport/import/1-1/1': Placeholder('upload'), 211s }, 211s 'update_branches': { 211s 'importer/ubuntu/trusty': Placeholder('upload'), 211s }, 211s }, 211s # validation_repo_expected_identical_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty-proposed', 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/upload/1-1', 211s 'refs/tags/importer/reimport/import/1-1/0', 211s 'refs/tags/importer/reimport/import/1-1/1', 211s ], 211s # reuse: 211s True, 211s ), 211s 211s # 3) An existing import tag with a different Git tree and an existing 211s # upload tag with a different Git tree 211s # - Create reimport tag 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo( 211s commits=[ 211s Commit.from_spec( 211s name='import', 211s mutate='The import tag contents', 211s ), 211s Commit.from_spec( 211s name='upload', 211s mutate='The upload tag contents', 211s ), 211s ], 211s branches={ 211s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 211s }, 211s tags={ 211s 'importer/import/1-1': Placeholder('import'), 211s 'importer/upload/1-1': Placeholder('upload'), 211s }, 211s ), 211s # expected_output_refs: 211s [ 211s 'refs/heads/do-not-push', 211s 'refs/tags/importer/upstream/ubuntu/1.gz', 211s 'refs/heads/importer/importer/ubuntu/dsc', 211s 'refs/heads/importer/importer/ubuntu/pristine-tar', 211s 'refs/notes/importer/changelog', 211s 'refs/notes/importer/importer', 211s ], 211s # validation_repo_delta: 211s { 211s 'add_commits': [Commit.from_spec( 211s name='reimport', 211s message='Test commit (new)', 211s )], 211s 'update_tags': { 211s 'importer/reimport/import/1-1/0': Placeholder('import'), 211s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 211s }, 211s 'update_branches': { 211s 'importer/ubuntu/trusty': Placeholder('reimport'), 211s }, 211s }, 211s # validation_repo_expected_identical_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty-proposed', 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/upload/1-1', 211s 'refs/tags/importer/reimport/import/1-1/0', 211s 'refs/tags/importer/reimport/import/1-1/1', 211s ], 211s # reuse: 211s False, 211s ), 211s 211s # 4) An existing import tag with a different Git tree and no upload tag 211s # - Create reimport tag 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo( 211s commits=[ 211s Commit.from_spec( 211s name='import', 211s mutate='The import tag contents', 211s ), 211s ], 211s branches={ 211s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 211s }, 211s tags={'importer/import/1-1': Placeholder('import')}, 211s ), 211s # expected_output_refs: 211s [ 211s 'refs/heads/do-not-push', 211s 'refs/tags/importer/upstream/ubuntu/1.gz', 211s 'refs/heads/importer/importer/ubuntu/dsc', 211s 'refs/heads/importer/importer/ubuntu/pristine-tar', 211s 'refs/notes/importer/changelog', 211s 'refs/notes/importer/importer', 211s ], 211s # validation_repo_delta: 211s { 211s 'add_commits': [Commit.from_spec( 211s name='reimport', 211s message='Test commit (new)', 211s )], 211s 'update_tags': { 211s 'importer/reimport/import/1-1/0': Placeholder('import'), 211s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 211s }, 211s 'update_branches': { 211s 'importer/ubuntu/trusty': Placeholder('reimport'), 211s }, 211s }, 211s # validation_repo_expected_identical_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty-proposed', 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/reimport/import/1-1/0', 211s 'refs/tags/importer/reimport/import/1-1/1', 211s ], 211s # reuse: 211s False, 211s ), 211s 211s # 5) No import tag and an existing upload tag with the same Git tree 211s # - Reuse upload tag, create import tag 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo( 211s commits=[Commit.from_spec(name='upload')], 211s tags={'importer/upload/1-1': Placeholder('upload')}, 211s ), 211s # expected_output_refs: 211s [ 211s 'refs/heads/do-not-push', 211s 'refs/tags/importer/upstream/ubuntu/1.gz', 211s 'refs/heads/importer/importer/ubuntu/dsc', 211s 'refs/heads/importer/importer/ubuntu/pristine-tar', 211s 'refs/notes/importer/importer', 211s ], 211s # validation_repo_delta: 211s { 211s 'update_tags': { 211s 'importer/import/1-1': Placeholder('upload'), 211s }, 211s 'update_branches': { 211s 'importer/ubuntu/trusty': Placeholder('upload'), 211s }, 211s }, 211s # validation_repo_expected_identical_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/upload/1-1', 211s ], 211s # reuse: 211s True, 211s ), 211s 211s # 6) No import tag and an existing upload tag with a different Git tree 211s # - Create import tag 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo( 211s commits=[ 211s Commit.from_spec( 211s name='upload', 211s mutate='The upload tag contents', 211s ), 211s ], 211s tags={'importer/upload/1-1': Placeholder('upload')}, 211s ), 211s # expected_output_refs: 211s [ 211s 'refs/heads/do-not-push', 211s 'refs/tags/importer/upstream/ubuntu/1.gz', 211s 'refs/heads/importer/importer/ubuntu/dsc', 211s 'refs/heads/importer/importer/ubuntu/pristine-tar', 211s 'refs/notes/importer/changelog', 211s 'refs/notes/importer/importer', 211s ], 211s # validation_repo_delta: 211s { 211s 'add_commits': [ 211s Commit.from_spec( 211s name='publish', 211s message='Test commit (new)', 211s ), 211s ], 211s 'update_tags': { 211s 'importer/import/1-1': Placeholder('publish'), 211s }, 211s 'update_branches': { 211s 'importer/ubuntu/trusty': Placeholder('publish'), 211s }, 211s }, 211s # validation_repo_expected_identical_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/upload/1-1', 211s ], 211s # reuse: 211s False, 211s ), 211s 211s # 7) No import tags or upload tags 211s # - Create import tag 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo(), 211s # expected_output_refs: 211s [ 211s 'refs/heads/do-not-push', 211s 'refs/tags/importer/upstream/ubuntu/1.gz', 211s 'refs/heads/importer/importer/ubuntu/dsc', 211s 'refs/heads/importer/importer/ubuntu/pristine-tar', 211s 'refs/notes/importer/changelog', 211s 'refs/notes/importer/importer', 211s ], 211s # validation_repo_delta: 211s { 211s 'add_commits': [ 211s Commit.from_spec( 211s name='publish', 211s message='Test commit (new)', 211s ), 211s ], 211s 'update_tags': { 211s 'importer/import/1-1': Placeholder('publish'), 211s }, 211s 'update_branches': { 211s 'importer/ubuntu/trusty': Placeholder('publish'), 211s }, 211s }, 211s # validation_repo_expected_identical_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1' 211s ], 211s # reuse: 211s False, 211s ), 211s ] 211s ) 211s @patch('gitubuntu.importer.get_import_tag_msg') 211s @patch('gitubuntu.importer.get_import_commit_msg') 211s def test_import_unapplied_spi_tags( 211s get_import_commit_msg_mock, 211s get_import_tag_msg_mock, 211s repo, 211s input_repo, 211s expected_output_refs, 211s validation_repo_delta, 211s validation_repo_expected_identical_refs, 211s reuse, 211s ): 211s """Test that unapplied tags are correctly created, adjusted and/or reused 211s 211s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 211s that determines the commit message to use for a given import 211s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 211s that determines the tag message to use for a given import 211s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 211s temporary output repository 211s :param repo_builder.Repo input_repo: input repository data 211s :param list(str) expected_output_refs: refs that must exist in the output 211s repository 211s :param dict validation_repo_delta: how to transform the input 211s repository into a "validation repository", expressed as a dict to 211s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 211s input repository. The validation repository is then used for the 211s purposes of comparison against the output repository. 211s :param list(str) validation_repo_expected_identical_refs: refs that must be 211s identical between the validation repository and the output repository 211s :param bool reuse: if set, the output ref importer/ubuntu/trusty must be 211s one supplied by the input repository (assumed to have a commit message 211s of "Test commit") and not one created by the importer in this run 211s (arranged by this test to have a different commit message) 211s 211s The input repository data is written into the output repository and then a 211s fake non-native source package publication of version 1-1 in the Trusty 211s release pocket is imported into it by calling import_unapplied_spi() 211s directly. expected_output_refs, validation_repo_expected_identical_refs and 211s reuse are then asserted. It is further asserted that no other refs exist in 211s the output repository except for those listed in expected_output_refs and 211s validation_repo_expected_identical_refs. 211s """ 211s # Match the repo_builder objects 211s get_import_tag_msg_mock.return_value = 'Test tag' 211s # Importantly, the following commit message must not be the same as the 211s # commit messages used by the test input repository commits, so that we can 211s # later detect the difference between commits that were already there and 211s # new commits created by the importer for the purposes of asserting the 211s # reuse parameter correctly. 211s get_import_commit_msg_mock.return_value = b'Test commit (new)' 211s 211s > input_repo.write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_tag_test.py:463: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmp6r4xx3wp/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s _ test_import_unapplied_spi_tags[input_repo4-expected_output_refs4-validation_repo_delta4-validation_repo_expected_identical_refs4-False] _ 211s 211s get_import_commit_msg_mock = 211s get_import_tag_msg_mock = 211s repo = 211s input_repo = 211s expected_output_refs = ['refs/heads/do-not-push', 'refs/tags/importer/upstream/ubuntu/1.gz', 'refs/heads/importer/importer/ubuntu/dsc', 'refs/heads/importer/importer/ubuntu/pristine-tar', 'refs/notes/importer/changelog', 'refs/notes/importer/importer'] 211s validation_repo_delta = {'add_commits': [], 'update_branches': {'importer/ubuntu/trust...t at 0x637914a57dd0>, 'importer/reimport/import/1-1/1': }} 211s validation_repo_expected_identical_refs = ['refs/heads/importer/ubuntu/trusty-proposed', 'refs/heads/importer/ubuntu/trusty', 'refs/tags/importer/import/1-1', 'refs/tags/importer/reimport/import/1-1/0', 'refs/tags/importer/reimport/import/1-1/1'] 211s reuse = False 211s 211s @pytest.mark.parametrize( 211s [ 211s 'input_repo', 211s 'expected_output_refs', 211s 'validation_repo_delta', 211s 'validation_repo_expected_identical_refs', 211s 'reuse', 211s ], 211s [ 211s # 1) An existing import tag (or reimport tag) with the same Git tree 211s # - Reuse import tag 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo( 211s commits=[Commit.from_spec(name='import')], 211s branches={ 211s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 211s }, 211s tags={'importer/import/1-1': Placeholder('import')}, 211s ), 211s # expected_output_refs: 211s [ 211s 'refs/heads/do-not-push', 211s 'refs/tags/importer/upstream/ubuntu/1.gz', 211s 'refs/heads/importer/importer/ubuntu/dsc', 211s 'refs/heads/importer/importer/ubuntu/pristine-tar', 211s ], 211s # validation_repo_delta: 211s { 211s 'update_branches': { 211s 'importer/ubuntu/trusty': Placeholder('import'), 211s }, 211s }, 211s # validation_repo_expected_identical_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty-proposed', 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1', 211s ], 211s # reuse: 211s True, 211s ), 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo( 211s commits=[ 211s Commit.from_spec( 211s name='import', 211s mutate='import tag contents', 211s ), 211s Commit.from_spec(name='reimport'), 211s ], 211s branches={ 211s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 211s }, 211s tags={ 211s 'importer/import/1-1': Placeholder('import'), 211s 'importer/reimport/import/1-1/0': Placeholder('import'), 211s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 211s }, 211s ), 211s # expected_output_refs: 211s [ 211s 'refs/heads/do-not-push', 211s 'refs/tags/importer/upstream/ubuntu/1.gz', 211s 'refs/heads/importer/importer/ubuntu/dsc', 211s 'refs/heads/importer/importer/ubuntu/pristine-tar', 211s ], 211s # validation_repo_delta: 211s { 211s 'update_branches': { 211s 'importer/ubuntu/trusty': Placeholder('reimport'), 211s }, 211s }, 211s # validation_repo_expected_identical_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty-proposed', 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/reimport/import/1-1/0', 211s 'refs/tags/importer/reimport/import/1-1/1', 211s ], 211s # reuse: 211s True, 211s ), 211s 211s # 2) An existing import tag with a different Git tree and an existing 211s # upload tag with the same Git tree 211s # - Reuse upload tag, create reimport tag 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo( 211s commits=[ 211s Commit.from_spec( 211s name='import', 211s mutate='The import tag contents', 211s ), 211s Commit.from_spec(name='upload'), 211s ], 211s branches={ 211s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 211s }, 211s tags={ 211s 'importer/import/1-1': Placeholder('import'), 211s 'importer/upload/1-1': Placeholder('upload'), 211s }, 211s ), 211s # expected_output_refs: 211s [ 211s 'refs/heads/do-not-push', 211s 'refs/tags/importer/upstream/ubuntu/1.gz', 211s 'refs/heads/importer/importer/ubuntu/dsc', 211s 'refs/heads/importer/importer/ubuntu/pristine-tar', 211s 'refs/notes/importer/importer', 211s ], 211s # validation_repo_delta: 211s { 211s 'update_tags': { 211s 'importer/reimport/import/1-1/0': Placeholder('import'), 211s 'importer/reimport/import/1-1/1': Placeholder('upload'), 211s }, 211s 'update_branches': { 211s 'importer/ubuntu/trusty': Placeholder('upload'), 211s }, 211s }, 211s # validation_repo_expected_identical_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty-proposed', 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/upload/1-1', 211s 'refs/tags/importer/reimport/import/1-1/0', 211s 'refs/tags/importer/reimport/import/1-1/1', 211s ], 211s # reuse: 211s True, 211s ), 211s 211s # 3) An existing import tag with a different Git tree and an existing 211s # upload tag with a different Git tree 211s # - Create reimport tag 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo( 211s commits=[ 211s Commit.from_spec( 211s name='import', 211s mutate='The import tag contents', 211s ), 211s Commit.from_spec( 211s name='upload', 211s mutate='The upload tag contents', 211s ), 211s ], 211s branches={ 211s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 211s }, 211s tags={ 211s 'importer/import/1-1': Placeholder('import'), 211s 'importer/upload/1-1': Placeholder('upload'), 211s }, 211s ), 211s # expected_output_refs: 211s [ 211s 'refs/heads/do-not-push', 211s 'refs/tags/importer/upstream/ubuntu/1.gz', 211s 'refs/heads/importer/importer/ubuntu/dsc', 211s 'refs/heads/importer/importer/ubuntu/pristine-tar', 211s 'refs/notes/importer/changelog', 211s 'refs/notes/importer/importer', 211s ], 211s # validation_repo_delta: 211s { 211s 'add_commits': [Commit.from_spec( 211s name='reimport', 211s message='Test commit (new)', 211s )], 211s 'update_tags': { 211s 'importer/reimport/import/1-1/0': Placeholder('import'), 211s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 211s }, 211s 'update_branches': { 211s 'importer/ubuntu/trusty': Placeholder('reimport'), 211s }, 211s }, 211s # validation_repo_expected_identical_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty-proposed', 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/upload/1-1', 211s 'refs/tags/importer/reimport/import/1-1/0', 211s 'refs/tags/importer/reimport/import/1-1/1', 211s ], 211s # reuse: 211s False, 211s ), 211s 211s # 4) An existing import tag with a different Git tree and no upload tag 211s # - Create reimport tag 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo( 211s commits=[ 211s Commit.from_spec( 211s name='import', 211s mutate='The import tag contents', 211s ), 211s ], 211s branches={ 211s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 211s }, 211s tags={'importer/import/1-1': Placeholder('import')}, 211s ), 211s # expected_output_refs: 211s [ 211s 'refs/heads/do-not-push', 211s 'refs/tags/importer/upstream/ubuntu/1.gz', 211s 'refs/heads/importer/importer/ubuntu/dsc', 211s 'refs/heads/importer/importer/ubuntu/pristine-tar', 211s 'refs/notes/importer/changelog', 211s 'refs/notes/importer/importer', 211s ], 211s # validation_repo_delta: 211s { 211s 'add_commits': [Commit.from_spec( 211s name='reimport', 211s message='Test commit (new)', 211s )], 211s 'update_tags': { 211s 'importer/reimport/import/1-1/0': Placeholder('import'), 211s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 211s }, 211s 'update_branches': { 211s 'importer/ubuntu/trusty': Placeholder('reimport'), 211s }, 211s }, 211s # validation_repo_expected_identical_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty-proposed', 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/reimport/import/1-1/0', 211s 'refs/tags/importer/reimport/import/1-1/1', 211s ], 211s # reuse: 211s False, 211s ), 211s 211s # 5) No import tag and an existing upload tag with the same Git tree 211s # - Reuse upload tag, create import tag 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo( 211s commits=[Commit.from_spec(name='upload')], 211s tags={'importer/upload/1-1': Placeholder('upload')}, 211s ), 211s # expected_output_refs: 211s [ 211s 'refs/heads/do-not-push', 211s 'refs/tags/importer/upstream/ubuntu/1.gz', 211s 'refs/heads/importer/importer/ubuntu/dsc', 211s 'refs/heads/importer/importer/ubuntu/pristine-tar', 211s 'refs/notes/importer/importer', 211s ], 211s # validation_repo_delta: 211s { 211s 'update_tags': { 211s 'importer/import/1-1': Placeholder('upload'), 211s }, 211s 'update_branches': { 211s 'importer/ubuntu/trusty': Placeholder('upload'), 211s }, 211s }, 211s # validation_repo_expected_identical_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/upload/1-1', 211s ], 211s # reuse: 211s True, 211s ), 211s 211s # 6) No import tag and an existing upload tag with a different Git tree 211s # - Create import tag 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo( 211s commits=[ 211s Commit.from_spec( 211s name='upload', 211s mutate='The upload tag contents', 211s ), 211s ], 211s tags={'importer/upload/1-1': Placeholder('upload')}, 211s ), 211s # expected_output_refs: 211s [ 211s 'refs/heads/do-not-push', 211s 'refs/tags/importer/upstream/ubuntu/1.gz', 211s 'refs/heads/importer/importer/ubuntu/dsc', 211s 'refs/heads/importer/importer/ubuntu/pristine-tar', 211s 'refs/notes/importer/changelog', 211s 'refs/notes/importer/importer', 211s ], 211s # validation_repo_delta: 211s { 211s 'add_commits': [ 211s Commit.from_spec( 211s name='publish', 211s message='Test commit (new)', 211s ), 211s ], 211s 'update_tags': { 211s 'importer/import/1-1': Placeholder('publish'), 211s }, 211s 'update_branches': { 211s 'importer/ubuntu/trusty': Placeholder('publish'), 211s }, 211s }, 211s # validation_repo_expected_identical_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/upload/1-1', 211s ], 211s # reuse: 211s False, 211s ), 211s 211s # 7) No import tags or upload tags 211s # - Create import tag 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo(), 211s # expected_output_refs: 211s [ 211s 'refs/heads/do-not-push', 211s 'refs/tags/importer/upstream/ubuntu/1.gz', 211s 'refs/heads/importer/importer/ubuntu/dsc', 211s 'refs/heads/importer/importer/ubuntu/pristine-tar', 211s 'refs/notes/importer/changelog', 211s 'refs/notes/importer/importer', 211s ], 211s # validation_repo_delta: 211s { 211s 'add_commits': [ 211s Commit.from_spec( 211s name='publish', 211s message='Test commit (new)', 211s ), 211s ], 211s 'update_tags': { 211s 'importer/import/1-1': Placeholder('publish'), 211s }, 211s 'update_branches': { 211s 'importer/ubuntu/trusty': Placeholder('publish'), 211s }, 211s }, 211s # validation_repo_expected_identical_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1' 211s ], 211s # reuse: 211s False, 211s ), 211s ] 211s ) 211s @patch('gitubuntu.importer.get_import_tag_msg') 211s @patch('gitubuntu.importer.get_import_commit_msg') 211s def test_import_unapplied_spi_tags( 211s get_import_commit_msg_mock, 211s get_import_tag_msg_mock, 211s repo, 211s input_repo, 211s expected_output_refs, 211s validation_repo_delta, 211s validation_repo_expected_identical_refs, 211s reuse, 211s ): 211s """Test that unapplied tags are correctly created, adjusted and/or reused 211s 211s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 211s that determines the commit message to use for a given import 211s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 211s that determines the tag message to use for a given import 211s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 211s temporary output repository 211s :param repo_builder.Repo input_repo: input repository data 211s :param list(str) expected_output_refs: refs that must exist in the output 211s repository 211s :param dict validation_repo_delta: how to transform the input 211s repository into a "validation repository", expressed as a dict to 211s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 211s input repository. The validation repository is then used for the 211s purposes of comparison against the output repository. 211s :param list(str) validation_repo_expected_identical_refs: refs that must be 211s identical between the validation repository and the output repository 211s :param bool reuse: if set, the output ref importer/ubuntu/trusty must be 211s one supplied by the input repository (assumed to have a commit message 211s of "Test commit") and not one created by the importer in this run 211s (arranged by this test to have a different commit message) 211s 211s The input repository data is written into the output repository and then a 211s fake non-native source package publication of version 1-1 in the Trusty 211s release pocket is imported into it by calling import_unapplied_spi() 211s directly. expected_output_refs, validation_repo_expected_identical_refs and 211s reuse are then asserted. It is further asserted that no other refs exist in 211s the output repository except for those listed in expected_output_refs and 211s validation_repo_expected_identical_refs. 211s """ 211s # Match the repo_builder objects 211s get_import_tag_msg_mock.return_value = 'Test tag' 211s # Importantly, the following commit message must not be the same as the 211s # commit messages used by the test input repository commits, so that we can 211s # later detect the difference between commits that were already there and 211s # new commits created by the importer for the purposes of asserting the 211s # reuse parameter correctly. 211s get_import_commit_msg_mock.return_value = b'Test commit (new)' 211s 211s > input_repo.write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_tag_test.py:463: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmpxpjto1n3/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s _ test_import_unapplied_spi_tags[input_repo5-expected_output_refs5-validation_repo_delta5-validation_repo_expected_identical_refs5-True] _ 211s 211s get_import_commit_msg_mock = 211s get_import_tag_msg_mock = 211s repo = 211s input_repo = 211s expected_output_refs = ['refs/heads/do-not-push', 'refs/tags/importer/upstream/ubuntu/1.gz', 'refs/heads/importer/importer/ubuntu/dsc', 'refs/heads/importer/importer/ubuntu/pristine-tar', 'refs/notes/importer/importer'] 211s validation_repo_delta = {'update_branches': {'importer/ubuntu/trusty': }, 'update_tags': {'importer/import/1-1': }} 211s validation_repo_expected_identical_refs = ['refs/heads/importer/ubuntu/trusty', 'refs/tags/importer/import/1-1', 'refs/tags/importer/upload/1-1'] 211s reuse = True 211s 211s @pytest.mark.parametrize( 211s [ 211s 'input_repo', 211s 'expected_output_refs', 211s 'validation_repo_delta', 211s 'validation_repo_expected_identical_refs', 211s 'reuse', 211s ], 211s [ 211s # 1) An existing import tag (or reimport tag) with the same Git tree 211s # - Reuse import tag 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo( 211s commits=[Commit.from_spec(name='import')], 211s branches={ 211s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 211s }, 211s tags={'importer/import/1-1': Placeholder('import')}, 211s ), 211s # expected_output_refs: 211s [ 211s 'refs/heads/do-not-push', 211s 'refs/tags/importer/upstream/ubuntu/1.gz', 211s 'refs/heads/importer/importer/ubuntu/dsc', 211s 'refs/heads/importer/importer/ubuntu/pristine-tar', 211s ], 211s # validation_repo_delta: 211s { 211s 'update_branches': { 211s 'importer/ubuntu/trusty': Placeholder('import'), 211s }, 211s }, 211s # validation_repo_expected_identical_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty-proposed', 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1', 211s ], 211s # reuse: 211s True, 211s ), 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo( 211s commits=[ 211s Commit.from_spec( 211s name='import', 211s mutate='import tag contents', 211s ), 211s Commit.from_spec(name='reimport'), 211s ], 211s branches={ 211s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 211s }, 211s tags={ 211s 'importer/import/1-1': Placeholder('import'), 211s 'importer/reimport/import/1-1/0': Placeholder('import'), 211s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 211s }, 211s ), 211s # expected_output_refs: 211s [ 211s 'refs/heads/do-not-push', 211s 'refs/tags/importer/upstream/ubuntu/1.gz', 211s 'refs/heads/importer/importer/ubuntu/dsc', 211s 'refs/heads/importer/importer/ubuntu/pristine-tar', 211s ], 211s # validation_repo_delta: 211s { 211s 'update_branches': { 211s 'importer/ubuntu/trusty': Placeholder('reimport'), 211s }, 211s }, 211s # validation_repo_expected_identical_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty-proposed', 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/reimport/import/1-1/0', 211s 'refs/tags/importer/reimport/import/1-1/1', 211s ], 211s # reuse: 211s True, 211s ), 211s 211s # 2) An existing import tag with a different Git tree and an existing 211s # upload tag with the same Git tree 211s # - Reuse upload tag, create reimport tag 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo( 211s commits=[ 211s Commit.from_spec( 211s name='import', 211s mutate='The import tag contents', 211s ), 211s Commit.from_spec(name='upload'), 211s ], 211s branches={ 211s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 211s }, 211s tags={ 211s 'importer/import/1-1': Placeholder('import'), 211s 'importer/upload/1-1': Placeholder('upload'), 211s }, 211s ), 211s # expected_output_refs: 211s [ 211s 'refs/heads/do-not-push', 211s 'refs/tags/importer/upstream/ubuntu/1.gz', 211s 'refs/heads/importer/importer/ubuntu/dsc', 211s 'refs/heads/importer/importer/ubuntu/pristine-tar', 211s 'refs/notes/importer/importer', 211s ], 211s # validation_repo_delta: 211s { 211s 'update_tags': { 211s 'importer/reimport/import/1-1/0': Placeholder('import'), 211s 'importer/reimport/import/1-1/1': Placeholder('upload'), 211s }, 211s 'update_branches': { 211s 'importer/ubuntu/trusty': Placeholder('upload'), 211s }, 211s }, 211s # validation_repo_expected_identical_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty-proposed', 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/upload/1-1', 211s 'refs/tags/importer/reimport/import/1-1/0', 211s 'refs/tags/importer/reimport/import/1-1/1', 211s ], 211s # reuse: 211s True, 211s ), 211s 211s # 3) An existing import tag with a different Git tree and an existing 211s # upload tag with a different Git tree 211s # - Create reimport tag 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo( 211s commits=[ 211s Commit.from_spec( 211s name='import', 211s mutate='The import tag contents', 211s ), 211s Commit.from_spec( 211s name='upload', 211s mutate='The upload tag contents', 211s ), 211s ], 211s branches={ 211s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 211s }, 211s tags={ 211s 'importer/import/1-1': Placeholder('import'), 211s 'importer/upload/1-1': Placeholder('upload'), 211s }, 211s ), 211s # expected_output_refs: 211s [ 211s 'refs/heads/do-not-push', 211s 'refs/tags/importer/upstream/ubuntu/1.gz', 211s 'refs/heads/importer/importer/ubuntu/dsc', 211s 'refs/heads/importer/importer/ubuntu/pristine-tar', 211s 'refs/notes/importer/changelog', 211s 'refs/notes/importer/importer', 211s ], 211s # validation_repo_delta: 211s { 211s 'add_commits': [Commit.from_spec( 211s name='reimport', 211s message='Test commit (new)', 211s )], 211s 'update_tags': { 211s 'importer/reimport/import/1-1/0': Placeholder('import'), 211s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 211s }, 211s 'update_branches': { 211s 'importer/ubuntu/trusty': Placeholder('reimport'), 211s }, 211s }, 211s # validation_repo_expected_identical_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty-proposed', 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/upload/1-1', 211s 'refs/tags/importer/reimport/import/1-1/0', 211s 'refs/tags/importer/reimport/import/1-1/1', 211s ], 211s # reuse: 211s False, 211s ), 211s 211s # 4) An existing import tag with a different Git tree and no upload tag 211s # - Create reimport tag 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo( 211s commits=[ 211s Commit.from_spec( 211s name='import', 211s mutate='The import tag contents', 211s ), 211s ], 211s branches={ 211s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 211s }, 211s tags={'importer/import/1-1': Placeholder('import')}, 211s ), 211s # expected_output_refs: 211s [ 211s 'refs/heads/do-not-push', 211s 'refs/tags/importer/upstream/ubuntu/1.gz', 211s 'refs/heads/importer/importer/ubuntu/dsc', 211s 'refs/heads/importer/importer/ubuntu/pristine-tar', 211s 'refs/notes/importer/changelog', 211s 'refs/notes/importer/importer', 211s ], 211s # validation_repo_delta: 211s { 211s 'add_commits': [Commit.from_spec( 211s name='reimport', 211s message='Test commit (new)', 211s )], 211s 'update_tags': { 211s 'importer/reimport/import/1-1/0': Placeholder('import'), 211s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 211s }, 211s 'update_branches': { 211s 'importer/ubuntu/trusty': Placeholder('reimport'), 211s }, 211s }, 211s # validation_repo_expected_identical_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty-proposed', 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/reimport/import/1-1/0', 211s 'refs/tags/importer/reimport/import/1-1/1', 211s ], 211s # reuse: 211s False, 211s ), 211s 211s # 5) No import tag and an existing upload tag with the same Git tree 211s # - Reuse upload tag, create import tag 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo( 211s commits=[Commit.from_spec(name='upload')], 211s tags={'importer/upload/1-1': Placeholder('upload')}, 211s ), 211s # expected_output_refs: 211s [ 211s 'refs/heads/do-not-push', 211s 'refs/tags/importer/upstream/ubuntu/1.gz', 211s 'refs/heads/importer/importer/ubuntu/dsc', 211s 'refs/heads/importer/importer/ubuntu/pristine-tar', 211s 'refs/notes/importer/importer', 211s ], 211s # validation_repo_delta: 211s { 211s 'update_tags': { 211s 'importer/import/1-1': Placeholder('upload'), 211s }, 211s 'update_branches': { 211s 'importer/ubuntu/trusty': Placeholder('upload'), 211s }, 211s }, 211s # validation_repo_expected_identical_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/upload/1-1', 211s ], 211s # reuse: 211s True, 211s ), 211s 211s # 6) No import tag and an existing upload tag with a different Git tree 211s # - Create import tag 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo( 211s commits=[ 211s Commit.from_spec( 211s name='upload', 211s mutate='The upload tag contents', 211s ), 211s ], 211s tags={'importer/upload/1-1': Placeholder('upload')}, 211s ), 211s # expected_output_refs: 211s [ 211s 'refs/heads/do-not-push', 211s 'refs/tags/importer/upstream/ubuntu/1.gz', 211s 'refs/heads/importer/importer/ubuntu/dsc', 211s 'refs/heads/importer/importer/ubuntu/pristine-tar', 211s 'refs/notes/importer/changelog', 211s 'refs/notes/importer/importer', 211s ], 211s # validation_repo_delta: 211s { 211s 'add_commits': [ 211s Commit.from_spec( 211s name='publish', 211s message='Test commit (new)', 211s ), 211s ], 211s 'update_tags': { 211s 'importer/import/1-1': Placeholder('publish'), 211s }, 211s 'update_branches': { 211s 'importer/ubuntu/trusty': Placeholder('publish'), 211s }, 211s }, 211s # validation_repo_expected_identical_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/upload/1-1', 211s ], 211s # reuse: 211s False, 211s ), 211s 211s # 7) No import tags or upload tags 211s # - Create import tag 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo(), 211s # expected_output_refs: 211s [ 211s 'refs/heads/do-not-push', 211s 'refs/tags/importer/upstream/ubuntu/1.gz', 211s 'refs/heads/importer/importer/ubuntu/dsc', 211s 'refs/heads/importer/importer/ubuntu/pristine-tar', 211s 'refs/notes/importer/changelog', 211s 'refs/notes/importer/importer', 211s ], 211s # validation_repo_delta: 211s { 211s 'add_commits': [ 211s Commit.from_spec( 211s name='publish', 211s message='Test commit (new)', 211s ), 211s ], 211s 'update_tags': { 211s 'importer/import/1-1': Placeholder('publish'), 211s }, 211s 'update_branches': { 211s 'importer/ubuntu/trusty': Placeholder('publish'), 211s }, 211s }, 211s # validation_repo_expected_identical_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1' 211s ], 211s # reuse: 211s False, 211s ), 211s ] 211s ) 211s @patch('gitubuntu.importer.get_import_tag_msg') 211s @patch('gitubuntu.importer.get_import_commit_msg') 211s def test_import_unapplied_spi_tags( 211s get_import_commit_msg_mock, 211s get_import_tag_msg_mock, 211s repo, 211s input_repo, 211s expected_output_refs, 211s validation_repo_delta, 211s validation_repo_expected_identical_refs, 211s reuse, 211s ): 211s """Test that unapplied tags are correctly created, adjusted and/or reused 211s 211s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 211s that determines the commit message to use for a given import 211s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 211s that determines the tag message to use for a given import 211s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 211s temporary output repository 211s :param repo_builder.Repo input_repo: input repository data 211s :param list(str) expected_output_refs: refs that must exist in the output 211s repository 211s :param dict validation_repo_delta: how to transform the input 211s repository into a "validation repository", expressed as a dict to 211s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 211s input repository. The validation repository is then used for the 211s purposes of comparison against the output repository. 211s :param list(str) validation_repo_expected_identical_refs: refs that must be 211s identical between the validation repository and the output repository 211s :param bool reuse: if set, the output ref importer/ubuntu/trusty must be 211s one supplied by the input repository (assumed to have a commit message 211s of "Test commit") and not one created by the importer in this run 211s (arranged by this test to have a different commit message) 211s 211s The input repository data is written into the output repository and then a 211s fake non-native source package publication of version 1-1 in the Trusty 211s release pocket is imported into it by calling import_unapplied_spi() 211s directly. expected_output_refs, validation_repo_expected_identical_refs and 211s reuse are then asserted. It is further asserted that no other refs exist in 211s the output repository except for those listed in expected_output_refs and 211s validation_repo_expected_identical_refs. 211s """ 211s # Match the repo_builder objects 211s get_import_tag_msg_mock.return_value = 'Test tag' 211s # Importantly, the following commit message must not be the same as the 211s # commit messages used by the test input repository commits, so that we can 211s # later detect the difference between commits that were already there and 211s # new commits created by the importer for the purposes of asserting the 211s # reuse parameter correctly. 211s get_import_commit_msg_mock.return_value = b'Test commit (new)' 211s 211s > input_repo.write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_tag_test.py:463: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmpyi4x_x8h/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s _ test_import_unapplied_spi_tags[input_repo6-expected_output_refs6-validation_repo_delta6-validation_repo_expected_identical_refs6-False] _ 211s 211s get_import_commit_msg_mock = 211s get_import_tag_msg_mock = 211s repo = 211s input_repo = 211s expected_output_refs = ['refs/heads/do-not-push', 'refs/tags/importer/upstream/ubuntu/1.gz', 'refs/heads/importer/importer/ubuntu/dsc', 'refs/heads/importer/importer/ubuntu/pristine-tar', 'refs/notes/importer/changelog', 'refs/notes/importer/importer'] 211s validation_repo_delta = {'add_commits': [], 'update_branches': {'importer/ubuntu/trust...x637914a6c260>}, 'update_tags': {'importer/import/1-1': }} 211s validation_repo_expected_identical_refs = ['refs/heads/importer/ubuntu/trusty', 'refs/tags/importer/import/1-1', 'refs/tags/importer/upload/1-1'] 211s reuse = False 211s 211s @pytest.mark.parametrize( 211s [ 211s 'input_repo', 211s 'expected_output_refs', 211s 'validation_repo_delta', 211s 'validation_repo_expected_identical_refs', 211s 'reuse', 211s ], 211s [ 211s # 1) An existing import tag (or reimport tag) with the same Git tree 211s # - Reuse import tag 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo( 211s commits=[Commit.from_spec(name='import')], 211s branches={ 211s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 211s }, 211s tags={'importer/import/1-1': Placeholder('import')}, 211s ), 211s # expected_output_refs: 211s [ 211s 'refs/heads/do-not-push', 211s 'refs/tags/importer/upstream/ubuntu/1.gz', 211s 'refs/heads/importer/importer/ubuntu/dsc', 211s 'refs/heads/importer/importer/ubuntu/pristine-tar', 211s ], 211s # validation_repo_delta: 211s { 211s 'update_branches': { 211s 'importer/ubuntu/trusty': Placeholder('import'), 211s }, 211s }, 211s # validation_repo_expected_identical_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty-proposed', 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1', 211s ], 211s # reuse: 211s True, 211s ), 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo( 211s commits=[ 211s Commit.from_spec( 211s name='import', 211s mutate='import tag contents', 211s ), 211s Commit.from_spec(name='reimport'), 211s ], 211s branches={ 211s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 211s }, 211s tags={ 211s 'importer/import/1-1': Placeholder('import'), 211s 'importer/reimport/import/1-1/0': Placeholder('import'), 211s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 211s }, 211s ), 211s # expected_output_refs: 211s [ 211s 'refs/heads/do-not-push', 211s 'refs/tags/importer/upstream/ubuntu/1.gz', 211s 'refs/heads/importer/importer/ubuntu/dsc', 211s 'refs/heads/importer/importer/ubuntu/pristine-tar', 211s ], 211s # validation_repo_delta: 211s { 211s 'update_branches': { 211s 'importer/ubuntu/trusty': Placeholder('reimport'), 211s }, 211s }, 211s # validation_repo_expected_identical_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty-proposed', 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/reimport/import/1-1/0', 211s 'refs/tags/importer/reimport/import/1-1/1', 211s ], 211s # reuse: 211s True, 211s ), 211s 211s # 2) An existing import tag with a different Git tree and an existing 211s # upload tag with the same Git tree 211s # - Reuse upload tag, create reimport tag 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo( 211s commits=[ 211s Commit.from_spec( 211s name='import', 211s mutate='The import tag contents', 211s ), 211s Commit.from_spec(name='upload'), 211s ], 211s branches={ 211s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 211s }, 211s tags={ 211s 'importer/import/1-1': Placeholder('import'), 211s 'importer/upload/1-1': Placeholder('upload'), 211s }, 211s ), 211s # expected_output_refs: 211s [ 211s 'refs/heads/do-not-push', 211s 'refs/tags/importer/upstream/ubuntu/1.gz', 211s 'refs/heads/importer/importer/ubuntu/dsc', 211s 'refs/heads/importer/importer/ubuntu/pristine-tar', 211s 'refs/notes/importer/importer', 211s ], 211s # validation_repo_delta: 211s { 211s 'update_tags': { 211s 'importer/reimport/import/1-1/0': Placeholder('import'), 211s 'importer/reimport/import/1-1/1': Placeholder('upload'), 211s }, 211s 'update_branches': { 211s 'importer/ubuntu/trusty': Placeholder('upload'), 211s }, 211s }, 211s # validation_repo_expected_identical_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty-proposed', 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/upload/1-1', 211s 'refs/tags/importer/reimport/import/1-1/0', 211s 'refs/tags/importer/reimport/import/1-1/1', 211s ], 211s # reuse: 211s True, 211s ), 211s 211s # 3) An existing import tag with a different Git tree and an existing 211s # upload tag with a different Git tree 211s # - Create reimport tag 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo( 211s commits=[ 211s Commit.from_spec( 211s name='import', 211s mutate='The import tag contents', 211s ), 211s Commit.from_spec( 211s name='upload', 211s mutate='The upload tag contents', 211s ), 211s ], 211s branches={ 211s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 211s }, 211s tags={ 211s 'importer/import/1-1': Placeholder('import'), 211s 'importer/upload/1-1': Placeholder('upload'), 211s }, 211s ), 211s # expected_output_refs: 211s [ 211s 'refs/heads/do-not-push', 211s 'refs/tags/importer/upstream/ubuntu/1.gz', 211s 'refs/heads/importer/importer/ubuntu/dsc', 211s 'refs/heads/importer/importer/ubuntu/pristine-tar', 211s 'refs/notes/importer/changelog', 211s 'refs/notes/importer/importer', 211s ], 211s # validation_repo_delta: 211s { 211s 'add_commits': [Commit.from_spec( 211s name='reimport', 211s message='Test commit (new)', 211s )], 211s 'update_tags': { 211s 'importer/reimport/import/1-1/0': Placeholder('import'), 211s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 211s }, 211s 'update_branches': { 211s 'importer/ubuntu/trusty': Placeholder('reimport'), 211s }, 211s }, 211s # validation_repo_expected_identical_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty-proposed', 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/upload/1-1', 211s 'refs/tags/importer/reimport/import/1-1/0', 211s 'refs/tags/importer/reimport/import/1-1/1', 211s ], 211s # reuse: 211s False, 211s ), 211s 211s # 4) An existing import tag with a different Git tree and no upload tag 211s # - Create reimport tag 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo( 211s commits=[ 211s Commit.from_spec( 211s name='import', 211s mutate='The import tag contents', 211s ), 211s ], 211s branches={ 211s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 211s }, 211s tags={'importer/import/1-1': Placeholder('import')}, 211s ), 211s # expected_output_refs: 211s [ 211s 'refs/heads/do-not-push', 211s 'refs/tags/importer/upstream/ubuntu/1.gz', 211s 'refs/heads/importer/importer/ubuntu/dsc', 211s 'refs/heads/importer/importer/ubuntu/pristine-tar', 211s 'refs/notes/importer/changelog', 211s 'refs/notes/importer/importer', 211s ], 211s # validation_repo_delta: 211s { 211s 'add_commits': [Commit.from_spec( 211s name='reimport', 211s message='Test commit (new)', 211s )], 211s 'update_tags': { 211s 'importer/reimport/import/1-1/0': Placeholder('import'), 211s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 211s }, 211s 'update_branches': { 211s 'importer/ubuntu/trusty': Placeholder('reimport'), 211s }, 211s }, 211s # validation_repo_expected_identical_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty-proposed', 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/reimport/import/1-1/0', 211s 'refs/tags/importer/reimport/import/1-1/1', 211s ], 211s # reuse: 211s False, 211s ), 211s 211s # 5) No import tag and an existing upload tag with the same Git tree 211s # - Reuse upload tag, create import tag 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo( 211s commits=[Commit.from_spec(name='upload')], 211s tags={'importer/upload/1-1': Placeholder('upload')}, 211s ), 211s # expected_output_refs: 211s [ 211s 'refs/heads/do-not-push', 211s 'refs/tags/importer/upstream/ubuntu/1.gz', 211s 'refs/heads/importer/importer/ubuntu/dsc', 211s 'refs/heads/importer/importer/ubuntu/pristine-tar', 211s 'refs/notes/importer/importer', 211s ], 211s # validation_repo_delta: 211s { 211s 'update_tags': { 211s 'importer/import/1-1': Placeholder('upload'), 211s }, 211s 'update_branches': { 211s 'importer/ubuntu/trusty': Placeholder('upload'), 211s }, 211s }, 211s # validation_repo_expected_identical_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/upload/1-1', 211s ], 211s # reuse: 211s True, 211s ), 211s 211s # 6) No import tag and an existing upload tag with a different Git tree 211s # - Create import tag 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo( 211s commits=[ 211s Commit.from_spec( 211s name='upload', 211s mutate='The upload tag contents', 211s ), 211s ], 211s tags={'importer/upload/1-1': Placeholder('upload')}, 211s ), 211s # expected_output_refs: 211s [ 211s 'refs/heads/do-not-push', 211s 'refs/tags/importer/upstream/ubuntu/1.gz', 211s 'refs/heads/importer/importer/ubuntu/dsc', 211s 'refs/heads/importer/importer/ubuntu/pristine-tar', 211s 'refs/notes/importer/changelog', 211s 'refs/notes/importer/importer', 211s ], 211s # validation_repo_delta: 211s { 211s 'add_commits': [ 211s Commit.from_spec( 211s name='publish', 211s message='Test commit (new)', 211s ), 211s ], 211s 'update_tags': { 211s 'importer/import/1-1': Placeholder('publish'), 211s }, 211s 'update_branches': { 211s 'importer/ubuntu/trusty': Placeholder('publish'), 211s }, 211s }, 211s # validation_repo_expected_identical_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/upload/1-1', 211s ], 211s # reuse: 211s False, 211s ), 211s 211s # 7) No import tags or upload tags 211s # - Create import tag 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo(), 211s # expected_output_refs: 211s [ 211s 'refs/heads/do-not-push', 211s 'refs/tags/importer/upstream/ubuntu/1.gz', 211s 'refs/heads/importer/importer/ubuntu/dsc', 211s 'refs/heads/importer/importer/ubuntu/pristine-tar', 211s 'refs/notes/importer/changelog', 211s 'refs/notes/importer/importer', 211s ], 211s # validation_repo_delta: 211s { 211s 'add_commits': [ 211s Commit.from_spec( 211s name='publish', 211s message='Test commit (new)', 211s ), 211s ], 211s 'update_tags': { 211s 'importer/import/1-1': Placeholder('publish'), 211s }, 211s 'update_branches': { 211s 'importer/ubuntu/trusty': Placeholder('publish'), 211s }, 211s }, 211s # validation_repo_expected_identical_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1' 211s ], 211s # reuse: 211s False, 211s ), 211s ] 211s ) 211s @patch('gitubuntu.importer.get_import_tag_msg') 211s @patch('gitubuntu.importer.get_import_commit_msg') 211s def test_import_unapplied_spi_tags( 211s get_import_commit_msg_mock, 211s get_import_tag_msg_mock, 211s repo, 211s input_repo, 211s expected_output_refs, 211s validation_repo_delta, 211s validation_repo_expected_identical_refs, 211s reuse, 211s ): 211s """Test that unapplied tags are correctly created, adjusted and/or reused 211s 211s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 211s that determines the commit message to use for a given import 211s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 211s that determines the tag message to use for a given import 211s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 211s temporary output repository 211s :param repo_builder.Repo input_repo: input repository data 211s :param list(str) expected_output_refs: refs that must exist in the output 211s repository 211s :param dict validation_repo_delta: how to transform the input 211s repository into a "validation repository", expressed as a dict to 211s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 211s input repository. The validation repository is then used for the 211s purposes of comparison against the output repository. 211s :param list(str) validation_repo_expected_identical_refs: refs that must be 211s identical between the validation repository and the output repository 211s :param bool reuse: if set, the output ref importer/ubuntu/trusty must be 211s one supplied by the input repository (assumed to have a commit message 211s of "Test commit") and not one created by the importer in this run 211s (arranged by this test to have a different commit message) 211s 211s The input repository data is written into the output repository and then a 211s fake non-native source package publication of version 1-1 in the Trusty 211s release pocket is imported into it by calling import_unapplied_spi() 211s directly. expected_output_refs, validation_repo_expected_identical_refs and 211s reuse are then asserted. It is further asserted that no other refs exist in 211s the output repository except for those listed in expected_output_refs and 211s validation_repo_expected_identical_refs. 211s """ 211s # Match the repo_builder objects 211s get_import_tag_msg_mock.return_value = 'Test tag' 211s # Importantly, the following commit message must not be the same as the 211s # commit messages used by the test input repository commits, so that we can 211s # later detect the difference between commits that were already there and 211s # new commits created by the importer for the purposes of asserting the 211s # reuse parameter correctly. 211s get_import_commit_msg_mock.return_value = b'Test commit (new)' 211s 211s > input_repo.write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_tag_test.py:463: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmpxkpxyby5/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s _ test_import_unapplied_spi_tags[input_repo7-expected_output_refs7-validation_repo_delta7-validation_repo_expected_identical_refs7-False] _ 211s 211s get_import_commit_msg_mock = 211s get_import_tag_msg_mock = 211s repo = 211s input_repo = 211s expected_output_refs = ['refs/heads/do-not-push', 'refs/tags/importer/upstream/ubuntu/1.gz', 'refs/heads/importer/importer/ubuntu/dsc', 'refs/heads/importer/importer/ubuntu/pristine-tar', 'refs/notes/importer/changelog', 'refs/notes/importer/importer'] 211s validation_repo_delta = {'add_commits': [], 'update_branches': {'importer/ubuntu/trust...x637914a6c560>}, 'update_tags': {'importer/import/1-1': }} 211s validation_repo_expected_identical_refs = ['refs/heads/importer/ubuntu/trusty', 'refs/tags/importer/import/1-1'] 211s reuse = False 211s 211s @pytest.mark.parametrize( 211s [ 211s 'input_repo', 211s 'expected_output_refs', 211s 'validation_repo_delta', 211s 'validation_repo_expected_identical_refs', 211s 'reuse', 211s ], 211s [ 211s # 1) An existing import tag (or reimport tag) with the same Git tree 211s # - Reuse import tag 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo( 211s commits=[Commit.from_spec(name='import')], 211s branches={ 211s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 211s }, 211s tags={'importer/import/1-1': Placeholder('import')}, 211s ), 211s # expected_output_refs: 211s [ 211s 'refs/heads/do-not-push', 211s 'refs/tags/importer/upstream/ubuntu/1.gz', 211s 'refs/heads/importer/importer/ubuntu/dsc', 211s 'refs/heads/importer/importer/ubuntu/pristine-tar', 211s ], 211s # validation_repo_delta: 211s { 211s 'update_branches': { 211s 'importer/ubuntu/trusty': Placeholder('import'), 211s }, 211s }, 211s # validation_repo_expected_identical_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty-proposed', 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1', 211s ], 211s # reuse: 211s True, 211s ), 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo( 211s commits=[ 211s Commit.from_spec( 211s name='import', 211s mutate='import tag contents', 211s ), 211s Commit.from_spec(name='reimport'), 211s ], 211s branches={ 211s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 211s }, 211s tags={ 211s 'importer/import/1-1': Placeholder('import'), 211s 'importer/reimport/import/1-1/0': Placeholder('import'), 211s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 211s }, 211s ), 211s # expected_output_refs: 211s [ 211s 'refs/heads/do-not-push', 211s 'refs/tags/importer/upstream/ubuntu/1.gz', 211s 'refs/heads/importer/importer/ubuntu/dsc', 211s 'refs/heads/importer/importer/ubuntu/pristine-tar', 211s ], 211s # validation_repo_delta: 211s { 211s 'update_branches': { 211s 'importer/ubuntu/trusty': Placeholder('reimport'), 211s }, 211s }, 211s # validation_repo_expected_identical_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty-proposed', 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/reimport/import/1-1/0', 211s 'refs/tags/importer/reimport/import/1-1/1', 211s ], 211s # reuse: 211s True, 211s ), 211s 211s # 2) An existing import tag with a different Git tree and an existing 211s # upload tag with the same Git tree 211s # - Reuse upload tag, create reimport tag 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo( 211s commits=[ 211s Commit.from_spec( 211s name='import', 211s mutate='The import tag contents', 211s ), 211s Commit.from_spec(name='upload'), 211s ], 211s branches={ 211s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 211s }, 211s tags={ 211s 'importer/import/1-1': Placeholder('import'), 211s 'importer/upload/1-1': Placeholder('upload'), 211s }, 211s ), 211s # expected_output_refs: 211s [ 211s 'refs/heads/do-not-push', 211s 'refs/tags/importer/upstream/ubuntu/1.gz', 211s 'refs/heads/importer/importer/ubuntu/dsc', 211s 'refs/heads/importer/importer/ubuntu/pristine-tar', 211s 'refs/notes/importer/importer', 211s ], 211s # validation_repo_delta: 211s { 211s 'update_tags': { 211s 'importer/reimport/import/1-1/0': Placeholder('import'), 211s 'importer/reimport/import/1-1/1': Placeholder('upload'), 211s }, 211s 'update_branches': { 211s 'importer/ubuntu/trusty': Placeholder('upload'), 211s }, 211s }, 211s # validation_repo_expected_identical_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty-proposed', 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/upload/1-1', 211s 'refs/tags/importer/reimport/import/1-1/0', 211s 'refs/tags/importer/reimport/import/1-1/1', 211s ], 211s # reuse: 211s True, 211s ), 211s 211s # 3) An existing import tag with a different Git tree and an existing 211s # upload tag with a different Git tree 211s # - Create reimport tag 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo( 211s commits=[ 211s Commit.from_spec( 211s name='import', 211s mutate='The import tag contents', 211s ), 211s Commit.from_spec( 211s name='upload', 211s mutate='The upload tag contents', 211s ), 211s ], 211s branches={ 211s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 211s }, 211s tags={ 211s 'importer/import/1-1': Placeholder('import'), 211s 'importer/upload/1-1': Placeholder('upload'), 211s }, 211s ), 211s # expected_output_refs: 211s [ 211s 'refs/heads/do-not-push', 211s 'refs/tags/importer/upstream/ubuntu/1.gz', 211s 'refs/heads/importer/importer/ubuntu/dsc', 211s 'refs/heads/importer/importer/ubuntu/pristine-tar', 211s 'refs/notes/importer/changelog', 211s 'refs/notes/importer/importer', 211s ], 211s # validation_repo_delta: 211s { 211s 'add_commits': [Commit.from_spec( 211s name='reimport', 211s message='Test commit (new)', 211s )], 211s 'update_tags': { 211s 'importer/reimport/import/1-1/0': Placeholder('import'), 211s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 211s }, 211s 'update_branches': { 211s 'importer/ubuntu/trusty': Placeholder('reimport'), 211s }, 211s }, 211s # validation_repo_expected_identical_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty-proposed', 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/upload/1-1', 211s 'refs/tags/importer/reimport/import/1-1/0', 211s 'refs/tags/importer/reimport/import/1-1/1', 211s ], 211s # reuse: 211s False, 211s ), 211s 211s # 4) An existing import tag with a different Git tree and no upload tag 211s # - Create reimport tag 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo( 211s commits=[ 211s Commit.from_spec( 211s name='import', 211s mutate='The import tag contents', 211s ), 211s ], 211s branches={ 211s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 211s }, 211s tags={'importer/import/1-1': Placeholder('import')}, 211s ), 211s # expected_output_refs: 211s [ 211s 'refs/heads/do-not-push', 211s 'refs/tags/importer/upstream/ubuntu/1.gz', 211s 'refs/heads/importer/importer/ubuntu/dsc', 211s 'refs/heads/importer/importer/ubuntu/pristine-tar', 211s 'refs/notes/importer/changelog', 211s 'refs/notes/importer/importer', 211s ], 211s # validation_repo_delta: 211s { 211s 'add_commits': [Commit.from_spec( 211s name='reimport', 211s message='Test commit (new)', 211s )], 211s 'update_tags': { 211s 'importer/reimport/import/1-1/0': Placeholder('import'), 211s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 211s }, 211s 'update_branches': { 211s 'importer/ubuntu/trusty': Placeholder('reimport'), 211s }, 211s }, 211s # validation_repo_expected_identical_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty-proposed', 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/reimport/import/1-1/0', 211s 'refs/tags/importer/reimport/import/1-1/1', 211s ], 211s # reuse: 211s False, 211s ), 211s 211s # 5) No import tag and an existing upload tag with the same Git tree 211s # - Reuse upload tag, create import tag 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo( 211s commits=[Commit.from_spec(name='upload')], 211s tags={'importer/upload/1-1': Placeholder('upload')}, 211s ), 211s # expected_output_refs: 211s [ 211s 'refs/heads/do-not-push', 211s 'refs/tags/importer/upstream/ubuntu/1.gz', 211s 'refs/heads/importer/importer/ubuntu/dsc', 211s 'refs/heads/importer/importer/ubuntu/pristine-tar', 211s 'refs/notes/importer/importer', 211s ], 211s # validation_repo_delta: 211s { 211s 'update_tags': { 211s 'importer/import/1-1': Placeholder('upload'), 211s }, 211s 'update_branches': { 211s 'importer/ubuntu/trusty': Placeholder('upload'), 211s }, 211s }, 211s # validation_repo_expected_identical_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/upload/1-1', 211s ], 211s # reuse: 211s True, 211s ), 211s 211s # 6) No import tag and an existing upload tag with a different Git tree 211s # - Create import tag 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo( 211s commits=[ 211s Commit.from_spec( 211s name='upload', 211s mutate='The upload tag contents', 211s ), 211s ], 211s tags={'importer/upload/1-1': Placeholder('upload')}, 211s ), 211s # expected_output_refs: 211s [ 211s 'refs/heads/do-not-push', 211s 'refs/tags/importer/upstream/ubuntu/1.gz', 211s 'refs/heads/importer/importer/ubuntu/dsc', 211s 'refs/heads/importer/importer/ubuntu/pristine-tar', 211s 'refs/notes/importer/changelog', 211s 'refs/notes/importer/importer', 211s ], 211s # validation_repo_delta: 211s { 211s 'add_commits': [ 211s Commit.from_spec( 211s name='publish', 211s message='Test commit (new)', 211s ), 211s ], 211s 'update_tags': { 211s 'importer/import/1-1': Placeholder('publish'), 211s }, 211s 'update_branches': { 211s 'importer/ubuntu/trusty': Placeholder('publish'), 211s }, 211s }, 211s # validation_repo_expected_identical_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/upload/1-1', 211s ], 211s # reuse: 211s False, 211s ), 211s 211s # 7) No import tags or upload tags 211s # - Create import tag 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo(), 211s # expected_output_refs: 211s [ 211s 'refs/heads/do-not-push', 211s 'refs/tags/importer/upstream/ubuntu/1.gz', 211s 'refs/heads/importer/importer/ubuntu/dsc', 211s 'refs/heads/importer/importer/ubuntu/pristine-tar', 211s 'refs/notes/importer/changelog', 211s 'refs/notes/importer/importer', 211s ], 211s # validation_repo_delta: 211s { 211s 'add_commits': [ 211s Commit.from_spec( 211s name='publish', 211s message='Test commit (new)', 211s ), 211s ], 211s 'update_tags': { 211s 'importer/import/1-1': Placeholder('publish'), 211s }, 211s 'update_branches': { 211s 'importer/ubuntu/trusty': Placeholder('publish'), 211s }, 211s }, 211s # validation_repo_expected_identical_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1' 211s ], 211s # reuse: 211s False, 211s ), 211s ] 211s ) 211s @patch('gitubuntu.importer.get_import_tag_msg') 211s @patch('gitubuntu.importer.get_import_commit_msg') 211s def test_import_unapplied_spi_tags( 211s get_import_commit_msg_mock, 211s get_import_tag_msg_mock, 211s repo, 211s input_repo, 211s expected_output_refs, 211s validation_repo_delta, 211s validation_repo_expected_identical_refs, 211s reuse, 211s ): 211s """Test that unapplied tags are correctly created, adjusted and/or reused 211s 211s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 211s that determines the commit message to use for a given import 211s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 211s that determines the tag message to use for a given import 211s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 211s temporary output repository 211s :param repo_builder.Repo input_repo: input repository data 211s :param list(str) expected_output_refs: refs that must exist in the output 211s repository 211s :param dict validation_repo_delta: how to transform the input 211s repository into a "validation repository", expressed as a dict to 211s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 211s input repository. The validation repository is then used for the 211s purposes of comparison against the output repository. 211s :param list(str) validation_repo_expected_identical_refs: refs that must be 211s identical between the validation repository and the output repository 211s :param bool reuse: if set, the output ref importer/ubuntu/trusty must be 211s one supplied by the input repository (assumed to have a commit message 211s of "Test commit") and not one created by the importer in this run 211s (arranged by this test to have a different commit message) 211s 211s The input repository data is written into the output repository and then a 211s fake non-native source package publication of version 1-1 in the Trusty 211s release pocket is imported into it by calling import_unapplied_spi() 211s directly. expected_output_refs, validation_repo_expected_identical_refs and 211s reuse are then asserted. It is further asserted that no other refs exist in 211s the output repository except for those listed in expected_output_refs and 211s validation_repo_expected_identical_refs. 211s """ 211s # Match the repo_builder objects 211s get_import_tag_msg_mock.return_value = 'Test tag' 211s # Importantly, the following commit message must not be the same as the 211s # commit messages used by the test input repository commits, so that we can 211s # later detect the difference between commits that were already there and 211s # new commits created by the importer for the purposes of asserting the 211s # reuse parameter correctly. 211s get_import_commit_msg_mock.return_value = b'Test commit (new)' 211s 211s input_repo.write(repo.raw_repo) 211s 211s publish_spec = source_builder.SourceSpec( 211s version='1-1', 211s native=False, 211s ) 211s 211s with source_builder.Source(publish_spec) as dsc_path: 211s > target.import_unapplied_spi( 211s repo=repo, 211s spi=MockSPI(dsc_path, publish_spec.version), 211s namespace='importer', 211s skip_orig=False, 211s parent_overrides={}, 211s ) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_tag_test.py:471: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer.py:2308: in import_unapplied_spi 211s import_unapplied_dsc( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer.py:2230: in import_unapplied_dsc 211s commit, tag = find_or_create_unapplied_commit( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer.py:2052: in find_or_create_unapplied_commit 211s changelog_parents = get_unapplied_import_parents( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer.py:1503: in get_unapplied_import_parents 211s import_tree_versions = repo.get_all_changelog_versions_from_treeish( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:2230: in get_all_changelog_versions_from_treeish 211s changelog = self.get_changelog_from_treeish(treeish) 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 211s return Changelog.from_treeish( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:569: in from_treeish 211s blob = follow_symlinks_to_blob( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 211s return _follow_symlinks_to_blob( 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s repo = pygit2.Repository('/tmp/tmpanjo5b1f/.git/') 211s top_tree_object = 211s search_path = 'debian/changelog' 211s _rel_tree = 211s _rel_path = '' 211s 211s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 211s _rel_tree=None, _rel_path='' 211s ): 211s '''Recursively follow a path down a tree, following symlinks, to find blob 211s 211s repo: pygit2.Repository object 211s top_tree: pygit2.Tree object of the top of the tree structure 211s search_path: '/'-separated path string of blob to find 211s _rel_tree: (internal) which tree to look further into 211s _rel_path: (internal) the path we are in so far 211s ''' 211s 211s NORMAL_BLOB_MODES = set([ 211s pygit2.GIT_FILEMODE_BLOB, 211s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 211s ]) 211s 211s _rel_tree = _rel_tree or top_tree_object 211s head, tail = posixpath.split(search_path) 211s 211s # A traditional functional split would put a single entry in head with tail 211s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 211s # to make it appear to have traditional semantics. 211s if not head: 211s head = tail 211s tail = None 211s 211s entry = _rel_tree[head] 211s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:68: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s _ test_import_applied_spi_tags[input_repo0-validation_repo_delta0-validation_repo_expected_treewise_refs0-True] _ 211s 211s get_import_commit_msg_mock = 211s get_import_tag_msg_mock = 211s repo = 211s input_repo = 211s validation_repo_delta = {} 211s validation_repo_expected_treewise_refs = ['refs/heads/importer/ubuntu/trusty', 'refs/heads/importer/applied/ubuntu/trusty', 'refs/tags/importer/import/1-1', 'refs/tags/importer/applied/1-1'] 211s reuse = True 211s 211s @pytest.mark.parametrize( 211s [ 211s 'input_repo', 211s 'validation_repo_delta', 211s 'validation_repo_expected_treewise_refs', 211s 'reuse', 211s ], 211s [ 211s # 1) An existing applied tag (or reimport tag) with the same Git tree 211s # - Reuse applied tag 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo( 211s commits=[ 211s Commit.from_spec(name='unapplied', has_patches=True), 211s Commit.from_spec(name='applied', patches_applied=True), 211s ], 211s branches={ 211s 'importer/ubuntu/trusty': Placeholder('unapplied'), 211s 'importer/applied/ubuntu/trusty': Placeholder('applied'), 211s }, 211s tags={ 211s 'importer/import/1-1': Placeholder('unapplied'), 211s 'importer/applied/1-1': Placeholder('applied'), 211s }, 211s ), 211s # validation_repo_delta: 211s { 211s # no output repository delta 211s }, 211s # validation_repo_expected_treewise_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/heads/importer/applied/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/applied/1-1', 211s ], 211s # reuse: 211s True, 211s ), 211s 211s # 2) An existing applied tag with a different Git tree 211s # - Create reimport tag 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo( 211s commits=[ 211s Commit.from_spec( 211s name='unapplied', 211s has_patches=True, 211s mutate='import tag contents', 211s ), 211s Commit.from_spec( 211s name='unapplied_reimport', 211s has_patches=True, 211s ), 211s Commit.from_spec( 211s name='applied', 211s patches_applied=True, 211s mutate='import tag contents', 211s ) 211s ], 211s branches={'importer/ubuntu/trusty': Placeholder('unapplied')}, 211s tags={ 211s 'importer/import/1-1': 211s Placeholder('unapplied'), 211s 'importer/reimport/import/1-1/0': 211s Placeholder('unapplied'), 211s 'importer/reimport/import/1-1/1': 211s Placeholder('unapplied_reimport'), 211s 'importer/applied/1-1': 211s Placeholder('applied'), 211s }, 211s ), 211s # validation_repo_delta: 211s { 211s 'add_commits': [ 211s Commit.from_spec( 211s name='applied_reimport', 211s patches_applied=True, 211s parents=[Placeholder('unapplied_reimport')], 211s ), 211s ], 211s 'update_tags': { 211s 'importer/reimport/applied/1-1/0': 211s Placeholder('applied'), 211s 'importer/reimport/applied/1-1/1': 211s Placeholder('applied_reimport'), 211s }, 211s 'update_branches': { 211s 'importer/applied/ubuntu/trusty': 211s Placeholder('applied_reimport'), 211s }, 211s }, 211s # validation_repo_expected_treewise_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/heads/importer/applied/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/reimport/import/1-1/0', 211s 'refs/tags/importer/reimport/import/1-1/1', 211s 'refs/tags/importer/applied/1-1', 211s 'refs/tags/importer/reimport/applied/1-1/0', 211s 'refs/tags/importer/reimport/applied/1-1/1', 211s ], 211s # reuse: 211s False, 211s 211s marks=pytest.mark.xfail(reason='LP: #1755247'), 211s ), 211s 211s # 3) No applied tags 211s # - Create applied tag 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo( 211s commits=[Commit.from_spec(name='unapplied', has_patches=True)], 211s branches={'importer/ubuntu/trusty': Placeholder('unapplied')}, 211s tags={'importer/import/1-1': Placeholder('unapplied')}, 211s ), 211s # validation_repo_delta: 211s { 211s 'add_commits': [ 211s Commit.from_spec( 211s name='applied', 211s patches_applied=True, 211s parents=[Placeholder('unapplied')], 211s ), 211s ], 211s 'update_tags': { 211s 'importer/applied/1-1': Placeholder('applied') 211s }, 211s 'update_branches': { 211s 'importer/applied/ubuntu/trusty': Placeholder('applied'), 211s }, 211s }, 211s # validation_repo_expected_treewise_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/heads/importer/applied/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/applied/1-1' 211s ], 211s # reuse: 211s False, 211s ), 211s ] 211s ) 211s @patch('gitubuntu.importer.get_import_tag_msg') 211s @patch('gitubuntu.importer.get_import_commit_msg') 211s def test_import_applied_spi_tags( 211s get_import_commit_msg_mock, 211s get_import_tag_msg_mock, 211s repo, 211s input_repo, 211s validation_repo_delta, 211s validation_repo_expected_treewise_refs, 211s reuse, 211s ): 211s """Test that applied tags are correctly created, adjusted and/or reused 211s 211s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 211s that determines the commit message to use for a given import 211s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 211s that determines the tag message to use for a given import 211s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 211s temporary output repository 211s :param repo_builder.Repo input_repo: input repository data 211s :param dict validation_repo_delta: how to transform the input repository 211s into a "validation repository", expressed as a dict to 211s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 211s input repository. The validation repository is then used for the 211s purposes of comparison against the output repository. 211s :param list(str) validation_repo_expected_treewise_refs: refs whose trees 211s must be identical between the validation repository and the output 211s repository 211s :param bool reuse: if set, the output ref importer/ubuntu/trusty must be 211s one supplied by the input repository (assumed to have a commit message 211s of "Test commit") and not one created by the importer in this run 211s (arranged by this test to have a different commit message) 211s 211s The input repository data is written into the output repository and then a 211s fake non-native source package publication of version 1-1 in the Trusty 211s release pocket is imported into it by calling import_applied_spi() 211s directly. reuse and validation_repo_expected_treewise_refs are then 211s asserted. 211s 211s This is similar to test_unapplied_spi_tags except that it calls 211s import_applied_spi() instead of import_unapplied_spi() and only treewise 211s ref comparisons are made. 211s """ 211s # Match the repo_builder objects 211s get_import_tag_msg_mock.return_value = 'Test tag' 211s # Importantly, the following commit message must not be the same as the 211s # commit messages used by the test input repository commits, so that we can 211s # later detect the difference between commits that were already there and 211s # new commits created by the importer for the purposes of asserting the 211s # reuse parameter correctly. 211s get_import_commit_msg_mock.return_value = b'Test commit (new)' 211s 211s > input_repo.write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_tag_test.py:711: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmpvhf40tnm/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: using patch list from debian/patches/series 211s dpkg-source: info: applying a 211s dpkg-source: info: applying b 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: using patch list from debian/patches/series 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: using patch list from debian/patches/series 211s dpkg-source: info: applying a 211s dpkg-source: info: applying b 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: using patch list from debian/patches/series 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: using patch list from debian/patches/series 211s dpkg-source: info: applying a 211s dpkg-source: info: applying b 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: using patch list from debian/patches/series 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: using patch list from debian/patches/series 211s dpkg-source: info: applying a 211s dpkg-source: info: applying b 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: using patch list from debian/patches/series 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: using patch list from debian/patches/series 211s dpkg-source: info: applying a 211s dpkg-source: info: applying b 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: using patch list from debian/patches/series 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s _ test_import_applied_spi_tags[input_repo2-validation_repo_delta2-validation_repo_expected_treewise_refs2-False] _ 211s 211s get_import_commit_msg_mock = 211s get_import_tag_msg_mock = 211s repo = 211s input_repo = 211s validation_repo_delta = {'add_commits': [], 'update_branches': {'importer/applied/ubun...637914a6da00>}, 'update_tags': {'importer/applied/1-1': }} 211s validation_repo_expected_treewise_refs = ['refs/heads/importer/ubuntu/trusty', 'refs/heads/importer/applied/ubuntu/trusty', 'refs/tags/importer/import/1-1', 'refs/tags/importer/applied/1-1'] 211s reuse = False 211s 211s @pytest.mark.parametrize( 211s [ 211s 'input_repo', 211s 'validation_repo_delta', 211s 'validation_repo_expected_treewise_refs', 211s 'reuse', 211s ], 211s [ 211s # 1) An existing applied tag (or reimport tag) with the same Git tree 211s # - Reuse applied tag 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo( 211s commits=[ 211s Commit.from_spec(name='unapplied', has_patches=True), 211s Commit.from_spec(name='applied', patches_applied=True), 211s ], 211s branches={ 211s 'importer/ubuntu/trusty': Placeholder('unapplied'), 211s 'importer/applied/ubuntu/trusty': Placeholder('applied'), 211s }, 211s tags={ 211s 'importer/import/1-1': Placeholder('unapplied'), 211s 'importer/applied/1-1': Placeholder('applied'), 211s }, 211s ), 211s # validation_repo_delta: 211s { 211s # no output repository delta 211s }, 211s # validation_repo_expected_treewise_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/heads/importer/applied/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/applied/1-1', 211s ], 211s # reuse: 211s True, 211s ), 211s 211s # 2) An existing applied tag with a different Git tree 211s # - Create reimport tag 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo( 211s commits=[ 211s Commit.from_spec( 211s name='unapplied', 211s has_patches=True, 211s mutate='import tag contents', 211s ), 211s Commit.from_spec( 211s name='unapplied_reimport', 211s has_patches=True, 211s ), 211s Commit.from_spec( 211s name='applied', 211s patches_applied=True, 211s mutate='import tag contents', 211s ) 211s ], 211s branches={'importer/ubuntu/trusty': Placeholder('unapplied')}, 211s tags={ 211s 'importer/import/1-1': 211s Placeholder('unapplied'), 211s 'importer/reimport/import/1-1/0': 211s Placeholder('unapplied'), 211s 'importer/reimport/import/1-1/1': 211s Placeholder('unapplied_reimport'), 211s 'importer/applied/1-1': 211s Placeholder('applied'), 211s }, 211s ), 211s # validation_repo_delta: 211s { 211s 'add_commits': [ 211s Commit.from_spec( 211s name='applied_reimport', 211s patches_applied=True, 211s parents=[Placeholder('unapplied_reimport')], 211s ), 211s ], 211s 'update_tags': { 211s 'importer/reimport/applied/1-1/0': 211s Placeholder('applied'), 211s 'importer/reimport/applied/1-1/1': 211s Placeholder('applied_reimport'), 211s }, 211s 'update_branches': { 211s 'importer/applied/ubuntu/trusty': 211s Placeholder('applied_reimport'), 211s }, 211s }, 211s # validation_repo_expected_treewise_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/heads/importer/applied/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/reimport/import/1-1/0', 211s 'refs/tags/importer/reimport/import/1-1/1', 211s 'refs/tags/importer/applied/1-1', 211s 'refs/tags/importer/reimport/applied/1-1/0', 211s 'refs/tags/importer/reimport/applied/1-1/1', 211s ], 211s # reuse: 211s False, 211s 211s marks=pytest.mark.xfail(reason='LP: #1755247'), 211s ), 211s 211s # 3) No applied tags 211s # - Create applied tag 211s pytest.param( 211s # input_repo: 211s repo_builder.Repo( 211s commits=[Commit.from_spec(name='unapplied', has_patches=True)], 211s branches={'importer/ubuntu/trusty': Placeholder('unapplied')}, 211s tags={'importer/import/1-1': Placeholder('unapplied')}, 211s ), 211s # validation_repo_delta: 211s { 211s 'add_commits': [ 211s Commit.from_spec( 211s name='applied', 211s patches_applied=True, 211s parents=[Placeholder('unapplied')], 211s ), 211s ], 211s 'update_tags': { 211s 'importer/applied/1-1': Placeholder('applied') 211s }, 211s 'update_branches': { 211s 'importer/applied/ubuntu/trusty': Placeholder('applied'), 211s }, 211s }, 211s # validation_repo_expected_treewise_refs: 211s [ 211s 'refs/heads/importer/ubuntu/trusty', 211s 'refs/heads/importer/applied/ubuntu/trusty', 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/applied/1-1' 211s ], 211s # reuse: 211s False, 211s ), 211s ] 211s ) 211s @patch('gitubuntu.importer.get_import_tag_msg') 211s @patch('gitubuntu.importer.get_import_commit_msg') 211s def test_import_applied_spi_tags( 211s get_import_commit_msg_mock, 211s get_import_tag_msg_mock, 211s repo, 211s input_repo, 211s validation_repo_delta, 211s validation_repo_expected_treewise_refs, 211s reuse, 211s ): 211s """Test that applied tags are correctly created, adjusted and/or reused 211s 211s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 211s that determines the commit message to use for a given import 211s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 211s that determines the tag message to use for a given import 211s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 211s temporary output repository 211s :param repo_builder.Repo input_repo: input repository data 211s :param dict validation_repo_delta: how to transform the input repository 211s into a "validation repository", expressed as a dict to 211s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 211s input repository. The validation repository is then used for the 211s purposes of comparison against the output repository. 211s :param list(str) validation_repo_expected_treewise_refs: refs whose trees 211s must be identical between the validation repository and the output 211s repository 211s :param bool reuse: if set, the output ref importer/ubuntu/trusty must be 211s one supplied by the input repository (assumed to have a commit message 211s of "Test commit") and not one created by the importer in this run 211s (arranged by this test to have a different commit message) 211s 211s The input repository data is written into the output repository and then a 211s fake non-native source package publication of version 1-1 in the Trusty 211s release pocket is imported into it by calling import_applied_spi() 211s directly. reuse and validation_repo_expected_treewise_refs are then 211s asserted. 211s 211s This is similar to test_unapplied_spi_tags except that it calls 211s import_applied_spi() instead of import_unapplied_spi() and only treewise 211s ref comparisons are made. 211s """ 211s # Match the repo_builder objects 211s get_import_tag_msg_mock.return_value = 'Test tag' 211s # Importantly, the following commit message must not be the same as the 211s # commit messages used by the test input repository commits, so that we can 211s # later detect the difference between commits that were already there and 211s # new commits created by the importer for the purposes of asserting the 211s # reuse parameter correctly. 211s get_import_commit_msg_mock.return_value = b'Test commit (new)' 211s 211s > input_repo.write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_tag_test.py:711: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmpqdorb2td/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: using patch list from debian/patches/series 211s dpkg-source: info: applying a 211s dpkg-source: info: applying b 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: using patch list from debian/patches/series 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: using patch list from debian/patches/series 211s dpkg-source: info: applying a 211s dpkg-source: info: applying b 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: using patch list from debian/patches/series 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: using patch list from debian/patches/series 211s dpkg-source: info: applying a 211s dpkg-source: info: applying b 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: using patch list from debian/patches/series 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s __ test_get_existing_import_tags[input_repo1-PatchState.UNAPPLIED-expected1] ___ 211s 211s repo = 211s patch_state = 211s input_repo = 211s expected = ['refs/tags/importer/import/1-1'] 211s 211s @pytest.mark.parametrize( 211s 'input_repo, patch_state, expected', [ 211s ( 211s repo_builder.Repo(), 211s PatchState.UNAPPLIED, 211s [], 211s ), 211s ( 211s repo_builder.Repo( 211s tags={'importer/import/1-1': repo_builder.Commit()}, 211s ), 211s PatchState.UNAPPLIED, 211s ['refs/tags/importer/import/1-1'], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit(name='import'), 211s repo_builder.Commit(name='reimport1'), 211s ], 211s tags={ 211s 'importer/import/1-1': repo_builder.Commit(), 211s 'importer/reimport/import/1-1/0': repo_builder.Commit(), 211s 'importer/reimport/import/1-1/1': repo_builder.Commit(), 211s }, 211s ), 211s PatchState.UNAPPLIED, 211s [ 211s 'refs/tags/importer/reimport/import/1-1/0', 211s 'refs/tags/importer/reimport/import/1-1/1', 211s ], 211s ), 211s ( 211s repo_builder.Repo(), 211s PatchState.APPLIED, 211s [], 211s ), 211s ( 211s repo_builder.Repo( 211s tags={'importer/applied/1-1': repo_builder.Commit()}, 211s ), 211s PatchState.APPLIED, 211s ['refs/tags/importer/applied/1-1'], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit(name='applied'), 211s repo_builder.Commit(name='reimport1'), 211s ], 211s tags={ 211s 'importer/applied/1-1': repo_builder.Commit(), 211s 'importer/reimport/applied/1-1/0': repo_builder.Commit(), 211s 'importer/reimport/applied/1-1/1': repo_builder.Commit(), 211s }, 211s ), 211s PatchState.APPLIED, 211s [ 211s 'refs/tags/importer/reimport/applied/1-1/0', 211s 'refs/tags/importer/reimport/applied/1-1/1', 211s ], 211s ), 211s ], 211s ) 211s def test_get_existing_import_tags(repo, patch_state, input_repo, expected): 211s """Test that get_existing_import_tags is generally correct 211s 211s This is the general parameterised test for the common case uses of 211s target.get_existing_import_tags. 211s 211s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 211s temporary output repository 211s :param PatchState patch_state: passed through to get_existing_import_tags 211s :param repo_builder.Repo input_repo: input repository data 211s :param list(str) expected: the names of the references that are expected to 211s be returned, in order. 211s """ 211s > input_repo.write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:214: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmpmw3j2j9y/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s __ test_get_existing_import_tags[input_repo2-PatchState.UNAPPLIED-expected2] ___ 211s 211s repo = 211s patch_state = 211s input_repo = 211s expected = ['refs/tags/importer/reimport/import/1-1/0', 'refs/tags/importer/reimport/import/1-1/1'] 211s 211s @pytest.mark.parametrize( 211s 'input_repo, patch_state, expected', [ 211s ( 211s repo_builder.Repo(), 211s PatchState.UNAPPLIED, 211s [], 211s ), 211s ( 211s repo_builder.Repo( 211s tags={'importer/import/1-1': repo_builder.Commit()}, 211s ), 211s PatchState.UNAPPLIED, 211s ['refs/tags/importer/import/1-1'], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit(name='import'), 211s repo_builder.Commit(name='reimport1'), 211s ], 211s tags={ 211s 'importer/import/1-1': repo_builder.Commit(), 211s 'importer/reimport/import/1-1/0': repo_builder.Commit(), 211s 'importer/reimport/import/1-1/1': repo_builder.Commit(), 211s }, 211s ), 211s PatchState.UNAPPLIED, 211s [ 211s 'refs/tags/importer/reimport/import/1-1/0', 211s 'refs/tags/importer/reimport/import/1-1/1', 211s ], 211s ), 211s ( 211s repo_builder.Repo(), 211s PatchState.APPLIED, 211s [], 211s ), 211s ( 211s repo_builder.Repo( 211s tags={'importer/applied/1-1': repo_builder.Commit()}, 211s ), 211s PatchState.APPLIED, 211s ['refs/tags/importer/applied/1-1'], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit(name='applied'), 211s repo_builder.Commit(name='reimport1'), 211s ], 211s tags={ 211s 'importer/applied/1-1': repo_builder.Commit(), 211s 'importer/reimport/applied/1-1/0': repo_builder.Commit(), 211s 'importer/reimport/applied/1-1/1': repo_builder.Commit(), 211s }, 211s ), 211s PatchState.APPLIED, 211s [ 211s 'refs/tags/importer/reimport/applied/1-1/0', 211s 'refs/tags/importer/reimport/applied/1-1/1', 211s ], 211s ), 211s ], 211s ) 211s def test_get_existing_import_tags(repo, patch_state, input_repo, expected): 211s """Test that get_existing_import_tags is generally correct 211s 211s This is the general parameterised test for the common case uses of 211s target.get_existing_import_tags. 211s 211s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 211s temporary output repository 211s :param PatchState patch_state: passed through to get_existing_import_tags 211s :param repo_builder.Repo input_repo: input repository data 211s :param list(str) expected: the names of the references that are expected to 211s be returned, in order. 211s """ 211s > input_repo.write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:214: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmp3tarr1ab/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s ___ test_get_existing_import_tags[input_repo4-PatchState.APPLIED-expected4] ____ 211s 211s repo = 211s patch_state = 211s input_repo = 211s expected = ['refs/tags/importer/applied/1-1'] 211s 211s @pytest.mark.parametrize( 211s 'input_repo, patch_state, expected', [ 211s ( 211s repo_builder.Repo(), 211s PatchState.UNAPPLIED, 211s [], 211s ), 211s ( 211s repo_builder.Repo( 211s tags={'importer/import/1-1': repo_builder.Commit()}, 211s ), 211s PatchState.UNAPPLIED, 211s ['refs/tags/importer/import/1-1'], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit(name='import'), 211s repo_builder.Commit(name='reimport1'), 211s ], 211s tags={ 211s 'importer/import/1-1': repo_builder.Commit(), 211s 'importer/reimport/import/1-1/0': repo_builder.Commit(), 211s 'importer/reimport/import/1-1/1': repo_builder.Commit(), 211s }, 211s ), 211s PatchState.UNAPPLIED, 211s [ 211s 'refs/tags/importer/reimport/import/1-1/0', 211s 'refs/tags/importer/reimport/import/1-1/1', 211s ], 211s ), 211s ( 211s repo_builder.Repo(), 211s PatchState.APPLIED, 211s [], 211s ), 211s ( 211s repo_builder.Repo( 211s tags={'importer/applied/1-1': repo_builder.Commit()}, 211s ), 211s PatchState.APPLIED, 211s ['refs/tags/importer/applied/1-1'], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit(name='applied'), 211s repo_builder.Commit(name='reimport1'), 211s ], 211s tags={ 211s 'importer/applied/1-1': repo_builder.Commit(), 211s 'importer/reimport/applied/1-1/0': repo_builder.Commit(), 211s 'importer/reimport/applied/1-1/1': repo_builder.Commit(), 211s }, 211s ), 211s PatchState.APPLIED, 211s [ 211s 'refs/tags/importer/reimport/applied/1-1/0', 211s 'refs/tags/importer/reimport/applied/1-1/1', 211s ], 211s ), 211s ], 211s ) 211s def test_get_existing_import_tags(repo, patch_state, input_repo, expected): 211s """Test that get_existing_import_tags is generally correct 211s 211s This is the general parameterised test for the common case uses of 211s target.get_existing_import_tags. 211s 211s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 211s temporary output repository 211s :param PatchState patch_state: passed through to get_existing_import_tags 211s :param repo_builder.Repo input_repo: input repository data 211s :param list(str) expected: the names of the references that are expected to 211s be returned, in order. 211s """ 211s > input_repo.write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:214: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmp7lxy8yjg/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s ___ test_get_existing_import_tags[input_repo5-PatchState.APPLIED-expected5] ____ 211s 211s repo = 211s patch_state = 211s input_repo = 211s expected = ['refs/tags/importer/reimport/applied/1-1/0', 'refs/tags/importer/reimport/applied/1-1/1'] 211s 211s @pytest.mark.parametrize( 211s 'input_repo, patch_state, expected', [ 211s ( 211s repo_builder.Repo(), 211s PatchState.UNAPPLIED, 211s [], 211s ), 211s ( 211s repo_builder.Repo( 211s tags={'importer/import/1-1': repo_builder.Commit()}, 211s ), 211s PatchState.UNAPPLIED, 211s ['refs/tags/importer/import/1-1'], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit(name='import'), 211s repo_builder.Commit(name='reimport1'), 211s ], 211s tags={ 211s 'importer/import/1-1': repo_builder.Commit(), 211s 'importer/reimport/import/1-1/0': repo_builder.Commit(), 211s 'importer/reimport/import/1-1/1': repo_builder.Commit(), 211s }, 211s ), 211s PatchState.UNAPPLIED, 211s [ 211s 'refs/tags/importer/reimport/import/1-1/0', 211s 'refs/tags/importer/reimport/import/1-1/1', 211s ], 211s ), 211s ( 211s repo_builder.Repo(), 211s PatchState.APPLIED, 211s [], 211s ), 211s ( 211s repo_builder.Repo( 211s tags={'importer/applied/1-1': repo_builder.Commit()}, 211s ), 211s PatchState.APPLIED, 211s ['refs/tags/importer/applied/1-1'], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit(name='applied'), 211s repo_builder.Commit(name='reimport1'), 211s ], 211s tags={ 211s 'importer/applied/1-1': repo_builder.Commit(), 211s 'importer/reimport/applied/1-1/0': repo_builder.Commit(), 211s 'importer/reimport/applied/1-1/1': repo_builder.Commit(), 211s }, 211s ), 211s PatchState.APPLIED, 211s [ 211s 'refs/tags/importer/reimport/applied/1-1/0', 211s 'refs/tags/importer/reimport/applied/1-1/1', 211s ], 211s ), 211s ], 211s ) 211s def test_get_existing_import_tags(repo, patch_state, input_repo, expected): 211s """Test that get_existing_import_tags is generally correct 211s 211s This is the general parameterised test for the common case uses of 211s target.get_existing_import_tags. 211s 211s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 211s temporary output repository 211s :param PatchState patch_state: passed through to get_existing_import_tags 211s :param repo_builder.Repo input_repo: input repository data 211s :param list(str) expected: the names of the references that are expected to 211s be returned, in order. 211s """ 211s > input_repo.write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:214: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmpkzq35i8h/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s ____________________ test_get_existing_import_tags_ordering ____________________ 211s 211s repo = 211s 211s def test_get_existing_import_tags_ordering(repo): 211s """Test that get_existing_import_tags returns results in the correct order 211s 211s To maintain hash stability, the spec defines that multiple changelog 211s parents must appear in the order that they were published. For this to 211s work, get_existing_import_tags must return the tags in the correct order 211s even if the underlying git repository tags appear in an arbitrary order. 211s 211s :param GitUbuntuRepository repo: fixture of a temporary repository to use 211s """ 211s 211s # Construct a synthetic git repository containing tags 211s repo_builder.Repo( 211s tags={ 211s 'importer/import/1-1': repo_builder.Commit(), 211s 'importer/reimport/import/1-1/0': repo_builder.Commit(), 211s 'importer/reimport/import/1-1/1': repo_builder.Commit(), 211s } 211s > ).write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:240: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmpsk4gfkbh/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s _ test_create_import_tag[input_repo0-validation_repo_delta0-validation_repo_expected_identical_refs0] _ 211s 211s repo = 211s input_repo = 211s validation_repo_delta = {'add_commits': [], 'update_tags': {'importer/import/1-1': }} 211s validation_repo_expected_identical_refs = ['refs/tags/importer/import/1-1'] 211s 211s @pytest.mark.parametrize( 211s [ 211s 'input_repo', 211s 'validation_repo_delta', 211s 'validation_repo_expected_identical_refs', 211s ], 211s [ 211s ( 211s repo_builder.Repo(), 211s { 211s 'add_commits': [ 211s repo_builder.Commit(name='import'), 211s ], 211s 'update_tags': { 211s 'importer/import/1-1': Placeholder('import'), 211s }, 211s }, 211s [ 211s 'refs/tags/importer/import/1-1', 211s ], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[repo_builder.Commit(name='import')], 211s tags={'importer/import/1-1': Placeholder('import')}, 211s ), 211s { 211s 'add_commits': [ 211s repo_builder.Commit(name='reimport'), 211s ], 211s 'update_tags': { 211s 'importer/reimport/import/1-1/0': Placeholder('import'), 211s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 211s }, 211s }, 211s [ 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/reimport/import/1-1/0', 211s 'refs/tags/importer/reimport/import/1-1/1', 211s ], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit(name='import'), 211s repo_builder.Commit(name='reimport1'), 211s ], 211s tags={ 211s 'importer/import/1-1': Placeholder('import'), 211s 'importer/reimport/import/1-1/0': Placeholder('import'), 211s 'importer/reimport/import/1-1/1': Placeholder('reimport1'), 211s }, 211s ), 211s { 211s 'add_commits': [ 211s repo_builder.Commit(name='reimport2'), 211s ], 211s 'update_tags': { 211s 'importer/reimport/import/1-1/2': Placeholder('reimport2'), 211s }, 211s }, 211s [ 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/reimport/import/1-1/0', 211s 'refs/tags/importer/reimport/import/1-1/1', 211s 'refs/tags/importer/reimport/import/1-1/2', 211s ], 211s ), 211s ], 211s ) 211s def test_create_import_tag( 211s repo, 211s input_repo, 211s validation_repo_delta, 211s validation_repo_expected_identical_refs, 211s ): 211s """ 211s Unit test that create_import_tag creates the correct import tag 211s 211s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 211s temporary output repository 211s :param repo_builder.Repo input_repo: input repository data 211s :param dict validation_repo_delta: how to transform the input repository 211s into a "validation repository", expressed as a dict to 211s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 211s input repository. The validation repository is then used for the 211s purposes of comparison against the output repository. 211s :param list(str) validation_repo_expected_identical_refs: refs that must be 211s identical between the validation repository and the output repository 211s """ 211s publish_commit = repo.raw_repo.get( 211s repo_builder.Commit().write(repo.raw_repo) 211s ).peel(pygit2.Commit) 211s input_repo.write(repo.raw_repo) 211s 211s > target.create_import_tag(repo, publish_commit, '1-1', 'importer') 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:370: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer.py:1379: in create_import_tag 211s repo.create_tag( 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s commit_hash = '240dd844a69653244edb52c57c42d709512d64cd' 211s tag_name = 'importer/import/1-1', tag_msg = 'git-ubuntu import' 211s tagger = pygit2.Signature('git-ubuntu importer', 'ubuntu-devel-discuss@lists.ubuntu.com', 0, 0, None) 211s 211s def create_tag(self, 211s commit_hash, 211s tag_name, 211s tag_msg, 211s tagger=None, 211s ): 211s """Create a tag in the repository 211s 211s :param str commit_hash: the commit hash the tag will point to. 211s :param str tag_name: the name of the tag to be created. 211s :param str tag_msg: the text of the tag annotation. 211s :param pygit2.Signature tagger: if supplied, use this signature in the 211s created tag's "tagger" metadata. If not supplied, an arbitrary name 211s and email address is used with the current time. 211s :returns: None 211s """ 211s if not tagger: 211s tagger_time, tagger_offset = datetime_to_signature_spec( 211s datetime.datetime.now(), 211s ) 211s tagger = pygit2.Signature( 211s gitubuntu.spec.SYNTHESIZED_COMMITTER_NAME, 211s gitubuntu.spec.SYNTHESIZED_COMMITTER_EMAIL, 211s tagger_time, 211s tagger_offset, 211s ) 211s 211s logging.debug("Creating tag %s pointing to %s", tag_name, commit_hash) 211s self.raw_repo.create_tag( 211s tag_name, 211s pygit2.Oid(hex=commit_hash), 211s > pygit2.GIT_OBJ_COMMIT, 211s tagger, 211s tag_msg, 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:2114: AttributeError 211s _ test_create_import_tag[input_repo1-validation_repo_delta1-validation_repo_expected_identical_refs1] _ 211s 211s repo = 211s input_repo = 211s validation_repo_delta = {'add_commits': [], 'update_tags': {'importer/reimport/import/...t at 0x637914a8ea80>, 'importer/reimport/import/1-1/1': }} 211s validation_repo_expected_identical_refs = ['refs/tags/importer/import/1-1', 'refs/tags/importer/reimport/import/1-1/0', 'refs/tags/importer/reimport/import/1-1/1'] 211s 211s @pytest.mark.parametrize( 211s [ 211s 'input_repo', 211s 'validation_repo_delta', 211s 'validation_repo_expected_identical_refs', 211s ], 211s [ 211s ( 211s repo_builder.Repo(), 211s { 211s 'add_commits': [ 211s repo_builder.Commit(name='import'), 211s ], 211s 'update_tags': { 211s 'importer/import/1-1': Placeholder('import'), 211s }, 211s }, 211s [ 211s 'refs/tags/importer/import/1-1', 211s ], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[repo_builder.Commit(name='import')], 211s tags={'importer/import/1-1': Placeholder('import')}, 211s ), 211s { 211s 'add_commits': [ 211s repo_builder.Commit(name='reimport'), 211s ], 211s 'update_tags': { 211s 'importer/reimport/import/1-1/0': Placeholder('import'), 211s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 211s }, 211s }, 211s [ 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/reimport/import/1-1/0', 211s 'refs/tags/importer/reimport/import/1-1/1', 211s ], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit(name='import'), 211s repo_builder.Commit(name='reimport1'), 211s ], 211s tags={ 211s 'importer/import/1-1': Placeholder('import'), 211s 'importer/reimport/import/1-1/0': Placeholder('import'), 211s 'importer/reimport/import/1-1/1': Placeholder('reimport1'), 211s }, 211s ), 211s { 211s 'add_commits': [ 211s repo_builder.Commit(name='reimport2'), 211s ], 211s 'update_tags': { 211s 'importer/reimport/import/1-1/2': Placeholder('reimport2'), 211s }, 211s }, 211s [ 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/reimport/import/1-1/0', 211s 'refs/tags/importer/reimport/import/1-1/1', 211s 'refs/tags/importer/reimport/import/1-1/2', 211s ], 211s ), 211s ], 211s ) 211s def test_create_import_tag( 211s repo, 211s input_repo, 211s validation_repo_delta, 211s validation_repo_expected_identical_refs, 211s ): 211s """ 211s Unit test that create_import_tag creates the correct import tag 211s 211s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 211s temporary output repository 211s :param repo_builder.Repo input_repo: input repository data 211s :param dict validation_repo_delta: how to transform the input repository 211s into a "validation repository", expressed as a dict to 211s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 211s input repository. The validation repository is then used for the 211s purposes of comparison against the output repository. 211s :param list(str) validation_repo_expected_identical_refs: refs that must be 211s identical between the validation repository and the output repository 211s """ 211s publish_commit = repo.raw_repo.get( 211s repo_builder.Commit().write(repo.raw_repo) 211s ).peel(pygit2.Commit) 211s > input_repo.write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:368: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmpk0ifj0r3/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s _ test_create_import_tag[input_repo2-validation_repo_delta2-validation_repo_expected_identical_refs2] _ 211s 211s repo = 211s input_repo = 211s validation_repo_delta = {'add_commits': [], 'update_tags': {'importer/reimport/import/1-1/2': }} 211s validation_repo_expected_identical_refs = ['refs/tags/importer/import/1-1', 'refs/tags/importer/reimport/import/1-1/0', 'refs/tags/importer/reimport/import/1-1/1', 'refs/tags/importer/reimport/import/1-1/2'] 211s 211s @pytest.mark.parametrize( 211s [ 211s 'input_repo', 211s 'validation_repo_delta', 211s 'validation_repo_expected_identical_refs', 211s ], 211s [ 211s ( 211s repo_builder.Repo(), 211s { 211s 'add_commits': [ 211s repo_builder.Commit(name='import'), 211s ], 211s 'update_tags': { 211s 'importer/import/1-1': Placeholder('import'), 211s }, 211s }, 211s [ 211s 'refs/tags/importer/import/1-1', 211s ], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[repo_builder.Commit(name='import')], 211s tags={'importer/import/1-1': Placeholder('import')}, 211s ), 211s { 211s 'add_commits': [ 211s repo_builder.Commit(name='reimport'), 211s ], 211s 'update_tags': { 211s 'importer/reimport/import/1-1/0': Placeholder('import'), 211s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 211s }, 211s }, 211s [ 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/reimport/import/1-1/0', 211s 'refs/tags/importer/reimport/import/1-1/1', 211s ], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit(name='import'), 211s repo_builder.Commit(name='reimport1'), 211s ], 211s tags={ 211s 'importer/import/1-1': Placeholder('import'), 211s 'importer/reimport/import/1-1/0': Placeholder('import'), 211s 'importer/reimport/import/1-1/1': Placeholder('reimport1'), 211s }, 211s ), 211s { 211s 'add_commits': [ 211s repo_builder.Commit(name='reimport2'), 211s ], 211s 'update_tags': { 211s 'importer/reimport/import/1-1/2': Placeholder('reimport2'), 211s }, 211s }, 211s [ 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/reimport/import/1-1/0', 211s 'refs/tags/importer/reimport/import/1-1/1', 211s 'refs/tags/importer/reimport/import/1-1/2', 211s ], 211s ), 211s ], 211s ) 211s def test_create_import_tag( 211s repo, 211s input_repo, 211s validation_repo_delta, 211s validation_repo_expected_identical_refs, 211s ): 211s """ 211s Unit test that create_import_tag creates the correct import tag 211s 211s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 211s temporary output repository 211s :param repo_builder.Repo input_repo: input repository data 211s :param dict validation_repo_delta: how to transform the input repository 211s into a "validation repository", expressed as a dict to 211s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 211s input repository. The validation repository is then used for the 211s purposes of comparison against the output repository. 211s :param list(str) validation_repo_expected_identical_refs: refs that must be 211s identical between the validation repository and the output repository 211s """ 211s publish_commit = repo.raw_repo.get( 211s repo_builder.Commit().write(repo.raw_repo) 211s ).peel(pygit2.Commit) 211s > input_repo.write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:368: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmpbgwyzsbe/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s ____________ test_create_import_tag_hash_stability_on_first_import _____________ 211s 211s repo = 211s 211s def test_create_import_tag_hash_stability_on_first_import(repo): 211s """Created import tags should be hash stable on first import 211s 211s :param GitUbuntuRepository repo: fixture providing a temporary 211s GitUbuntuRepository instance to use 211s """ 211s publish_commit = repo.raw_repo.get( 211s repo_builder.Commit( 211s author=pygit2.Signature( 211s 'Hash stability test author', 211s 'newauthor@example.com', 211s 1, 211s 2, 211s ), 211s committer=pygit2.Signature( 211s 'Hash stability test committer', 211s 'newcommitter@example.com', 211s 3, 211s 4, 211s ), 211s ).write(repo.raw_repo) 211s ).peel(pygit2.Commit) 211s > target.create_import_tag(repo, publish_commit, '1-1', 'importer') 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:402: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer.py:1379: in create_import_tag 211s repo.create_tag( 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s commit_hash = '65729a1dca101328820bf4f49fbca4e9571a772a' 211s tag_name = 'importer/import/1-1', tag_msg = 'git-ubuntu import' 211s tagger = pygit2.Signature('git-ubuntu importer', 'ubuntu-devel-discuss@lists.ubuntu.com', 3, 4, None) 211s 211s def create_tag(self, 211s commit_hash, 211s tag_name, 211s tag_msg, 211s tagger=None, 211s ): 211s """Create a tag in the repository 211s 211s :param str commit_hash: the commit hash the tag will point to. 211s :param str tag_name: the name of the tag to be created. 211s :param str tag_msg: the text of the tag annotation. 211s :param pygit2.Signature tagger: if supplied, use this signature in the 211s created tag's "tagger" metadata. If not supplied, an arbitrary name 211s and email address is used with the current time. 211s :returns: None 211s """ 211s if not tagger: 211s tagger_time, tagger_offset = datetime_to_signature_spec( 211s datetime.datetime.now(), 211s ) 211s tagger = pygit2.Signature( 211s gitubuntu.spec.SYNTHESIZED_COMMITTER_NAME, 211s gitubuntu.spec.SYNTHESIZED_COMMITTER_EMAIL, 211s tagger_time, 211s tagger_offset, 211s ) 211s 211s logging.debug("Creating tag %s pointing to %s", tag_name, commit_hash) 211s self.raw_repo.create_tag( 211s tag_name, 211s pygit2.Oid(hex=commit_hash), 211s > pygit2.GIT_OBJ_COMMIT, 211s tagger, 211s tag_msg, 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:2114: AttributeError 211s ______________ test_create_import_tag_hash_stability_on_reimport _______________ 211s 211s repo = 211s 211s def test_create_import_tag_hash_stability_on_reimport(repo): 211s """Created import tags should be hash stable on reimport 211s 211s This includes both the /0 duplicate reimport tag of the original import tag 211s as well as the /1 reimport tag being created. 211s 211s :param GitUbuntuRepository repo: fixture providing a temporary 211s GitUbuntuRepository instance to use 211s """ 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit( 211s name='root', 211s author=pygit2.Signature( 211s 'Hash stability test author', 211s 'author@example.com', 211s 1, 211s 2, 211s ), 211s committer=pygit2.Signature( 211s 'Hash stability test committer', 211s 'committer@example.com', 211s 3, 211s 4, 211s ), 211s ), 211s ], 211s tags={ 211s 'importer/import/1-1': Placeholder('root'), 211s }, 211s tagger=pygit2.Signature( 211s 'Hash stability test name', 211s 'stability@example.com', 211s 5, 211s 6, 211s ), 211s > ).write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:449: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmpehety97z/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s _ test_create_applied_tag[input_repo0-validation_repo_delta0-validation_repo_expected_identical_refs0] _ 211s 211s repo = 211s input_repo = 211s validation_repo_delta = {'add_commits': [], 'update_tags': {'importer/applied/1-1': }} 211s validation_repo_expected_identical_refs = ['refs/tags/importer/applied/1-1'] 211s 211s @pytest.mark.parametrize( 211s [ 211s 'input_repo', 211s 'validation_repo_delta', 211s 'validation_repo_expected_identical_refs', 211s ], 211s [ 211s ( 211s repo_builder.Repo(), 211s { 211s 'add_commits': [repo_builder.Commit(name='import')], 211s 'update_tags': {'importer/applied/1-1': Placeholder('import')}, 211s }, 211s [ 211s 'refs/tags/importer/applied/1-1', 211s ], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[repo_builder.Commit(name='import')], 211s tags={'importer/applied/1-1': Placeholder('import')}, 211s ), 211s { 211s 'add_commits': [repo_builder.Commit(name='reimport')], 211s 'update_tags': { 211s 'importer/reimport/applied/1-1/0': Placeholder('import'), 211s 'importer/reimport/applied/1-1/1': Placeholder('reimport'), 211s }, 211s }, 211s [ 211s 'refs/tags/importer/applied/1-1', 211s 'refs/tags/importer/reimport/applied/1-1/0', 211s 'refs/tags/importer/reimport/applied/1-1/1', 211s ], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit(name='import'), 211s repo_builder.Commit(name='reimport1'), 211s ], 211s tags={ 211s 'importer/applied/1-1': Placeholder('import'), 211s 'importer/reimport/applied/1-1/0': Placeholder('import'), 211s 'importer/reimport/applied/1-1/1': Placeholder('reimport1'), 211s }, 211s ), 211s { 211s 'add_commits': [ 211s repo_builder.Commit(name='reimport2') 211s ], 211s 'update_tags': { 211s 'importer/reimport/applied/1-1/2': Placeholder('reimport2'), 211s }, 211s }, 211s [ 211s 'refs/tags/importer/applied/1-1', 211s 'refs/tags/importer/reimport/applied/1-1/0', 211s 'refs/tags/importer/reimport/applied/1-1/1', 211s 'refs/tags/importer/reimport/applied/1-1/2', 211s ], 211s ), 211s ], 211s ) 211s def test_create_applied_tag( 211s repo, 211s input_repo, 211s validation_repo_delta, 211s validation_repo_expected_identical_refs, 211s ): 211s """ 211s Unit test that create_applied_tag creates the correct import tag 211s 211s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 211s temporary output repository 211s :param repo_builder.Repo input_repo: input repository data 211s :param dict validation_repo_delta: how to transform the input repository 211s into a "validation repository", expressed as a dict to 211s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 211s input repository. The validation repository is then used for the 211s purposes of comparison against the output repository. 211s :param list(str) validation_repo_expected_identical_refs: refs that must be 211s identical between the validation repository and the output repository 211s """ 211s publish_commit_str = str( 211s repo.raw_repo.get( 211s repo_builder.Commit().write(repo.raw_repo) 211s ).peel(pygit2.Commit).id 211s ) 211s 211s input_repo.write(repo.raw_repo) 211s 211s > target.create_applied_tag(repo, publish_commit_str, '1-1', 'importer') 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:577: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer.py:1309: in create_applied_tag 211s repo.create_tag( 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s commit_hash = '240dd844a69653244edb52c57c42d709512d64cd' 211s tag_name = 'importer/applied/1-1', tag_msg = 'git-ubuntu import' 211s tagger = pygit2.Signature('git-ubuntu importer', 'ubuntu-devel-discuss@lists.ubuntu.com', 1732877245, 0, None) 211s 211s def create_tag(self, 211s commit_hash, 211s tag_name, 211s tag_msg, 211s tagger=None, 211s ): 211s """Create a tag in the repository 211s 211s :param str commit_hash: the commit hash the tag will point to. 211s :param str tag_name: the name of the tag to be created. 211s :param str tag_msg: the text of the tag annotation. 211s :param pygit2.Signature tagger: if supplied, use this signature in the 211s created tag's "tagger" metadata. If not supplied, an arbitrary name 211s and email address is used with the current time. 211s :returns: None 211s """ 211s if not tagger: 211s tagger_time, tagger_offset = datetime_to_signature_spec( 211s datetime.datetime.now(), 211s ) 211s tagger = pygit2.Signature( 211s gitubuntu.spec.SYNTHESIZED_COMMITTER_NAME, 211s gitubuntu.spec.SYNTHESIZED_COMMITTER_EMAIL, 211s tagger_time, 211s tagger_offset, 211s ) 211s 211s logging.debug("Creating tag %s pointing to %s", tag_name, commit_hash) 211s self.raw_repo.create_tag( 211s tag_name, 211s pygit2.Oid(hex=commit_hash), 211s > pygit2.GIT_OBJ_COMMIT, 211s tagger, 211s tag_msg, 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:2114: AttributeError 211s _ test_create_applied_tag[input_repo1-validation_repo_delta1-validation_repo_expected_identical_refs1] _ 211s 211s repo = 211s input_repo = 211s validation_repo_delta = {'add_commits': [], 'update_tags': {'importer/reimport/applied... at 0x637914a8db50>, 'importer/reimport/applied/1-1/1': }} 211s validation_repo_expected_identical_refs = ['refs/tags/importer/applied/1-1', 'refs/tags/importer/reimport/applied/1-1/0', 'refs/tags/importer/reimport/applied/1-1/1'] 211s 211s @pytest.mark.parametrize( 211s [ 211s 'input_repo', 211s 'validation_repo_delta', 211s 'validation_repo_expected_identical_refs', 211s ], 211s [ 211s ( 211s repo_builder.Repo(), 211s { 211s 'add_commits': [repo_builder.Commit(name='import')], 211s 'update_tags': {'importer/applied/1-1': Placeholder('import')}, 211s }, 211s [ 211s 'refs/tags/importer/applied/1-1', 211s ], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[repo_builder.Commit(name='import')], 211s tags={'importer/applied/1-1': Placeholder('import')}, 211s ), 211s { 211s 'add_commits': [repo_builder.Commit(name='reimport')], 211s 'update_tags': { 211s 'importer/reimport/applied/1-1/0': Placeholder('import'), 211s 'importer/reimport/applied/1-1/1': Placeholder('reimport'), 211s }, 211s }, 211s [ 211s 'refs/tags/importer/applied/1-1', 211s 'refs/tags/importer/reimport/applied/1-1/0', 211s 'refs/tags/importer/reimport/applied/1-1/1', 211s ], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit(name='import'), 211s repo_builder.Commit(name='reimport1'), 211s ], 211s tags={ 211s 'importer/applied/1-1': Placeholder('import'), 211s 'importer/reimport/applied/1-1/0': Placeholder('import'), 211s 'importer/reimport/applied/1-1/1': Placeholder('reimport1'), 211s }, 211s ), 211s { 211s 'add_commits': [ 211s repo_builder.Commit(name='reimport2') 211s ], 211s 'update_tags': { 211s 'importer/reimport/applied/1-1/2': Placeholder('reimport2'), 211s }, 211s }, 211s [ 211s 'refs/tags/importer/applied/1-1', 211s 'refs/tags/importer/reimport/applied/1-1/0', 211s 'refs/tags/importer/reimport/applied/1-1/1', 211s 'refs/tags/importer/reimport/applied/1-1/2', 211s ], 211s ), 211s ], 211s ) 211s def test_create_applied_tag( 211s repo, 211s input_repo, 211s validation_repo_delta, 211s validation_repo_expected_identical_refs, 211s ): 211s """ 211s Unit test that create_applied_tag creates the correct import tag 211s 211s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 211s temporary output repository 211s :param repo_builder.Repo input_repo: input repository data 211s :param dict validation_repo_delta: how to transform the input repository 211s into a "validation repository", expressed as a dict to 211s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 211s input repository. The validation repository is then used for the 211s purposes of comparison against the output repository. 211s :param list(str) validation_repo_expected_identical_refs: refs that must be 211s identical between the validation repository and the output repository 211s """ 211s publish_commit_str = str( 211s repo.raw_repo.get( 211s repo_builder.Commit().write(repo.raw_repo) 211s ).peel(pygit2.Commit).id 211s ) 211s 211s > input_repo.write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:575: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmp4_u70n5p/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s _ test_create_applied_tag[input_repo2-validation_repo_delta2-validation_repo_expected_identical_refs2] _ 211s 211s repo = 211s input_repo = 211s validation_repo_delta = {'add_commits': [], 'update_tags': {'importer/reimport/applied/1-1/2': }} 211s validation_repo_expected_identical_refs = ['refs/tags/importer/applied/1-1', 'refs/tags/importer/reimport/applied/1-1/0', 'refs/tags/importer/reimport/applied/1-1/1', 'refs/tags/importer/reimport/applied/1-1/2'] 211s 211s @pytest.mark.parametrize( 211s [ 211s 'input_repo', 211s 'validation_repo_delta', 211s 'validation_repo_expected_identical_refs', 211s ], 211s [ 211s ( 211s repo_builder.Repo(), 211s { 211s 'add_commits': [repo_builder.Commit(name='import')], 211s 'update_tags': {'importer/applied/1-1': Placeholder('import')}, 211s }, 211s [ 211s 'refs/tags/importer/applied/1-1', 211s ], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[repo_builder.Commit(name='import')], 211s tags={'importer/applied/1-1': Placeholder('import')}, 211s ), 211s { 211s 'add_commits': [repo_builder.Commit(name='reimport')], 211s 'update_tags': { 211s 'importer/reimport/applied/1-1/0': Placeholder('import'), 211s 'importer/reimport/applied/1-1/1': Placeholder('reimport'), 211s }, 211s }, 211s [ 211s 'refs/tags/importer/applied/1-1', 211s 'refs/tags/importer/reimport/applied/1-1/0', 211s 'refs/tags/importer/reimport/applied/1-1/1', 211s ], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit(name='import'), 211s repo_builder.Commit(name='reimport1'), 211s ], 211s tags={ 211s 'importer/applied/1-1': Placeholder('import'), 211s 'importer/reimport/applied/1-1/0': Placeholder('import'), 211s 'importer/reimport/applied/1-1/1': Placeholder('reimport1'), 211s }, 211s ), 211s { 211s 'add_commits': [ 211s repo_builder.Commit(name='reimport2') 211s ], 211s 'update_tags': { 211s 'importer/reimport/applied/1-1/2': Placeholder('reimport2'), 211s }, 211s }, 211s [ 211s 'refs/tags/importer/applied/1-1', 211s 'refs/tags/importer/reimport/applied/1-1/0', 211s 'refs/tags/importer/reimport/applied/1-1/1', 211s 'refs/tags/importer/reimport/applied/1-1/2', 211s ], 211s ), 211s ], 211s ) 211s def test_create_applied_tag( 211s repo, 211s input_repo, 211s validation_repo_delta, 211s validation_repo_expected_identical_refs, 211s ): 211s """ 211s Unit test that create_applied_tag creates the correct import tag 211s 211s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 211s temporary output repository 211s :param repo_builder.Repo input_repo: input repository data 211s :param dict validation_repo_delta: how to transform the input repository 211s into a "validation repository", expressed as a dict to 211s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 211s input repository. The validation repository is then used for the 211s purposes of comparison against the output repository. 211s :param list(str) validation_repo_expected_identical_refs: refs that must be 211s identical between the validation repository and the output repository 211s """ 211s publish_commit_str = str( 211s repo.raw_repo.get( 211s repo_builder.Commit().write(repo.raw_repo) 211s ).peel(pygit2.Commit).id 211s ) 211s 211s > input_repo.write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:575: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmpgh5_2wb_/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s _ test_get_changelog_parent_commits[input_repo1-parent_overrides1-changelog_versions1-PatchState.UNAPPLIED-expected_refs1] _ 211s 211s repo = 211s input_repo = 211s parent_overrides = {}, changelog_versions = ['1-2', '1-1'] 211s patch_state = 211s expected_refs = ['refs/tags/importer/import/1-1'] 211s 211s @pytest.mark.parametrize( 211s [ 211s 'input_repo', 211s 'parent_overrides', 211s 'changelog_versions', 211s 'patch_state', 211s 'expected_refs', 211s ], 211s [ 211s ( 211s repo_builder.Repo(), 211s {}, 211s ['1-2', '1-1',], 211s PatchState.UNAPPLIED, 211s [], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[repo_builder.Commit.from_spec(name='import')], 211s tags={'importer/import/1-1': Placeholder('import')}, 211s ), 211s {}, 211s ['1-2', '1-1'], 211s PatchState.UNAPPLIED, 211s ['refs/tags/importer/import/1-1'], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit.from_spec(name='import'), 211s repo_builder.Commit.from_spec(name='reimport', mutate=1), 211s ], 211s tags={ 211s 'importer/import/1-1': Placeholder('import'), 211s 'importer/reimport/import/1-1/0': Placeholder('import'), 211s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 211s }, 211s ), 211s {}, 211s ['1-2', '1-1'], 211s PatchState.UNAPPLIED, 211s [ 211s 'refs/tags/importer/reimport/import/1-1/0', 211s 'refs/tags/importer/reimport/import/1-1/1', 211s ], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[repo_builder.Commit.from_spec(name='import')], 211s tags={'importer/import/1-1': Placeholder('import')}, 211s ), 211s {}, 211s ['1-3', '1-2', '1-1'], 211s PatchState.UNAPPLIED, 211s ['refs/tags/importer/import/1-1'], 211s ), 211s ( 211s repo_builder.Repo(), 211s {}, 211s ['1-2', '1-1',], 211s PatchState.APPLIED, 211s [], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[repo_builder.Commit.from_spec(name='applied')], 211s tags={'importer/applied/1-1': Placeholder('applied')}, 211s ), 211s {}, 211s ['1-2', '1-1'], 211s PatchState.APPLIED, 211s ['refs/tags/importer/applied/1-1'], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit.from_spec(name='import'), 211s repo_builder.Commit.from_spec(name='reimport', mutate=1), 211s ], 211s tags={ 211s 'importer/applied/1-1': Placeholder('import'), 211s 'importer/reimport/applied/1-1/0': Placeholder('import'), 211s 'importer/reimport/applied/1-1/1': Placeholder('reimport'), 211s }, 211s ), 211s {}, 211s ['1-2', '1-1'], 211s PatchState.APPLIED, 211s [ 211s 'refs/tags/importer/reimport/applied/1-1/0', 211s 'refs/tags/importer/reimport/applied/1-1/1', 211s ], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[repo_builder.Commit.from_spec(name='applied')], 211s tags={'importer/applied/1-1': Placeholder('applied')}, 211s ), 211s {}, 211s ['1-3', '1-2', '1-1'], 211s PatchState.APPLIED, 211s ['refs/tags/importer/applied/1-1'], 211s ), 211s ], 211s ) 211s def test_get_changelog_parent_commits( 211s repo, 211s input_repo, 211s parent_overrides, 211s changelog_versions, 211s patch_state, 211s expected_refs, 211s ): 211s """Test that get_changelog_parent_commits is generally correct 211s 211s This is the general parameterised test for the common case uses of 211s target.get_changelog_parent_commits. 211s 211s :param GitUbuntuRepository repo: fixture providing a temporary 211s GitUbuntuRepository instance to use 211s :param repo_builder.Repo input_repo: the input repository data to use that 211s will be populated into @repo before @repo is passed through to 211s get_changelog_parent_commits 211s :param dict parent_overrides: passed through to 211s get_changelog_parent_commits. 211s :param PatchState patch_state: passed through to 211s get_changelog_parent_commits 211s :param list(str) expected_refs: the expected return value of 211s get_changelog_parent_commits expressed using a list of reference names. 211s Since get_changelog_parent_commits returns a list of commit hash 211s strings, the reference names will need to be dereferenced before 211s comparison; this way the test parameters don't need to be opaque hash 211s strings. 211s """ 211s > input_repo.write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:721: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmp532vvli5/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s _ test_get_changelog_parent_commits[input_repo2-parent_overrides2-changelog_versions2-PatchState.UNAPPLIED-expected_refs2] _ 211s 211s repo = 211s input_repo = 211s parent_overrides = {}, changelog_versions = ['1-2', '1-1'] 211s patch_state = 211s expected_refs = ['refs/tags/importer/reimport/import/1-1/0', 'refs/tags/importer/reimport/import/1-1/1'] 211s 211s @pytest.mark.parametrize( 211s [ 211s 'input_repo', 211s 'parent_overrides', 211s 'changelog_versions', 211s 'patch_state', 211s 'expected_refs', 211s ], 211s [ 211s ( 211s repo_builder.Repo(), 211s {}, 211s ['1-2', '1-1',], 211s PatchState.UNAPPLIED, 211s [], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[repo_builder.Commit.from_spec(name='import')], 211s tags={'importer/import/1-1': Placeholder('import')}, 211s ), 211s {}, 211s ['1-2', '1-1'], 211s PatchState.UNAPPLIED, 211s ['refs/tags/importer/import/1-1'], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit.from_spec(name='import'), 211s repo_builder.Commit.from_spec(name='reimport', mutate=1), 211s ], 211s tags={ 211s 'importer/import/1-1': Placeholder('import'), 211s 'importer/reimport/import/1-1/0': Placeholder('import'), 211s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 211s }, 211s ), 211s {}, 211s ['1-2', '1-1'], 211s PatchState.UNAPPLIED, 211s [ 211s 'refs/tags/importer/reimport/import/1-1/0', 211s 'refs/tags/importer/reimport/import/1-1/1', 211s ], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[repo_builder.Commit.from_spec(name='import')], 211s tags={'importer/import/1-1': Placeholder('import')}, 211s ), 211s {}, 211s ['1-3', '1-2', '1-1'], 211s PatchState.UNAPPLIED, 211s ['refs/tags/importer/import/1-1'], 211s ), 211s ( 211s repo_builder.Repo(), 211s {}, 211s ['1-2', '1-1',], 211s PatchState.APPLIED, 211s [], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[repo_builder.Commit.from_spec(name='applied')], 211s tags={'importer/applied/1-1': Placeholder('applied')}, 211s ), 211s {}, 211s ['1-2', '1-1'], 211s PatchState.APPLIED, 211s ['refs/tags/importer/applied/1-1'], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit.from_spec(name='import'), 211s repo_builder.Commit.from_spec(name='reimport', mutate=1), 211s ], 211s tags={ 211s 'importer/applied/1-1': Placeholder('import'), 211s 'importer/reimport/applied/1-1/0': Placeholder('import'), 211s 'importer/reimport/applied/1-1/1': Placeholder('reimport'), 211s }, 211s ), 211s {}, 211s ['1-2', '1-1'], 211s PatchState.APPLIED, 211s [ 211s 'refs/tags/importer/reimport/applied/1-1/0', 211s 'refs/tags/importer/reimport/applied/1-1/1', 211s ], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[repo_builder.Commit.from_spec(name='applied')], 211s tags={'importer/applied/1-1': Placeholder('applied')}, 211s ), 211s {}, 211s ['1-3', '1-2', '1-1'], 211s PatchState.APPLIED, 211s ['refs/tags/importer/applied/1-1'], 211s ), 211s ], 211s ) 211s def test_get_changelog_parent_commits( 211s repo, 211s input_repo, 211s parent_overrides, 211s changelog_versions, 211s patch_state, 211s expected_refs, 211s ): 211s """Test that get_changelog_parent_commits is generally correct 211s 211s This is the general parameterised test for the common case uses of 211s target.get_changelog_parent_commits. 211s 211s :param GitUbuntuRepository repo: fixture providing a temporary 211s GitUbuntuRepository instance to use 211s :param repo_builder.Repo input_repo: the input repository data to use that 211s will be populated into @repo before @repo is passed through to 211s get_changelog_parent_commits 211s :param dict parent_overrides: passed through to 211s get_changelog_parent_commits. 211s :param PatchState patch_state: passed through to 211s get_changelog_parent_commits 211s :param list(str) expected_refs: the expected return value of 211s get_changelog_parent_commits expressed using a list of reference names. 211s Since get_changelog_parent_commits returns a list of commit hash 211s strings, the reference names will need to be dereferenced before 211s comparison; this way the test parameters don't need to be opaque hash 211s strings. 211s """ 211s > input_repo.write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:721: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmp_1_i30pa/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s _ test_get_changelog_parent_commits[input_repo3-parent_overrides3-changelog_versions3-PatchState.UNAPPLIED-expected_refs3] _ 211s 211s repo = 211s input_repo = 211s parent_overrides = {}, changelog_versions = ['1-3', '1-2', '1-1'] 211s patch_state = 211s expected_refs = ['refs/tags/importer/import/1-1'] 211s 211s @pytest.mark.parametrize( 211s [ 211s 'input_repo', 211s 'parent_overrides', 211s 'changelog_versions', 211s 'patch_state', 211s 'expected_refs', 211s ], 211s [ 211s ( 211s repo_builder.Repo(), 211s {}, 211s ['1-2', '1-1',], 211s PatchState.UNAPPLIED, 211s [], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[repo_builder.Commit.from_spec(name='import')], 211s tags={'importer/import/1-1': Placeholder('import')}, 211s ), 211s {}, 211s ['1-2', '1-1'], 211s PatchState.UNAPPLIED, 211s ['refs/tags/importer/import/1-1'], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit.from_spec(name='import'), 211s repo_builder.Commit.from_spec(name='reimport', mutate=1), 211s ], 211s tags={ 211s 'importer/import/1-1': Placeholder('import'), 211s 'importer/reimport/import/1-1/0': Placeholder('import'), 211s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 211s }, 211s ), 211s {}, 211s ['1-2', '1-1'], 211s PatchState.UNAPPLIED, 211s [ 211s 'refs/tags/importer/reimport/import/1-1/0', 211s 'refs/tags/importer/reimport/import/1-1/1', 211s ], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[repo_builder.Commit.from_spec(name='import')], 211s tags={'importer/import/1-1': Placeholder('import')}, 211s ), 211s {}, 211s ['1-3', '1-2', '1-1'], 211s PatchState.UNAPPLIED, 211s ['refs/tags/importer/import/1-1'], 211s ), 211s ( 211s repo_builder.Repo(), 211s {}, 211s ['1-2', '1-1',], 211s PatchState.APPLIED, 211s [], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[repo_builder.Commit.from_spec(name='applied')], 211s tags={'importer/applied/1-1': Placeholder('applied')}, 211s ), 211s {}, 211s ['1-2', '1-1'], 211s PatchState.APPLIED, 211s ['refs/tags/importer/applied/1-1'], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit.from_spec(name='import'), 211s repo_builder.Commit.from_spec(name='reimport', mutate=1), 211s ], 211s tags={ 211s 'importer/applied/1-1': Placeholder('import'), 211s 'importer/reimport/applied/1-1/0': Placeholder('import'), 211s 'importer/reimport/applied/1-1/1': Placeholder('reimport'), 211s }, 211s ), 211s {}, 211s ['1-2', '1-1'], 211s PatchState.APPLIED, 211s [ 211s 'refs/tags/importer/reimport/applied/1-1/0', 211s 'refs/tags/importer/reimport/applied/1-1/1', 211s ], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[repo_builder.Commit.from_spec(name='applied')], 211s tags={'importer/applied/1-1': Placeholder('applied')}, 211s ), 211s {}, 211s ['1-3', '1-2', '1-1'], 211s PatchState.APPLIED, 211s ['refs/tags/importer/applied/1-1'], 211s ), 211s ], 211s ) 211s def test_get_changelog_parent_commits( 211s repo, 211s input_repo, 211s parent_overrides, 211s changelog_versions, 211s patch_state, 211s expected_refs, 211s ): 211s """Test that get_changelog_parent_commits is generally correct 211s 211s This is the general parameterised test for the common case uses of 211s target.get_changelog_parent_commits. 211s 211s :param GitUbuntuRepository repo: fixture providing a temporary 211s GitUbuntuRepository instance to use 211s :param repo_builder.Repo input_repo: the input repository data to use that 211s will be populated into @repo before @repo is passed through to 211s get_changelog_parent_commits 211s :param dict parent_overrides: passed through to 211s get_changelog_parent_commits. 211s :param PatchState patch_state: passed through to 211s get_changelog_parent_commits 211s :param list(str) expected_refs: the expected return value of 211s get_changelog_parent_commits expressed using a list of reference names. 211s Since get_changelog_parent_commits returns a list of commit hash 211s strings, the reference names will need to be dereferenced before 211s comparison; this way the test parameters don't need to be opaque hash 211s strings. 211s """ 211s > input_repo.write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:721: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmp4mwd9jws/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s _ test_get_changelog_parent_commits[input_repo5-parent_overrides5-changelog_versions5-PatchState.APPLIED-expected_refs5] _ 211s 211s repo = 211s input_repo = 211s parent_overrides = {}, changelog_versions = ['1-2', '1-1'] 211s patch_state = 211s expected_refs = ['refs/tags/importer/applied/1-1'] 211s 211s @pytest.mark.parametrize( 211s [ 211s 'input_repo', 211s 'parent_overrides', 211s 'changelog_versions', 211s 'patch_state', 211s 'expected_refs', 211s ], 211s [ 211s ( 211s repo_builder.Repo(), 211s {}, 211s ['1-2', '1-1',], 211s PatchState.UNAPPLIED, 211s [], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[repo_builder.Commit.from_spec(name='import')], 211s tags={'importer/import/1-1': Placeholder('import')}, 211s ), 211s {}, 211s ['1-2', '1-1'], 211s PatchState.UNAPPLIED, 211s ['refs/tags/importer/import/1-1'], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit.from_spec(name='import'), 211s repo_builder.Commit.from_spec(name='reimport', mutate=1), 211s ], 211s tags={ 211s 'importer/import/1-1': Placeholder('import'), 211s 'importer/reimport/import/1-1/0': Placeholder('import'), 211s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 211s }, 211s ), 211s {}, 211s ['1-2', '1-1'], 211s PatchState.UNAPPLIED, 211s [ 211s 'refs/tags/importer/reimport/import/1-1/0', 211s 'refs/tags/importer/reimport/import/1-1/1', 211s ], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[repo_builder.Commit.from_spec(name='import')], 211s tags={'importer/import/1-1': Placeholder('import')}, 211s ), 211s {}, 211s ['1-3', '1-2', '1-1'], 211s PatchState.UNAPPLIED, 211s ['refs/tags/importer/import/1-1'], 211s ), 211s ( 211s repo_builder.Repo(), 211s {}, 211s ['1-2', '1-1',], 211s PatchState.APPLIED, 211s [], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[repo_builder.Commit.from_spec(name='applied')], 211s tags={'importer/applied/1-1': Placeholder('applied')}, 211s ), 211s {}, 211s ['1-2', '1-1'], 211s PatchState.APPLIED, 211s ['refs/tags/importer/applied/1-1'], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit.from_spec(name='import'), 211s repo_builder.Commit.from_spec(name='reimport', mutate=1), 211s ], 211s tags={ 211s 'importer/applied/1-1': Placeholder('import'), 211s 'importer/reimport/applied/1-1/0': Placeholder('import'), 211s 'importer/reimport/applied/1-1/1': Placeholder('reimport'), 211s }, 211s ), 211s {}, 211s ['1-2', '1-1'], 211s PatchState.APPLIED, 211s [ 211s 'refs/tags/importer/reimport/applied/1-1/0', 211s 'refs/tags/importer/reimport/applied/1-1/1', 211s ], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[repo_builder.Commit.from_spec(name='applied')], 211s tags={'importer/applied/1-1': Placeholder('applied')}, 211s ), 211s {}, 211s ['1-3', '1-2', '1-1'], 211s PatchState.APPLIED, 211s ['refs/tags/importer/applied/1-1'], 211s ), 211s ], 211s ) 211s def test_get_changelog_parent_commits( 211s repo, 211s input_repo, 211s parent_overrides, 211s changelog_versions, 211s patch_state, 211s expected_refs, 211s ): 211s """Test that get_changelog_parent_commits is generally correct 211s 211s This is the general parameterised test for the common case uses of 211s target.get_changelog_parent_commits. 211s 211s :param GitUbuntuRepository repo: fixture providing a temporary 211s GitUbuntuRepository instance to use 211s :param repo_builder.Repo input_repo: the input repository data to use that 211s will be populated into @repo before @repo is passed through to 211s get_changelog_parent_commits 211s :param dict parent_overrides: passed through to 211s get_changelog_parent_commits. 211s :param PatchState patch_state: passed through to 211s get_changelog_parent_commits 211s :param list(str) expected_refs: the expected return value of 211s get_changelog_parent_commits expressed using a list of reference names. 211s Since get_changelog_parent_commits returns a list of commit hash 211s strings, the reference names will need to be dereferenced before 211s comparison; this way the test parameters don't need to be opaque hash 211s strings. 211s """ 211s > input_repo.write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:721: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmptjloh0se/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s _ test_get_changelog_parent_commits[input_repo6-parent_overrides6-changelog_versions6-PatchState.APPLIED-expected_refs6] _ 211s 211s repo = 211s input_repo = 211s parent_overrides = {}, changelog_versions = ['1-2', '1-1'] 211s patch_state = 211s expected_refs = ['refs/tags/importer/reimport/applied/1-1/0', 'refs/tags/importer/reimport/applied/1-1/1'] 211s 211s @pytest.mark.parametrize( 211s [ 211s 'input_repo', 211s 'parent_overrides', 211s 'changelog_versions', 211s 'patch_state', 211s 'expected_refs', 211s ], 211s [ 211s ( 211s repo_builder.Repo(), 211s {}, 211s ['1-2', '1-1',], 211s PatchState.UNAPPLIED, 211s [], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[repo_builder.Commit.from_spec(name='import')], 211s tags={'importer/import/1-1': Placeholder('import')}, 211s ), 211s {}, 211s ['1-2', '1-1'], 211s PatchState.UNAPPLIED, 211s ['refs/tags/importer/import/1-1'], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit.from_spec(name='import'), 211s repo_builder.Commit.from_spec(name='reimport', mutate=1), 211s ], 211s tags={ 211s 'importer/import/1-1': Placeholder('import'), 211s 'importer/reimport/import/1-1/0': Placeholder('import'), 211s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 211s }, 211s ), 211s {}, 211s ['1-2', '1-1'], 211s PatchState.UNAPPLIED, 211s [ 211s 'refs/tags/importer/reimport/import/1-1/0', 211s 'refs/tags/importer/reimport/import/1-1/1', 211s ], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[repo_builder.Commit.from_spec(name='import')], 211s tags={'importer/import/1-1': Placeholder('import')}, 211s ), 211s {}, 211s ['1-3', '1-2', '1-1'], 211s PatchState.UNAPPLIED, 211s ['refs/tags/importer/import/1-1'], 211s ), 211s ( 211s repo_builder.Repo(), 211s {}, 211s ['1-2', '1-1',], 211s PatchState.APPLIED, 211s [], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[repo_builder.Commit.from_spec(name='applied')], 211s tags={'importer/applied/1-1': Placeholder('applied')}, 211s ), 211s {}, 211s ['1-2', '1-1'], 211s PatchState.APPLIED, 211s ['refs/tags/importer/applied/1-1'], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit.from_spec(name='import'), 211s repo_builder.Commit.from_spec(name='reimport', mutate=1), 211s ], 211s tags={ 211s 'importer/applied/1-1': Placeholder('import'), 211s 'importer/reimport/applied/1-1/0': Placeholder('import'), 211s 'importer/reimport/applied/1-1/1': Placeholder('reimport'), 211s }, 211s ), 211s {}, 211s ['1-2', '1-1'], 211s PatchState.APPLIED, 211s [ 211s 'refs/tags/importer/reimport/applied/1-1/0', 211s 'refs/tags/importer/reimport/applied/1-1/1', 211s ], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[repo_builder.Commit.from_spec(name='applied')], 211s tags={'importer/applied/1-1': Placeholder('applied')}, 211s ), 211s {}, 211s ['1-3', '1-2', '1-1'], 211s PatchState.APPLIED, 211s ['refs/tags/importer/applied/1-1'], 211s ), 211s ], 211s ) 211s def test_get_changelog_parent_commits( 211s repo, 211s input_repo, 211s parent_overrides, 211s changelog_versions, 211s patch_state, 211s expected_refs, 211s ): 211s """Test that get_changelog_parent_commits is generally correct 211s 211s This is the general parameterised test for the common case uses of 211s target.get_changelog_parent_commits. 211s 211s :param GitUbuntuRepository repo: fixture providing a temporary 211s GitUbuntuRepository instance to use 211s :param repo_builder.Repo input_repo: the input repository data to use that 211s will be populated into @repo before @repo is passed through to 211s get_changelog_parent_commits 211s :param dict parent_overrides: passed through to 211s get_changelog_parent_commits. 211s :param PatchState patch_state: passed through to 211s get_changelog_parent_commits 211s :param list(str) expected_refs: the expected return value of 211s get_changelog_parent_commits expressed using a list of reference names. 211s Since get_changelog_parent_commits returns a list of commit hash 211s strings, the reference names will need to be dereferenced before 211s comparison; this way the test parameters don't need to be opaque hash 211s strings. 211s """ 211s > input_repo.write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:721: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmppiqpece9/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s _ test_get_changelog_parent_commits[input_repo7-parent_overrides7-changelog_versions7-PatchState.APPLIED-expected_refs7] _ 211s 211s repo = 211s input_repo = 211s parent_overrides = {}, changelog_versions = ['1-3', '1-2', '1-1'] 211s patch_state = 211s expected_refs = ['refs/tags/importer/applied/1-1'] 211s 211s @pytest.mark.parametrize( 211s [ 211s 'input_repo', 211s 'parent_overrides', 211s 'changelog_versions', 211s 'patch_state', 211s 'expected_refs', 211s ], 211s [ 211s ( 211s repo_builder.Repo(), 211s {}, 211s ['1-2', '1-1',], 211s PatchState.UNAPPLIED, 211s [], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[repo_builder.Commit.from_spec(name='import')], 211s tags={'importer/import/1-1': Placeholder('import')}, 211s ), 211s {}, 211s ['1-2', '1-1'], 211s PatchState.UNAPPLIED, 211s ['refs/tags/importer/import/1-1'], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit.from_spec(name='import'), 211s repo_builder.Commit.from_spec(name='reimport', mutate=1), 211s ], 211s tags={ 211s 'importer/import/1-1': Placeholder('import'), 211s 'importer/reimport/import/1-1/0': Placeholder('import'), 211s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 211s }, 211s ), 211s {}, 211s ['1-2', '1-1'], 211s PatchState.UNAPPLIED, 211s [ 211s 'refs/tags/importer/reimport/import/1-1/0', 211s 'refs/tags/importer/reimport/import/1-1/1', 211s ], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[repo_builder.Commit.from_spec(name='import')], 211s tags={'importer/import/1-1': Placeholder('import')}, 211s ), 211s {}, 211s ['1-3', '1-2', '1-1'], 211s PatchState.UNAPPLIED, 211s ['refs/tags/importer/import/1-1'], 211s ), 211s ( 211s repo_builder.Repo(), 211s {}, 211s ['1-2', '1-1',], 211s PatchState.APPLIED, 211s [], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[repo_builder.Commit.from_spec(name='applied')], 211s tags={'importer/applied/1-1': Placeholder('applied')}, 211s ), 211s {}, 211s ['1-2', '1-1'], 211s PatchState.APPLIED, 211s ['refs/tags/importer/applied/1-1'], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit.from_spec(name='import'), 211s repo_builder.Commit.from_spec(name='reimport', mutate=1), 211s ], 211s tags={ 211s 'importer/applied/1-1': Placeholder('import'), 211s 'importer/reimport/applied/1-1/0': Placeholder('import'), 211s 'importer/reimport/applied/1-1/1': Placeholder('reimport'), 211s }, 211s ), 211s {}, 211s ['1-2', '1-1'], 211s PatchState.APPLIED, 211s [ 211s 'refs/tags/importer/reimport/applied/1-1/0', 211s 'refs/tags/importer/reimport/applied/1-1/1', 211s ], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[repo_builder.Commit.from_spec(name='applied')], 211s tags={'importer/applied/1-1': Placeholder('applied')}, 211s ), 211s {}, 211s ['1-3', '1-2', '1-1'], 211s PatchState.APPLIED, 211s ['refs/tags/importer/applied/1-1'], 211s ), 211s ], 211s ) 211s def test_get_changelog_parent_commits( 211s repo, 211s input_repo, 211s parent_overrides, 211s changelog_versions, 211s patch_state, 211s expected_refs, 211s ): 211s """Test that get_changelog_parent_commits is generally correct 211s 211s This is the general parameterised test for the common case uses of 211s target.get_changelog_parent_commits. 211s 211s :param GitUbuntuRepository repo: fixture providing a temporary 211s GitUbuntuRepository instance to use 211s :param repo_builder.Repo input_repo: the input repository data to use that 211s will be populated into @repo before @repo is passed through to 211s get_changelog_parent_commits 211s :param dict parent_overrides: passed through to 211s get_changelog_parent_commits. 211s :param PatchState patch_state: passed through to 211s get_changelog_parent_commits 211s :param list(str) expected_refs: the expected return value of 211s get_changelog_parent_commits expressed using a list of reference names. 211s Since get_changelog_parent_commits returns a list of commit hash 211s strings, the reference names will need to be dereferenced before 211s comparison; this way the test parameters don't need to be opaque hash 211s strings. 211s """ 211s > input_repo.write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:721: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmph9qpmytb/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s _________ test_validate_rich_history[input_repo0-published_spec0-True] _________ 211s 211s repo = 211s input_repo = 211s published_spec = {'changelog_versions': ['1-2', '1-1']}, expected_result = True 211s 211s @pytest.mark.parametrize( 211s [ 211s 'input_repo', 211s 'published_spec', 211s 'expected_result', 211s ], 211s [ 211s ( 211s # Common case: upload tag has a changelog parent as an ancestor 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit.from_spec(name='import'), 211s repo_builder.Commit.from_spec( 211s name='upload', 211s changelog_versions=['1-2', '1-1'], 211s parents=[Placeholder('import')], 211s ), 211s ], 211s tags={ 211s 'importer/import/1-1': Placeholder('import'), 211s 'importer/upload/1-2': Placeholder('upload'), 211s }, 211s ), 211s {'changelog_versions': ['1-2', '1-1']}, 211s True, 211s ), 211s ( 211s # Upload tag is the first one, with no parents present 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit.from_spec( 211s name='upload', 211s version='1-2', 211s ), 211s ], 211s tags={ 211s 'importer/upload/1-2': Placeholder('upload'), 211s }, 211s ), 211s {'changelog_versions': ['1-2']}, 211s True, 211s ), 211s ( 211s # Upload tag mismatches published tree but is otherwise correct 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit.from_spec(name='import'), 211s repo_builder.Commit.from_spec( 211s name='upload', 211s changelog_versions=['1-2', '1-1'], 211s parents=[Placeholder('import')], 211s mutate=True, 211s ), 211s ], 211s tags={ 211s 'importer/import/1-1': Placeholder('import'), 211s 'importer/upload/1-2': Placeholder('upload'), 211s }, 211s ), 211s {'changelog_versions': ['1-2', '1-1']}, 211s target.RichHistoryTreeMismatch, 211s ), 211s ( 211s # Upload tag doesn't have a changelog parent as an ancestor but is 211s # otherwise correct 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit.from_spec(name='import'), 211s repo_builder.Commit.from_spec( 211s name='upload', 211s changelog_versions=['1-2', '1-1'], 211s ), 211s ], 211s tags={ 211s 'importer/import/1-1': Placeholder('import'), 211s 'importer/upload/1-2': Placeholder('upload'), 211s }, 211s ), 211s {'changelog_versions': ['1-2', '1-1']}, 211s target.RichHistoryHasNoChangelogParentAncestor, 211s ), 211s ], 211s ) 211s def test_validate_rich_history( 211s repo, 211s input_repo, 211s published_spec, 211s expected_result, 211s ): 211s """ 211s General test for validate_rich_history(). 211s 211s This unit tests validate_rich_history() for various parameterized cases. 211s Given an input repository and the specification of a Launchpad publication 211s of a source package, we check that validate_rich_history() correctly 211s accepts or rejects the rich history corresponding to the upload tag named 211s 'importer/upload/1-2'. It is assumed that the package being imported is 211s always of version '1-2' for all parameter sets. 211s 211s Since the target function requires rich history, the case of there not 211s being rich history does not need to be tested here, as it wouldn't be 211s called in this case. 211s 211s validate_rich_history() is generic for all sourced rich history, not just 211s rich history sourced from an upload tag. But since it is independent of how 211s the rich history commit arrived, it is easiest to use upload tags to test 211s it; this results in coverage for all sources. 211s 211s :param GitUbuntuRepository repo: fixture providing a temporary 211s GitUbuntuRepository instance to use 211s :param repo_builder.Repo input_repo: input repository data 211s :param dict published_spec: the package simulated being imported from the 211s archive, specified as a dict to pass as **kwargs to 211s repo_builder.Commit.from_spec() 211s :param bool expected_result: the expected return value of, or exception 211s raised by, the call to validate_rich_history() 211s """ 211s > input_repo.write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:910: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmp9fp_0t3w/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-2.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-2.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s _________ test_validate_rich_history[input_repo1-published_spec1-True] _________ 211s 211s repo = 211s input_repo = 211s published_spec = {'changelog_versions': ['1-2']}, expected_result = True 211s 211s @pytest.mark.parametrize( 211s [ 211s 'input_repo', 211s 'published_spec', 211s 'expected_result', 211s ], 211s [ 211s ( 211s # Common case: upload tag has a changelog parent as an ancestor 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit.from_spec(name='import'), 211s repo_builder.Commit.from_spec( 211s name='upload', 211s changelog_versions=['1-2', '1-1'], 211s parents=[Placeholder('import')], 211s ), 211s ], 211s tags={ 211s 'importer/import/1-1': Placeholder('import'), 211s 'importer/upload/1-2': Placeholder('upload'), 211s }, 211s ), 211s {'changelog_versions': ['1-2', '1-1']}, 211s True, 211s ), 211s ( 211s # Upload tag is the first one, with no parents present 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit.from_spec( 211s name='upload', 211s version='1-2', 211s ), 211s ], 211s tags={ 211s 'importer/upload/1-2': Placeholder('upload'), 211s }, 211s ), 211s {'changelog_versions': ['1-2']}, 211s True, 211s ), 211s ( 211s # Upload tag mismatches published tree but is otherwise correct 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit.from_spec(name='import'), 211s repo_builder.Commit.from_spec( 211s name='upload', 211s changelog_versions=['1-2', '1-1'], 211s parents=[Placeholder('import')], 211s mutate=True, 211s ), 211s ], 211s tags={ 211s 'importer/import/1-1': Placeholder('import'), 211s 'importer/upload/1-2': Placeholder('upload'), 211s }, 211s ), 211s {'changelog_versions': ['1-2', '1-1']}, 211s target.RichHistoryTreeMismatch, 211s ), 211s ( 211s # Upload tag doesn't have a changelog parent as an ancestor but is 211s # otherwise correct 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit.from_spec(name='import'), 211s repo_builder.Commit.from_spec( 211s name='upload', 211s changelog_versions=['1-2', '1-1'], 211s ), 211s ], 211s tags={ 211s 'importer/import/1-1': Placeholder('import'), 211s 'importer/upload/1-2': Placeholder('upload'), 211s }, 211s ), 211s {'changelog_versions': ['1-2', '1-1']}, 211s target.RichHistoryHasNoChangelogParentAncestor, 211s ), 211s ], 211s ) 211s def test_validate_rich_history( 211s repo, 211s input_repo, 211s published_spec, 211s expected_result, 211s ): 211s """ 211s General test for validate_rich_history(). 211s 211s This unit tests validate_rich_history() for various parameterized cases. 211s Given an input repository and the specification of a Launchpad publication 211s of a source package, we check that validate_rich_history() correctly 211s accepts or rejects the rich history corresponding to the upload tag named 211s 'importer/upload/1-2'. It is assumed that the package being imported is 211s always of version '1-2' for all parameter sets. 211s 211s Since the target function requires rich history, the case of there not 211s being rich history does not need to be tested here, as it wouldn't be 211s called in this case. 211s 211s validate_rich_history() is generic for all sourced rich history, not just 211s rich history sourced from an upload tag. But since it is independent of how 211s the rich history commit arrived, it is easiest to use upload tags to test 211s it; this results in coverage for all sources. 211s 211s :param GitUbuntuRepository repo: fixture providing a temporary 211s GitUbuntuRepository instance to use 211s :param repo_builder.Repo input_repo: input repository data 211s :param dict published_spec: the package simulated being imported from the 211s archive, specified as a dict to pass as **kwargs to 211s repo_builder.Commit.from_spec() 211s :param bool expected_result: the expected return value of, or exception 211s raised by, the call to validate_rich_history() 211s """ 211s > input_repo.write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:910: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmppg91w6_2/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-2.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-2.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-2.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-2.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s _ test_validate_rich_history[input_repo2-published_spec2-RichHistoryTreeMismatch] _ 211s 211s repo = 211s input_repo = 211s published_spec = {'changelog_versions': ['1-2', '1-1']} 211s expected_result = 211s 211s @pytest.mark.parametrize( 211s [ 211s 'input_repo', 211s 'published_spec', 211s 'expected_result', 211s ], 211s [ 211s ( 211s # Common case: upload tag has a changelog parent as an ancestor 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit.from_spec(name='import'), 211s repo_builder.Commit.from_spec( 211s name='upload', 211s changelog_versions=['1-2', '1-1'], 211s parents=[Placeholder('import')], 211s ), 211s ], 211s tags={ 211s 'importer/import/1-1': Placeholder('import'), 211s 'importer/upload/1-2': Placeholder('upload'), 211s }, 211s ), 211s {'changelog_versions': ['1-2', '1-1']}, 211s True, 211s ), 211s ( 211s # Upload tag is the first one, with no parents present 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit.from_spec( 211s name='upload', 211s version='1-2', 211s ), 211s ], 211s tags={ 211s 'importer/upload/1-2': Placeholder('upload'), 211s }, 211s ), 211s {'changelog_versions': ['1-2']}, 211s True, 211s ), 211s ( 211s # Upload tag mismatches published tree but is otherwise correct 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit.from_spec(name='import'), 211s repo_builder.Commit.from_spec( 211s name='upload', 211s changelog_versions=['1-2', '1-1'], 211s parents=[Placeholder('import')], 211s mutate=True, 211s ), 211s ], 211s tags={ 211s 'importer/import/1-1': Placeholder('import'), 211s 'importer/upload/1-2': Placeholder('upload'), 211s }, 211s ), 211s {'changelog_versions': ['1-2', '1-1']}, 211s target.RichHistoryTreeMismatch, 211s ), 211s ( 211s # Upload tag doesn't have a changelog parent as an ancestor but is 211s # otherwise correct 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit.from_spec(name='import'), 211s repo_builder.Commit.from_spec( 211s name='upload', 211s changelog_versions=['1-2', '1-1'], 211s ), 211s ], 211s tags={ 211s 'importer/import/1-1': Placeholder('import'), 211s 'importer/upload/1-2': Placeholder('upload'), 211s }, 211s ), 211s {'changelog_versions': ['1-2', '1-1']}, 211s target.RichHistoryHasNoChangelogParentAncestor, 211s ), 211s ], 211s ) 211s def test_validate_rich_history( 211s repo, 211s input_repo, 211s published_spec, 211s expected_result, 211s ): 211s """ 211s General test for validate_rich_history(). 211s 211s This unit tests validate_rich_history() for various parameterized cases. 211s Given an input repository and the specification of a Launchpad publication 211s of a source package, we check that validate_rich_history() correctly 211s accepts or rejects the rich history corresponding to the upload tag named 211s 'importer/upload/1-2'. It is assumed that the package being imported is 211s always of version '1-2' for all parameter sets. 211s 211s Since the target function requires rich history, the case of there not 211s being rich history does not need to be tested here, as it wouldn't be 211s called in this case. 211s 211s validate_rich_history() is generic for all sourced rich history, not just 211s rich history sourced from an upload tag. But since it is independent of how 211s the rich history commit arrived, it is easiest to use upload tags to test 211s it; this results in coverage for all sources. 211s 211s :param GitUbuntuRepository repo: fixture providing a temporary 211s GitUbuntuRepository instance to use 211s :param repo_builder.Repo input_repo: input repository data 211s :param dict published_spec: the package simulated being imported from the 211s archive, specified as a dict to pass as **kwargs to 211s repo_builder.Commit.from_spec() 211s :param bool expected_result: the expected return value of, or exception 211s raised by, the call to validate_rich_history() 211s """ 211s > input_repo.write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:910: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmpb5pxf6kj/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-2.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-2.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s _ test_validate_rich_history[input_repo3-published_spec3-RichHistoryHasNoChangelogParentAncestor] _ 211s 211s repo = 211s input_repo = 211s published_spec = {'changelog_versions': ['1-2', '1-1']} 211s expected_result = 211s 211s @pytest.mark.parametrize( 211s [ 211s 'input_repo', 211s 'published_spec', 211s 'expected_result', 211s ], 211s [ 211s ( 211s # Common case: upload tag has a changelog parent as an ancestor 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit.from_spec(name='import'), 211s repo_builder.Commit.from_spec( 211s name='upload', 211s changelog_versions=['1-2', '1-1'], 211s parents=[Placeholder('import')], 211s ), 211s ], 211s tags={ 211s 'importer/import/1-1': Placeholder('import'), 211s 'importer/upload/1-2': Placeholder('upload'), 211s }, 211s ), 211s {'changelog_versions': ['1-2', '1-1']}, 211s True, 211s ), 211s ( 211s # Upload tag is the first one, with no parents present 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit.from_spec( 211s name='upload', 211s version='1-2', 211s ), 211s ], 211s tags={ 211s 'importer/upload/1-2': Placeholder('upload'), 211s }, 211s ), 211s {'changelog_versions': ['1-2']}, 211s True, 211s ), 211s ( 211s # Upload tag mismatches published tree but is otherwise correct 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit.from_spec(name='import'), 211s repo_builder.Commit.from_spec( 211s name='upload', 211s changelog_versions=['1-2', '1-1'], 211s parents=[Placeholder('import')], 211s mutate=True, 211s ), 211s ], 211s tags={ 211s 'importer/import/1-1': Placeholder('import'), 211s 'importer/upload/1-2': Placeholder('upload'), 211s }, 211s ), 211s {'changelog_versions': ['1-2', '1-1']}, 211s target.RichHistoryTreeMismatch, 211s ), 211s ( 211s # Upload tag doesn't have a changelog parent as an ancestor but is 211s # otherwise correct 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit.from_spec(name='import'), 211s repo_builder.Commit.from_spec( 211s name='upload', 211s changelog_versions=['1-2', '1-1'], 211s ), 211s ], 211s tags={ 211s 'importer/import/1-1': Placeholder('import'), 211s 'importer/upload/1-2': Placeholder('upload'), 211s }, 211s ), 211s {'changelog_versions': ['1-2', '1-1']}, 211s target.RichHistoryHasNoChangelogParentAncestor, 211s ), 211s ], 211s ) 211s def test_validate_rich_history( 211s repo, 211s input_repo, 211s published_spec, 211s expected_result, 211s ): 211s """ 211s General test for validate_rich_history(). 211s 211s This unit tests validate_rich_history() for various parameterized cases. 211s Given an input repository and the specification of a Launchpad publication 211s of a source package, we check that validate_rich_history() correctly 211s accepts or rejects the rich history corresponding to the upload tag named 211s 'importer/upload/1-2'. It is assumed that the package being imported is 211s always of version '1-2' for all parameter sets. 211s 211s Since the target function requires rich history, the case of there not 211s being rich history does not need to be tested here, as it wouldn't be 211s called in this case. 211s 211s validate_rich_history() is generic for all sourced rich history, not just 211s rich history sourced from an upload tag. But since it is independent of how 211s the rich history commit arrived, it is easiest to use upload tags to test 211s it; this results in coverage for all sources. 211s 211s :param GitUbuntuRepository repo: fixture providing a temporary 211s GitUbuntuRepository instance to use 211s :param repo_builder.Repo input_repo: input repository data 211s :param dict published_spec: the package simulated being imported from the 211s archive, specified as a dict to pass as **kwargs to 211s repo_builder.Commit.from_spec() 211s :param bool expected_result: the expected return value of, or exception 211s raised by, the call to validate_rich_history() 211s """ 211s > input_repo.write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:910: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmpuzemlwlf/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-2.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-2.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s ______________________ test_add_changelog_note_to_commit _______________________ 211s 211s repo = 211s 211s def test_add_changelog_note_to_commit(repo): 211s """add_changelog_note_to_commit should add the expected note""" 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit.from_spec(name='1-1'), 211s repo_builder.Commit.from_spec( 211s name='1-2', 211s changelog_versions=['1-1', '1-2'], 211s parents=[Placeholder('1-1')], 211s ), 211s ], 211s tags={'1-1': Placeholder('1-1'), '1-2': Placeholder('1-2')}, 211s > ).write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:953: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmphkoj9gho/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s ____________________ test_add_changelog_note_to_commit_utf8 ____________________ 211s 211s repo = 211s 211s def test_add_changelog_note_to_commit_utf8(repo): 211s """A changelog file with non-UTF8 should have such characters substituted 211s 211s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 211s temporary output repository 211s """ 211s test_utf8_error_changelog_path = os.path.join( 211s pkg_resources.resource_filename('gitubuntu', 'changelog_tests'), 211s 'test_utf8_error', 211s ) 211s with open(test_utf8_error_changelog_path, 'rb') as f: 211s utf8_changelog_blob = f.read() 211s 211s # We only need an example child commit with a debian/changelog file since 211s # this is the only file accessed by add_changelog_note_to_commit(). 211s # Further, the parent need only exist and can be empty. 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit(name='parent'), 211s repo_builder.Commit( 211s tree=repo_builder.Tree({'debian': repo_builder.Tree( 211s {'changelog': repo_builder.Blob(utf8_changelog_blob)} 211s )}), 211s name='child', 211s ) 211s ], 211s tags={'parent': Placeholder('parent'), 'child': Placeholder('child')}, 211s > ).write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:1002: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmpuifd49jy/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s _________________ test_double_changelog_note_add_does_not_fail _________________ 211s 211s repo = 211s 211s def test_double_changelog_note_add_does_not_fail(repo): 211s """add_changelog_note_to_commit shouldn't fail if a note already exists""" 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit.from_spec(name='1-1'), 211s repo_builder.Commit.from_spec( 211s name='1-2', 211s changelog_versions=['1-1', '1-2'], 211s parents=[Placeholder('1-1')], 211s ), 211s ], 211s tags={'1-1': Placeholder('1-1'), '1-2': Placeholder('1-2')}, 211s > ).write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:1035: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmp75lo2asd/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s ___________________________ test_create_import_note ____________________________ 211s 211s repo = 211s 211s def test_create_import_note(repo): 211s """create_import_note() should create a note in the correct ref""" 211s repo_builder.Repo( 211s commits=[repo_builder.Commit(name='root')], 211s tags={'root': repo_builder.Placeholder('root')}, 211s > ).write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:1066: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmpapwk1p8d/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s ______________________ test_create_import_note_timestamp _______________________ 211s 211s repo = 211s 211s def test_create_import_note_timestamp(repo): 211s """create_import_note() should include the timestamp in the note""" 211s repo_builder.Repo( 211s commits=[repo_builder.Commit(name='root')], 211s tags={'root': repo_builder.Placeholder('root')}, 211s > ).write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:1082: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmpkaycwxkm/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s _______________________ test_import_creates_import_note ________________________ 211s 211s repo = 211s 211s def test_import_creates_import_note(repo): 211s """When an import runs, the note should appear in the correct ref""" 211s with source_builder.Source() as dsc_pathname: 211s > target.import_unapplied_dsc( 211s repo=repo, 211s version='1-1', 211s namespace='importer', 211s dist='ubuntu', 211s dsc_pathname=dsc_pathname, 211s head_name='ubuntu/focal', 211s skip_orig=True, 211s parent_overrides={}, 211s ) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:1102: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer.py:2230: in import_unapplied_dsc 211s commit, tag = find_or_create_unapplied_commit( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer.py:2052: in find_or_create_unapplied_commit 211s changelog_parents = get_unapplied_import_parents( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer.py:1503: in get_unapplied_import_parents 211s import_tree_versions = repo.get_all_changelog_versions_from_treeish( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:2230: in get_all_changelog_versions_from_treeish 211s changelog = self.get_changelog_from_treeish(treeish) 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 211s return Changelog.from_treeish( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:569: in from_treeish 211s blob = follow_symlinks_to_blob( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 211s return _follow_symlinks_to_blob( 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s repo = pygit2.Repository('/tmp/tmpkmyctplb/.git/') 211s top_tree_object = 211s search_path = 'debian/changelog' 211s _rel_tree = 211s _rel_path = '' 211s 211s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 211s _rel_tree=None, _rel_path='' 211s ): 211s '''Recursively follow a path down a tree, following symlinks, to find blob 211s 211s repo: pygit2.Repository object 211s top_tree: pygit2.Tree object of the top of the tree structure 211s search_path: '/'-separated path string of blob to find 211s _rel_tree: (internal) which tree to look further into 211s _rel_path: (internal) the path we are in so far 211s ''' 211s 211s NORMAL_BLOB_MODES = set([ 211s pygit2.GIT_FILEMODE_BLOB, 211s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 211s ]) 211s 211s _rel_tree = _rel_tree or top_tree_object 211s head, tail = posixpath.split(search_path) 211s 211s # A traditional functional split would put a single entry in head with tail 211s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 211s # to make it appear to have traditional semantics. 211s if not head: 211s head = tail 211s tail = None 211s 211s entry = _rel_tree[head] 211s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:68: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s ___________________ test_import_unapplied_spi_quilt_patches ____________________ 211s 211s get_import_commit_msg_mock = 211s get_import_tag_msg_mock = 211s repo = 211s 211s @patch('gitubuntu.importer.get_import_tag_msg') 211s @patch('gitubuntu.importer.get_import_commit_msg') 211s def test_import_unapplied_spi_quilt_patches( 211s get_import_commit_msg_mock, 211s get_import_tag_msg_mock, 211s repo, 211s ): 211s """Test that a package with quilt patches is imported with correct 211s unapplied refs 211s 211s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 211s that determines the commit message to use for a given import 211s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 211s that determines the tag message to use for a given import 211s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 211s temporary output repository 211s """ 211s # Match the repo_builder objects 211s get_import_tag_msg_mock.return_value = 'Test tag' 211s get_import_commit_msg_mock.return_value = b'Test commit' 211s 211s publish_spec = source_builder.SourceSpec(has_patches=True) 211s 211s input_repo = repo_builder.Repo() 211s input_repo.write(repo.raw_repo) 211s expected_result = repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit( 211s tree=repo_builder.SourceTree( 211s source_builder.Source(publish_spec) 211s ), 211s name='publish' 211s ), 211s ], 211s tags={'importer/import/1-1': Placeholder('publish')}, 211s branches={'importer/ubuntu/trusty': Placeholder('publish')}, 211s ) 211s 211s with source_builder.Source(publish_spec) as dsc_path: 211s # import_unapplied_spi currently assumes it is called from the 211s # repository directory (pristine-tar and other commands rely on 211s # this) 211s > target.import_unapplied_spi( 211s repo=repo, 211s spi=MockSPI(dsc_path, publish_spec.version), 211s namespace='importer', 211s skip_orig=False, 211s parent_overrides={}, 211s ) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:1222: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer.py:2308: in import_unapplied_spi 211s import_unapplied_dsc( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer.py:2230: in import_unapplied_dsc 211s commit, tag = find_or_create_unapplied_commit( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer.py:2052: in find_or_create_unapplied_commit 211s changelog_parents = get_unapplied_import_parents( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer.py:1503: in get_unapplied_import_parents 211s import_tree_versions = repo.get_all_changelog_versions_from_treeish( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:2230: in get_all_changelog_versions_from_treeish 211s changelog = self.get_changelog_from_treeish(treeish) 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 211s return Changelog.from_treeish( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:569: in from_treeish 211s blob = follow_symlinks_to_blob( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 211s return _follow_symlinks_to_blob( 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s repo = pygit2.Repository('/tmp/tmpjpnzegss/.git/') 211s top_tree_object = 211s search_path = 'debian/changelog' 211s _rel_tree = 211s _rel_path = '' 211s 211s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 211s _rel_tree=None, _rel_path='' 211s ): 211s '''Recursively follow a path down a tree, following symlinks, to find blob 211s 211s repo: pygit2.Repository object 211s top_tree: pygit2.Tree object of the top of the tree structure 211s search_path: '/'-separated path string of blob to find 211s _rel_tree: (internal) which tree to look further into 211s _rel_path: (internal) the path we are in so far 211s ''' 211s 211s NORMAL_BLOB_MODES = set([ 211s pygit2.GIT_FILEMODE_BLOB, 211s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 211s ]) 211s 211s _rel_tree = _rel_tree or top_tree_object 211s head, tail = posixpath.split(search_path) 211s 211s # A traditional functional split would put a single entry in head with tail 211s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 211s # to make it appear to have traditional semantics. 211s if not head: 211s head = tail 211s tail = None 211s 211s entry = _rel_tree[head] 211s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:68: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: using patch list from debian/patches/series 211s dpkg-source: info: applying a 211s dpkg-source: info: applying b 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: using patch list from debian/patches/series 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s _ test_import_unapplied_spi_parenting[input_repo0-changelog_versions0-validation_repo_delta0-validation_repo_expected_identical_refs0] _ 211s 211s get_import_commit_msg_mock = 211s get_import_tag_msg_mock = 211s repo = 211s input_repo = 211s changelog_versions = ['1-1'] 211s validation_repo_delta = {'add_commits': [], 'update_tags': {'importer/import/1-1': }} 211s validation_repo_expected_identical_refs = ['refs/tags/importer/import/1-1'] 211s 211s @pytest.mark.parametrize( 211s [ 211s 'input_repo', 211s 'changelog_versions', 211s 'validation_repo_delta', 211s 'validation_repo_expected_identical_refs', 211s ], 211s [ 211s pytest.param( 211s repo_builder.Repo(), 211s ['1-1'], 211s { 211s 'add_commits': [ 211s repo_builder.Commit.from_spec(name='publish'), 211s ], 211s 'update_tags': {'importer/import/1-1': Placeholder('publish')}, 211s }, 211s [ 211s 'refs/tags/importer/import/1-1', 211s ] 211s ), 211s pytest.param( 211s repo_builder.Repo( 211s commits=[repo_builder.Commit.from_spec(name='import')], 211s tags={'importer/import/1-1': Placeholder('import')}, 211s ), 211s ['1-2', '1-1'], 211s { 211s 'add_commits': [ 211s repo_builder.Commit.from_spec( 211s name='publish', 211s parents=[Placeholder('import')], 211s changelog_versions=['1-2', '1-1'], 211s ), 211s ], 211s 'update_tags': {'importer/import/1-2': Placeholder('publish')}, 211s }, 211s [ 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/import/1-2', 211s ], 211s ), 211s pytest.param( 211s repo_builder.Repo( 211s commits=[repo_builder.Commit.from_spec(name='import')], 211s tags={'importer/import/1-1': Placeholder('import')}, 211s ), 211s ['1-3', '1-2', '1-1'], 211s { 211s 'add_commits': [ 211s repo_builder.Commit.from_spec( 211s parents=[Placeholder('import')], 211s name='publish', 211s changelog_versions=['1-3', '1-2', '1-1'], 211s ), 211s ], 211s 'update_tags': {'importer/import/1-3': Placeholder('publish')}, 211s }, 211s [ 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/import/1-3', 211s ], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit.from_spec(name='import'), 211s repo_builder.Commit.from_spec( 211s name='reimport', 211s mutate='Reimport tag contents', 211s ), 211s ], 211s tags={ 211s 'importer/import/1-1': Placeholder('import'), 211s 'importer/reimport/import/1-1/0': Placeholder('import'), 211s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 211s }, 211s ), 211s ['1-2', '1-1'], 211s { 211s 'add_commits': [ 211s repo_builder.Commit.from_spec( 211s parents=[ 211s Placeholder('import'), 211s Placeholder('reimport'), 211s ], 211s name='publish', 211s changelog_versions=['1-2', '1-1'], 211s ), 211s ], 211s 'update_tags': {'importer/import/1-2': Placeholder('publish')}, 211s }, 211s [ 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/reimport/import/1-1/0', 211s 'refs/tags/importer/reimport/import/1-1/1', 211s 'refs/tags/importer/import/1-2', 211s ], 211s ), 211s ] 211s ) 211s @patch('gitubuntu.importer.get_import_tag_msg') 211s @patch('gitubuntu.importer.get_import_commit_msg') 211s def test_import_unapplied_spi_parenting( 211s get_import_commit_msg_mock, 211s get_import_tag_msg_mock, 211s repo, 211s input_repo, 211s changelog_versions, 211s validation_repo_delta, 211s validation_repo_expected_identical_refs, 211s ): 211s """Test that unapplied import commits have the correct parents 211s 211s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 211s that determines the commit message to use for a given import 211s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 211s that determines the tag message to use for a given import 211s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 211s temporary output repository 211s :param repo_builder.Repo input_repo: input repository data 211s :param list(str) changelog_versions: the versions in the changelog of a 211s fake package to test import 211s :param dict validation_repo_delta: how to transform the input 211s repository into a "validation repository", expressed as a dict to 211s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 211s input repository. The validation repository is then used for the 211s purposes of comparison against the output repository. 211s :param list(str) validation_repo_expected_identical_refs: refs that must be 211s identical between the validation repository and the output repository 211s 211s Verify that if an import of a package is made into input_repo where the 211s package being imported has the given changelog_versions, then the output 211s repository has commits with the parents we expect. This is tested by 211s comparing specific output references against the validation repository. 211s """ 211s 211s # Match the repo_builder objects 211s get_import_tag_msg_mock.return_value = 'Test tag' 211s get_import_commit_msg_mock.return_value = b'Test commit' 211s 211s input_repo.write(repo.raw_repo) 211s 211s publish_spec = source_builder.SourceSpec( 211s changelog_versions=changelog_versions, 211s ) 211s 211s with source_builder.Source(publish_spec) as dsc_path: 211s # import_unapplied_spi currently assumes it is called from the 211s # repository directory (pristine-tar and other commands rely on 211s # this) 211s > target.import_unapplied_spi( 211s repo=repo, 211s spi=MockSPI(dsc_path, publish_spec.version), 211s namespace='importer', 211s skip_orig=False, 211s parent_overrides={}, 211s ) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:1391: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer.py:2308: in import_unapplied_spi 211s import_unapplied_dsc( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer.py:2230: in import_unapplied_dsc 211s commit, tag = find_or_create_unapplied_commit( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer.py:2052: in find_or_create_unapplied_commit 211s changelog_parents = get_unapplied_import_parents( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer.py:1503: in get_unapplied_import_parents 211s import_tree_versions = repo.get_all_changelog_versions_from_treeish( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:2230: in get_all_changelog_versions_from_treeish 211s changelog = self.get_changelog_from_treeish(treeish) 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 211s return Changelog.from_treeish( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:569: in from_treeish 211s blob = follow_symlinks_to_blob( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 211s return _follow_symlinks_to_blob( 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s repo = pygit2.Repository('/tmp/tmp5e6866i9/.git/') 211s top_tree_object = 211s search_path = 'debian/changelog' 211s _rel_tree = 211s _rel_path = '' 211s 211s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 211s _rel_tree=None, _rel_path='' 211s ): 211s '''Recursively follow a path down a tree, following symlinks, to find blob 211s 211s repo: pygit2.Repository object 211s top_tree: pygit2.Tree object of the top of the tree structure 211s search_path: '/'-separated path string of blob to find 211s _rel_tree: (internal) which tree to look further into 211s _rel_path: (internal) the path we are in so far 211s ''' 211s 211s NORMAL_BLOB_MODES = set([ 211s pygit2.GIT_FILEMODE_BLOB, 211s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 211s ]) 211s 211s _rel_tree = _rel_tree or top_tree_object 211s head, tail = posixpath.split(search_path) 211s 211s # A traditional functional split would put a single entry in head with tail 211s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 211s # to make it appear to have traditional semantics. 211s if not head: 211s head = tail 211s tail = None 211s 211s entry = _rel_tree[head] 211s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:68: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s _ test_import_unapplied_spi_parenting[input_repo1-changelog_versions1-validation_repo_delta1-validation_repo_expected_identical_refs1] _ 211s 211s get_import_commit_msg_mock = 211s get_import_tag_msg_mock = 211s repo = 211s input_repo = 211s changelog_versions = ['1-2', '1-1'] 211s validation_repo_delta = {'add_commits': [], 'update_tags': {'importer/import/1-2': }} 211s validation_repo_expected_identical_refs = ['refs/tags/importer/import/1-1', 'refs/tags/importer/import/1-2'] 211s 211s @pytest.mark.parametrize( 211s [ 211s 'input_repo', 211s 'changelog_versions', 211s 'validation_repo_delta', 211s 'validation_repo_expected_identical_refs', 211s ], 211s [ 211s pytest.param( 211s repo_builder.Repo(), 211s ['1-1'], 211s { 211s 'add_commits': [ 211s repo_builder.Commit.from_spec(name='publish'), 211s ], 211s 'update_tags': {'importer/import/1-1': Placeholder('publish')}, 211s }, 211s [ 211s 'refs/tags/importer/import/1-1', 211s ] 211s ), 211s pytest.param( 211s repo_builder.Repo( 211s commits=[repo_builder.Commit.from_spec(name='import')], 211s tags={'importer/import/1-1': Placeholder('import')}, 211s ), 211s ['1-2', '1-1'], 211s { 211s 'add_commits': [ 211s repo_builder.Commit.from_spec( 211s name='publish', 211s parents=[Placeholder('import')], 211s changelog_versions=['1-2', '1-1'], 211s ), 211s ], 211s 'update_tags': {'importer/import/1-2': Placeholder('publish')}, 211s }, 211s [ 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/import/1-2', 211s ], 211s ), 211s pytest.param( 211s repo_builder.Repo( 211s commits=[repo_builder.Commit.from_spec(name='import')], 211s tags={'importer/import/1-1': Placeholder('import')}, 211s ), 211s ['1-3', '1-2', '1-1'], 211s { 211s 'add_commits': [ 211s repo_builder.Commit.from_spec( 211s parents=[Placeholder('import')], 211s name='publish', 211s changelog_versions=['1-3', '1-2', '1-1'], 211s ), 211s ], 211s 'update_tags': {'importer/import/1-3': Placeholder('publish')}, 211s }, 211s [ 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/import/1-3', 211s ], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit.from_spec(name='import'), 211s repo_builder.Commit.from_spec( 211s name='reimport', 211s mutate='Reimport tag contents', 211s ), 211s ], 211s tags={ 211s 'importer/import/1-1': Placeholder('import'), 211s 'importer/reimport/import/1-1/0': Placeholder('import'), 211s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 211s }, 211s ), 211s ['1-2', '1-1'], 211s { 211s 'add_commits': [ 211s repo_builder.Commit.from_spec( 211s parents=[ 211s Placeholder('import'), 211s Placeholder('reimport'), 211s ], 211s name='publish', 211s changelog_versions=['1-2', '1-1'], 211s ), 211s ], 211s 'update_tags': {'importer/import/1-2': Placeholder('publish')}, 211s }, 211s [ 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/reimport/import/1-1/0', 211s 'refs/tags/importer/reimport/import/1-1/1', 211s 'refs/tags/importer/import/1-2', 211s ], 211s ), 211s ] 211s ) 211s @patch('gitubuntu.importer.get_import_tag_msg') 211s @patch('gitubuntu.importer.get_import_commit_msg') 211s def test_import_unapplied_spi_parenting( 211s get_import_commit_msg_mock, 211s get_import_tag_msg_mock, 211s repo, 211s input_repo, 211s changelog_versions, 211s validation_repo_delta, 211s validation_repo_expected_identical_refs, 211s ): 211s """Test that unapplied import commits have the correct parents 211s 211s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 211s that determines the commit message to use for a given import 211s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 211s that determines the tag message to use for a given import 211s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 211s temporary output repository 211s :param repo_builder.Repo input_repo: input repository data 211s :param list(str) changelog_versions: the versions in the changelog of a 211s fake package to test import 211s :param dict validation_repo_delta: how to transform the input 211s repository into a "validation repository", expressed as a dict to 211s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 211s input repository. The validation repository is then used for the 211s purposes of comparison against the output repository. 211s :param list(str) validation_repo_expected_identical_refs: refs that must be 211s identical between the validation repository and the output repository 211s 211s Verify that if an import of a package is made into input_repo where the 211s package being imported has the given changelog_versions, then the output 211s repository has commits with the parents we expect. This is tested by 211s comparing specific output references against the validation repository. 211s """ 211s 211s # Match the repo_builder objects 211s get_import_tag_msg_mock.return_value = 'Test tag' 211s get_import_commit_msg_mock.return_value = b'Test commit' 211s 211s > input_repo.write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:1381: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmpzdj11u53/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s _ test_import_unapplied_spi_parenting[input_repo2-changelog_versions2-validation_repo_delta2-validation_repo_expected_identical_refs2] _ 211s 211s get_import_commit_msg_mock = 211s get_import_tag_msg_mock = 211s repo = 211s input_repo = 211s changelog_versions = ['1-3', '1-2', '1-1'] 211s validation_repo_delta = {'add_commits': [], 'update_tags': {'importer/import/1-3': }} 211s validation_repo_expected_identical_refs = ['refs/tags/importer/import/1-1', 'refs/tags/importer/import/1-3'] 211s 211s @pytest.mark.parametrize( 211s [ 211s 'input_repo', 211s 'changelog_versions', 211s 'validation_repo_delta', 211s 'validation_repo_expected_identical_refs', 211s ], 211s [ 211s pytest.param( 211s repo_builder.Repo(), 211s ['1-1'], 211s { 211s 'add_commits': [ 211s repo_builder.Commit.from_spec(name='publish'), 211s ], 211s 'update_tags': {'importer/import/1-1': Placeholder('publish')}, 211s }, 211s [ 211s 'refs/tags/importer/import/1-1', 211s ] 211s ), 211s pytest.param( 211s repo_builder.Repo( 211s commits=[repo_builder.Commit.from_spec(name='import')], 211s tags={'importer/import/1-1': Placeholder('import')}, 211s ), 211s ['1-2', '1-1'], 211s { 211s 'add_commits': [ 211s repo_builder.Commit.from_spec( 211s name='publish', 211s parents=[Placeholder('import')], 211s changelog_versions=['1-2', '1-1'], 211s ), 211s ], 211s 'update_tags': {'importer/import/1-2': Placeholder('publish')}, 211s }, 211s [ 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/import/1-2', 211s ], 211s ), 211s pytest.param( 211s repo_builder.Repo( 211s commits=[repo_builder.Commit.from_spec(name='import')], 211s tags={'importer/import/1-1': Placeholder('import')}, 211s ), 211s ['1-3', '1-2', '1-1'], 211s { 211s 'add_commits': [ 211s repo_builder.Commit.from_spec( 211s parents=[Placeholder('import')], 211s name='publish', 211s changelog_versions=['1-3', '1-2', '1-1'], 211s ), 211s ], 211s 'update_tags': {'importer/import/1-3': Placeholder('publish')}, 211s }, 211s [ 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/import/1-3', 211s ], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit.from_spec(name='import'), 211s repo_builder.Commit.from_spec( 211s name='reimport', 211s mutate='Reimport tag contents', 211s ), 211s ], 211s tags={ 211s 'importer/import/1-1': Placeholder('import'), 211s 'importer/reimport/import/1-1/0': Placeholder('import'), 211s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 211s }, 211s ), 211s ['1-2', '1-1'], 211s { 211s 'add_commits': [ 211s repo_builder.Commit.from_spec( 211s parents=[ 211s Placeholder('import'), 211s Placeholder('reimport'), 211s ], 211s name='publish', 211s changelog_versions=['1-2', '1-1'], 211s ), 211s ], 211s 'update_tags': {'importer/import/1-2': Placeholder('publish')}, 211s }, 211s [ 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/reimport/import/1-1/0', 211s 'refs/tags/importer/reimport/import/1-1/1', 211s 'refs/tags/importer/import/1-2', 211s ], 211s ), 211s ] 211s ) 211s @patch('gitubuntu.importer.get_import_tag_msg') 211s @patch('gitubuntu.importer.get_import_commit_msg') 211s def test_import_unapplied_spi_parenting( 211s get_import_commit_msg_mock, 211s get_import_tag_msg_mock, 211s repo, 211s input_repo, 211s changelog_versions, 211s validation_repo_delta, 211s validation_repo_expected_identical_refs, 211s ): 211s """Test that unapplied import commits have the correct parents 211s 211s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 211s that determines the commit message to use for a given import 211s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 211s that determines the tag message to use for a given import 211s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 211s temporary output repository 211s :param repo_builder.Repo input_repo: input repository data 211s :param list(str) changelog_versions: the versions in the changelog of a 211s fake package to test import 211s :param dict validation_repo_delta: how to transform the input 211s repository into a "validation repository", expressed as a dict to 211s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 211s input repository. The validation repository is then used for the 211s purposes of comparison against the output repository. 211s :param list(str) validation_repo_expected_identical_refs: refs that must be 211s identical between the validation repository and the output repository 211s 211s Verify that if an import of a package is made into input_repo where the 211s package being imported has the given changelog_versions, then the output 211s repository has commits with the parents we expect. This is tested by 211s comparing specific output references against the validation repository. 211s """ 211s 211s # Match the repo_builder objects 211s get_import_tag_msg_mock.return_value = 'Test tag' 211s get_import_commit_msg_mock.return_value = b'Test commit' 211s 211s > input_repo.write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:1381: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmpqey79d42/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s _ test_import_unapplied_spi_parenting[input_repo3-changelog_versions3-validation_repo_delta3-validation_repo_expected_identical_refs3] _ 211s 211s get_import_commit_msg_mock = 211s get_import_tag_msg_mock = 211s repo = 211s input_repo = 211s changelog_versions = ['1-2', '1-1'] 211s validation_repo_delta = {'add_commits': [], 'update_tags': {'importer/import/1-2': }} 211s validation_repo_expected_identical_refs = ['refs/tags/importer/import/1-1', 'refs/tags/importer/reimport/import/1-1/0', 'refs/tags/importer/reimport/import/1-1/1', 'refs/tags/importer/import/1-2'] 211s 211s @pytest.mark.parametrize( 211s [ 211s 'input_repo', 211s 'changelog_versions', 211s 'validation_repo_delta', 211s 'validation_repo_expected_identical_refs', 211s ], 211s [ 211s pytest.param( 211s repo_builder.Repo(), 211s ['1-1'], 211s { 211s 'add_commits': [ 211s repo_builder.Commit.from_spec(name='publish'), 211s ], 211s 'update_tags': {'importer/import/1-1': Placeholder('publish')}, 211s }, 211s [ 211s 'refs/tags/importer/import/1-1', 211s ] 211s ), 211s pytest.param( 211s repo_builder.Repo( 211s commits=[repo_builder.Commit.from_spec(name='import')], 211s tags={'importer/import/1-1': Placeholder('import')}, 211s ), 211s ['1-2', '1-1'], 211s { 211s 'add_commits': [ 211s repo_builder.Commit.from_spec( 211s name='publish', 211s parents=[Placeholder('import')], 211s changelog_versions=['1-2', '1-1'], 211s ), 211s ], 211s 'update_tags': {'importer/import/1-2': Placeholder('publish')}, 211s }, 211s [ 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/import/1-2', 211s ], 211s ), 211s pytest.param( 211s repo_builder.Repo( 211s commits=[repo_builder.Commit.from_spec(name='import')], 211s tags={'importer/import/1-1': Placeholder('import')}, 211s ), 211s ['1-3', '1-2', '1-1'], 211s { 211s 'add_commits': [ 211s repo_builder.Commit.from_spec( 211s parents=[Placeholder('import')], 211s name='publish', 211s changelog_versions=['1-3', '1-2', '1-1'], 211s ), 211s ], 211s 'update_tags': {'importer/import/1-3': Placeholder('publish')}, 211s }, 211s [ 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/import/1-3', 211s ], 211s ), 211s ( 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit.from_spec(name='import'), 211s repo_builder.Commit.from_spec( 211s name='reimport', 211s mutate='Reimport tag contents', 211s ), 211s ], 211s tags={ 211s 'importer/import/1-1': Placeholder('import'), 211s 'importer/reimport/import/1-1/0': Placeholder('import'), 211s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 211s }, 211s ), 211s ['1-2', '1-1'], 211s { 211s 'add_commits': [ 211s repo_builder.Commit.from_spec( 211s parents=[ 211s Placeholder('import'), 211s Placeholder('reimport'), 211s ], 211s name='publish', 211s changelog_versions=['1-2', '1-1'], 211s ), 211s ], 211s 'update_tags': {'importer/import/1-2': Placeholder('publish')}, 211s }, 211s [ 211s 'refs/tags/importer/import/1-1', 211s 'refs/tags/importer/reimport/import/1-1/0', 211s 'refs/tags/importer/reimport/import/1-1/1', 211s 'refs/tags/importer/import/1-2', 211s ], 211s ), 211s ] 211s ) 211s @patch('gitubuntu.importer.get_import_tag_msg') 211s @patch('gitubuntu.importer.get_import_commit_msg') 211s def test_import_unapplied_spi_parenting( 211s get_import_commit_msg_mock, 211s get_import_tag_msg_mock, 211s repo, 211s input_repo, 211s changelog_versions, 211s validation_repo_delta, 211s validation_repo_expected_identical_refs, 211s ): 211s """Test that unapplied import commits have the correct parents 211s 211s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 211s that determines the commit message to use for a given import 211s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 211s that determines the tag message to use for a given import 211s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 211s temporary output repository 211s :param repo_builder.Repo input_repo: input repository data 211s :param list(str) changelog_versions: the versions in the changelog of a 211s fake package to test import 211s :param dict validation_repo_delta: how to transform the input 211s repository into a "validation repository", expressed as a dict to 211s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 211s input repository. The validation repository is then used for the 211s purposes of comparison against the output repository. 211s :param list(str) validation_repo_expected_identical_refs: refs that must be 211s identical between the validation repository and the output repository 211s 211s Verify that if an import of a package is made into input_repo where the 211s package being imported has the given changelog_versions, then the output 211s repository has commits with the parents we expect. This is tested by 211s comparing specific output references against the validation repository. 211s """ 211s 211s # Match the repo_builder objects 211s get_import_tag_msg_mock.return_value = 'Test tag' 211s get_import_commit_msg_mock.return_value = b'Test commit' 211s 211s > input_repo.write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:1381: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmpxtk5rq2d/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s __________________ test_import_unapplied_spi_parent_override ___________________ 211s 211s get_import_commit_msg_mock = 211s get_import_tag_msg_mock = 211s repo = 211s 211s @patch('gitubuntu.importer.get_import_tag_msg') 211s @patch('gitubuntu.importer.get_import_commit_msg') 211s def test_import_unapplied_spi_parent_override( 211s get_import_commit_msg_mock, 211s get_import_tag_msg_mock, 211s repo, 211s ): 211s """Test import_unapplied_spi() parent_override functionality 211s 211s Test that if parent_overrides is used in the import_unapplied_spi call then 211s the resulting commit correctly uses the overridden parents specified. 211s 211s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 211s that determines the commit message to use for a given import 211s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 211s that determines the tag message to use for a given import 211s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 211s temporary output repository 211s :param repo_builder.Repo input_repo: input repository data 211s """ 211s # Match the repo_builder objects 211s get_import_tag_msg_mock.return_value = 'Test tag' 211s get_import_commit_msg_mock.return_value = b'Test commit' 211s 211s input_repo = repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit.from_spec(name='import1-1', version='1-1'), 211s repo_builder.Commit.from_spec(name='import1-2', version='1-2'), 211s ], 211s tags={ 211s 'importer/import/1-1': Placeholder('import1-1'), 211s 'importer/import/1-2': Placeholder('import1-2'), 211s }, 211s ) 211s > input_repo.write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:1444: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmp47h4u12l/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-2.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-2.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s ______________ test_import_unapplied_spi_parent_override_failure _______________ 211s 211s repo = 211s 211s def test_import_unapplied_spi_parent_override_failure(repo): 211s """ 211s Test override_parents ParentOverrideError raise 211s 211s When a parent override is specified but the specified version doesn't have 211s an import tag, an exception should be raised. 211s 211s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 211s temporary output repository 211s """ 211s repo_builder.Repo( 211s commits=[repo_builder.Commit.from_spec(name='import1-1')], 211s tags={'importer/import/1-1': Placeholder('import1-1')}, 211s > ).write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:1499: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmp4wahzcqz/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s _ test_import_applied_spi_parenting[input_repo0-expected_ancestor_commits0-expected_parent_commits0] _ 211s 211s get_import_commit_msg_mock = 211s get_import_tag_msg_mock = 211s repo = 211s input_repo = 211s expected_ancestor_commits = ['refs/tags/importer/import/1-2'] 211s expected_parent_commits = ['refs/tags/importer/applied/1-1'] 211s 211s @pytest.mark.parametrize( 211s 'input_repo, expected_ancestor_commits, expected_parent_commits', [ 211s # In general, these tests do not set applied commit parents in the 211s # input repository since we have no mechanism to do that correctly, but 211s # this doesn't matter for the purposes of these tests. 211s 211s # if only one import tag exists, then it is the parent 211s pytest.param( 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit.from_spec( 211s name='unapplied1', 211s has_patches=True, 211s ), 211s repo_builder.Commit.from_spec( 211s parents=[Placeholder('unapplied1')], 211s name='unapplied2', 211s changelog_versions=['1-2', '1-1'], 211s has_patches=True, 211s ), 211s repo_builder.Commit.from_spec( 211s name='applied1', 211s patches_applied=True, 211s ), 211s ], 211s # no branches: technically not possible but branches are not 211s # relevant to the test 211s branches={}, 211s tags={ 211s 'importer/import/1-1': Placeholder('unapplied1'), 211s 'importer/import/1-2': Placeholder('unapplied2'), 211s 'importer/applied/1-1': Placeholder('applied1'), 211s }, 211s ), 211s ['refs/tags/importer/import/1-2'], 211s ['refs/tags/importer/applied/1-1'], 211s ), 211s 211s # if multiple import tags exist, then do they all end up as parents? 211s pytest.param( 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit.from_spec( 211s name='unapplied1', 211s has_patches=True, 211s ), 211s repo_builder.Commit.from_spec( 211s parents=[Placeholder('unapplied1')], 211s name='unapplied2', 211s changelog_versions=['1-2', '1-1'], 211s has_patches=True, 211s ), 211s repo_builder.Commit.from_spec( 211s parents=[Placeholder('unapplied1')], 211s name='unapplied2reimport', 211s changelog_versions=['1-2', '1-1'], 211s has_patches=True, 211s mutate='reimport tag', 211s ), 211s repo_builder.Commit.from_spec( 211s name='applied1', 211s patches_applied=True, 211s ), 211s ], 211s # no branches: technically not possible but branches are not 211s # relevant to the test 211s branches={}, 211s tags={ 211s 'importer/import/1-1': 211s Placeholder('unapplied1'), 211s 'importer/import/1-2': 211s Placeholder('unapplied2'), 211s 'importer/reimport/import/1-2/0': 211s Placeholder('unapplied2'), 211s 'importer/reimport/import/1-2/1': 211s Placeholder('unapplied2reimport'), 211s 'importer/applied/1-1': 211s Placeholder('applied1'), 211s }, 211s ), 211s [ 211s 'refs/tags/importer/reimport/import/1-2/0', 211s 'refs/tags/importer/reimport/import/1-2/1', 211s ], 211s [ 211s 'refs/tags/importer/applied/1-1', 211s ], 211s marks=pytest.mark.xfail(reason='LP: #1755247'), 211s ), 211s 211s # do we correctly create a reimport tag because a different import 211s # already exists? 211s pytest.param( 211s repo_builder.Repo( 211s commits=[ 211s repo_builder.Commit.from_spec( 211s name='unapplied1', 211s has_patches=True, 211s ), 211s repo_builder.Commit.from_spec( 211s name='unapplied1_reimport', 211s has_patches=True, 211s mutate='reimport contents', 211s ), 211s repo_builder.Commit.from_spec( 211s parents=[Placeholder('unapplied1')], 211s name='unapplied2', 211s changelog_versions=['1-2', '1-1'], 211s has_patches=True, 211s ), 211s repo_builder.Commit.from_spec( 211s name='applied1', 211s patches_applied=True, 211s ), 211s repo_builder.Commit.from_spec( 211s name='applied1_reimport', 211s patches_applied=True, 211s mutate='reimport contents', 211s ), 211s ], 211s # no branches: technically not possible but branches are not 211s # relevant to the test 211s branches={}, 211s tags={ 211s 'importer/import/1-1': 211s Placeholder('unapplied1'), 211s 'importer/reimport/import/1-1/0': 211s Placeholder('unapplied1'), 211s 'importer/reimport/import/1-1/1': 211s Placeholder('unapplied1_reimport'), 211s 'importer/import/1-2': 211s Placeholder('unapplied2'), 211s 'importer/applied/1-1': 211s Placeholder('applied1'), 211s 'importer/reimport/applied/1-1/0': 211s Placeholder('applied1'), 211s 'importer/reimport/applied/1-1/1': 211s Placeholder('applied1_reimport'), 211s }, 211s ), 211s [ 211s 'refs/tags/importer/reimport/import/1-2/0', 211s 'refs/tags/importer/reimport/import/1-2/1', 211s ], 211s [ 211s 'refs/tags/importer/reimport/applied/1-1/0', 211s 'refs/tags/importer/reimport/applied/1-1/1', 211s ], 211s marks=pytest.mark.xfail(reason='LP: #1755247'), 211s ), 211s ], 211s ) 211s @patch('gitubuntu.importer.get_import_tag_msg') 211s @patch('gitubuntu.importer.get_import_commit_msg') 211s def test_import_applied_spi_parenting( 211s get_import_commit_msg_mock, 211s get_import_tag_msg_mock, 211s repo, 211s input_repo, 211s expected_ancestor_commits, 211s expected_parent_commits, 211s ): 211s """Test that applied import commits have the right parents 211s 211s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 211s that determines the commit message to use for a given import 211s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 211s that determines the tag message to use for a given import 211s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 211s temporary output repository 211s :param repo_builder.Repo input_repo: input repository data 211s :param list(str) expected_ancestor_commits: list of commit-ish strings that 211s must be ancestors of the 'applied/1-2' tag following the applied import 211s :param list(str) expected_parent_commits: list of commit-ish strings that 211s must be parents of the 'applied/1-2' tag following the applied import. 211s 211s A fake package with version '1-2' that has a changelog parent of '1-1' is 211s imported on top of the provided input_repo. The test fails if any 211s of the expected_ancestor_commits or expected_parent_commits are not 211s present. 211s 211s This test is ugly because we do not yet have a programmatic way 211s to get the interstitial commits of the patch applications. 211s """ 211s # Match the repo_builder objects 211s get_import_tag_msg_mock.return_value = 'Test tag' 211s get_import_commit_msg_mock.return_value = b'Test commit' 211s 211s > input_repo.write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:1698: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmpcds48lyl/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: using patch list from debian/patches/series 211s dpkg-source: info: applying a 211s dpkg-source: info: applying b 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: using patch list from debian/patches/series 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: using patch list from debian/patches/series 211s dpkg-source: info: applying a 211s dpkg-source: info: applying b 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: using patch list from debian/patches/series 211s dpkg-source: info: building source-builder-package in source-builder-package_1-2.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-2.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: using patch list from debian/patches/series 211s dpkg-source: info: applying a 211s dpkg-source: info: applying b 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: using patch list from debian/patches/series 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: using patch list from debian/patches/series 211s dpkg-source: info: applying a 211s dpkg-source: info: applying b 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: using patch list from debian/patches/series 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: using patch list from debian/patches/series 211s dpkg-source: info: applying a 211s dpkg-source: info: applying b 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: using patch list from debian/patches/series 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s _ test_authorship_date[False-Fri, 2 Feb 1971 12:34:56 +0100-expected_result0] __ 211s 211s repo = 211s override = False, input_string = 'Fri, 2 Feb 1971 12:34:56 +0100' 211s expected_result = (1971, 2, 2, 11, 34, 56, ...) 211s 211s @pytest.mark.parametrize(['override', 'input_string', 'expected_result'], [ 211s # Standard date that should parse and be used 211s (False, 'Fri, 2 Feb 1971 12:34:56 +0100', (1971, 2, 2, 11, 34, 56, 60)), 211s # Deliberately illegal date that cannot be parsed 211s (True, 'Failday, 30 Feb 1971 99:99:99 +9999', (1972, 3, 3, 12, 45, 57, 0)), 211s ]) 211s def test_authorship_date(repo, override, input_string, expected_result): 211s """Synthesized commit should use changelog or override when provided 211s 211s A synthesized commit should use the date of the changelog entry in the 211s usual case, or commit_date when an override is requested. 211s 211s :param GitUbuntuRepository repo: fixture providing a temporary 211s GitUbuntuRepository instance to use 211s :param bool override: whether a changelog date override should be requested 211s from import_unapplied_dsc() 211s :param str input_string: the timestamp part of the changelog entry to use 211s :param tuple expected_result: the expected author date of the synthesized 211s commit, specified as six parameters to datetime.datetime() followed by 211s the expected tz offset in minutes. 211s """ 211s spec = source_builder.SourceSpec(changelog_date=input_string) 211s with source_builder.Source(spec) as dsc_pathname: 211s > target.import_unapplied_dsc( 211s repo=repo, 211s version='1-1', 211s namespace='importer', 211s dist='ubuntu', 211s dsc_pathname=dsc_pathname, 211s head_name='ubuntu/focal', 211s skip_orig=True, 211s parent_overrides={}, 211s commit_date=datetime.datetime( 211s 1972, 211s 3, 211s 3, 211s 12, 211s 45, 211s 57, 211s tzinfo=datetime.timezone.utc, 211s ), 211s changelog_date_overrides=( 211s frozenset({'1-1'}) if override else frozenset() 211s ), 211s ) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:1815: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer.py:2230: in import_unapplied_dsc 211s commit, tag = find_or_create_unapplied_commit( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer.py:2052: in find_or_create_unapplied_commit 211s changelog_parents = get_unapplied_import_parents( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer.py:1503: in get_unapplied_import_parents 211s import_tree_versions = repo.get_all_changelog_versions_from_treeish( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:2230: in get_all_changelog_versions_from_treeish 211s changelog = self.get_changelog_from_treeish(treeish) 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 211s return Changelog.from_treeish( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:569: in from_treeish 211s blob = follow_symlinks_to_blob( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 211s return _follow_symlinks_to_blob( 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s repo = pygit2.Repository('/tmp/tmpsv38jl2f/.git/') 211s top_tree_object = 211s search_path = 'debian/changelog' 211s _rel_tree = 211s _rel_path = '' 211s 211s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 211s _rel_tree=None, _rel_path='' 211s ): 211s '''Recursively follow a path down a tree, following symlinks, to find blob 211s 211s repo: pygit2.Repository object 211s top_tree: pygit2.Tree object of the top of the tree structure 211s search_path: '/'-separated path string of blob to find 211s _rel_tree: (internal) which tree to look further into 211s _rel_path: (internal) the path we are in so far 211s ''' 211s 211s NORMAL_BLOB_MODES = set([ 211s pygit2.GIT_FILEMODE_BLOB, 211s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 211s ]) 211s 211s _rel_tree = _rel_tree or top_tree_object 211s head, tail = posixpath.split(search_path) 211s 211s # A traditional functional split would put a single entry in head with tail 211s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 211s # to make it appear to have traditional semantics. 211s if not head: 211s head = tail 211s tail = None 211s 211s entry = _rel_tree[head] 211s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:68: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s _ test_authorship_date[True-Failday, 30 Feb 1971 99:99:99 +9999-expected_result1] _ 211s 211s repo = 211s override = True, input_string = 'Failday, 30 Feb 1971 99:99:99 +9999' 211s expected_result = (1972, 3, 3, 12, 45, 57, ...) 211s 211s @pytest.mark.parametrize(['override', 'input_string', 'expected_result'], [ 211s # Standard date that should parse and be used 211s (False, 'Fri, 2 Feb 1971 12:34:56 +0100', (1971, 2, 2, 11, 34, 56, 60)), 211s # Deliberately illegal date that cannot be parsed 211s (True, 'Failday, 30 Feb 1971 99:99:99 +9999', (1972, 3, 3, 12, 45, 57, 0)), 211s ]) 211s def test_authorship_date(repo, override, input_string, expected_result): 211s """Synthesized commit should use changelog or override when provided 211s 211s A synthesized commit should use the date of the changelog entry in the 211s usual case, or commit_date when an override is requested. 211s 211s :param GitUbuntuRepository repo: fixture providing a temporary 211s GitUbuntuRepository instance to use 211s :param bool override: whether a changelog date override should be requested 211s from import_unapplied_dsc() 211s :param str input_string: the timestamp part of the changelog entry to use 211s :param tuple expected_result: the expected author date of the synthesized 211s commit, specified as six parameters to datetime.datetime() followed by 211s the expected tz offset in minutes. 211s """ 211s spec = source_builder.SourceSpec(changelog_date=input_string) 211s with source_builder.Source(spec) as dsc_pathname: 211s > target.import_unapplied_dsc( 211s repo=repo, 211s version='1-1', 211s namespace='importer', 211s dist='ubuntu', 211s dsc_pathname=dsc_pathname, 211s head_name='ubuntu/focal', 211s skip_orig=True, 211s parent_overrides={}, 211s commit_date=datetime.datetime( 211s 1972, 211s 3, 211s 3, 211s 12, 211s 45, 211s 57, 211s tzinfo=datetime.timezone.utc, 211s ), 211s changelog_date_overrides=( 211s frozenset({'1-1'}) if override else frozenset() 211s ), 211s ) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:1815: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer.py:2230: in import_unapplied_dsc 211s commit, tag = find_or_create_unapplied_commit( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer.py:2052: in find_or_create_unapplied_commit 211s changelog_parents = get_unapplied_import_parents( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer.py:1503: in get_unapplied_import_parents 211s import_tree_versions = repo.get_all_changelog_versions_from_treeish( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:2230: in get_all_changelog_versions_from_treeish 211s changelog = self.get_changelog_from_treeish(treeish) 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 211s return Changelog.from_treeish( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:569: in from_treeish 211s blob = follow_symlinks_to_blob( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 211s return _follow_symlinks_to_blob( 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s repo = pygit2.Repository('/tmp/tmpy3h8bvtq/.git/') 211s top_tree_object = 211s search_path = 'debian/changelog' 211s _rel_tree = 211s _rel_path = '' 211s 211s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 211s _rel_tree=None, _rel_path='' 211s ): 211s '''Recursively follow a path down a tree, following symlinks, to find blob 211s 211s repo: pygit2.Repository object 211s top_tree: pygit2.Tree object of the top of the tree structure 211s search_path: '/'-separated path string of blob to find 211s _rel_tree: (internal) which tree to look further into 211s _rel_path: (internal) the path we are in so far 211s ''' 211s 211s NORMAL_BLOB_MODES = set([ 211s pygit2.GIT_FILEMODE_BLOB, 211s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 211s ]) 211s 211s _rel_tree = _rel_tree or top_tree_object 211s head, tail = posixpath.split(search_path) 211s 211s # A traditional functional split would put a single entry in head with tail 211s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 211s # to make it appear to have traditional semantics. 211s if not head: 211s head = tail 211s tail = None 211s 211s entry = _rel_tree[head] 211s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:68: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: srcpkg/debian/changelog(l4): ignoring invalid week day 'Failday' 211s LINE: -- git ubuntu Failday, 30 Feb 1971 99:99:99 +9999 211s dpkg-source: warning: srcpkg/debian/changelog(l4): cannot parse non-conformant date '30 Feb 1971 99:99:99 +9999' 211s LINE: -- git ubuntu Failday, 30 Feb 1971 99:99:99 +9999 211s dpkg-source: warning: missing information for output field Standards-Version 211s __________________ test_fetch_rich_history_from_changes_file ___________________ 211s 211s repo = 211s pygit2_repo = pygit2.Repository('/tmp/tmpn1tzwd80/.git/') 211s 211s @patch('gitubuntu.importer.LAUNCHPAD_GIT_HOSTING_URL_PREFIX', 'file://') 211s @patch('gitubuntu.importer.VCS_GIT_URL_VALIDATION', re.compile(r'.*')) 211s def test_fetch_rich_history_from_changes_file(repo, pygit2_repo): 211s """Rich history specified in a changes file is found and validated""" 211s > rich_commit, parent_commit, import_tree = populate_rich_history( 211s import_repo=repo.raw_repo, 211s uploader_repo=pygit2_repo, 211s ) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:2111: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:2080: in populate_rich_history 211s ).write(import_repo) 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmp1t4ozrd9/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s ________ test_fetch_rich_history_from_changes_file_fetch_failure_retry _________ 211s 211s repo = 211s pygit2_repo = pygit2.Repository('/tmp/tmpif5s2hd4/.git/') 211s 211s @patch('gitubuntu.importer.LAUNCHPAD_GIT_HOSTING_URL_PREFIX', 'file://') 211s @patch('gitubuntu.importer.VCS_GIT_URL_VALIDATION', re.compile(r'.*')) 211s def test_fetch_rich_history_from_changes_file_fetch_failure_retry( 211s repo, 211s pygit2_repo, 211s ): 211s """If rich history cannot be fetched once, it is retried""" 211s > rich_commit, parent_commit, import_tree = populate_rich_history( 211s import_repo=repo.raw_repo, 211s uploader_repo=pygit2_repo, 211s ) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:2204: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:2080: in populate_rich_history 211s ).write(import_repo) 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmpxhmg0gjn/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s ____________ test_fetch_rich_history_from_changes_file_missing_ref _____________ 211s 211s repo = 211s pygit2_repo = pygit2.Repository('/tmp/tmp84w34a34/.git/') 211s 211s @patch('gitubuntu.importer.LAUNCHPAD_GIT_HOSTING_URL_PREFIX', 'file://') 211s @patch('gitubuntu.importer.VCS_GIT_URL_VALIDATION', re.compile(r'.*')) 211s def test_fetch_rich_history_from_changes_file_missing_ref( 211s repo, 211s pygit2_repo, 211s ): 211s """If rich history is specified but the ref cannot be found, a hard 211s exception is raised 211s """ 211s > rich_commit, _, _ = populate_rich_history( 211s import_repo=repo.raw_repo, 211s uploader_repo=pygit2_repo, 211s ) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:2243: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:2080: in populate_rich_history 211s ).write(import_repo) 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmpmy4ylomn/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s ___________ test_fetch_rich_history_from_changes_file_missing_commit ___________ 211s 211s repo = 211s pygit2_repo = pygit2.Repository('/tmp/tmpqh3kyjgl/.git/') 211s 211s @patch('gitubuntu.importer.LAUNCHPAD_GIT_HOSTING_URL_PREFIX', 'file://') 211s @patch('gitubuntu.importer.VCS_GIT_URL_VALIDATION', re.compile(r'.*')) 211s def test_fetch_rich_history_from_changes_file_missing_commit( 211s repo, 211s pygit2_repo, 211s ): 211s """If rich history is specified but the commit cannot be found, an 211s exception is raised 211s """ 211s > rich_commit, _, _ = populate_rich_history( 211s import_repo=repo.raw_repo, 211s uploader_repo=pygit2_repo, 211s ) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:2271: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:2080: in populate_rich_history 211s ).write(import_repo) 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmp6sd4egyb/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s ____________ test_fetch_rich_history_from_changes_file_not_a_commit ____________ 211s 211s repo = 211s pygit2_repo = pygit2.Repository('/tmp/tmp744z7s50/.git/') 211s 211s @patch('gitubuntu.importer.LAUNCHPAD_GIT_HOSTING_URL_PREFIX', 'file://') 211s @patch('gitubuntu.importer.VCS_GIT_URL_VALIDATION', re.compile(r'.*')) 211s def test_fetch_rich_history_from_changes_file_not_a_commit(repo, pygit2_repo): 211s """If rich history is specified but the commit hash resolves to something 211s other than a commit, an exception is raised 211s """ 211s > rich_commit, _, _ = populate_rich_history( 211s import_repo=repo.raw_repo, 211s uploader_repo=pygit2_repo, 211s ) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:2297: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/importer_test.py:2080: in populate_rich_history 211s ).write(import_repo) 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmp92wnu94d/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s __________________________ test_reconstruct_changelog __________________________ 211s 211s pygit2_repo = pygit2.Repository('/tmp/tmphuqgp6oa/.git/') 211s monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x637914979160> 211s 211s @pytest.mark.skipif( 211s ENTRY_POINT_TYPE is None, 211s reason="Entry point testing not available", 211s ) 211s def test_reconstruct_changelog(pygit2_repo, monkeypatch): 211s '''The reconstruct-changelog endpoint should add the expected commit''' 211s monkeypatch.setenv('DEBFULLNAME', 'Test User') 211s monkeypatch.setenv('DEBEMAIL', 'test@example.com') 211s Repo( 211s commits=[ 211s Commit(tree=SourceTree(Source()), name='root'), 211s Commit( 211s tree=SourceTree(Source(spec=SourceSpec(mutate=1))), 211s message=' * Test changelog entry', 211s name='child', 211s parents=[Placeholder('root')], 211s ), 211s ], 211s tags={'root': Placeholder('root'), 'child': Placeholder('child')}, 211s > ).write(pygit2_repo) 211s 211s gitubuntu/integration_test.py:219: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmphuqgp6oa/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s gitubuntu/repo_builder.py:389: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s dpkg-source: warning: missing information for output field Standards-Version 211s ___________________ TestObjectCreation.testRepoBranchesTags ____________________ 211s 211s self = 211s 211s def testRepoBranchesTags(self): 211s graph = Repo( 211s commits=[ 211s Commit( 211s Tree({}), 211s parents=[Placeholder('parent')], 211s name='child', 211s ), 211s Commit(Tree({}), name='parent'), 211s ], 211s branches={ 211s 'branch1': Placeholder('parent'), 211s 'branch2': Commit(Tree({'foo': Blob(b'qux')})), 211s }, 211s tags={ 211s 'tag1': Placeholder('child'), 211s 'tag2': Commit(Tree({'foo': Blob(b'quz')})), 211s }, 211s ) 211s > child_ref = graph.write(self.repo) 211s 211s gitubuntu/repo_builder_test.py:154: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmpj01il8jb/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s gitubuntu/repo_builder.py:389: AttributeError 211s ______________________ TestObjectCreation.testRepoTagger _______________________ 211s 211s self = 211s 211s def testRepoTagger(self): 211s """The tagger parameter should make it through to the tag""" 211s input_repo = Repo( 211s commits=[Commit(name='root')], 211s tags={'root': Placeholder('root')}, 211s tagger=pygit2.Signature( 211s 'Test Tagger', 211s 'test@example.com', 211s 1, 211s 2, 211s ), 211s ) 211s > input_repo.write(self.repo) 211s 211s gitubuntu/repo_builder_test.py:178: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmpkxc8e7qq/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s gitubuntu/repo_builder.py:389: AttributeError 211s _______________________________ test_source_tree _______________________________ 211s 211s pygit2_repo = pygit2.Repository('/tmp/tmp4u_hqinc/.git/') 211s 211s def test_source_tree(pygit2_repo): 211s commit_str = Commit(SourceTree(Source())).write(pygit2_repo) 211s commit = pygit2_repo.get(commit_str) 211s > assert gitubuntu.git_repository.follow_symlinks_to_blob( 211s repo=pygit2_repo, 211s treeish_object=commit, 211s path='debian/changelog', 211s ) 211s 211s gitubuntu/repo_builder_test.py:190: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 211s return _follow_symlinks_to_blob( 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s repo = pygit2.Repository('/tmp/tmp4u_hqinc/.git/') 211s top_tree_object = 211s search_path = 'debian/changelog' 211s _rel_tree = 211s _rel_path = '' 211s 211s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 211s _rel_tree=None, _rel_path='' 211s ): 211s '''Recursively follow a path down a tree, following symlinks, to find blob 211s 211s repo: pygit2.Repository object 211s top_tree: pygit2.Tree object of the top of the tree structure 211s search_path: '/'-separated path string of blob to find 211s _rel_tree: (internal) which tree to look further into 211s _rel_path: (internal) the path we are in so far 211s ''' 211s 211s NORMAL_BLOB_MODES = set([ 211s pygit2.GIT_FILEMODE_BLOB, 211s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 211s ]) 211s 211s _rel_tree = _rel_tree or top_tree_object 211s head, tail = posixpath.split(search_path) 211s 211s # A traditional functional split would put a single entry in head with tail 211s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 211s # to make it appear to have traditional semantics. 211s if not head: 211s head = tail 211s tail = None 211s 211s entry = _rel_tree[head] 211s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 211s 211s gitubuntu/git_repository.py:68: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s ______________________________ test_preservation _______________________________ 211s 211s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_preservation0') 211s repo = 211s 211s def test_preservation(tmpdir, repo): 211s """An export followed by an import should preserve rich history 211s 211s Given a minimal repository that should be able to have upload tags be 211s exported, when we import the export result into a similar repository with a 211s subtly different upload tag in which the rich history should still apply, 211s the result should be a correctly reconstructed upload tag. 211s 211s :param py.path tmpdir: the pytest standard tmpdir fixture. 211s :param repo: our standard repo fixture. 211s """ 211s Repo( 211s commits=[ 211s Commit( 211s name='1', 211s tree=Tree({ 211s 'a': Blob(b'a'), 211s }), 211s ), 211s Commit( 211s name='2', 211s parents=[Placeholder('1')], 211s tree=Tree({ 211s 'a': Blob(b'ab'), 211s }), 211s ), 211s Commit( 211s name='3', 211s parents=[Placeholder('2')], 211s tree=Tree({ 211s 'a': Blob(b'abc'), 211s }), 211s ), 211s ], 211s tags={ 211s 'importer/import/1': Placeholder('1'), 211s 'importer/upload/2': Placeholder('3'), 211s } 211s > ).write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/rich_history_test.py:51: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmpmspzu5gl/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s ______________________ test_preservation_multiple_parents ______________________ 211s 211s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_preservation_multiple_par0') 211s repo = 211s 211s def test_preservation_multiple_parents(tmpdir, repo): 211s """An export of rich history should omit multiple parent cases 211s 211s If an upload tag leads to multiple parents before we reach an import tag, 211s it should be excluded from the export as this type of upload tag is not 211s supported for rich history preservation. This test also serves to verify 211s code paths that handle the MultipleParentError exception in the export 211s code. 211s 211s :param py.path tmpdir: the pytest standard tmpdir fixture. 211s :param repo: our standard repo fixture. 211s """ 211s Repo( 211s commits=[ 211s Commit(name='1', message='a'), 211s Commit(name='2', message='b'), 211s Commit(name='child', parents=[Placeholder('1'), Placeholder('2')]), 211s ], 211s tags={ 211s 'importer/import/1': Placeholder('1'), 211s 'importer/upload/2': Placeholder('child'), 211s } 211s > ).write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/rich_history_test.py:102: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmpz4pf_i2x/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s _________________________ test_preservation_no_parents _________________________ 211s 211s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_preservation_no_parents0') 211s repo = 211s 211s def test_preservation_no_parents(tmpdir, repo): 211s """An export of rich history should omit no parent cases 211s 211s If an upload tag leads to no parents before we reach an import tag, 211s it should be excluded from the export as this type of upload tag is not 211s supported for rich history preservation. This test also serves to verify 211s code paths that handle the NoParentError exception in the export 211s code. 211s 211s :param py.path tmpdir: the pytest standard tmpdir fixture. 211s :param repo: our standard repo fixture. 211s """ 211s Repo( 211s commits=[ 211s Commit(name='1', message='a'), 211s Commit(name='2', message='b'), 211s ], 211s tags={ 211s 'importer/import/1': Placeholder('1'), 211s 'importer/upload/2': Placeholder('2'), 211s } 211s > ).write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/rich_history_test.py:129: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmpp4cj1d0b/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s _____________ test_input_edge_cases[before_export0-before_import0] _____________ 211s 211s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_input_edge_cases_before_e0') 211s repo = 211s before_export = {'commits': [, , 'importer/upload/2': }} 211s before_import = {'commits': [], 'tags': {'importer/import/1': }} 211s 211s @pytest.mark.parametrize(['before_export', 'before_import'], [ 211s ( 211s # Commit messages with patch-like contents should not fail 211s 211s # If a commit message in rich history contains text in a patch-like 211s # format (such as a diff of some file), it should not prevent correct 211s # round-tripping. "git format-patch" followed by "git am" fails this 211s # test, for example. 211s { 211s 'commits': [ 211s Commit(name='1', message='a', tree=Tree({'a': Blob(b'a')})), 211s Commit( 211s name='2', 211s message='''First line 211s 211s Inline patch that isn't part of the real patch starts here 211s 211s --- a/foo 211s +++ b/foo 211s @@ -1 +1,2 @@ 211s foo 211s +bar 211s ''', 211s tree=Tree({'a': Blob(b'ab')}), 211s parents=[Placeholder('1')], 211s ), 211s ], 211s 'tags': { 211s 'importer/import/1': Placeholder('1'), 211s 'importer/upload/2': Placeholder('2'), 211s } 211s }, 211s { 211s 'commits': [ 211s Commit(name='b1', message='c', tree=Tree({'a': Blob(b'a')})), 211s ], 211s 'tags': {'importer/import/1': Placeholder('b1')}, 211s }, 211s ), 211s ( 211s # Commits that have no changes should round trip 211s { 211s 'commits': [ 211s Commit( 211s name='1', 211s message='a', 211s ), 211s Commit( 211s name='2', 211s message='b', 211s parents=[Placeholder('1')], 211s ), 211s ], 211s 'tags': { 211s 'importer/import/1': Placeholder('1'), 211s 'importer/upload/2': Placeholder('2'), 211s }, 211s }, 211s { 211s 'commits': [Commit(name='b1', message='c')], 211s 'tags': {'importer/import/1': Placeholder('b1')}, 211s }, 211s ), 211s ( 211s # Commits that have no commit message should round trip 211s { 211s 'commits': [ 211s Commit( 211s name='1', 211s message='a', 211s ), 211s Commit( 211s name='2', 211s message='', 211s tree=Tree({'a': Blob(b'a')}), 211s parents=[Placeholder('1')], 211s ), 211s ], 211s 'tags': { 211s 'importer/import/1': Placeholder('1'), 211s 'importer/upload/2': Placeholder('2'), 211s } 211s }, 211s { 211s 'commits': [Commit(name='b1', message='c')], 211s 'tags': {'importer/import/1': Placeholder('b1')}, 211s }, 211s ), 211s ]) 211s def test_input_edge_cases(tmpdir, repo, before_export, before_import): 211s """ 211s Edge cases in input rich history should reimport without failure 211s 211s Check that rich history preservation completes without an exception in 211s various cases. Details of each case are described in comments in the test 211s parameters above. 211s 211s Since these tests generally cover the mutated case (where rich history has 211s to be ported forward because parent commits have mutated), we must remove 211s and recreate the 'importer/import/1' tag so that it is different before 211s attempting reimport. This is done by deleting all ('importer/*') tags and 211s then using the before_import parameter to recreate it again. 211s 211s :param py.path tmpdir: the pytest standard tmpdir fixture. 211s :param GitUbuntuRepository repo: our standard repo fixture. 211s :param dict before_export: the parameters to supply to Repo() to construct 211s the repository that will be exported. 211s :param dict before_import: the parametsrs to supply to Repo() to add to the 211s repository before attempting reimport. 211s """ 211s > Repo(**before_export).write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/rich_history_test.py:260: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmpthnnh5vu/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s _____________ test_input_edge_cases[before_export1-before_import1] _____________ 211s 211s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_input_edge_cases_before_e1') 211s repo = 211s before_export = {'commits': [, , 'importer/upload/2': }} 211s before_import = {'commits': [], 'tags': {'importer/import/1': }} 211s 211s @pytest.mark.parametrize(['before_export', 'before_import'], [ 211s ( 211s # Commit messages with patch-like contents should not fail 211s 211s # If a commit message in rich history contains text in a patch-like 211s # format (such as a diff of some file), it should not prevent correct 211s # round-tripping. "git format-patch" followed by "git am" fails this 211s # test, for example. 211s { 211s 'commits': [ 211s Commit(name='1', message='a', tree=Tree({'a': Blob(b'a')})), 211s Commit( 211s name='2', 211s message='''First line 211s 211s Inline patch that isn't part of the real patch starts here 211s 211s --- a/foo 211s +++ b/foo 211s @@ -1 +1,2 @@ 211s foo 211s +bar 211s ''', 211s tree=Tree({'a': Blob(b'ab')}), 211s parents=[Placeholder('1')], 211s ), 211s ], 211s 'tags': { 211s 'importer/import/1': Placeholder('1'), 211s 'importer/upload/2': Placeholder('2'), 211s } 211s }, 211s { 211s 'commits': [ 211s Commit(name='b1', message='c', tree=Tree({'a': Blob(b'a')})), 211s ], 211s 'tags': {'importer/import/1': Placeholder('b1')}, 211s }, 211s ), 211s ( 211s # Commits that have no changes should round trip 211s { 211s 'commits': [ 211s Commit( 211s name='1', 211s message='a', 211s ), 211s Commit( 211s name='2', 211s message='b', 211s parents=[Placeholder('1')], 211s ), 211s ], 211s 'tags': { 211s 'importer/import/1': Placeholder('1'), 211s 'importer/upload/2': Placeholder('2'), 211s }, 211s }, 211s { 211s 'commits': [Commit(name='b1', message='c')], 211s 'tags': {'importer/import/1': Placeholder('b1')}, 211s }, 211s ), 211s ( 211s # Commits that have no commit message should round trip 211s { 211s 'commits': [ 211s Commit( 211s name='1', 211s message='a', 211s ), 211s Commit( 211s name='2', 211s message='', 211s tree=Tree({'a': Blob(b'a')}), 211s parents=[Placeholder('1')], 211s ), 211s ], 211s 'tags': { 211s 'importer/import/1': Placeholder('1'), 211s 'importer/upload/2': Placeholder('2'), 211s } 211s }, 211s { 211s 'commits': [Commit(name='b1', message='c')], 211s 'tags': {'importer/import/1': Placeholder('b1')}, 211s }, 211s ), 211s ]) 211s def test_input_edge_cases(tmpdir, repo, before_export, before_import): 211s """ 211s Edge cases in input rich history should reimport without failure 211s 211s Check that rich history preservation completes without an exception in 211s various cases. Details of each case are described in comments in the test 211s parameters above. 211s 211s Since these tests generally cover the mutated case (where rich history has 211s to be ported forward because parent commits have mutated), we must remove 211s and recreate the 'importer/import/1' tag so that it is different before 211s attempting reimport. This is done by deleting all ('importer/*') tags and 211s then using the before_import parameter to recreate it again. 211s 211s :param py.path tmpdir: the pytest standard tmpdir fixture. 211s :param GitUbuntuRepository repo: our standard repo fixture. 211s :param dict before_export: the parameters to supply to Repo() to construct 211s the repository that will be exported. 211s :param dict before_import: the parametsrs to supply to Repo() to add to the 211s repository before attempting reimport. 211s """ 211s > Repo(**before_export).write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/rich_history_test.py:260: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmpjdx2v5xr/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s _____________ test_input_edge_cases[before_export2-before_import2] _____________ 211s 211s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_input_edge_cases_before_e2') 211s repo = 211s before_export = {'commits': [, , 'importer/upload/2': }} 211s before_import = {'commits': [], 'tags': {'importer/import/1': }} 211s 211s @pytest.mark.parametrize(['before_export', 'before_import'], [ 211s ( 211s # Commit messages with patch-like contents should not fail 211s 211s # If a commit message in rich history contains text in a patch-like 211s # format (such as a diff of some file), it should not prevent correct 211s # round-tripping. "git format-patch" followed by "git am" fails this 211s # test, for example. 211s { 211s 'commits': [ 211s Commit(name='1', message='a', tree=Tree({'a': Blob(b'a')})), 211s Commit( 211s name='2', 211s message='''First line 211s 211s Inline patch that isn't part of the real patch starts here 211s 211s --- a/foo 211s +++ b/foo 211s @@ -1 +1,2 @@ 211s foo 211s +bar 211s ''', 211s tree=Tree({'a': Blob(b'ab')}), 211s parents=[Placeholder('1')], 211s ), 211s ], 211s 'tags': { 211s 'importer/import/1': Placeholder('1'), 211s 'importer/upload/2': Placeholder('2'), 211s } 211s }, 211s { 211s 'commits': [ 211s Commit(name='b1', message='c', tree=Tree({'a': Blob(b'a')})), 211s ], 211s 'tags': {'importer/import/1': Placeholder('b1')}, 211s }, 211s ), 211s ( 211s # Commits that have no changes should round trip 211s { 211s 'commits': [ 211s Commit( 211s name='1', 211s message='a', 211s ), 211s Commit( 211s name='2', 211s message='b', 211s parents=[Placeholder('1')], 211s ), 211s ], 211s 'tags': { 211s 'importer/import/1': Placeholder('1'), 211s 'importer/upload/2': Placeholder('2'), 211s }, 211s }, 211s { 211s 'commits': [Commit(name='b1', message='c')], 211s 'tags': {'importer/import/1': Placeholder('b1')}, 211s }, 211s ), 211s ( 211s # Commits that have no commit message should round trip 211s { 211s 'commits': [ 211s Commit( 211s name='1', 211s message='a', 211s ), 211s Commit( 211s name='2', 211s message='', 211s tree=Tree({'a': Blob(b'a')}), 211s parents=[Placeholder('1')], 211s ), 211s ], 211s 'tags': { 211s 'importer/import/1': Placeholder('1'), 211s 'importer/upload/2': Placeholder('2'), 211s } 211s }, 211s { 211s 'commits': [Commit(name='b1', message='c')], 211s 'tags': {'importer/import/1': Placeholder('b1')}, 211s }, 211s ), 211s ]) 211s def test_input_edge_cases(tmpdir, repo, before_export, before_import): 211s """ 211s Edge cases in input rich history should reimport without failure 211s 211s Check that rich history preservation completes without an exception in 211s various cases. Details of each case are described in comments in the test 211s parameters above. 211s 211s Since these tests generally cover the mutated case (where rich history has 211s to be ported forward because parent commits have mutated), we must remove 211s and recreate the 'importer/import/1' tag so that it is different before 211s attempting reimport. This is done by deleting all ('importer/*') tags and 211s then using the before_import parameter to recreate it again. 211s 211s :param py.path tmpdir: the pytest standard tmpdir fixture. 211s :param GitUbuntuRepository repo: our standard repo fixture. 211s :param dict before_export: the parameters to supply to Repo() to construct 211s the repository that will be exported. 211s :param dict before_import: the parametsrs to supply to Repo() to add to the 211s repository before attempting reimport. 211s """ 211s > Repo(**before_export).write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/rich_history_test.py:260: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmp7udqeqeb/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s _______________________ test_preservation_fast_forwards ________________________ 211s 211s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_preservation_fast_forward0') 211s repo = 211s 211s def test_preservation_fast_forwards(tmpdir, repo): 211s """Rich history that can be fast forwarded should not mutate 211s 211s :param py.path tmpdir: the pytest standard tmpdir fixture. 211s :param GitUbuntuRepository repo: our standard repo fixture. 211s """ 211s Repo( 211s commits=[ 211s Commit( 211s name='1', 211s message='a', 211s ), 211s Commit( 211s name='2', 211s message='', 211s tree=Tree({'a': Blob(b'a')}), 211s parents=[Placeholder('1')], 211s ), 211s ], 211s tags={ 211s 'importer/import/1': Placeholder('1'), 211s 'importer/upload/2': Placeholder('2'), 211s } 211s > ).write(repo.raw_repo) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/rich_history_test.py:294: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s self = 211s repo = pygit2.Repository('/tmp/tmpceq2sd8m/.git/'), record = {} 211s 211s def write(self, repo, record=None): 211s replace_placeholders(self) 211s record = record or dict() 211s written_commits = [ 211s commit.write(repo=repo, record=record) 211s for commit 211s in self.commit_list 211s ] 211s for name, target in self.branches.items(): 211s repo.create_branch( 211s name, 211s repo.get(target.write(repo)).peel(pygit2.Commit), 211s ) 211s for name, target in self.tags.items(): 211s repo.create_tag( 211s name, 211s target.write(repo), 211s > pygit2.GIT_OBJ_COMMIT, 211s self.tagger.signature, 211s 'Tag message', 211s ) 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/repo_builder.py:389: AttributeError 211s _______________________ test_source_create_with_version ________________________ 211s 211s repo = 211s 211s def test_source_create_with_version(repo): 211s > version = get_spec_changelog_version(repo, version='3', native=True) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/source_builder_test.py:57: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/source_builder_test.py:47: in get_spec_changelog_version 211s changelog = repo.get_changelog_from_treeish(tree_hash) 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 211s return Changelog.from_treeish( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:569: in from_treeish 211s blob = follow_symlinks_to_blob( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 211s return _follow_symlinks_to_blob( 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s repo = pygit2.Repository('/tmp/tmp86axbfly/.git/') 211s top_tree_object = 211s search_path = 'debian/changelog' 211s _rel_tree = 211s _rel_path = '' 211s 211s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 211s _rel_tree=None, _rel_path='' 211s ): 211s '''Recursively follow a path down a tree, following symlinks, to find blob 211s 211s repo: pygit2.Repository object 211s top_tree: pygit2.Tree object of the top of the tree structure 211s search_path: '/'-separated path string of blob to find 211s _rel_tree: (internal) which tree to look further into 211s _rel_path: (internal) the path we are in so far 211s ''' 211s 211s NORMAL_BLOB_MODES = set([ 211s pygit2.GIT_FILEMODE_BLOB, 211s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 211s ]) 211s 211s _rel_tree = _rel_tree or top_tree_object 211s head, tail = posixpath.split(search_path) 211s 211s # A traditional functional split would put a single entry in head with tail 211s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 211s # to make it appear to have traditional semantics. 211s if not head: 211s head = tail 211s tail = None 211s 211s entry = _rel_tree[head] 211s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:68: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (native)' 211s dpkg-source: info: building source-builder-package in source-builder-package_3.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_3.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s _______________________ test_source_create_with_versions _______________________ 211s 211s repo = 211s 211s def test_source_create_with_versions(repo): 211s source_spec = target.SourceSpec(changelog_versions=['3', '4'], native=True) 211s with target.Source(source_spec) as f: 211s tree_hash = importer.dsc_to_tree_hash(repo.raw_repo, f) 211s > changelog = repo.get_changelog_from_treeish(tree_hash) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/source_builder_test.py:65: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 211s return Changelog.from_treeish( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:569: in from_treeish 211s blob = follow_symlinks_to_blob( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 211s return _follow_symlinks_to_blob( 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s repo = pygit2.Repository('/tmp/tmp3qn2nypj/.git/') 211s top_tree_object = 211s search_path = 'debian/changelog' 211s _rel_tree = 211s _rel_path = '' 211s 211s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 211s _rel_tree=None, _rel_path='' 211s ): 211s '''Recursively follow a path down a tree, following symlinks, to find blob 211s 211s repo: pygit2.Repository object 211s top_tree: pygit2.Tree object of the top of the tree structure 211s search_path: '/'-separated path string of blob to find 211s _rel_tree: (internal) which tree to look further into 211s _rel_path: (internal) the path we are in so far 211s ''' 211s 211s NORMAL_BLOB_MODES = set([ 211s pygit2.GIT_FILEMODE_BLOB, 211s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 211s ]) 211s 211s _rel_tree = _rel_tree or top_tree_object 211s head, tail = posixpath.split(search_path) 211s 211s # A traditional functional split would put a single entry in head with tail 211s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 211s # to make it appear to have traditional semantics. 211s if not head: 211s head = tail 211s tail = None 211s 211s entry = _rel_tree[head] 211s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:68: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (native)' 211s dpkg-source: info: building source-builder-package in source-builder-package_3.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_3.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s ____________ test_source_native_source_format[True-3.0 (native)\n] _____________ 211s 211s repo = 211s native = True, expected = b'3.0 (native)\n' 211s 211s @pytest.mark.parametrize('native,expected', [ 211s (True, b"3.0 (native)\n"), 211s (False, b"3.0 (quilt)\n"), 211s ]) 211s def test_source_native_source_format(repo, native, expected): 211s with target.Source(target.SourceSpec(native=native)) as dsc_path: 211s > blob = git_repository.follow_symlinks_to_blob( 211s repo.raw_repo, 211s dsc_path_to_tree(repo, dsc_path), 211s 'debian/source/format', 211s ) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/source_builder_test.py:133: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 211s return _follow_symlinks_to_blob( 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s repo = pygit2.Repository('/tmp/tmplhp6vk5_/.git/') 211s top_tree_object = 211s search_path = 'debian/source/format' 211s _rel_tree = 211s _rel_path = '' 211s 211s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 211s _rel_tree=None, _rel_path='' 211s ): 211s '''Recursively follow a path down a tree, following symlinks, to find blob 211s 211s repo: pygit2.Repository object 211s top_tree: pygit2.Tree object of the top of the tree structure 211s search_path: '/'-separated path string of blob to find 211s _rel_tree: (internal) which tree to look further into 211s _rel_path: (internal) the path we are in so far 211s ''' 211s 211s NORMAL_BLOB_MODES = set([ 211s pygit2.GIT_FILEMODE_BLOB, 211s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 211s ]) 211s 211s _rel_tree = _rel_tree or top_tree_object 211s head, tail = posixpath.split(search_path) 211s 211s # A traditional functional split would put a single entry in head with tail 211s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 211s # to make it appear to have traditional semantics. 211s if not head: 211s head = tail 211s tail = None 211s 211s entry = _rel_tree[head] 211s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:68: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (native)' 211s dpkg-source: info: building source-builder-package in source-builder-package_1.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s ____________ test_source_native_source_format[False-3.0 (quilt)\n] _____________ 211s 211s repo = 211s native = False, expected = b'3.0 (quilt)\n' 211s 211s @pytest.mark.parametrize('native,expected', [ 211s (True, b"3.0 (native)\n"), 211s (False, b"3.0 (quilt)\n"), 211s ]) 211s def test_source_native_source_format(repo, native, expected): 211s with target.Source(target.SourceSpec(native=native)) as dsc_path: 211s > blob = git_repository.follow_symlinks_to_blob( 211s repo.raw_repo, 211s dsc_path_to_tree(repo, dsc_path), 211s 'debian/source/format', 211s ) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/source_builder_test.py:133: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 211s return _follow_symlinks_to_blob( 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s repo = pygit2.Repository('/tmp/tmpby1gezni/.git/') 211s top_tree_object = 211s search_path = 'debian/source/format' 211s _rel_tree = 211s _rel_path = '' 211s 211s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 211s _rel_tree=None, _rel_path='' 211s ): 211s '''Recursively follow a path down a tree, following symlinks, to find blob 211s 211s repo: pygit2.Repository object 211s top_tree: pygit2.Tree object of the top of the tree structure 211s search_path: '/'-separated path string of blob to find 211s _rel_tree: (internal) which tree to look further into 211s _rel_path: (internal) the path we are in so far 211s ''' 211s 211s NORMAL_BLOB_MODES = set([ 211s pygit2.GIT_FILEMODE_BLOB, 211s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 211s ]) 211s 211s _rel_tree = _rel_tree or top_tree_object 211s head, tail = posixpath.split(search_path) 211s 211s # A traditional functional split would put a single entry in head with tail 211s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 211s # to make it appear to have traditional semantics. 211s if not head: 211s head = tail 211s tail = None 211s 211s entry = _rel_tree[head] 211s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:68: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s _________________________ test_source_quilt_no_patches _________________________ 211s 211s repo = 211s 211s def test_source_quilt_no_patches(repo): 211s with target.Source(target.SourceSpec()) as dsc_path: 211s top = dsc_path_to_tree(repo, dsc_path) 211s debian_entry = top['debian'] 211s > assert debian_entry.type in [pygit2.GIT_OBJ_TREE, 'tree'] 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/source_builder_test.py:144: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s ________________________ test_source_quilt_with_patches ________________________ 211s 211s repo = 211s 211s def test_source_quilt_with_patches(repo): 211s spec = target.SourceSpec(has_patches=True) 211s with target.Source(spec) as dsc_path: 211s top = dsc_path_to_tree(repo, dsc_path) 211s expected_files = ['series', 'a', 'b'] 211s for basename in expected_files: 211s > assert git_repository.follow_symlinks_to_blob( 211s repo.raw_repo, 211s top, 211s 'debian/patches/%s' % basename, 211s ) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/source_builder_test.py:156: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 211s return _follow_symlinks_to_blob( 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s repo = pygit2.Repository('/tmp/tmptn2gl39k/.git/') 211s top_tree_object = 211s search_path = 'debian/patches/series' 211s _rel_tree = 211s _rel_path = '' 211s 211s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 211s _rel_tree=None, _rel_path='' 211s ): 211s '''Recursively follow a path down a tree, following symlinks, to find blob 211s 211s repo: pygit2.Repository object 211s top_tree: pygit2.Tree object of the top of the tree structure 211s search_path: '/'-separated path string of blob to find 211s _rel_tree: (internal) which tree to look further into 211s _rel_path: (internal) the path we are in so far 211s ''' 211s 211s NORMAL_BLOB_MODES = set([ 211s pygit2.GIT_FILEMODE_BLOB, 211s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 211s ]) 211s 211s _rel_tree = _rel_tree or top_tree_object 211s head, tail = posixpath.split(search_path) 211s 211s # A traditional functional split would put a single entry in head with tail 211s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 211s # to make it appear to have traditional semantics. 211s if not head: 211s head = tail 211s tail = None 211s 211s entry = _rel_tree[head] 211s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:68: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: using patch list from debian/patches/series 211s dpkg-source: info: applying a 211s dpkg-source: info: applying b 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: using patch list from debian/patches/series 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s ____________________ test_source_quilt_with_patches_applied ____________________ 211s 211s repo = 211s 211s def test_source_quilt_with_patches_applied(repo): 211s spec = target.SourceSpec(has_patches=True) 211s with target.Source(spec) as dsc_path: 211s top = dsc_path_to_tree(repo, dsc_path, patches_applied=True) 211s expected_files = [ 211s 'debian/patches/series', 211s 'debian/patches/a', 211s 'debian/patches/b', 211s 'a', 211s 'b', 211s ] 211s for filename in expected_files: 211s > assert git_repository.follow_symlinks_to_blob( 211s repo.raw_repo, 211s top, 211s filename, 211s ) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/source_builder_test.py:183: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 211s return _follow_symlinks_to_blob( 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s repo = pygit2.Repository('/tmp/tmp9kmr1kgj/.git/') 211s top_tree_object = 211s search_path = 'debian/patches/series' 211s _rel_tree = 211s _rel_path = '' 211s 211s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 211s _rel_tree=None, _rel_path='' 211s ): 211s '''Recursively follow a path down a tree, following symlinks, to find blob 211s 211s repo: pygit2.Repository object 211s top_tree: pygit2.Tree object of the top of the tree structure 211s search_path: '/'-separated path string of blob to find 211s _rel_tree: (internal) which tree to look further into 211s _rel_path: (internal) the path we are in so far 211s ''' 211s 211s NORMAL_BLOB_MODES = set([ 211s pygit2.GIT_FILEMODE_BLOB, 211s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 211s ]) 211s 211s _rel_tree = _rel_tree or top_tree_object 211s head, tail = posixpath.split(search_path) 211s 211s # A traditional functional split would put a single entry in head with tail 211s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 211s # to make it appear to have traditional semantics. 211s if not head: 211s head = tail 211s tail = None 211s 211s entry = _rel_tree[head] 211s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:68: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: using patch list from debian/patches/series 211s dpkg-source: info: applying a 211s dpkg-source: info: applying b 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: using patch list from debian/patches/series 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s ______________________ test_source_version_native_default ______________________ 211s 211s repo = 211s 211s def test_source_version_native_default(repo): 211s """The default version string for a native package should not have a 211s '-' in it. 211s """ 211s > version = get_spec_changelog_version(repo, native=True) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/source_builder_test.py:194: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/source_builder_test.py:47: in get_spec_changelog_version 211s changelog = repo.get_changelog_from_treeish(tree_hash) 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 211s return Changelog.from_treeish( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:569: in from_treeish 211s blob = follow_symlinks_to_blob( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 211s return _follow_symlinks_to_blob( 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s repo = pygit2.Repository('/tmp/tmp5ip7_sy1/.git/') 211s top_tree_object = 211s search_path = 'debian/changelog' 211s _rel_tree = 211s _rel_path = '' 211s 211s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 211s _rel_tree=None, _rel_path='' 211s ): 211s '''Recursively follow a path down a tree, following symlinks, to find blob 211s 211s repo: pygit2.Repository object 211s top_tree: pygit2.Tree object of the top of the tree structure 211s search_path: '/'-separated path string of blob to find 211s _rel_tree: (internal) which tree to look further into 211s _rel_path: (internal) the path we are in so far 211s ''' 211s 211s NORMAL_BLOB_MODES = set([ 211s pygit2.GIT_FILEMODE_BLOB, 211s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 211s ]) 211s 211s _rel_tree = _rel_tree or top_tree_object 211s head, tail = posixpath.split(search_path) 211s 211s # A traditional functional split would put a single entry in head with tail 211s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 211s # to make it appear to have traditional semantics. 211s if not head: 211s head = tail 211s tail = None 211s 211s entry = _rel_tree[head] 211s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:68: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (native)' 211s dpkg-source: info: building source-builder-package in source-builder-package_1.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s ____________________ test_source_version_non_native_default ____________________ 211s 211s repo = 211s 211s def test_source_version_non_native_default(repo): 211s """The default version string for a non-native package should have a 211s '-' in it. 211s """ 211s > version = get_spec_changelog_version(repo, native=False) 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/source_builder_test.py:202: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/source_builder_test.py:47: in get_spec_changelog_version 211s changelog = repo.get_changelog_from_treeish(tree_hash) 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 211s return Changelog.from_treeish( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:569: in from_treeish 211s blob = follow_symlinks_to_blob( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 211s return _follow_symlinks_to_blob( 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s repo = pygit2.Repository('/tmp/tmp78ad0wwh/.git/') 211s top_tree_object = 211s search_path = 'debian/changelog' 211s _rel_tree = 211s _rel_path = '' 211s 211s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 211s _rel_tree=None, _rel_path='' 211s ): 211s '''Recursively follow a path down a tree, following symlinks, to find blob 211s 211s repo: pygit2.Repository object 211s top_tree: pygit2.Tree object of the top of the tree structure 211s search_path: '/'-separated path string of blob to find 211s _rel_tree: (internal) which tree to look further into 211s _rel_path: (internal) the path we are in so far 211s ''' 211s 211s NORMAL_BLOB_MODES = set([ 211s pygit2.GIT_FILEMODE_BLOB, 211s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 211s ]) 211s 211s _rel_tree = _rel_tree or top_tree_object 211s head, tail = posixpath.split(search_path) 211s 211s # A traditional functional split would put a single entry in head with tail 211s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 211s # to make it appear to have traditional semantics. 211s if not head: 211s head = tail 211s tail = None 211s 211s entry = _rel_tree[head] 211s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:68: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s _____________________ test_source_version_native_specific ______________________ 211s 211s repo = 211s 211s def test_source_version_native_specific(repo): 211s """We should be able to create a native package with a 211s native-looking version string. 211s """ 211s > version = get_spec_changelog_version(repo, native=True, version='1.0') 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/source_builder_test.py:210: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/source_builder_test.py:47: in get_spec_changelog_version 211s changelog = repo.get_changelog_from_treeish(tree_hash) 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 211s return Changelog.from_treeish( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:569: in from_treeish 211s blob = follow_symlinks_to_blob( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 211s return _follow_symlinks_to_blob( 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s repo = pygit2.Repository('/tmp/tmpvkg15px5/.git/') 211s top_tree_object = 211s search_path = 'debian/changelog' 211s _rel_tree = 211s _rel_path = '' 211s 211s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 211s _rel_tree=None, _rel_path='' 211s ): 211s '''Recursively follow a path down a tree, following symlinks, to find blob 211s 211s repo: pygit2.Repository object 211s top_tree: pygit2.Tree object of the top of the tree structure 211s search_path: '/'-separated path string of blob to find 211s _rel_tree: (internal) which tree to look further into 211s _rel_path: (internal) the path we are in so far 211s ''' 211s 211s NORMAL_BLOB_MODES = set([ 211s pygit2.GIT_FILEMODE_BLOB, 211s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 211s ]) 211s 211s _rel_tree = _rel_tree or top_tree_object 211s head, tail = posixpath.split(search_path) 211s 211s # A traditional functional split would put a single entry in head with tail 211s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 211s # to make it appear to have traditional semantics. 211s if not head: 211s head = tail 211s tail = None 211s 211s entry = _rel_tree[head] 211s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:68: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (native)' 211s dpkg-source: info: building source-builder-package in source-builder-package_1.0.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1.0.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s ___________________ test_source_version_non_native_specific ____________________ 211s 211s repo = 211s 211s def test_source_version_non_native_specific(repo): 211s """We should be able to create a non-native package with a 211s non-native-looking version string. 211s """ 211s > version = get_spec_changelog_version(repo, native=False, version='1.0-1') 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/source_builder_test.py:218: 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/source_builder_test.py:47: in get_spec_changelog_version 211s changelog = repo.get_changelog_from_treeish(tree_hash) 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 211s return Changelog.from_treeish( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:569: in from_treeish 211s blob = follow_symlinks_to_blob( 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 211s return _follow_symlinks_to_blob( 211s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 211s 211s repo = pygit2.Repository('/tmp/tmphrosfaoh/.git/') 211s top_tree_object = 211s search_path = 'debian/changelog' 211s _rel_tree = 211s _rel_path = '' 211s 211s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 211s _rel_tree=None, _rel_path='' 211s ): 211s '''Recursively follow a path down a tree, following symlinks, to find blob 211s 211s repo: pygit2.Repository object 211s top_tree: pygit2.Tree object of the top of the tree structure 211s search_path: '/'-separated path string of blob to find 211s _rel_tree: (internal) which tree to look further into 211s _rel_path: (internal) the path we are in so far 211s ''' 211s 211s NORMAL_BLOB_MODES = set([ 211s pygit2.GIT_FILEMODE_BLOB, 211s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 211s ]) 211s 211s _rel_tree = _rel_tree or top_tree_object 211s head, tail = posixpath.split(search_path) 211s 211s # A traditional functional split would put a single entry in head with tail 211s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 211s # to make it appear to have traditional semantics. 211s if not head: 211s head = tail 211s tail = None 211s 211s entry = _rel_tree[head] 211s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 211s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 211s 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/git_repository.py:68: AttributeError 211s ----------------------------- Captured stdout call ----------------------------- 211s dpkg-source: info: using source format '3.0 (quilt)' 211s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.0.orig.tar.gz 211s dpkg-source: info: building source-builder-package in source-builder-package_1.0-1.debian.tar.xz 211s dpkg-source: info: building source-builder-package in source-builder-package_1.0-1.dsc 211s ----------------------------- Captured stderr call ----------------------------- 211s dpkg-source: warning: missing information for output field Standards-Version 211s =============================== warnings summary =============================== 211s gitubuntu/__main__.py:7 211s /tmp/autopkgtest.tWFg1I/build.9Ml/src/gitubuntu/__main__.py:7: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html 211s import pkg_resources 211s 211s ../../../../usr/lib/python3/dist-packages/pkg_resources/__init__.py:3154 211s /usr/lib/python3/dist-packages/pkg_resources/__init__.py:3154: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('logilab')`. 211s Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages 211s declare_namespace(pkg) 211s 211s -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html 211s 211s ---------- coverage: platform linux, python 3.12.7-final-0 ----------- 211s Name Stmts Miss Cover 211s --------------------------------------------------------------- 211s gitubuntu/__init__.py 0 0 100% 211s gitubuntu/__main__.py 103 94 9% 211s gitubuntu/build.py 185 131 29% 211s gitubuntu/cache.py 1 0 100% 211s gitubuntu/clone.py 70 54 23% 211s gitubuntu/dsc.py 65 16 75% 211s gitubuntu/exportorig.py 48 37 23% 211s gitubuntu/git_repository.py 1103 521 53% 211s gitubuntu/git_repository_test.py 316 40 87% 211s gitubuntu/importer.py 707 446 37% 211s gitubuntu/importer_service.py 215 22 90% 211s gitubuntu/importer_service_broker.py 60 49 18% 211s gitubuntu/importer_service_ipc.py 12 2 83% 211s gitubuntu/importer_service_poller.py 37 25 32% 211s gitubuntu/importer_service_test.py 147 0 100% 211s gitubuntu/importer_service_worker.py 87 64 26% 211s gitubuntu/importer_service_worker_test.py 18 0 100% 211s gitubuntu/importer_tag_test.py 47 20 57% 211s gitubuntu/importer_test.py 388 133 66% 211s gitubuntu/integration_test.py 67 26 61% 211s gitubuntu/logging.py 8 4 50% 211s gitubuntu/merge.py 219 192 12% 211s gitubuntu/patch_state.py 2 0 100% 211s gitubuntu/prepare_upload.py 86 3 97% 211s gitubuntu/prepare_upload_test.py 152 0 100% 211s gitubuntu/queue.py 174 148 15% 211s gitubuntu/remote.py 100 85 15% 211s gitubuntu/repo_builder.py 162 0 100% 211s gitubuntu/repo_builder_test.py 159 12 92% 211s gitubuntu/repo_comparator.py 32 25 22% 211s gitubuntu/rich_history.py 67 45 33% 211s gitubuntu/rich_history_test.py 53 31 42% 211s gitubuntu/run.py 72 12 83% 211s gitubuntu/scriptutils.py 11 0 100% 211s gitubuntu/source_builder.py 119 0 100% 211s gitubuntu/source_builder_test.py 105 18 83% 211s gitubuntu/source_information.py 339 133 61% 211s gitubuntu/source_information_test.py 78 3 96% 211s gitubuntu/spec.py 3 0 100% 211s gitubuntu/submit.py 103 86 17% 211s gitubuntu/tag.py 78 69 12% 211s gitubuntu/test_fixtures.py 29 5 83% 211s gitubuntu/test_util.py 5 0 100% 211s gitubuntu/version.py 1 0 100% 211s gitubuntu/versioning.py 124 16 87% 211s --------------------------------------------------------------- 211s TOTAL 5957 2567 57% 211s 211s =========================== short test summary info ============================ 211s FAILED gitubuntu/git_repository_test.py::test_follow_symlinks_to_blob[0] 211s FAILED gitubuntu/git_repository_test.py::test_follow_symlinks_to_blob[1] 211s FAILED gitubuntu/git_repository_test.py::test_follow_symlinks_to_blob[2] 211s FAILED gitubuntu/git_repository_test.py::test_follow_symlinks_to_blob[3] 211s FAILED gitubuntu/git_repository_test.py::test_follow_symlinks_to_blob[4] 211s FAILED gitubuntu/git_repository_test.py::test_follow_symlinks_to_blob_not_found[tree1] 211s FAILED gitubuntu/git_repository_test.py::test_follow_symlinks_to_blob_not_found[tree2] 211s FAILED gitubuntu/git_repository_test.py::test_follow_symlinks_to_blob_not_found[tree3] 211s FAILED gitubuntu/git_repository_test.py::test_git_escape_dir_to_tree - Attrib... 211s FAILED gitubuntu/git_repository_test.py::test_determine_quilt_series_path[tree_data1-debian/patches/series] 211s FAILED gitubuntu/git_repository_test.py::test_determine_quilt_series_path[tree_data2-debian/patches/series] 211s FAILED gitubuntu/git_repository_test.py::test_determine_quilt_series_path[tree_data3-debian/patches/debian.series] 211s FAILED gitubuntu/git_repository_test.py::test_determine_quilt_series_path[tree_data4-debian/patches/debian.series] 211s FAILED gitubuntu/git_repository_test.py::test_quilt_env - AttributeError: mod... 211s FAILED gitubuntu/git_repository_test.py::test_repo_quilt_env - AttributeError... 211s FAILED gitubuntu/git_repository_test.py::test_repo_quilt_env_from_treeish_str 211s FAILED gitubuntu/git_repository_test.py::test_repo_find_ubuntu_merge[Common case-input_data0-pkg/import/1-1ubuntu1-pkg/import/2-1-pkg/import/1-1] 211s FAILED gitubuntu/git_repository_test.py::test_repo_find_ubuntu_merge[Ubuntu delta based on a NMU-input_data1-pkg/import/1-1.1ubuntu1-pkg/import/2-1-pkg/import/1-1.1] 211s FAILED gitubuntu/git_repository_test.py::test_repo_find_ubuntu_merge[Ubuntu upstream version head of Debian-input_data2-pkg/import/2-0ubuntu1-pkg/import/3-1-pkg/import/1-1] 211s FAILED gitubuntu/git_repository_test.py::test_commit_tree - AttributeError: m... 211s FAILED gitubuntu/git_repository_test.py::test_descendant_of[root-root-False] 211s FAILED gitubuntu/git_repository_test.py::test_descendant_of[child1-root-True] 211s FAILED gitubuntu/git_repository_test.py::test_descendant_of[root-child1-False] 211s FAILED gitubuntu/git_repository_test.py::test_descendant_of[grandchild1-root-True] 211s FAILED gitubuntu/git_repository_test.py::test_descendant_of[child1-child2-False] 211s FAILED gitubuntu/git_repository_test.py::test_descendant_of[root-disjoint-False] 211s FAILED gitubuntu/git_repository_test.py::test_create_tag - AttributeError: mo... 211s FAILED gitubuntu/git_repository_test.py::test_get_all_reimport_tags - Attribu... 211s FAILED gitubuntu/git_repository_test.py::test_get_head_info - AttributeError:... 211s FAILED gitubuntu/importer_tag_test.py::test_import_unapplied_spi_tags[input_repo0-expected_output_refs0-validation_repo_delta0-validation_repo_expected_identical_refs0-True] 211s FAILED gitubuntu/importer_tag_test.py::test_import_unapplied_spi_tags[input_repo1-expected_output_refs1-validation_repo_delta1-validation_repo_expected_identical_refs1-True] 211s FAILED gitubuntu/importer_tag_test.py::test_import_unapplied_spi_tags[input_repo2-expected_output_refs2-validation_repo_delta2-validation_repo_expected_identical_refs2-True] 211s FAILED gitubuntu/importer_tag_test.py::test_import_unapplied_spi_tags[input_repo3-expected_output_refs3-validation_repo_delta3-validation_repo_expected_identical_refs3-False] 211s FAILED gitubuntu/importer_tag_test.py::test_import_unapplied_spi_tags[input_repo4-expected_output_refs4-validation_repo_delta4-validation_repo_expected_identical_refs4-False] 211s FAILED gitubuntu/importer_tag_test.py::test_import_unapplied_spi_tags[input_repo5-expected_output_refs5-validation_repo_delta5-validation_repo_expected_identical_refs5-True] 211s FAILED gitubuntu/importer_tag_test.py::test_import_unapplied_spi_tags[input_repo6-expected_output_refs6-validation_repo_delta6-validation_repo_expected_identical_refs6-False] 211s FAILED gitubuntu/importer_tag_test.py::test_import_unapplied_spi_tags[input_repo7-expected_output_refs7-validation_repo_delta7-validation_repo_expected_identical_refs7-False] 211s FAILED gitubuntu/importer_tag_test.py::test_import_applied_spi_tags[input_repo0-validation_repo_delta0-validation_repo_expected_treewise_refs0-True] 211s FAILED gitubuntu/importer_tag_test.py::test_import_applied_spi_tags[input_repo2-validation_repo_delta2-validation_repo_expected_treewise_refs2-False] 211s FAILED gitubuntu/importer_test.py::test_get_existing_import_tags[input_repo1-PatchState.UNAPPLIED-expected1] 211s FAILED gitubuntu/importer_test.py::test_get_existing_import_tags[input_repo2-PatchState.UNAPPLIED-expected2] 211s FAILED gitubuntu/importer_test.py::test_get_existing_import_tags[input_repo4-PatchState.APPLIED-expected4] 211s FAILED gitubuntu/importer_test.py::test_get_existing_import_tags[input_repo5-PatchState.APPLIED-expected5] 211s FAILED gitubuntu/importer_test.py::test_get_existing_import_tags_ordering - A... 211s FAILED gitubuntu/importer_test.py::test_create_import_tag[input_repo0-validation_repo_delta0-validation_repo_expected_identical_refs0] 211s FAILED gitubuntu/importer_test.py::test_create_import_tag[input_repo1-validation_repo_delta1-validation_repo_expected_identical_refs1] 211s FAILED gitubuntu/importer_test.py::test_create_import_tag[input_repo2-validation_repo_delta2-validation_repo_expected_identical_refs2] 211s FAILED gitubuntu/importer_test.py::test_create_import_tag_hash_stability_on_first_import 211s FAILED gitubuntu/importer_test.py::test_create_import_tag_hash_stability_on_reimport 211s FAILED gitubuntu/importer_test.py::test_create_applied_tag[input_repo0-validation_repo_delta0-validation_repo_expected_identical_refs0] 211s FAILED gitubuntu/importer_test.py::test_create_applied_tag[input_repo1-validation_repo_delta1-validation_repo_expected_identical_refs1] 211s FAILED gitubuntu/importer_test.py::test_create_applied_tag[input_repo2-validation_repo_delta2-validation_repo_expected_identical_refs2] 211s FAILED gitubuntu/importer_test.py::test_get_changelog_parent_commits[input_repo1-parent_overrides1-changelog_versions1-PatchState.UNAPPLIED-expected_refs1] 211s FAILED gitubuntu/importer_test.py::test_get_changelog_parent_commits[input_repo2-parent_overrides2-changelog_versions2-PatchState.UNAPPLIED-expected_refs2] 211s FAILED gitubuntu/importer_test.py::test_get_changelog_parent_commits[input_repo3-parent_overrides3-changelog_versions3-PatchState.UNAPPLIED-expected_refs3] 211s FAILED gitubuntu/importer_test.py::test_get_changelog_parent_commits[input_repo5-parent_overrides5-changelog_versions5-PatchState.APPLIED-expected_refs5] 211s FAILED gitubuntu/importer_test.py::test_get_changelog_parent_commits[input_repo6-parent_overrides6-changelog_versions6-PatchState.APPLIED-expected_refs6] 211s FAILED gitubuntu/importer_test.py::test_get_changelog_parent_commits[input_repo7-parent_overrides7-changelog_versions7-PatchState.APPLIED-expected_refs7] 211s FAILED gitubuntu/importer_test.py::test_validate_rich_history[input_repo0-published_spec0-True] 211s FAILED gitubuntu/importer_test.py::test_validate_rich_history[input_repo1-published_spec1-True] 211s FAILED gitubuntu/importer_test.py::test_validate_rich_history[input_repo2-published_spec2-RichHistoryTreeMismatch] 211s FAILED gitubuntu/importer_test.py::test_validate_rich_history[input_repo3-published_spec3-RichHistoryHasNoChangelogParentAncestor] 211s FAILED gitubuntu/importer_test.py::test_add_changelog_note_to_commit - Attrib... 211s FAILED gitubuntu/importer_test.py::test_add_changelog_note_to_commit_utf8 - A... 211s FAILED gitubuntu/importer_test.py::test_double_changelog_note_add_does_not_fail 211s FAILED gitubuntu/importer_test.py::test_create_import_note - AttributeError: ... 211s FAILED gitubuntu/importer_test.py::test_create_import_note_timestamp - Attrib... 211s FAILED gitubuntu/importer_test.py::test_import_creates_import_note - Attribut... 211s FAILED gitubuntu/importer_test.py::test_import_unapplied_spi_quilt_patches - ... 211s FAILED gitubuntu/importer_test.py::test_import_unapplied_spi_parenting[input_repo0-changelog_versions0-validation_repo_delta0-validation_repo_expected_identical_refs0] 211s FAILED gitubuntu/importer_test.py::test_import_unapplied_spi_parenting[input_repo1-changelog_versions1-validation_repo_delta1-validation_repo_expected_identical_refs1] 211s FAILED gitubuntu/importer_test.py::test_import_unapplied_spi_parenting[input_repo2-changelog_versions2-validation_repo_delta2-validation_repo_expected_identical_refs2] 211s FAILED gitubuntu/importer_test.py::test_import_unapplied_spi_parenting[input_repo3-changelog_versions3-validation_repo_delta3-validation_repo_expected_identical_refs3] 211s FAILED gitubuntu/importer_test.py::test_import_unapplied_spi_parent_override 211s FAILED gitubuntu/importer_test.py::test_import_unapplied_spi_parent_override_failure 211s FAILED gitubuntu/importer_test.py::test_import_applied_spi_parenting[input_repo0-expected_ancestor_commits0-expected_parent_commits0] 211s FAILED gitubuntu/importer_test.py::test_authorship_date[False-Fri, 2 Feb 1971 12:34:56 +0100-expected_result0] 211s FAILED gitubuntu/importer_test.py::test_authorship_date[True-Failday, 30 Feb 1971 99:99:99 +9999-expected_result1] 211s FAILED gitubuntu/importer_test.py::test_fetch_rich_history_from_changes_file 211s FAILED gitubuntu/importer_test.py::test_fetch_rich_history_from_changes_file_fetch_failure_retry 211s FAILED gitubuntu/importer_test.py::test_fetch_rich_history_from_changes_file_missing_ref 211s FAILED gitubuntu/importer_test.py::test_fetch_rich_history_from_changes_file_missing_commit 211s FAILED gitubuntu/importer_test.py::test_fetch_rich_history_from_changes_file_not_a_commit 211s FAILED gitubuntu/integration_test.py::test_reconstruct_changelog - AttributeE... 211s FAILED gitubuntu/repo_builder_test.py::TestObjectCreation::testRepoBranchesTags 211s FAILED gitubuntu/repo_builder_test.py::TestObjectCreation::testRepoTagger - A... 211s FAILED gitubuntu/repo_builder_test.py::test_source_tree - AttributeError: mod... 211s FAILED gitubuntu/rich_history_test.py::test_preservation - AttributeError: mo... 211s FAILED gitubuntu/rich_history_test.py::test_preservation_multiple_parents - A... 211s FAILED gitubuntu/rich_history_test.py::test_preservation_no_parents - Attribu... 211s FAILED gitubuntu/rich_history_test.py::test_input_edge_cases[before_export0-before_import0] 211s FAILED gitubuntu/rich_history_test.py::test_input_edge_cases[before_export1-before_import1] 211s FAILED gitubuntu/rich_history_test.py::test_input_edge_cases[before_export2-before_import2] 211s FAILED gitubuntu/rich_history_test.py::test_preservation_fast_forwards - Attr... 211s FAILED gitubuntu/source_builder_test.py::test_source_create_with_version - At... 211s FAILED gitubuntu/source_builder_test.py::test_source_create_with_versions - A... 211s FAILED gitubuntu/source_builder_test.py::test_source_native_source_format[True-3.0 (native)\n] 211s FAILED gitubuntu/source_builder_test.py::test_source_native_source_format[False-3.0 (quilt)\n] 211s FAILED gitubuntu/source_builder_test.py::test_source_quilt_no_patches - Attri... 211s FAILED gitubuntu/source_builder_test.py::test_source_quilt_with_patches - Att... 211s FAILED gitubuntu/source_builder_test.py::test_source_quilt_with_patches_applied 211s FAILED gitubuntu/source_builder_test.py::test_source_version_native_default 211s FAILED gitubuntu/source_builder_test.py::test_source_version_non_native_default 211s FAILED gitubuntu/source_builder_test.py::test_source_version_native_specific 211s FAILED gitubuntu/source_builder_test.py::test_source_version_non_native_specific 211s = 105 failed, 348 passed, 3 skipped, 3 xfailed, 2 warnings in 82.90s (0:01:22) = 211s pytest failed; self test will fail 211s autopkgtest [10:48:09]: test self-test: -----------------------] 212s self-test FAIL non-zero exit status 1 212s autopkgtest [10:48:10]: test self-test: - - - - - - - - - - results - - - - - - - - - - 213s autopkgtest [10:48:11]: @@@@@@@@@@@@@@@@@@@@ summary 213s self-test FAIL non-zero exit status 1 217s nova [W] Using flock in prodstack6-ppc64el 217s Creating nova instance adt-plucky-ppc64el-git-ubuntu-20241129-102451-juju-7f2275-prod-proposed-migration-environment-20-bf63012a-e1ef-445b-adaf-edf44f22686b from image adt/ubuntu-plucky-ppc64el-server-20241129.img (UUID 4310160b-3912-43a6-9b37-357145536086)...