0s autopkgtest [09:34:55]: starting date and time: 2024-12-03 09:34:55+0000 0s autopkgtest [09:34:55]: git checkout: be626eda Fix armhf LXD image generation for plucky 0s autopkgtest [09:34:55]: host juju-7f2275-prod-proposed-migration-environment-15; command line: /home/ubuntu/autopkgtest/runner/autopkgtest --output-dir /tmp/autopkgtest-work.8aaa520r/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 --security-groups autopkgtest-juju-7f2275-prod-proposed-migration-environment-15@bos03-arm64-37.secgroup --name adt-plucky-arm64-git-ubuntu-20241203-093455-juju-7f2275-prod-proposed-migration-environment-15-6852d306-3960-459b-a94a-a22dbe3d5b2c --image adt/ubuntu-plucky-arm64-server --keyname testbed-juju-7f2275-prod-proposed-migration-environment-15 --net-id=net_prod-proposed-migration -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/ 192s autopkgtest [09:38:07]: testbed dpkg architecture: arm64 192s autopkgtest [09:38:07]: testbed apt version: 2.9.14ubuntu1 193s autopkgtest [09:38:08]: @@@@@@@@@@@@@@@@@@@@ test bed setup 193s autopkgtest [09:38:08]: testbed release detected to be: None 194s autopkgtest [09:38:09]: updating testbed package index (apt update) 194s Get:1 http://ftpmaster.internal/ubuntu plucky-proposed InRelease [73.9 kB] 194s Hit:2 http://ftpmaster.internal/ubuntu plucky InRelease 194s Hit:3 http://ftpmaster.internal/ubuntu plucky-updates InRelease 194s Hit:4 http://ftpmaster.internal/ubuntu plucky-security InRelease 194s Get:5 http://ftpmaster.internal/ubuntu plucky-proposed/main Sources [65.3 kB] 194s Get:6 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse Sources [15.1 kB] 194s Get:7 http://ftpmaster.internal/ubuntu plucky-proposed/universe Sources [781 kB] 195s Get:8 http://ftpmaster.internal/ubuntu plucky-proposed/restricted Sources [9708 B] 195s Get:9 http://ftpmaster.internal/ubuntu plucky-proposed/main arm64 Packages [145 kB] 195s Get:10 http://ftpmaster.internal/ubuntu plucky-proposed/restricted arm64 Packages [58.2 kB] 195s Get:11 http://ftpmaster.internal/ubuntu plucky-proposed/universe arm64 Packages [669 kB] 195s Get:12 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse arm64 Packages [21.3 kB] 195s Fetched 1838 kB in 1s (1976 kB/s) 196s Reading package lists... 196s Reading package lists... 197s Building dependency tree... 198s Reading state information... 198s Calculating upgrade... 199s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 199s Reading package lists... 199s Building dependency tree... 199s Reading state information... 200s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 200s autopkgtest [09:38:15]: upgrading testbed (apt dist-upgrade and autopurge) 200s Reading package lists... 201s Building dependency tree... 201s Reading state information... 201s Calculating upgrade...Starting pkgProblemResolver with broken count: 0 201s Starting 2 pkgProblemResolver with broken count: 0 201s Done 202s Entering ResolveByKeep 202s 203s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 203s Reading package lists... 203s Building dependency tree... 203s Reading state information... 204s Starting pkgProblemResolver with broken count: 0 204s Starting 2 pkgProblemResolver with broken count: 0 204s Done 205s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 207s autopkgtest [09:38:22]: testbed running kernel: Linux 6.11.0-8-generic #8-Ubuntu SMP PREEMPT_DYNAMIC Mon Sep 16 14:19:41 UTC 2024 207s autopkgtest [09:38:22]: @@@@@@@@@@@@@@@@@@@@ apt-source git-ubuntu 209s Get:1 http://ftpmaster.internal/ubuntu plucky/universe git-ubuntu 1.1-1 (dsc) [2280 B] 209s Get:2 http://ftpmaster.internal/ubuntu plucky/universe git-ubuntu 1.1-1 (tar) [179 kB] 209s Get:3 http://ftpmaster.internal/ubuntu plucky/universe git-ubuntu 1.1-1 (diff) [5776 B] 209s gpgv: Signature made Wed Jul 3 16:18:24 2024 UTC 209s gpgv: using RSA key A62D2CFBD50B9B5BF360D54B159EB5C4EFC8774C 209s gpgv: Can't check signature: No public key 209s dpkg-source: warning: cannot verify inline signature for ./git-ubuntu_1.1-1.dsc: no acceptable signature found 210s autopkgtest [09:38:25]: testing package git-ubuntu version 1.1-1 210s autopkgtest [09:38:25]: build not needed 210s autopkgtest [09:38:25]: test self-test: preparing testbed 211s Reading package lists... 211s Building dependency tree... 211s Reading state information... 212s Starting pkgProblemResolver with broken count: 0 212s Starting 2 pkgProblemResolver with broken count: 0 212s Done 214s The following NEW packages will be installed: 214s dctrl-tools debian-archive-keyring devscripts diffstat dput gettext git 214s git-buildpackage git-man git-ubuntu libb-hooks-op-check-perl 214s libclass-method-modifiers-perl libclass-xsaccessor-perl libclone-perl 214s libdevel-callchecker-perl libdynaloader-functions-perl libencode-locale-perl 214s liberror-perl libfile-dirlist-perl libfile-homedir-perl libfile-listing-perl 214s libfile-touch-perl libfile-which-perl libgit2-1.8 libgomp1 214s libhtml-parser-perl libhtml-tagset-perl libhtml-tree-perl 214s libhttp-cookies-perl libhttp-date-perl libhttp-message-perl 214s libhttp-negotiate-perl libhttp-parser2.9 libimport-into-perl libio-html-perl 214s libio-pty-perl libio-socket-ssl-perl libipc-run-perl libjs-jquery 214s libjs-jquery-hotkeys libjs-jquery-isonscreen libjs-jquery-metadata 214s libjs-jquery-tablesorter libjs-jquery-throttle-debounce libjs-sphinxdoc 214s libjs-underscore liblwp-mediatypes-perl liblwp-protocol-https-perl 214s libmodule-runtime-perl libmoo-perl libnet-http-perl libnet-ssleay-perl 214s libnorm1t64 libparams-classify-perl libpgm-5.3-0t64 libpython3.13-minimal 214s libpython3.13-stdlib librole-tiny-perl libsodium23 libsub-quote-perl 214s libsys-cpuaffinity-perl libtimedate-perl libtry-tiny-perl liburi-perl 214s libwww-perl libwww-robotrules-perl libxdelta2t64 libzmq5 patchutils pbzip2 214s perl-openssl-defaults pixz pristine-tar pylint python3-argcomplete 214s python3-astroid python3-cachetools python3-coverage python3-dateutil 214s python3-debian python3-debianbts python3-dill python3-distro-info 214s python3-gpg python3-importlib-metadata python3-iniconfig python3-isort 214s python3-jaraco.classes python3-jeepney python3-keyring python3-keyrings.alt 214s python3-launchpadlib-desktop python3-logilab-common python3-mccabe 214s python3-mypy-extensions python3-packaging python3-platformdirs 214s python3-pluggy python3-py python3-pycryptodome python3-pygit2 python3-pytest 214s python3-pytest-cov python3-secretstorage python3-tenacity python3-tomlkit 214s python3-ubuntutools python3-xdg python3-zmq python3.13 python3.13-minimal 214s quilt ubuntu-dev-tools wdiff xdelta xdelta3 214s 0 upgraded, 116 newly installed, 0 to remove and 0 not upgraded. 214s Need to get 23.2 MB of archives. 214s After this operation, 103 MB of additional disk space will be used. 214s Get:1 http://ftpmaster.internal/ubuntu plucky/main arm64 libpython3.13-minimal arm64 3.13.0-2 [877 kB] 214s Get:2 http://ftpmaster.internal/ubuntu plucky/main arm64 python3.13-minimal arm64 3.13.0-2 [2100 kB] 214s Get:3 http://ftpmaster.internal/ubuntu plucky/main arm64 libjs-jquery all 3.6.1+dfsg+~3.5.14-1 [328 kB] 214s Get:4 http://ftpmaster.internal/ubuntu plucky/universe arm64 libjs-jquery-hotkeys all 0~20130707+git2d51e3a9+dfsg-2.1 [11.5 kB] 214s Get:5 http://ftpmaster.internal/ubuntu plucky/main arm64 python3-distro-info all 1.12 [7754 B] 214s Get:6 http://ftpmaster.internal/ubuntu plucky/main arm64 dctrl-tools arm64 2.24-3build3 [103 kB] 214s Get:7 http://ftpmaster.internal/ubuntu plucky/universe arm64 debian-archive-keyring all 2023.4ubuntu1 [168 kB] 214s Get:8 http://ftpmaster.internal/ubuntu plucky/main arm64 libfile-dirlist-perl all 0.05-3 [7286 B] 214s Get:9 http://ftpmaster.internal/ubuntu plucky/main arm64 libfile-which-perl all 1.27-2 [12.5 kB] 214s Get:10 http://ftpmaster.internal/ubuntu plucky/main arm64 libfile-homedir-perl all 1.006-2 [37.0 kB] 214s Get:11 http://ftpmaster.internal/ubuntu plucky/main arm64 libfile-touch-perl all 0.12-2 [7498 B] 214s Get:12 http://ftpmaster.internal/ubuntu plucky/main arm64 libio-pty-perl arm64 1:1.20-1build3 [31.3 kB] 214s Get:13 http://ftpmaster.internal/ubuntu plucky/main arm64 libipc-run-perl all 20231003.0-2 [91.5 kB] 214s Get:14 http://ftpmaster.internal/ubuntu plucky/main arm64 libclass-method-modifiers-perl all 2.15-1 [16.1 kB] 214s Get:15 http://ftpmaster.internal/ubuntu plucky/main arm64 libclass-xsaccessor-perl arm64 1.19-4build5 [32.7 kB] 214s Get:16 http://ftpmaster.internal/ubuntu plucky/main arm64 libb-hooks-op-check-perl arm64 0.22-3build2 [9348 B] 214s Get:17 http://ftpmaster.internal/ubuntu plucky/main arm64 libdynaloader-functions-perl all 0.004-1 [11.4 kB] 214s Get:18 http://ftpmaster.internal/ubuntu plucky/main arm64 libdevel-callchecker-perl arm64 0.009-1build1 [14.0 kB] 214s Get:19 http://ftpmaster.internal/ubuntu plucky/main arm64 libparams-classify-perl arm64 0.015-2build6 [19.8 kB] 214s Get:20 http://ftpmaster.internal/ubuntu plucky/main arm64 libmodule-runtime-perl all 0.016-2 [16.4 kB] 214s Get:21 http://ftpmaster.internal/ubuntu plucky/main arm64 libimport-into-perl all 1.002005-2 [10.7 kB] 215s Get:22 http://ftpmaster.internal/ubuntu plucky/main arm64 librole-tiny-perl all 2.002004-1 [16.3 kB] 215s Get:23 http://ftpmaster.internal/ubuntu plucky/main arm64 libsub-quote-perl all 2.006008-1ubuntu1 [20.7 kB] 215s Get:24 http://ftpmaster.internal/ubuntu plucky/main arm64 libmoo-perl all 2.005005-1 [47.4 kB] 215s Get:25 http://ftpmaster.internal/ubuntu plucky/main arm64 libencode-locale-perl all 1.05-3 [11.6 kB] 215s Get:26 http://ftpmaster.internal/ubuntu plucky/main arm64 libtimedate-perl all 2.3300-2 [34.0 kB] 215s Get:27 http://ftpmaster.internal/ubuntu plucky/main arm64 libhttp-date-perl all 6.06-1 [10.2 kB] 215s Get:28 http://ftpmaster.internal/ubuntu plucky/main arm64 libfile-listing-perl all 6.16-1 [11.3 kB] 215s Get:29 http://ftpmaster.internal/ubuntu plucky/main arm64 libhtml-tagset-perl all 3.24-1 [14.1 kB] 215s Get:30 http://ftpmaster.internal/ubuntu plucky/main arm64 liburi-perl all 5.30-1 [94.4 kB] 215s Get:31 http://ftpmaster.internal/ubuntu plucky/main arm64 libhtml-parser-perl arm64 3.83-1build1 [85.3 kB] 215s Get:32 http://ftpmaster.internal/ubuntu plucky/main arm64 libhtml-tree-perl all 5.07-3 [200 kB] 215s Get:33 http://ftpmaster.internal/ubuntu plucky/main arm64 libclone-perl arm64 0.47-1 [10.4 kB] 215s Get:34 http://ftpmaster.internal/ubuntu plucky/main arm64 libio-html-perl all 1.004-3 [15.9 kB] 215s Get:35 http://ftpmaster.internal/ubuntu plucky/main arm64 liblwp-mediatypes-perl all 6.04-2 [20.1 kB] 215s Get:36 http://ftpmaster.internal/ubuntu plucky/main arm64 libhttp-message-perl all 7.00-2ubuntu1 [75.9 kB] 215s Get:37 http://ftpmaster.internal/ubuntu plucky/main arm64 libhttp-cookies-perl all 6.11-1 [18.2 kB] 215s Get:38 http://ftpmaster.internal/ubuntu plucky/main arm64 libhttp-negotiate-perl all 6.01-2 [12.4 kB] 215s Get:39 http://ftpmaster.internal/ubuntu plucky/main arm64 perl-openssl-defaults arm64 7build3 [6628 B] 215s Get:40 http://ftpmaster.internal/ubuntu plucky/main arm64 libnet-ssleay-perl arm64 1.94-2 [307 kB] 215s Get:41 http://ftpmaster.internal/ubuntu plucky/main arm64 libio-socket-ssl-perl all 2.089-1 [200 kB] 215s Get:42 http://ftpmaster.internal/ubuntu plucky/main arm64 libnet-http-perl all 6.23-1 [22.3 kB] 215s Get:43 http://ftpmaster.internal/ubuntu plucky/main arm64 liblwp-protocol-https-perl all 6.14-1 [9040 B] 215s Get:44 http://ftpmaster.internal/ubuntu plucky/main arm64 libtry-tiny-perl all 0.32-1 [21.2 kB] 215s Get:45 http://ftpmaster.internal/ubuntu plucky/main arm64 libwww-robotrules-perl all 6.02-1 [12.6 kB] 215s Get:46 http://ftpmaster.internal/ubuntu plucky/main arm64 libwww-perl all 6.77-1 [138 kB] 215s Get:47 http://ftpmaster.internal/ubuntu plucky/main arm64 patchutils arm64 0.4.2-1build3 [75.3 kB] 215s Get:48 http://ftpmaster.internal/ubuntu plucky/main arm64 wdiff arm64 1.2.2-6build1 [28.6 kB] 215s Get:49 http://ftpmaster.internal/ubuntu plucky/main arm64 devscripts all 2.24.5 [1081 kB] 215s Get:50 http://ftpmaster.internal/ubuntu plucky/main arm64 diffstat arm64 1.67-1 [29.1 kB] 215s Get:51 http://ftpmaster.internal/ubuntu plucky/main arm64 python3-debian all 0.1.49ubuntu3 [116 kB] 215s Get:52 http://ftpmaster.internal/ubuntu plucky/main arm64 python3-gpg arm64 1.24.0-2ubuntu1 [288 kB] 215s Get:53 http://ftpmaster.internal/ubuntu plucky/main arm64 python3-xdg all 0.28-2 [38.3 kB] 215s Get:54 http://ftpmaster.internal/ubuntu plucky/main arm64 dput all 1.2.4ubuntu1 [49.1 kB] 215s Get:55 http://ftpmaster.internal/ubuntu plucky/main arm64 libgomp1 arm64 14.2.0-9ubuntu1 [145 kB] 215s Get:56 http://ftpmaster.internal/ubuntu plucky/main arm64 gettext arm64 0.22.5-2 [930 kB] 215s Get:57 http://ftpmaster.internal/ubuntu plucky/main arm64 liberror-perl all 0.17029-2 [25.6 kB] 215s Get:58 http://ftpmaster.internal/ubuntu plucky/main arm64 git-man all 1:2.45.2-1.2ubuntu1 [1122 kB] 215s Get:59 http://ftpmaster.internal/ubuntu plucky/main arm64 git arm64 1:2.45.2-1.2ubuntu1 [4123 kB] 215s Get:60 http://ftpmaster.internal/ubuntu plucky/main arm64 python3-dateutil all 2.9.0-3 [80.2 kB] 215s Get:61 http://ftpmaster.internal/ubuntu plucky/main arm64 python3-importlib-metadata all 8.5.0-1 [20.7 kB] 215s Get:62 http://ftpmaster.internal/ubuntu plucky/universe arm64 git-buildpackage all 0.9.35 [677 kB] 215s Get:63 http://ftpmaster.internal/ubuntu plucky/universe arm64 libsys-cpuaffinity-perl arm64 1.13~03-2build4 [31.6 kB] 215s Get:64 http://ftpmaster.internal/ubuntu plucky/universe arm64 pbzip2 arm64 1.1.13-1build1 [38.0 kB] 215s Get:65 http://ftpmaster.internal/ubuntu plucky/universe arm64 pixz arm64 1.0.7-3 [21.4 kB] 215s Get:66 http://ftpmaster.internal/ubuntu plucky/universe arm64 libxdelta2t64 arm64 1.1.3-10.7 [52.5 kB] 215s Get:67 http://ftpmaster.internal/ubuntu plucky/universe arm64 xdelta arm64 1.1.3-10.7 [25.1 kB] 215s Get:68 http://ftpmaster.internal/ubuntu plucky/universe arm64 xdelta3 arm64 3.0.11-dfsg-1.2 [73.9 kB] 215s Get:69 http://ftpmaster.internal/ubuntu plucky/universe arm64 pristine-tar arm64 1.50+nmu2build1 [118 kB] 215s Get:70 http://ftpmaster.internal/ubuntu plucky/universe arm64 quilt all 0.68-1 [439 kB] 215s Get:71 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-debianbts all 4.1.1 [12.8 kB] 215s Get:72 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-jeepney all 0.8.0-4 [33.1 kB] 215s Get:73 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-secretstorage all 3.3.3-3 [13.7 kB] 215s Get:74 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-jaraco.classes all 3.4.0-1 [7664 B] 215s Get:75 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-keyring all 25.4.1-1 [40.5 kB] 215s Get:76 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-launchpadlib-desktop all 2.0.0-1 [1778 B] 215s Get:77 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-ubuntutools all 0.203 [67.4 kB] 215s Get:78 http://ftpmaster.internal/ubuntu plucky/universe arm64 ubuntu-dev-tools all 0.203 [93.2 kB] 215s Get:79 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-astroid all 3.3.5-1 [174 kB] 215s Get:80 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-isort all 5.13.2-2 [59.3 kB] 215s Get:81 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-mypy-extensions all 1.0.0-1 [6148 B] 215s Get:82 http://ftpmaster.internal/ubuntu plucky/main arm64 libjs-underscore all 1.13.4~dfsg+~1.11.4-3 [118 kB] 215s Get:83 http://ftpmaster.internal/ubuntu plucky/main arm64 libjs-sphinxdoc all 7.4.7-4 [158 kB] 215s Get:84 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-logilab-common all 2.0.0-1 [281 kB] 215s Get:85 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-dill all 0.3.9-1 [84.5 kB] 215s Get:86 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-mccabe all 0.7.0-1 [8678 B] 215s Get:87 http://ftpmaster.internal/ubuntu plucky/main arm64 python3-platformdirs all 4.3.6-1 [16.8 kB] 215s Get:88 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-tomlkit all 0.13.2-1 [37.6 kB] 216s Get:89 http://ftpmaster.internal/ubuntu plucky/universe arm64 pylint all 3.3.1-2 [345 kB] 216s Get:90 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-argcomplete all 3.5.1-1ubuntu1 [35.6 kB] 216s Get:91 http://ftpmaster.internal/ubuntu plucky/main arm64 python3-cachetools all 5.3.3-1 [10.3 kB] 216s Get:92 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-pycryptodome arm64 3.20.0+dfsg-3build1 [1093 kB] 216s Get:93 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-keyrings.alt all 5.0.2-1 [16.6 kB] 216s Get:94 http://ftpmaster.internal/ubuntu plucky/main arm64 libhttp-parser2.9 arm64 2.9.4-6build1 [21.9 kB] 216s Get:95 http://ftpmaster.internal/ubuntu plucky-proposed/main arm64 libgit2-1.8 arm64 1.8.4+ds-1ubuntu1 [548 kB] 216s Get:96 http://ftpmaster.internal/ubuntu plucky-proposed/universe arm64 python3-pygit2 arm64 1.16.0-2 [194 kB] 216s Get:97 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-iniconfig all 1.1.1-2 [6024 B] 216s Get:98 http://ftpmaster.internal/ubuntu plucky/main arm64 python3-packaging all 24.2-1 [51.5 kB] 216s Get:99 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-pluggy all 1.5.0-1 [21.0 kB] 216s Get:100 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-pytest all 8.3.3-1 [251 kB] 216s Get:101 http://ftpmaster.internal/ubuntu plucky/main arm64 libpython3.13-stdlib arm64 3.13.0-2 [2073 kB] 216s Get:102 http://ftpmaster.internal/ubuntu plucky/main arm64 python3.13 arm64 3.13.0-2 [719 kB] 216s Get:103 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-coverage arm64 7.4.4+dfsg1-0ubuntu3 [150 kB] 216s Get:104 http://ftpmaster.internal/ubuntu plucky/universe arm64 libjs-jquery-isonscreen all 1.2.0-1.1 [3244 B] 216s Get:105 http://ftpmaster.internal/ubuntu plucky/universe arm64 libjs-jquery-metadata all 12-4 [6582 B] 216s Get:106 http://ftpmaster.internal/ubuntu plucky/universe arm64 libjs-jquery-tablesorter all 1:2.31.3+dfsg1-4 [192 kB] 216s Get:107 http://ftpmaster.internal/ubuntu plucky/universe arm64 libjs-jquery-throttle-debounce all 1.1+dfsg.1-2 [12.5 kB] 216s Get:108 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-pytest-cov all 5.0.0-1 [21.3 kB] 216s Get:109 http://ftpmaster.internal/ubuntu plucky/main arm64 python3-tenacity all 8.5.0-0ubuntu1 [17.0 kB] 216s Get:110 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-py all 1.11.0-2 [72.7 kB] 216s Get:111 http://ftpmaster.internal/ubuntu plucky/universe arm64 libnorm1t64 arm64 1.5.9+dfsg-3.1build1 [150 kB] 216s Get:112 http://ftpmaster.internal/ubuntu plucky/universe arm64 libpgm-5.3-0t64 arm64 5.3.128~dfsg-2.1build1 [162 kB] 216s Get:113 http://ftpmaster.internal/ubuntu plucky/main arm64 libsodium23 arm64 1.0.18-1build3 [119 kB] 216s Get:114 http://ftpmaster.internal/ubuntu plucky/universe arm64 libzmq5 arm64 4.3.5-1build2 [247 kB] 216s Get:115 http://ftpmaster.internal/ubuntu plucky/universe arm64 python3-zmq arm64 24.0.1-5build2 [347 kB] 216s Get:116 http://ftpmaster.internal/ubuntu plucky/universe arm64 git-ubuntu all 1.1-1 [152 kB] 217s Fetched 23.2 MB in 3s (8506 kB/s) 217s Selecting previously unselected package libpython3.13-minimal:arm64. 217s (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 ... 80333 files and directories currently installed.) 217s Preparing to unpack .../000-libpython3.13-minimal_3.13.0-2_arm64.deb ... 217s Unpacking libpython3.13-minimal:arm64 (3.13.0-2) ... 217s Selecting previously unselected package python3.13-minimal. 217s Preparing to unpack .../001-python3.13-minimal_3.13.0-2_arm64.deb ... 217s Unpacking python3.13-minimal (3.13.0-2) ... 218s Selecting previously unselected package libjs-jquery. 218s Preparing to unpack .../002-libjs-jquery_3.6.1+dfsg+~3.5.14-1_all.deb ... 218s Unpacking libjs-jquery (3.6.1+dfsg+~3.5.14-1) ... 218s Selecting previously unselected package libjs-jquery-hotkeys. 218s Preparing to unpack .../003-libjs-jquery-hotkeys_0~20130707+git2d51e3a9+dfsg-2.1_all.deb ... 218s Unpacking libjs-jquery-hotkeys (0~20130707+git2d51e3a9+dfsg-2.1) ... 218s Selecting previously unselected package python3-distro-info. 218s Preparing to unpack .../004-python3-distro-info_1.12_all.deb ... 218s Unpacking python3-distro-info (1.12) ... 218s Selecting previously unselected package dctrl-tools. 218s Preparing to unpack .../005-dctrl-tools_2.24-3build3_arm64.deb ... 218s Unpacking dctrl-tools (2.24-3build3) ... 218s Selecting previously unselected package debian-archive-keyring. 218s Preparing to unpack .../006-debian-archive-keyring_2023.4ubuntu1_all.deb ... 218s Unpacking debian-archive-keyring (2023.4ubuntu1) ... 218s Selecting previously unselected package libfile-dirlist-perl. 218s Preparing to unpack .../007-libfile-dirlist-perl_0.05-3_all.deb ... 218s Unpacking libfile-dirlist-perl (0.05-3) ... 218s Selecting previously unselected package libfile-which-perl. 218s Preparing to unpack .../008-libfile-which-perl_1.27-2_all.deb ... 218s Unpacking libfile-which-perl (1.27-2) ... 218s Selecting previously unselected package libfile-homedir-perl. 218s Preparing to unpack .../009-libfile-homedir-perl_1.006-2_all.deb ... 218s Unpacking libfile-homedir-perl (1.006-2) ... 218s Selecting previously unselected package libfile-touch-perl. 218s Preparing to unpack .../010-libfile-touch-perl_0.12-2_all.deb ... 218s Unpacking libfile-touch-perl (0.12-2) ... 218s Selecting previously unselected package libio-pty-perl. 218s Preparing to unpack .../011-libio-pty-perl_1%3a1.20-1build3_arm64.deb ... 218s Unpacking libio-pty-perl (1:1.20-1build3) ... 218s Selecting previously unselected package libipc-run-perl. 218s Preparing to unpack .../012-libipc-run-perl_20231003.0-2_all.deb ... 218s Unpacking libipc-run-perl (20231003.0-2) ... 218s Selecting previously unselected package libclass-method-modifiers-perl. 218s Preparing to unpack .../013-libclass-method-modifiers-perl_2.15-1_all.deb ... 218s Unpacking libclass-method-modifiers-perl (2.15-1) ... 218s Selecting previously unselected package libclass-xsaccessor-perl. 218s Preparing to unpack .../014-libclass-xsaccessor-perl_1.19-4build5_arm64.deb ... 218s Unpacking libclass-xsaccessor-perl (1.19-4build5) ... 218s Selecting previously unselected package libb-hooks-op-check-perl:arm64. 218s Preparing to unpack .../015-libb-hooks-op-check-perl_0.22-3build2_arm64.deb ... 218s Unpacking libb-hooks-op-check-perl:arm64 (0.22-3build2) ... 218s Selecting previously unselected package libdynaloader-functions-perl. 218s Preparing to unpack .../016-libdynaloader-functions-perl_0.004-1_all.deb ... 218s Unpacking libdynaloader-functions-perl (0.004-1) ... 218s Selecting previously unselected package libdevel-callchecker-perl:arm64. 218s Preparing to unpack .../017-libdevel-callchecker-perl_0.009-1build1_arm64.deb ... 218s Unpacking libdevel-callchecker-perl:arm64 (0.009-1build1) ... 218s Selecting previously unselected package libparams-classify-perl:arm64. 218s Preparing to unpack .../018-libparams-classify-perl_0.015-2build6_arm64.deb ... 218s Unpacking libparams-classify-perl:arm64 (0.015-2build6) ... 218s Selecting previously unselected package libmodule-runtime-perl. 218s Preparing to unpack .../019-libmodule-runtime-perl_0.016-2_all.deb ... 218s Unpacking libmodule-runtime-perl (0.016-2) ... 218s Selecting previously unselected package libimport-into-perl. 218s Preparing to unpack .../020-libimport-into-perl_1.002005-2_all.deb ... 218s Unpacking libimport-into-perl (1.002005-2) ... 218s Selecting previously unselected package librole-tiny-perl. 218s Preparing to unpack .../021-librole-tiny-perl_2.002004-1_all.deb ... 218s Unpacking librole-tiny-perl (2.002004-1) ... 218s Selecting previously unselected package libsub-quote-perl. 218s Preparing to unpack .../022-libsub-quote-perl_2.006008-1ubuntu1_all.deb ... 218s Unpacking libsub-quote-perl (2.006008-1ubuntu1) ... 218s Selecting previously unselected package libmoo-perl. 218s Preparing to unpack .../023-libmoo-perl_2.005005-1_all.deb ... 218s Unpacking libmoo-perl (2.005005-1) ... 218s Selecting previously unselected package libencode-locale-perl. 218s Preparing to unpack .../024-libencode-locale-perl_1.05-3_all.deb ... 218s Unpacking libencode-locale-perl (1.05-3) ... 219s Selecting previously unselected package libtimedate-perl. 219s Preparing to unpack .../025-libtimedate-perl_2.3300-2_all.deb ... 219s Unpacking libtimedate-perl (2.3300-2) ... 219s Selecting previously unselected package libhttp-date-perl. 219s Preparing to unpack .../026-libhttp-date-perl_6.06-1_all.deb ... 219s Unpacking libhttp-date-perl (6.06-1) ... 219s Selecting previously unselected package libfile-listing-perl. 219s Preparing to unpack .../027-libfile-listing-perl_6.16-1_all.deb ... 219s Unpacking libfile-listing-perl (6.16-1) ... 219s Selecting previously unselected package libhtml-tagset-perl. 219s Preparing to unpack .../028-libhtml-tagset-perl_3.24-1_all.deb ... 219s Unpacking libhtml-tagset-perl (3.24-1) ... 219s Selecting previously unselected package liburi-perl. 219s Preparing to unpack .../029-liburi-perl_5.30-1_all.deb ... 219s Unpacking liburi-perl (5.30-1) ... 219s Selecting previously unselected package libhtml-parser-perl:arm64. 219s Preparing to unpack .../030-libhtml-parser-perl_3.83-1build1_arm64.deb ... 219s Unpacking libhtml-parser-perl:arm64 (3.83-1build1) ... 219s Selecting previously unselected package libhtml-tree-perl. 219s Preparing to unpack .../031-libhtml-tree-perl_5.07-3_all.deb ... 219s Unpacking libhtml-tree-perl (5.07-3) ... 219s Selecting previously unselected package libclone-perl:arm64. 219s Preparing to unpack .../032-libclone-perl_0.47-1_arm64.deb ... 219s Unpacking libclone-perl:arm64 (0.47-1) ... 219s Selecting previously unselected package libio-html-perl. 219s Preparing to unpack .../033-libio-html-perl_1.004-3_all.deb ... 219s Unpacking libio-html-perl (1.004-3) ... 219s Selecting previously unselected package liblwp-mediatypes-perl. 219s Preparing to unpack .../034-liblwp-mediatypes-perl_6.04-2_all.deb ... 219s Unpacking liblwp-mediatypes-perl (6.04-2) ... 219s Selecting previously unselected package libhttp-message-perl. 219s Preparing to unpack .../035-libhttp-message-perl_7.00-2ubuntu1_all.deb ... 219s Unpacking libhttp-message-perl (7.00-2ubuntu1) ... 219s Selecting previously unselected package libhttp-cookies-perl. 219s Preparing to unpack .../036-libhttp-cookies-perl_6.11-1_all.deb ... 219s Unpacking libhttp-cookies-perl (6.11-1) ... 219s Selecting previously unselected package libhttp-negotiate-perl. 219s Preparing to unpack .../037-libhttp-negotiate-perl_6.01-2_all.deb ... 219s Unpacking libhttp-negotiate-perl (6.01-2) ... 219s Selecting previously unselected package perl-openssl-defaults:arm64. 219s Preparing to unpack .../038-perl-openssl-defaults_7build3_arm64.deb ... 219s Unpacking perl-openssl-defaults:arm64 (7build3) ... 219s Selecting previously unselected package libnet-ssleay-perl:arm64. 219s Preparing to unpack .../039-libnet-ssleay-perl_1.94-2_arm64.deb ... 219s Unpacking libnet-ssleay-perl:arm64 (1.94-2) ... 219s Selecting previously unselected package libio-socket-ssl-perl. 219s Preparing to unpack .../040-libio-socket-ssl-perl_2.089-1_all.deb ... 219s Unpacking libio-socket-ssl-perl (2.089-1) ... 219s Selecting previously unselected package libnet-http-perl. 219s Preparing to unpack .../041-libnet-http-perl_6.23-1_all.deb ... 219s Unpacking libnet-http-perl (6.23-1) ... 219s Selecting previously unselected package liblwp-protocol-https-perl. 219s Preparing to unpack .../042-liblwp-protocol-https-perl_6.14-1_all.deb ... 219s Unpacking liblwp-protocol-https-perl (6.14-1) ... 219s Selecting previously unselected package libtry-tiny-perl. 219s Preparing to unpack .../043-libtry-tiny-perl_0.32-1_all.deb ... 219s Unpacking libtry-tiny-perl (0.32-1) ... 219s Selecting previously unselected package libwww-robotrules-perl. 219s Preparing to unpack .../044-libwww-robotrules-perl_6.02-1_all.deb ... 219s Unpacking libwww-robotrules-perl (6.02-1) ... 219s Selecting previously unselected package libwww-perl. 219s Preparing to unpack .../045-libwww-perl_6.77-1_all.deb ... 219s Unpacking libwww-perl (6.77-1) ... 219s Selecting previously unselected package patchutils. 219s Preparing to unpack .../046-patchutils_0.4.2-1build3_arm64.deb ... 219s Unpacking patchutils (0.4.2-1build3) ... 219s Selecting previously unselected package wdiff. 219s Preparing to unpack .../047-wdiff_1.2.2-6build1_arm64.deb ... 219s Unpacking wdiff (1.2.2-6build1) ... 219s Selecting previously unselected package devscripts. 219s Preparing to unpack .../048-devscripts_2.24.5_all.deb ... 219s Unpacking devscripts (2.24.5) ... 220s Selecting previously unselected package diffstat. 220s Preparing to unpack .../049-diffstat_1.67-1_arm64.deb ... 220s Unpacking diffstat (1.67-1) ... 220s Selecting previously unselected package python3-debian. 220s Preparing to unpack .../050-python3-debian_0.1.49ubuntu3_all.deb ... 220s Unpacking python3-debian (0.1.49ubuntu3) ... 220s Selecting previously unselected package python3-gpg. 220s Preparing to unpack .../051-python3-gpg_1.24.0-2ubuntu1_arm64.deb ... 220s Unpacking python3-gpg (1.24.0-2ubuntu1) ... 220s Selecting previously unselected package python3-xdg. 220s Preparing to unpack .../052-python3-xdg_0.28-2_all.deb ... 220s Unpacking python3-xdg (0.28-2) ... 220s Selecting previously unselected package dput. 220s Preparing to unpack .../053-dput_1.2.4ubuntu1_all.deb ... 220s Unpacking dput (1.2.4ubuntu1) ... 220s Selecting previously unselected package libgomp1:arm64. 220s Preparing to unpack .../054-libgomp1_14.2.0-9ubuntu1_arm64.deb ... 220s Unpacking libgomp1:arm64 (14.2.0-9ubuntu1) ... 220s Selecting previously unselected package gettext. 220s Preparing to unpack .../055-gettext_0.22.5-2_arm64.deb ... 220s Unpacking gettext (0.22.5-2) ... 220s Selecting previously unselected package liberror-perl. 220s Preparing to unpack .../056-liberror-perl_0.17029-2_all.deb ... 220s Unpacking liberror-perl (0.17029-2) ... 220s Selecting previously unselected package git-man. 220s Preparing to unpack .../057-git-man_1%3a2.45.2-1.2ubuntu1_all.deb ... 220s Unpacking git-man (1:2.45.2-1.2ubuntu1) ... 220s Selecting previously unselected package git. 220s Preparing to unpack .../058-git_1%3a2.45.2-1.2ubuntu1_arm64.deb ... 220s Unpacking git (1:2.45.2-1.2ubuntu1) ... 220s Selecting previously unselected package python3-dateutil. 220s Preparing to unpack .../059-python3-dateutil_2.9.0-3_all.deb ... 220s Unpacking python3-dateutil (2.9.0-3) ... 220s Selecting previously unselected package python3-importlib-metadata. 220s Preparing to unpack .../060-python3-importlib-metadata_8.5.0-1_all.deb ... 220s Unpacking python3-importlib-metadata (8.5.0-1) ... 220s Selecting previously unselected package git-buildpackage. 220s Preparing to unpack .../061-git-buildpackage_0.9.35_all.deb ... 220s Unpacking git-buildpackage (0.9.35) ... 220s Selecting previously unselected package libsys-cpuaffinity-perl. 220s Preparing to unpack .../062-libsys-cpuaffinity-perl_1.13~03-2build4_arm64.deb ... 220s Unpacking libsys-cpuaffinity-perl (1.13~03-2build4) ... 220s Selecting previously unselected package pbzip2. 220s Preparing to unpack .../063-pbzip2_1.1.13-1build1_arm64.deb ... 220s Unpacking pbzip2 (1.1.13-1build1) ... 220s Selecting previously unselected package pixz. 220s Preparing to unpack .../064-pixz_1.0.7-3_arm64.deb ... 220s Unpacking pixz (1.0.7-3) ... 221s Selecting previously unselected package libxdelta2t64:arm64. 221s Preparing to unpack .../065-libxdelta2t64_1.1.3-10.7_arm64.deb ... 221s Unpacking libxdelta2t64:arm64 (1.1.3-10.7) ... 221s Selecting previously unselected package xdelta. 221s Preparing to unpack .../066-xdelta_1.1.3-10.7_arm64.deb ... 221s Unpacking xdelta (1.1.3-10.7) ... 221s Selecting previously unselected package xdelta3. 221s Preparing to unpack .../067-xdelta3_3.0.11-dfsg-1.2_arm64.deb ... 221s Unpacking xdelta3 (3.0.11-dfsg-1.2) ... 221s Selecting previously unselected package pristine-tar. 221s Preparing to unpack .../068-pristine-tar_1.50+nmu2build1_arm64.deb ... 221s Unpacking pristine-tar (1.50+nmu2build1) ... 221s Selecting previously unselected package quilt. 221s Preparing to unpack .../069-quilt_0.68-1_all.deb ... 221s Unpacking quilt (0.68-1) ... 221s Selecting previously unselected package python3-debianbts. 221s Preparing to unpack .../070-python3-debianbts_4.1.1_all.deb ... 221s Unpacking python3-debianbts (4.1.1) ... 221s Selecting previously unselected package python3-jeepney. 221s Preparing to unpack .../071-python3-jeepney_0.8.0-4_all.deb ... 221s Unpacking python3-jeepney (0.8.0-4) ... 221s Selecting previously unselected package python3-secretstorage. 221s Preparing to unpack .../072-python3-secretstorage_3.3.3-3_all.deb ... 221s Unpacking python3-secretstorage (3.3.3-3) ... 221s Selecting previously unselected package python3-jaraco.classes. 221s Preparing to unpack .../073-python3-jaraco.classes_3.4.0-1_all.deb ... 221s Unpacking python3-jaraco.classes (3.4.0-1) ... 221s Selecting previously unselected package python3-keyring. 221s Preparing to unpack .../074-python3-keyring_25.4.1-1_all.deb ... 221s Unpacking python3-keyring (25.4.1-1) ... 221s Selecting previously unselected package python3-launchpadlib-desktop. 221s Preparing to unpack .../075-python3-launchpadlib-desktop_2.0.0-1_all.deb ... 221s Unpacking python3-launchpadlib-desktop (2.0.0-1) ... 221s Selecting previously unselected package python3-ubuntutools. 221s Preparing to unpack .../076-python3-ubuntutools_0.203_all.deb ... 221s Unpacking python3-ubuntutools (0.203) ... 221s Selecting previously unselected package ubuntu-dev-tools. 221s Preparing to unpack .../077-ubuntu-dev-tools_0.203_all.deb ... 221s Unpacking ubuntu-dev-tools (0.203) ... 221s Selecting previously unselected package python3-astroid. 221s Preparing to unpack .../078-python3-astroid_3.3.5-1_all.deb ... 221s Unpacking python3-astroid (3.3.5-1) ... 221s Selecting previously unselected package python3-isort. 221s Preparing to unpack .../079-python3-isort_5.13.2-2_all.deb ... 221s Unpacking python3-isort (5.13.2-2) ... 221s Selecting previously unselected package python3-mypy-extensions. 221s Preparing to unpack .../080-python3-mypy-extensions_1.0.0-1_all.deb ... 221s Unpacking python3-mypy-extensions (1.0.0-1) ... 221s Selecting previously unselected package libjs-underscore. 221s Preparing to unpack .../081-libjs-underscore_1.13.4~dfsg+~1.11.4-3_all.deb ... 221s Unpacking libjs-underscore (1.13.4~dfsg+~1.11.4-3) ... 221s Selecting previously unselected package libjs-sphinxdoc. 221s Preparing to unpack .../082-libjs-sphinxdoc_7.4.7-4_all.deb ... 221s Unpacking libjs-sphinxdoc (7.4.7-4) ... 221s Selecting previously unselected package python3-logilab-common. 221s Preparing to unpack .../083-python3-logilab-common_2.0.0-1_all.deb ... 221s Unpacking python3-logilab-common (2.0.0-1) ... 221s Selecting previously unselected package python3-dill. 221s Preparing to unpack .../084-python3-dill_0.3.9-1_all.deb ... 221s Unpacking python3-dill (0.3.9-1) ... 221s Selecting previously unselected package python3-mccabe. 221s Preparing to unpack .../085-python3-mccabe_0.7.0-1_all.deb ... 221s Unpacking python3-mccabe (0.7.0-1) ... 221s Selecting previously unselected package python3-platformdirs. 222s Preparing to unpack .../086-python3-platformdirs_4.3.6-1_all.deb ... 222s Unpacking python3-platformdirs (4.3.6-1) ... 222s Selecting previously unselected package python3-tomlkit. 222s Preparing to unpack .../087-python3-tomlkit_0.13.2-1_all.deb ... 222s Unpacking python3-tomlkit (0.13.2-1) ... 222s Selecting previously unselected package pylint. 222s Preparing to unpack .../088-pylint_3.3.1-2_all.deb ... 222s Unpacking pylint (3.3.1-2) ... 222s Selecting previously unselected package python3-argcomplete. 222s Preparing to unpack .../089-python3-argcomplete_3.5.1-1ubuntu1_all.deb ... 222s Unpacking python3-argcomplete (3.5.1-1ubuntu1) ... 222s Selecting previously unselected package python3-cachetools. 222s Preparing to unpack .../090-python3-cachetools_5.3.3-1_all.deb ... 222s Unpacking python3-cachetools (5.3.3-1) ... 222s Selecting previously unselected package python3-pycryptodome. 222s Preparing to unpack .../091-python3-pycryptodome_3.20.0+dfsg-3build1_arm64.deb ... 222s Unpacking python3-pycryptodome (3.20.0+dfsg-3build1) ... 222s Selecting previously unselected package python3-keyrings.alt. 222s Preparing to unpack .../092-python3-keyrings.alt_5.0.2-1_all.deb ... 222s Unpacking python3-keyrings.alt (5.0.2-1) ... 222s Selecting previously unselected package libhttp-parser2.9:arm64. 222s Preparing to unpack .../093-libhttp-parser2.9_2.9.4-6build1_arm64.deb ... 222s Unpacking libhttp-parser2.9:arm64 (2.9.4-6build1) ... 222s Selecting previously unselected package libgit2-1.8:arm64. 222s Preparing to unpack .../094-libgit2-1.8_1.8.4+ds-1ubuntu1_arm64.deb ... 222s Unpacking libgit2-1.8:arm64 (1.8.4+ds-1ubuntu1) ... 222s Selecting previously unselected package python3-pygit2. 222s Preparing to unpack .../095-python3-pygit2_1.16.0-2_arm64.deb ... 222s Unpacking python3-pygit2 (1.16.0-2) ... 222s Selecting previously unselected package python3-iniconfig. 222s Preparing to unpack .../096-python3-iniconfig_1.1.1-2_all.deb ... 222s Unpacking python3-iniconfig (1.1.1-2) ... 222s Selecting previously unselected package python3-packaging. 222s Preparing to unpack .../097-python3-packaging_24.2-1_all.deb ... 222s Unpacking python3-packaging (24.2-1) ... 222s Selecting previously unselected package python3-pluggy. 222s Preparing to unpack .../098-python3-pluggy_1.5.0-1_all.deb ... 222s Unpacking python3-pluggy (1.5.0-1) ... 222s Selecting previously unselected package python3-pytest. 222s Preparing to unpack .../099-python3-pytest_8.3.3-1_all.deb ... 222s Unpacking python3-pytest (8.3.3-1) ... 222s Selecting previously unselected package libpython3.13-stdlib:arm64. 222s Preparing to unpack .../100-libpython3.13-stdlib_3.13.0-2_arm64.deb ... 222s Unpacking libpython3.13-stdlib:arm64 (3.13.0-2) ... 222s Selecting previously unselected package python3.13. 222s Preparing to unpack .../101-python3.13_3.13.0-2_arm64.deb ... 222s Unpacking python3.13 (3.13.0-2) ... 222s Selecting previously unselected package python3-coverage. 222s Preparing to unpack .../102-python3-coverage_7.4.4+dfsg1-0ubuntu3_arm64.deb ... 222s Unpacking python3-coverage (7.4.4+dfsg1-0ubuntu3) ... 222s Selecting previously unselected package libjs-jquery-isonscreen. 222s Preparing to unpack .../103-libjs-jquery-isonscreen_1.2.0-1.1_all.deb ... 222s Unpacking libjs-jquery-isonscreen (1.2.0-1.1) ... 222s Selecting previously unselected package libjs-jquery-metadata. 222s Preparing to unpack .../104-libjs-jquery-metadata_12-4_all.deb ... 222s Unpacking libjs-jquery-metadata (12-4) ... 222s Selecting previously unselected package libjs-jquery-tablesorter. 222s Preparing to unpack .../105-libjs-jquery-tablesorter_1%3a2.31.3+dfsg1-4_all.deb ... 222s Unpacking libjs-jquery-tablesorter (1:2.31.3+dfsg1-4) ... 223s Selecting previously unselected package libjs-jquery-throttle-debounce. 223s Preparing to unpack .../106-libjs-jquery-throttle-debounce_1.1+dfsg.1-2_all.deb ... 223s Unpacking libjs-jquery-throttle-debounce (1.1+dfsg.1-2) ... 223s Selecting previously unselected package python3-pytest-cov. 223s Preparing to unpack .../107-python3-pytest-cov_5.0.0-1_all.deb ... 223s Unpacking python3-pytest-cov (5.0.0-1) ... 223s Selecting previously unselected package python3-tenacity. 223s Preparing to unpack .../108-python3-tenacity_8.5.0-0ubuntu1_all.deb ... 223s Unpacking python3-tenacity (8.5.0-0ubuntu1) ... 223s Selecting previously unselected package python3-py. 223s Preparing to unpack .../109-python3-py_1.11.0-2_all.deb ... 223s Unpacking python3-py (1.11.0-2) ... 223s Selecting previously unselected package libnorm1t64:arm64. 223s Preparing to unpack .../110-libnorm1t64_1.5.9+dfsg-3.1build1_arm64.deb ... 223s Unpacking libnorm1t64:arm64 (1.5.9+dfsg-3.1build1) ... 223s Selecting previously unselected package libpgm-5.3-0t64:arm64. 223s Preparing to unpack .../111-libpgm-5.3-0t64_5.3.128~dfsg-2.1build1_arm64.deb ... 223s Unpacking libpgm-5.3-0t64:arm64 (5.3.128~dfsg-2.1build1) ... 223s Selecting previously unselected package libsodium23:arm64. 223s Preparing to unpack .../112-libsodium23_1.0.18-1build3_arm64.deb ... 223s Unpacking libsodium23:arm64 (1.0.18-1build3) ... 223s Selecting previously unselected package libzmq5:arm64. 223s Preparing to unpack .../113-libzmq5_4.3.5-1build2_arm64.deb ... 223s Unpacking libzmq5:arm64 (4.3.5-1build2) ... 223s Selecting previously unselected package python3-zmq. 223s Preparing to unpack .../114-python3-zmq_24.0.1-5build2_arm64.deb ... 223s Unpacking python3-zmq (24.0.1-5build2) ... 223s Selecting previously unselected package git-ubuntu. 223s Preparing to unpack .../115-git-ubuntu_1.1-1_all.deb ... 223s Unpacking git-ubuntu (1.1-1) ... 223s Setting up python3-iniconfig (1.1.1-2) ... 223s Setting up libnorm1t64:arm64 (1.5.9+dfsg-3.1build1) ... 223s Setting up wdiff (1.2.2-6build1) ... 223s Setting up libfile-which-perl (1.27-2) ... 223s Setting up libsodium23:arm64 (1.0.18-1build3) ... 223s Setting up python3-jaraco.classes (3.4.0-1) ... 223s Setting up libxdelta2t64:arm64 (1.1.3-10.7) ... 223s Setting up python3-importlib-metadata (8.5.0-1) ... 223s Setting up xdelta (1.1.3-10.7) ... 223s Setting up libsys-cpuaffinity-perl (1.13~03-2build4) ... 223s Setting up python3-py (1.11.0-2) ... 224s Setting up libdynaloader-functions-perl (0.004-1) ... 224s Setting up libclass-method-modifiers-perl (2.15-1) ... 224s Setting up libio-pty-perl (1:1.20-1build3) ... 224s Setting up python3-cachetools (5.3.3-1) ... 224s Setting up python3-debianbts (4.1.1) ... 224s Setting up libclone-perl:arm64 (0.47-1) ... 224s Setting up libhtml-tagset-perl (3.24-1) ... 224s Setting up python3-mypy-extensions (1.0.0-1) ... 224s Setting up python3-pycryptodome (3.20.0+dfsg-3build1) ... 225s Setting up python3-tenacity (8.5.0-0ubuntu1) ... 225s Setting up liblwp-mediatypes-perl (6.04-2) ... 225s Setting up debian-archive-keyring (2023.4ubuntu1) ... 225s Setting up libtry-tiny-perl (0.32-1) ... 225s Setting up perl-openssl-defaults:arm64 (7build3) ... 225s Setting up libencode-locale-perl (1.05-3) ... 225s Setting up libjs-jquery-throttle-debounce (1.1+dfsg.1-2) ... 225s Setting up libgomp1:arm64 (14.2.0-9ubuntu1) ... 225s Setting up python3-xdg (0.28-2) ... 225s Setting up pbzip2 (1.1.13-1build1) ... 225s Setting up python3-platformdirs (4.3.6-1) ... 225s Setting up liberror-perl (0.17029-2) ... 225s Setting up libpython3.13-minimal:arm64 (3.13.0-2) ... 225s Setting up patchutils (0.4.2-1build3) ... 225s Setting up libpgm-5.3-0t64:arm64 (5.3.128~dfsg-2.1build1) ... 225s Setting up python3-packaging (24.2-1) ... 225s Setting up python3-gpg (1.24.0-2ubuntu1) ... 226s Setting up python3-dill (0.3.9-1) ... 226s Setting up python3-debian (0.1.49ubuntu3) ... 226s Setting up diffstat (1.67-1) ... 226s Setting up libio-html-perl (1.004-3) ... 226s Setting up libb-hooks-op-check-perl:arm64 (0.22-3build2) ... 226s Setting up libipc-run-perl (20231003.0-2) ... 226s Setting up python3-jeepney (0.8.0-4) ... 226s Setting up python3-isort (5.13.2-2) ... 227s Setting up python3-pluggy (1.5.0-1) ... 227s Setting up libtimedate-perl (2.3300-2) ... 227s Setting up python3-astroid (3.3.5-1) ... 227s Setting up xdelta3 (3.0.11-dfsg-1.2) ... 227s Setting up pixz (1.0.7-3) ... 227s Setting up librole-tiny-perl (2.002004-1) ... 227s Setting up python3.13-minimal (3.13.0-2) ... 228s Setting up git-man (1:2.45.2-1.2ubuntu1) ... 228s Setting up python3-dateutil (2.9.0-3) ... 228s Setting up python3-mccabe (0.7.0-1) ... 228s Setting up libsub-quote-perl (2.006008-1ubuntu1) ... 228s Setting up libclass-xsaccessor-perl (1.19-4build5) ... 228s Setting up libjs-jquery (3.6.1+dfsg+~3.5.14-1) ... 229s Setting up libfile-dirlist-perl (0.05-3) ... 229s Setting up libjs-jquery-hotkeys (0~20130707+git2d51e3a9+dfsg-2.1) ... 229s Setting up python3-argcomplete (3.5.1-1ubuntu1) ... 229s Setting up libfile-homedir-perl (1.006-2) ... 229s Setting up python3-tomlkit (0.13.2-1) ... 229s Setting up python3-distro-info (1.12) ... 229s Setting up libpython3.13-stdlib:arm64 (3.13.0-2) ... 229s Setting up liburi-perl (5.30-1) ... 229s Setting up pristine-tar (1.50+nmu2build1) ... 229s Setting up libfile-touch-perl (0.12-2) ... 229s Setting up dctrl-tools (2.24-3build3) ... 229s Setting up libhttp-parser2.9:arm64 (2.9.4-6build1) ... 229s Setting up libjs-underscore (1.13.4~dfsg+~1.11.4-3) ... 229s Setting up libnet-ssleay-perl:arm64 (1.94-2) ... 229s Setting up libhttp-date-perl (6.06-1) ... 229s Setting up gettext (0.22.5-2) ... 229s Setting up libfile-listing-perl (6.16-1) ... 229s Setting up libzmq5:arm64 (4.3.5-1build2) ... 229s Setting up python3.13 (3.13.0-2) ... 230s Setting up python3-pytest (8.3.3-1) ... 231s Setting up libnet-http-perl (6.23-1) ... 231s Setting up python3-coverage (7.4.4+dfsg1-0ubuntu3) ... 231s Setting up quilt (0.68-1) ... 231s Setting up libdevel-callchecker-perl:arm64 (0.009-1build1) ... 231s Setting up dput (1.2.4ubuntu1) ... 231s Setting up python3-secretstorage (3.3.3-3) ... 231s Setting up python3-zmq (24.0.1-5build2) ... 231s Setting up libjs-jquery-metadata (12-4) ... 231s Setting up libgit2-1.8:arm64 (1.8.4+ds-1ubuntu1) ... 231s Setting up libjs-jquery-isonscreen (1.2.0-1.1) ... 231s Setting up git (1:2.45.2-1.2ubuntu1) ... 231s Setting up libjs-sphinxdoc (7.4.7-4) ... 231s Setting up libwww-robotrules-perl (6.02-1) ... 231s Setting up libjs-jquery-tablesorter (1:2.31.3+dfsg1-4) ... 231s Setting up libhtml-parser-perl:arm64 (3.83-1build1) ... 231s Setting up python3-keyring (25.4.1-1) ... 232s Setting up libio-socket-ssl-perl (2.089-1) ... 232s Setting up libhttp-message-perl (7.00-2ubuntu1) ... 232s Setting up libhttp-negotiate-perl (6.01-2) ... 232s Setting up libhttp-cookies-perl (6.11-1) ... 232s Setting up python3-logilab-common (2.0.0-1) ... 232s Setting up python3-pygit2 (1.16.0-2) ... 232s Setting up libhtml-tree-perl (5.07-3) ... 232s Setting up libparams-classify-perl:arm64 (0.015-2build6) ... 232s Setting up python3-pytest-cov (5.0.0-1) ... 232s Setting up libmodule-runtime-perl (0.016-2) ... 232s Setting up python3-launchpadlib-desktop (2.0.0-1) ... 232s Setting up python3-keyrings.alt (5.0.2-1) ... 232s Setting up pylint (3.3.1-2) ... 233s Setting up libimport-into-perl (1.002005-2) ... 233s Setting up libmoo-perl (2.005005-1) ... 233s Setting up python3-ubuntutools (0.203) ... 233s Setting up liblwp-protocol-https-perl (6.14-1) ... 233s Setting up libwww-perl (6.77-1) ... 233s Setting up devscripts (2.24.5) ... 233s Setting up git-buildpackage (0.9.35) ... 233s Setting up ubuntu-dev-tools (0.203) ... 233s Setting up git-ubuntu (1.1-1) ... 234s Processing triggers for libc-bin (2.40-1ubuntu3) ... 234s Processing triggers for systemd (256.5-2ubuntu4) ... 234s Processing triggers for man-db (2.13.0-1) ... 236s Processing triggers for install-info (7.1.1-1) ... 237s autopkgtest [09:38:52]: test self-test: TEST_SYSTEM_TREE=1 /usr/share/git-ubuntu/self-test 237s autopkgtest [09:38:52]: test self-test: [----------------------- 237s Testing git-ubuntu system installation. 237s Testing tree in /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu 237s Working dir /tmp/autopkgtest.2Zfyp6/build.8ZM/src 256s pylint passed! 264s ============================= test session starts ============================== 264s platform linux -- Python 3.12.7, pytest-8.3.3, pluggy-1.5.0 264s rootdir: /tmp/autopkgtest.2Zfyp6/build.8ZM/src 264s configfile: pytest.ini 264s plugins: typeguard-4.4.1, cov-5.0.0 264s collected 459 items 264s 264s gitubuntu/build.py ..... [ 1%] 266s gitubuntu/git_repository_test.py ....................................... [ 9%] 280s ...FFFFF.FFF...........................F.FFFFFFF.FFF.......FFFFFFFFFF [ 24%] 280s gitubuntu/importer_service_test.py ..................................... [ 32%] 280s ..... [ 33%] 280s gitubuntu/importer_service_worker_test.py ... [ 34%] 294s gitubuntu/importer_tag_test.py FFFFFFFFFxF [ 36%] 314s gitubuntu/importer_test.py .......FF.FFFFFFFFFFF.FFF.FFF..FFFFFFFFFFFFFF [ 46%] 331s FFFFxx..FF.................................................F....FFFF. [ 61%] 333s gitubuntu/integration_test.py ...............Fsss [ 65%] 333s gitubuntu/prepare_upload_test.py .............. [ 68%] 334s gitubuntu/repo_builder_test.py .........FF.F................ [ 75%] 334s gitubuntu/rich_history_test.py FFF.FFFF [ 76%] 340s gitubuntu/source_builder_test.py .FF.......FFFFFFFFF.. [ 81%] 341s gitubuntu/source_information_test.py ................................... [ 89%] 341s ... [ 89%] 341s gitubuntu/versioning.py ............................................... [100%] 341s 341s =================================== FAILURES =================================== 341s ___________________ test_follow_symlinks_to_blob[0] ____________________ 341s 341s pygit2_repo = pygit2.Repository('/tmp/tmpsrfhhbp5/.git/') 341s tree_func = at 0xeb3a4ab88180> 341s 341s @pytest.mark.parametrize('tree_func', [ 341s # The tree_func parameter is a function that accepts a mock Blob that is to 341s # represent the changelog blob itself and returns a mock Tree with the mock 341s # Blob embedded somewhere within it. The test function can then ensure that 341s # follow_symlinks_to_blob can correctly find the changelog Blob given the 341s # Tree. 341s 341s # Of course this is only expected to work if, after checking out the Tree, 341s # "cat debian/changelog" would work. But this allows us to test the various 341s # permutations of symlink following in Trees that _are_ valid. 341s 341s # Simple case 341s lambda b: Tree({ 341s 'debian': Tree({'changelog': b}), 341s }), 341s 341s # Symlink in debian/ 341s lambda b: Tree({ 341s 'debian': Tree({ 341s 'changelog.real': b, 341s 'changelog': Symlink('changelog.real'), 341s }), 341s }), 341s 341s # Symlink to parent directory 341s lambda b: Tree({ 341s 'changelog': b, 341s 'debian': Tree({ 341s 'changelog': Symlink('../changelog'), 341s }) 341s }), 341s 341s # Symlink to subdirectory 341s lambda b: Tree({ 341s 'debian': Tree({ 341s 'changelog': Symlink('subdirectory/changelog'), 341s 'subdirectory': Tree({'changelog': b}), 341s }) 341s }), 341s 341s # debian/ itself is a symlink to a different directory 341s lambda b: Tree({ 341s 'pkg': Tree({'changelog': b}), 341s 'debian': Symlink('pkg'), 341s }) 341s ]) 341s def test_follow_symlinks_to_blob(pygit2_repo, tree_func): 341s blob = Blob(b'') 341s blob_id = blob.write(pygit2_repo) 341s tree = pygit2_repo.get(tree_func(blob).write(pygit2_repo)) 341s > result_blob = target.follow_symlinks_to_blob( 341s pygit2_repo, 341s tree, 341s 'debian/changelog', 341s ) 341s 341s gitubuntu/git_repository_test.py:342: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 341s return _follow_symlinks_to_blob( 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s repo = pygit2.Repository('/tmp/tmpsrfhhbp5/.git/') 341s top_tree_object = 341s search_path = 'debian/changelog' 341s _rel_tree = 341s _rel_path = '' 341s 341s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 341s _rel_tree=None, _rel_path='' 341s ): 341s '''Recursively follow a path down a tree, following symlinks, to find blob 341s 341s repo: pygit2.Repository object 341s top_tree: pygit2.Tree object of the top of the tree structure 341s search_path: '/'-separated path string of blob to find 341s _rel_tree: (internal) which tree to look further into 341s _rel_path: (internal) the path we are in so far 341s ''' 341s 341s NORMAL_BLOB_MODES = set([ 341s pygit2.GIT_FILEMODE_BLOB, 341s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 341s ]) 341s 341s _rel_tree = _rel_tree or top_tree_object 341s head, tail = posixpath.split(search_path) 341s 341s # A traditional functional split would put a single entry in head with tail 341s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 341s # to make it appear to have traditional semantics. 341s if not head: 341s head = tail 341s tail = None 341s 341s entry = _rel_tree[head] 341s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 341s 341s gitubuntu/git_repository.py:68: AttributeError 341s ___________________ test_follow_symlinks_to_blob[1] ____________________ 341s 341s pygit2_repo = pygit2.Repository('/tmp/tmpdwmc9vps/.git/') 341s tree_func = at 0xeb3a4ab88220> 341s 341s @pytest.mark.parametrize('tree_func', [ 341s # The tree_func parameter is a function that accepts a mock Blob that is to 341s # represent the changelog blob itself and returns a mock Tree with the mock 341s # Blob embedded somewhere within it. The test function can then ensure that 341s # follow_symlinks_to_blob can correctly find the changelog Blob given the 341s # Tree. 341s 341s # Of course this is only expected to work if, after checking out the Tree, 341s # "cat debian/changelog" would work. But this allows us to test the various 341s # permutations of symlink following in Trees that _are_ valid. 341s 341s # Simple case 341s lambda b: Tree({ 341s 'debian': Tree({'changelog': b}), 341s }), 341s 341s # Symlink in debian/ 341s lambda b: Tree({ 341s 'debian': Tree({ 341s 'changelog.real': b, 341s 'changelog': Symlink('changelog.real'), 341s }), 341s }), 341s 341s # Symlink to parent directory 341s lambda b: Tree({ 341s 'changelog': b, 341s 'debian': Tree({ 341s 'changelog': Symlink('../changelog'), 341s }) 341s }), 341s 341s # Symlink to subdirectory 341s lambda b: Tree({ 341s 'debian': Tree({ 341s 'changelog': Symlink('subdirectory/changelog'), 341s 'subdirectory': Tree({'changelog': b}), 341s }) 341s }), 341s 341s # debian/ itself is a symlink to a different directory 341s lambda b: Tree({ 341s 'pkg': Tree({'changelog': b}), 341s 'debian': Symlink('pkg'), 341s }) 341s ]) 341s def test_follow_symlinks_to_blob(pygit2_repo, tree_func): 341s blob = Blob(b'') 341s blob_id = blob.write(pygit2_repo) 341s tree = pygit2_repo.get(tree_func(blob).write(pygit2_repo)) 341s > result_blob = target.follow_symlinks_to_blob( 341s pygit2_repo, 341s tree, 341s 'debian/changelog', 341s ) 341s 341s gitubuntu/git_repository_test.py:342: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 341s return _follow_symlinks_to_blob( 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s repo = pygit2.Repository('/tmp/tmpdwmc9vps/.git/') 341s top_tree_object = 341s search_path = 'debian/changelog' 341s _rel_tree = 341s _rel_path = '' 341s 341s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 341s _rel_tree=None, _rel_path='' 341s ): 341s '''Recursively follow a path down a tree, following symlinks, to find blob 341s 341s repo: pygit2.Repository object 341s top_tree: pygit2.Tree object of the top of the tree structure 341s search_path: '/'-separated path string of blob to find 341s _rel_tree: (internal) which tree to look further into 341s _rel_path: (internal) the path we are in so far 341s ''' 341s 341s NORMAL_BLOB_MODES = set([ 341s pygit2.GIT_FILEMODE_BLOB, 341s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 341s ]) 341s 341s _rel_tree = _rel_tree or top_tree_object 341s head, tail = posixpath.split(search_path) 341s 341s # A traditional functional split would put a single entry in head with tail 341s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 341s # to make it appear to have traditional semantics. 341s if not head: 341s head = tail 341s tail = None 341s 341s entry = _rel_tree[head] 341s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 341s 341s gitubuntu/git_repository.py:68: AttributeError 341s ___________________ test_follow_symlinks_to_blob[2] ____________________ 341s 341s pygit2_repo = pygit2.Repository('/tmp/tmpoifp_2jy/.git/') 341s tree_func = at 0xeb3a4ab882c0> 341s 341s @pytest.mark.parametrize('tree_func', [ 341s # The tree_func parameter is a function that accepts a mock Blob that is to 341s # represent the changelog blob itself and returns a mock Tree with the mock 341s # Blob embedded somewhere within it. The test function can then ensure that 341s # follow_symlinks_to_blob can correctly find the changelog Blob given the 341s # Tree. 341s 341s # Of course this is only expected to work if, after checking out the Tree, 341s # "cat debian/changelog" would work. But this allows us to test the various 341s # permutations of symlink following in Trees that _are_ valid. 341s 341s # Simple case 341s lambda b: Tree({ 341s 'debian': Tree({'changelog': b}), 341s }), 341s 341s # Symlink in debian/ 341s lambda b: Tree({ 341s 'debian': Tree({ 341s 'changelog.real': b, 341s 'changelog': Symlink('changelog.real'), 341s }), 341s }), 341s 341s # Symlink to parent directory 341s lambda b: Tree({ 341s 'changelog': b, 341s 'debian': Tree({ 341s 'changelog': Symlink('../changelog'), 341s }) 341s }), 341s 341s # Symlink to subdirectory 341s lambda b: Tree({ 341s 'debian': Tree({ 341s 'changelog': Symlink('subdirectory/changelog'), 341s 'subdirectory': Tree({'changelog': b}), 341s }) 341s }), 341s 341s # debian/ itself is a symlink to a different directory 341s lambda b: Tree({ 341s 'pkg': Tree({'changelog': b}), 341s 'debian': Symlink('pkg'), 341s }) 341s ]) 341s def test_follow_symlinks_to_blob(pygit2_repo, tree_func): 341s blob = Blob(b'') 341s blob_id = blob.write(pygit2_repo) 341s tree = pygit2_repo.get(tree_func(blob).write(pygit2_repo)) 341s > result_blob = target.follow_symlinks_to_blob( 341s pygit2_repo, 341s tree, 341s 'debian/changelog', 341s ) 341s 341s gitubuntu/git_repository_test.py:342: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 341s return _follow_symlinks_to_blob( 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s repo = pygit2.Repository('/tmp/tmpoifp_2jy/.git/') 341s top_tree_object = 341s search_path = 'debian/changelog' 341s _rel_tree = 341s _rel_path = '' 341s 341s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 341s _rel_tree=None, _rel_path='' 341s ): 341s '''Recursively follow a path down a tree, following symlinks, to find blob 341s 341s repo: pygit2.Repository object 341s top_tree: pygit2.Tree object of the top of the tree structure 341s search_path: '/'-separated path string of blob to find 341s _rel_tree: (internal) which tree to look further into 341s _rel_path: (internal) the path we are in so far 341s ''' 341s 341s NORMAL_BLOB_MODES = set([ 341s pygit2.GIT_FILEMODE_BLOB, 341s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 341s ]) 341s 341s _rel_tree = _rel_tree or top_tree_object 341s head, tail = posixpath.split(search_path) 341s 341s # A traditional functional split would put a single entry in head with tail 341s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 341s # to make it appear to have traditional semantics. 341s if not head: 341s head = tail 341s tail = None 341s 341s entry = _rel_tree[head] 341s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 341s 341s gitubuntu/git_repository.py:68: AttributeError 341s ___________________ test_follow_symlinks_to_blob[3] ____________________ 341s 341s pygit2_repo = pygit2.Repository('/tmp/tmp4n87wpgi/.git/') 341s tree_func = at 0xeb3a4ab88360> 341s 341s @pytest.mark.parametrize('tree_func', [ 341s # The tree_func parameter is a function that accepts a mock Blob that is to 341s # represent the changelog blob itself and returns a mock Tree with the mock 341s # Blob embedded somewhere within it. The test function can then ensure that 341s # follow_symlinks_to_blob can correctly find the changelog Blob given the 341s # Tree. 341s 341s # Of course this is only expected to work if, after checking out the Tree, 341s # "cat debian/changelog" would work. But this allows us to test the various 341s # permutations of symlink following in Trees that _are_ valid. 341s 341s # Simple case 341s lambda b: Tree({ 341s 'debian': Tree({'changelog': b}), 341s }), 341s 341s # Symlink in debian/ 341s lambda b: Tree({ 341s 'debian': Tree({ 341s 'changelog.real': b, 341s 'changelog': Symlink('changelog.real'), 341s }), 341s }), 341s 341s # Symlink to parent directory 341s lambda b: Tree({ 341s 'changelog': b, 341s 'debian': Tree({ 341s 'changelog': Symlink('../changelog'), 341s }) 341s }), 341s 341s # Symlink to subdirectory 341s lambda b: Tree({ 341s 'debian': Tree({ 341s 'changelog': Symlink('subdirectory/changelog'), 341s 'subdirectory': Tree({'changelog': b}), 341s }) 341s }), 341s 341s # debian/ itself is a symlink to a different directory 341s lambda b: Tree({ 341s 'pkg': Tree({'changelog': b}), 341s 'debian': Symlink('pkg'), 341s }) 341s ]) 341s def test_follow_symlinks_to_blob(pygit2_repo, tree_func): 341s blob = Blob(b'') 341s blob_id = blob.write(pygit2_repo) 341s tree = pygit2_repo.get(tree_func(blob).write(pygit2_repo)) 341s > result_blob = target.follow_symlinks_to_blob( 341s pygit2_repo, 341s tree, 341s 'debian/changelog', 341s ) 341s 341s gitubuntu/git_repository_test.py:342: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 341s return _follow_symlinks_to_blob( 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s repo = pygit2.Repository('/tmp/tmp4n87wpgi/.git/') 341s top_tree_object = 341s search_path = 'debian/changelog' 341s _rel_tree = 341s _rel_path = '' 341s 341s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 341s _rel_tree=None, _rel_path='' 341s ): 341s '''Recursively follow a path down a tree, following symlinks, to find blob 341s 341s repo: pygit2.Repository object 341s top_tree: pygit2.Tree object of the top of the tree structure 341s search_path: '/'-separated path string of blob to find 341s _rel_tree: (internal) which tree to look further into 341s _rel_path: (internal) the path we are in so far 341s ''' 341s 341s NORMAL_BLOB_MODES = set([ 341s pygit2.GIT_FILEMODE_BLOB, 341s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 341s ]) 341s 341s _rel_tree = _rel_tree or top_tree_object 341s head, tail = posixpath.split(search_path) 341s 341s # A traditional functional split would put a single entry in head with tail 341s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 341s # to make it appear to have traditional semantics. 341s if not head: 341s head = tail 341s tail = None 341s 341s entry = _rel_tree[head] 341s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 341s 341s gitubuntu/git_repository.py:68: AttributeError 341s ___________________ test_follow_symlinks_to_blob[4] ____________________ 341s 341s pygit2_repo = pygit2.Repository('/tmp/tmpg3doode5/.git/') 341s tree_func = at 0xeb3a4ab88400> 341s 341s @pytest.mark.parametrize('tree_func', [ 341s # The tree_func parameter is a function that accepts a mock Blob that is to 341s # represent the changelog blob itself and returns a mock Tree with the mock 341s # Blob embedded somewhere within it. The test function can then ensure that 341s # follow_symlinks_to_blob can correctly find the changelog Blob given the 341s # Tree. 341s 341s # Of course this is only expected to work if, after checking out the Tree, 341s # "cat debian/changelog" would work. But this allows us to test the various 341s # permutations of symlink following in Trees that _are_ valid. 341s 341s # Simple case 341s lambda b: Tree({ 341s 'debian': Tree({'changelog': b}), 341s }), 341s 341s # Symlink in debian/ 341s lambda b: Tree({ 341s 'debian': Tree({ 341s 'changelog.real': b, 341s 'changelog': Symlink('changelog.real'), 341s }), 341s }), 341s 341s # Symlink to parent directory 341s lambda b: Tree({ 341s 'changelog': b, 341s 'debian': Tree({ 341s 'changelog': Symlink('../changelog'), 341s }) 341s }), 341s 341s # Symlink to subdirectory 341s lambda b: Tree({ 341s 'debian': Tree({ 341s 'changelog': Symlink('subdirectory/changelog'), 341s 'subdirectory': Tree({'changelog': b}), 341s }) 341s }), 341s 341s # debian/ itself is a symlink to a different directory 341s lambda b: Tree({ 341s 'pkg': Tree({'changelog': b}), 341s 'debian': Symlink('pkg'), 341s }) 341s ]) 341s def test_follow_symlinks_to_blob(pygit2_repo, tree_func): 341s blob = Blob(b'') 341s blob_id = blob.write(pygit2_repo) 341s tree = pygit2_repo.get(tree_func(blob).write(pygit2_repo)) 341s > result_blob = target.follow_symlinks_to_blob( 341s pygit2_repo, 341s tree, 341s 'debian/changelog', 341s ) 341s 341s gitubuntu/git_repository_test.py:342: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 341s return _follow_symlinks_to_blob( 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s repo = pygit2.Repository('/tmp/tmpg3doode5/.git/') 341s top_tree_object = 341s search_path = 'debian/changelog' 341s _rel_tree = 341s _rel_path = '' 341s 341s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 341s _rel_tree=None, _rel_path='' 341s ): 341s '''Recursively follow a path down a tree, following symlinks, to find blob 341s 341s repo: pygit2.Repository object 341s top_tree: pygit2.Tree object of the top of the tree structure 341s search_path: '/'-separated path string of blob to find 341s _rel_tree: (internal) which tree to look further into 341s _rel_path: (internal) the path we are in so far 341s ''' 341s 341s NORMAL_BLOB_MODES = set([ 341s pygit2.GIT_FILEMODE_BLOB, 341s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 341s ]) 341s 341s _rel_tree = _rel_tree or top_tree_object 341s head, tail = posixpath.split(search_path) 341s 341s # A traditional functional split would put a single entry in head with tail 341s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 341s # to make it appear to have traditional semantics. 341s if not head: 341s head = tail 341s tail = None 341s 341s entry = _rel_tree[head] 341s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 341s 341s gitubuntu/git_repository.py:68: AttributeError 341s ________________ test_follow_symlinks_to_blob_not_found[tree1] _________________ 341s 341s pygit2_repo = pygit2.Repository('/tmp/tmpqy66pczs/.git/') 341s tree = 341s 341s @pytest.mark.parametrize('tree', [ 341s Tree({}), 341s Tree({'debian': Tree({})}), 341s Tree({'debian': Tree({'changelog': Symlink('other')})}), 341s Tree({'debian': Tree({'changelog': Symlink('../other')})}), 341s ]) 341s def test_follow_symlinks_to_blob_not_found(pygit2_repo, tree): 341s pygit2_tree = pygit2_repo.get(tree.write(pygit2_repo)) 341s with pytest.raises(KeyError): 341s > target.follow_symlinks_to_blob( 341s pygit2_repo, 341s pygit2_tree, 341s 'debian/changelog', 341s ) 341s 341s gitubuntu/git_repository_test.py:359: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 341s return _follow_symlinks_to_blob( 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s repo = pygit2.Repository('/tmp/tmpqy66pczs/.git/') 341s top_tree_object = 341s search_path = 'debian/changelog' 341s _rel_tree = 341s _rel_path = '' 341s 341s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 341s _rel_tree=None, _rel_path='' 341s ): 341s '''Recursively follow a path down a tree, following symlinks, to find blob 341s 341s repo: pygit2.Repository object 341s top_tree: pygit2.Tree object of the top of the tree structure 341s search_path: '/'-separated path string of blob to find 341s _rel_tree: (internal) which tree to look further into 341s _rel_path: (internal) the path we are in so far 341s ''' 341s 341s NORMAL_BLOB_MODES = set([ 341s pygit2.GIT_FILEMODE_BLOB, 341s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 341s ]) 341s 341s _rel_tree = _rel_tree or top_tree_object 341s head, tail = posixpath.split(search_path) 341s 341s # A traditional functional split would put a single entry in head with tail 341s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 341s # to make it appear to have traditional semantics. 341s if not head: 341s head = tail 341s tail = None 341s 341s entry = _rel_tree[head] 341s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 341s 341s gitubuntu/git_repository.py:68: AttributeError 341s ________________ test_follow_symlinks_to_blob_not_found[tree2] _________________ 341s 341s pygit2_repo = pygit2.Repository('/tmp/tmp52syfc_m/.git/') 341s tree = 341s 341s @pytest.mark.parametrize('tree', [ 341s Tree({}), 341s Tree({'debian': Tree({})}), 341s Tree({'debian': Tree({'changelog': Symlink('other')})}), 341s Tree({'debian': Tree({'changelog': Symlink('../other')})}), 341s ]) 341s def test_follow_symlinks_to_blob_not_found(pygit2_repo, tree): 341s pygit2_tree = pygit2_repo.get(tree.write(pygit2_repo)) 341s with pytest.raises(KeyError): 341s > target.follow_symlinks_to_blob( 341s pygit2_repo, 341s pygit2_tree, 341s 'debian/changelog', 341s ) 341s 341s gitubuntu/git_repository_test.py:359: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 341s return _follow_symlinks_to_blob( 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s repo = pygit2.Repository('/tmp/tmp52syfc_m/.git/') 341s top_tree_object = 341s search_path = 'debian/changelog' 341s _rel_tree = 341s _rel_path = '' 341s 341s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 341s _rel_tree=None, _rel_path='' 341s ): 341s '''Recursively follow a path down a tree, following symlinks, to find blob 341s 341s repo: pygit2.Repository object 341s top_tree: pygit2.Tree object of the top of the tree structure 341s search_path: '/'-separated path string of blob to find 341s _rel_tree: (internal) which tree to look further into 341s _rel_path: (internal) the path we are in so far 341s ''' 341s 341s NORMAL_BLOB_MODES = set([ 341s pygit2.GIT_FILEMODE_BLOB, 341s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 341s ]) 341s 341s _rel_tree = _rel_tree or top_tree_object 341s head, tail = posixpath.split(search_path) 341s 341s # A traditional functional split would put a single entry in head with tail 341s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 341s # to make it appear to have traditional semantics. 341s if not head: 341s head = tail 341s tail = None 341s 341s entry = _rel_tree[head] 341s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 341s 341s gitubuntu/git_repository.py:68: AttributeError 341s ________________ test_follow_symlinks_to_blob_not_found[tree3] _________________ 341s 341s pygit2_repo = pygit2.Repository('/tmp/tmpwzl3yw7j/.git/') 341s tree = 341s 341s @pytest.mark.parametrize('tree', [ 341s Tree({}), 341s Tree({'debian': Tree({})}), 341s Tree({'debian': Tree({'changelog': Symlink('other')})}), 341s Tree({'debian': Tree({'changelog': Symlink('../other')})}), 341s ]) 341s def test_follow_symlinks_to_blob_not_found(pygit2_repo, tree): 341s pygit2_tree = pygit2_repo.get(tree.write(pygit2_repo)) 341s with pytest.raises(KeyError): 341s > target.follow_symlinks_to_blob( 341s pygit2_repo, 341s pygit2_tree, 341s 'debian/changelog', 341s ) 341s 341s gitubuntu/git_repository_test.py:359: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 341s return _follow_symlinks_to_blob( 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s repo = pygit2.Repository('/tmp/tmpwzl3yw7j/.git/') 341s top_tree_object = 341s search_path = 'debian/changelog' 341s _rel_tree = 341s _rel_path = '' 341s 341s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 341s _rel_tree=None, _rel_path='' 341s ): 341s '''Recursively follow a path down a tree, following symlinks, to find blob 341s 341s repo: pygit2.Repository object 341s top_tree: pygit2.Tree object of the top of the tree structure 341s search_path: '/'-separated path string of blob to find 341s _rel_tree: (internal) which tree to look further into 341s _rel_path: (internal) the path we are in so far 341s ''' 341s 341s NORMAL_BLOB_MODES = set([ 341s pygit2.GIT_FILEMODE_BLOB, 341s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 341s ]) 341s 341s _rel_tree = _rel_tree or top_tree_object 341s head, tail = posixpath.split(search_path) 341s 341s # A traditional functional split would put a single entry in head with tail 341s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 341s # to make it appear to have traditional semantics. 341s if not head: 341s head = tail 341s tail = None 341s 341s entry = _rel_tree[head] 341s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 341s 341s gitubuntu/git_repository.py:68: AttributeError 341s _________________________ test_git_escape_dir_to_tree __________________________ 341s 341s pygit2_repo = pygit2.Repository('/tmp/tmp80sqvhfi/.git/') 341s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_git_escape_dir_to_tree0') 341s 341s def test_git_escape_dir_to_tree(pygit2_repo, tmpdir): 341s tmpdir.mkdir('.git') 341s > tree_hash = target.GitUbuntuRepository.dir_to_tree( 341s pygit2_repo, 341s str(tmpdir), 341s escape=True, 341s ) 341s 341s gitubuntu/git_repository_test.py:668: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s gitubuntu/git_repository.py:2463: in dir_to_tree 341s replacement_oid = cls._add_missing_tree_dirs( 341s gitubuntu/git_repository.py:2397: in _add_missing_tree_dirs 341s tree_builder = cls._create_replacement_tree_builder( 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s cls = 341s repo = pygit2.Repository('/tmp/tmp80sqvhfi/.git/') 341s treeish = 341s sub_path = '' 341s 341s @classmethod 341s def _create_replacement_tree_builder(cls, repo, treeish, sub_path): 341s '''Create a replacement TreeBuilder 341s 341s Create a TreeBuilder based on an existing repository, top-level 341s tree-ish and path inside that tree. 341s 341s A sub_path of '' is taken to mean a request for a replacement 341s TreeBuilder for the top level tree. 341s 341s Returns a TreeBuilder object pre-populated with the previous contents. 341s If the path did not previously exist in the tree-ish, then return an 341s empty TreeBuilder instead. 341s ''' 341s 341s > tree = treeish.peel(pygit2.GIT_OBJ_TREE) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 341s 341s gitubuntu/git_repository.py:2331: AttributeError 341s ______ test_determine_quilt_series_path[tree_data1-debian/patches/series] ______ 341s 341s pygit2_repo = pygit2.Repository('/tmp/tmp5jkslkkv/.git/') 341s tree_data = 341s expected_path = 'debian/patches/series' 341s 341s @pytest.mark.parametrize('tree_data,expected_path', [ 341s # Empty tree -> default 341s (Tree({}), 'debian/patches/series'), 341s 341s # Empty debian/patches directory -> default 341s (Tree({'debian': Tree({'patches': Tree({})})}), 'debian/patches/series'), 341s 341s # Only debian/patches/series -> that one 341s ( 341s Tree({'debian': Tree({'patches': Tree({'series': Blob(b'')})})}), 341s 'debian/patches/series', 341s ), 341s 341s # Only debian/patches/debian.series -> that one 341s ( 341s Tree({'debian': Tree({'patches': Tree({ 341s 'debian.series': Blob(b'') 341s })})}), 341s 'debian/patches/debian.series', 341s ), 341s 341s # Both -> debian.series 341s ( 341s Tree({'debian': Tree({'patches': Tree({ 341s 'debian.series': Blob(b''), 341s 'series': Blob(b''), 341s })})}), 341s 'debian/patches/debian.series', 341s ), 341s ]) 341s def test_determine_quilt_series_path(pygit2_repo, tree_data, expected_path): 341s tree_obj = pygit2_repo.get(tree_data.write(pygit2_repo)) 341s > path = target.determine_quilt_series_path(pygit2_repo, tree_obj) 341s 341s gitubuntu/git_repository_test.py:708: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s gitubuntu/git_repository.py:991: in determine_quilt_series_path 341s blob = follow_symlinks_to_blob( 341s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 341s return _follow_symlinks_to_blob( 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s repo = pygit2.Repository('/tmp/tmp5jkslkkv/.git/') 341s top_tree_object = 341s search_path = 'debian/patches/debian.series' 341s _rel_tree = 341s _rel_path = '' 341s 341s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 341s _rel_tree=None, _rel_path='' 341s ): 341s '''Recursively follow a path down a tree, following symlinks, to find blob 341s 341s repo: pygit2.Repository object 341s top_tree: pygit2.Tree object of the top of the tree structure 341s search_path: '/'-separated path string of blob to find 341s _rel_tree: (internal) which tree to look further into 341s _rel_path: (internal) the path we are in so far 341s ''' 341s 341s NORMAL_BLOB_MODES = set([ 341s pygit2.GIT_FILEMODE_BLOB, 341s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 341s ]) 341s 341s _rel_tree = _rel_tree or top_tree_object 341s head, tail = posixpath.split(search_path) 341s 341s # A traditional functional split would put a single entry in head with tail 341s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 341s # to make it appear to have traditional semantics. 341s if not head: 341s head = tail 341s tail = None 341s 341s entry = _rel_tree[head] 341s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 341s 341s gitubuntu/git_repository.py:68: AttributeError 341s ______ test_determine_quilt_series_path[tree_data2-debian/patches/series] ______ 341s 341s pygit2_repo = pygit2.Repository('/tmp/tmpudehpy2a/.git/') 341s tree_data = 341s expected_path = 'debian/patches/series' 341s 341s @pytest.mark.parametrize('tree_data,expected_path', [ 341s # Empty tree -> default 341s (Tree({}), 'debian/patches/series'), 341s 341s # Empty debian/patches directory -> default 341s (Tree({'debian': Tree({'patches': Tree({})})}), 'debian/patches/series'), 341s 341s # Only debian/patches/series -> that one 341s ( 341s Tree({'debian': Tree({'patches': Tree({'series': Blob(b'')})})}), 341s 'debian/patches/series', 341s ), 341s 341s # Only debian/patches/debian.series -> that one 341s ( 341s Tree({'debian': Tree({'patches': Tree({ 341s 'debian.series': Blob(b'') 341s })})}), 341s 'debian/patches/debian.series', 341s ), 341s 341s # Both -> debian.series 341s ( 341s Tree({'debian': Tree({'patches': Tree({ 341s 'debian.series': Blob(b''), 341s 'series': Blob(b''), 341s })})}), 341s 'debian/patches/debian.series', 341s ), 341s ]) 341s def test_determine_quilt_series_path(pygit2_repo, tree_data, expected_path): 341s tree_obj = pygit2_repo.get(tree_data.write(pygit2_repo)) 341s > path = target.determine_quilt_series_path(pygit2_repo, tree_obj) 341s 341s gitubuntu/git_repository_test.py:708: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s gitubuntu/git_repository.py:991: in determine_quilt_series_path 341s blob = follow_symlinks_to_blob( 341s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 341s return _follow_symlinks_to_blob( 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s repo = pygit2.Repository('/tmp/tmpudehpy2a/.git/') 341s top_tree_object = 341s search_path = 'debian/patches/debian.series' 341s _rel_tree = 341s _rel_path = '' 341s 341s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 341s _rel_tree=None, _rel_path='' 341s ): 341s '''Recursively follow a path down a tree, following symlinks, to find blob 341s 341s repo: pygit2.Repository object 341s top_tree: pygit2.Tree object of the top of the tree structure 341s search_path: '/'-separated path string of blob to find 341s _rel_tree: (internal) which tree to look further into 341s _rel_path: (internal) the path we are in so far 341s ''' 341s 341s NORMAL_BLOB_MODES = set([ 341s pygit2.GIT_FILEMODE_BLOB, 341s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 341s ]) 341s 341s _rel_tree = _rel_tree or top_tree_object 341s head, tail = posixpath.split(search_path) 341s 341s # A traditional functional split would put a single entry in head with tail 341s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 341s # to make it appear to have traditional semantics. 341s if not head: 341s head = tail 341s tail = None 341s 341s entry = _rel_tree[head] 341s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 341s 341s gitubuntu/git_repository.py:68: AttributeError 341s __ test_determine_quilt_series_path[tree_data3-debian/patches/debian.series] ___ 341s 341s pygit2_repo = pygit2.Repository('/tmp/tmpfryy4wpi/.git/') 341s tree_data = 341s expected_path = 'debian/patches/debian.series' 341s 341s @pytest.mark.parametrize('tree_data,expected_path', [ 341s # Empty tree -> default 341s (Tree({}), 'debian/patches/series'), 341s 341s # Empty debian/patches directory -> default 341s (Tree({'debian': Tree({'patches': Tree({})})}), 'debian/patches/series'), 341s 341s # Only debian/patches/series -> that one 341s ( 341s Tree({'debian': Tree({'patches': Tree({'series': Blob(b'')})})}), 341s 'debian/patches/series', 341s ), 341s 341s # Only debian/patches/debian.series -> that one 341s ( 341s Tree({'debian': Tree({'patches': Tree({ 341s 'debian.series': Blob(b'') 341s })})}), 341s 'debian/patches/debian.series', 341s ), 341s 341s # Both -> debian.series 341s ( 341s Tree({'debian': Tree({'patches': Tree({ 341s 'debian.series': Blob(b''), 341s 'series': Blob(b''), 341s })})}), 341s 'debian/patches/debian.series', 341s ), 341s ]) 341s def test_determine_quilt_series_path(pygit2_repo, tree_data, expected_path): 341s tree_obj = pygit2_repo.get(tree_data.write(pygit2_repo)) 341s > path = target.determine_quilt_series_path(pygit2_repo, tree_obj) 341s 341s gitubuntu/git_repository_test.py:708: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s gitubuntu/git_repository.py:991: in determine_quilt_series_path 341s blob = follow_symlinks_to_blob( 341s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 341s return _follow_symlinks_to_blob( 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s repo = pygit2.Repository('/tmp/tmpfryy4wpi/.git/') 341s top_tree_object = 341s search_path = 'debian/patches/debian.series' 341s _rel_tree = 341s _rel_path = '' 341s 341s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 341s _rel_tree=None, _rel_path='' 341s ): 341s '''Recursively follow a path down a tree, following symlinks, to find blob 341s 341s repo: pygit2.Repository object 341s top_tree: pygit2.Tree object of the top of the tree structure 341s search_path: '/'-separated path string of blob to find 341s _rel_tree: (internal) which tree to look further into 341s _rel_path: (internal) the path we are in so far 341s ''' 341s 341s NORMAL_BLOB_MODES = set([ 341s pygit2.GIT_FILEMODE_BLOB, 341s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 341s ]) 341s 341s _rel_tree = _rel_tree or top_tree_object 341s head, tail = posixpath.split(search_path) 341s 341s # A traditional functional split would put a single entry in head with tail 341s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 341s # to make it appear to have traditional semantics. 341s if not head: 341s head = tail 341s tail = None 341s 341s entry = _rel_tree[head] 341s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 341s 341s gitubuntu/git_repository.py:68: AttributeError 341s __ test_determine_quilt_series_path[tree_data4-debian/patches/debian.series] ___ 341s 341s pygit2_repo = pygit2.Repository('/tmp/tmpp5shte7o/.git/') 341s tree_data = 341s expected_path = 'debian/patches/debian.series' 341s 341s @pytest.mark.parametrize('tree_data,expected_path', [ 341s # Empty tree -> default 341s (Tree({}), 'debian/patches/series'), 341s 341s # Empty debian/patches directory -> default 341s (Tree({'debian': Tree({'patches': Tree({})})}), 'debian/patches/series'), 341s 341s # Only debian/patches/series -> that one 341s ( 341s Tree({'debian': Tree({'patches': Tree({'series': Blob(b'')})})}), 341s 'debian/patches/series', 341s ), 341s 341s # Only debian/patches/debian.series -> that one 341s ( 341s Tree({'debian': Tree({'patches': Tree({ 341s 'debian.series': Blob(b'') 341s })})}), 341s 'debian/patches/debian.series', 341s ), 341s 341s # Both -> debian.series 341s ( 341s Tree({'debian': Tree({'patches': Tree({ 341s 'debian.series': Blob(b''), 341s 'series': Blob(b''), 341s })})}), 341s 'debian/patches/debian.series', 341s ), 341s ]) 341s def test_determine_quilt_series_path(pygit2_repo, tree_data, expected_path): 341s tree_obj = pygit2_repo.get(tree_data.write(pygit2_repo)) 341s > path = target.determine_quilt_series_path(pygit2_repo, tree_obj) 341s 341s gitubuntu/git_repository_test.py:708: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s gitubuntu/git_repository.py:991: in determine_quilt_series_path 341s blob = follow_symlinks_to_blob( 341s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 341s return _follow_symlinks_to_blob( 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s repo = pygit2.Repository('/tmp/tmpp5shte7o/.git/') 341s top_tree_object = 341s search_path = 'debian/patches/debian.series' 341s _rel_tree = 341s _rel_path = '' 341s 341s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 341s _rel_tree=None, _rel_path='' 341s ): 341s '''Recursively follow a path down a tree, following symlinks, to find blob 341s 341s repo: pygit2.Repository object 341s top_tree: pygit2.Tree object of the top of the tree structure 341s search_path: '/'-separated path string of blob to find 341s _rel_tree: (internal) which tree to look further into 341s _rel_path: (internal) the path we are in so far 341s ''' 341s 341s NORMAL_BLOB_MODES = set([ 341s pygit2.GIT_FILEMODE_BLOB, 341s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 341s ]) 341s 341s _rel_tree = _rel_tree or top_tree_object 341s head, tail = posixpath.split(search_path) 341s 341s # A traditional functional split would put a single entry in head with tail 341s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 341s # to make it appear to have traditional semantics. 341s if not head: 341s head = tail 341s tail = None 341s 341s entry = _rel_tree[head] 341s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 341s 341s gitubuntu/git_repository.py:68: AttributeError 341s ________________________________ test_quilt_env ________________________________ 341s 341s pygit2_repo = pygit2.Repository('/tmp/tmpctcgrsac/.git/') 341s 341s def test_quilt_env(pygit2_repo): 341s tree_builder = Tree({'debian': 341s Tree({'patches': Tree({'debian.series': Blob(b'')})}) 341s }) 341s tree_obj = pygit2_repo.get(tree_builder.write(pygit2_repo)) 341s > env = target.quilt_env(pygit2_repo, tree_obj) 341s 341s gitubuntu/git_repository_test.py:717: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s gitubuntu/git_repository.py:1022: in quilt_env 341s 'QUILT_SERIES': determine_quilt_series_path(pygit2_repo, treeish), 341s gitubuntu/git_repository.py:991: in determine_quilt_series_path 341s blob = follow_symlinks_to_blob( 341s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 341s return _follow_symlinks_to_blob( 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s repo = pygit2.Repository('/tmp/tmpctcgrsac/.git/') 341s top_tree_object = 341s search_path = 'debian/patches/debian.series' 341s _rel_tree = 341s _rel_path = '' 341s 341s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 341s _rel_tree=None, _rel_path='' 341s ): 341s '''Recursively follow a path down a tree, following symlinks, to find blob 341s 341s repo: pygit2.Repository object 341s top_tree: pygit2.Tree object of the top of the tree structure 341s search_path: '/'-separated path string of blob to find 341s _rel_tree: (internal) which tree to look further into 341s _rel_path: (internal) the path we are in so far 341s ''' 341s 341s NORMAL_BLOB_MODES = set([ 341s pygit2.GIT_FILEMODE_BLOB, 341s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 341s ]) 341s 341s _rel_tree = _rel_tree or top_tree_object 341s head, tail = posixpath.split(search_path) 341s 341s # A traditional functional split would put a single entry in head with tail 341s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 341s # to make it appear to have traditional semantics. 341s if not head: 341s head = tail 341s tail = None 341s 341s entry = _rel_tree[head] 341s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 341s 341s gitubuntu/git_repository.py:68: AttributeError 341s _____________________________ test_repo_quilt_env ______________________________ 341s 341s repo = 341s 341s def test_repo_quilt_env(repo): 341s tree_builder = Tree({'debian': 341s Tree({'patches': Tree({'debian.series': Blob(b'')})}) 341s }) 341s tree_obj = repo.raw_repo.get(tree_builder.write(repo.raw_repo)) 341s > env = repo.quilt_env(tree_obj) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository_test.py:732: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:2575: in quilt_env 341s env.update(quilt_env(self.raw_repo, treeish)) 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:1022: in quilt_env 341s 'QUILT_SERIES': determine_quilt_series_path(pygit2_repo, treeish), 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:991: in determine_quilt_series_path 341s blob = follow_symlinks_to_blob( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 341s return _follow_symlinks_to_blob( 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s repo = pygit2.Repository('/tmp/tmpzklsmoop/.git/') 341s top_tree_object = 341s search_path = 'debian/patches/debian.series' 341s _rel_tree = 341s _rel_path = '' 341s 341s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 341s _rel_tree=None, _rel_path='' 341s ): 341s '''Recursively follow a path down a tree, following symlinks, to find blob 341s 341s repo: pygit2.Repository object 341s top_tree: pygit2.Tree object of the top of the tree structure 341s search_path: '/'-separated path string of blob to find 341s _rel_tree: (internal) which tree to look further into 341s _rel_path: (internal) the path we are in so far 341s ''' 341s 341s NORMAL_BLOB_MODES = set([ 341s pygit2.GIT_FILEMODE_BLOB, 341s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 341s ]) 341s 341s _rel_tree = _rel_tree or top_tree_object 341s head, tail = posixpath.split(search_path) 341s 341s # A traditional functional split would put a single entry in head with tail 341s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 341s # to make it appear to have traditional semantics. 341s if not head: 341s head = tail 341s tail = None 341s 341s entry = _rel_tree[head] 341s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:68: AttributeError 341s _____________________ test_repo_quilt_env_from_treeish_str _____________________ 341s 341s repo = 341s 341s def test_repo_quilt_env_from_treeish_str(repo): 341s tree_builder = Tree({'debian': 341s Tree({'patches': Tree({'debian.series': Blob(b'')})}) 341s }) 341s tree_obj = repo.raw_repo.get(tree_builder.write(repo.raw_repo)) 341s > env = repo.quilt_env_from_treeish_str(str(tree_obj.id)) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository_test.py:757: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:2589: in quilt_env_from_treeish_str 341s return self.quilt_env(self.raw_repo.get(treeish_str)) 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:2575: in quilt_env 341s env.update(quilt_env(self.raw_repo, treeish)) 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:1022: in quilt_env 341s 'QUILT_SERIES': determine_quilt_series_path(pygit2_repo, treeish), 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:991: in determine_quilt_series_path 341s blob = follow_symlinks_to_blob( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 341s return _follow_symlinks_to_blob( 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s repo = pygit2.Repository('/tmp/tmpqdcvckbi/.git/') 341s top_tree_object = 341s search_path = 'debian/patches/debian.series' 341s _rel_tree = 341s _rel_path = '' 341s 341s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 341s _rel_tree=None, _rel_path='' 341s ): 341s '''Recursively follow a path down a tree, following symlinks, to find blob 341s 341s repo: pygit2.Repository object 341s top_tree: pygit2.Tree object of the top of the tree structure 341s search_path: '/'-separated path string of blob to find 341s _rel_tree: (internal) which tree to look further into 341s _rel_path: (internal) the path we are in so far 341s ''' 341s 341s NORMAL_BLOB_MODES = set([ 341s pygit2.GIT_FILEMODE_BLOB, 341s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 341s ]) 341s 341s _rel_tree = _rel_tree or top_tree_object 341s head, tail = posixpath.split(search_path) 341s 341s # A traditional functional split would put a single entry in head with tail 341s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 341s # to make it appear to have traditional semantics. 341s if not head: 341s head = tail 341s tail = None 341s 341s entry = _rel_tree[head] 341s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:68: AttributeError 341s _ test_repo_find_ubuntu_merge[Common case-input_data0-pkg/import/1-1ubuntu1-pkg/import/2-1-pkg/import/1-1] _ 341s 341s description = 'Common case' 341s repo = 341s input_data = 341s old_ubuntu = 'pkg/import/1-1ubuntu1', new_debian = 'pkg/import/2-1' 341s expected = 'pkg/import/1-1' 341s 341s @pytest.mark.parametrize( 341s 'description, input_data, old_ubuntu, new_debian, expected', 341s [ 341s ( 341s 'Common case', 341s Repo( 341s commits=[ 341s Commit.from_spec( 341s name='old/debian' 341s ), 341s Commit.from_spec( 341s parents=[Placeholder('old/debian')], 341s name='old/ubuntu', 341s changelog_versions=['1-1ubuntu1', '1-1'], 341s ), 341s Commit.from_spec( 341s parents=[Placeholder('old/debian')], 341s name='new/debian', 341s changelog_versions=['2-1', '1-1'], 341s ), 341s ], 341s tags={ 341s 'pkg/import/1-1': Placeholder('old/debian'), 341s 'pkg/import/1-1ubuntu1': Placeholder('old/ubuntu'), 341s 'pkg/import/2-1': Placeholder('new/debian'), 341s }, 341s ), 341s 'pkg/import/1-1ubuntu1', 341s 'pkg/import/2-1', 341s 'pkg/import/1-1', 341s ), 341s ( 341s 'Ubuntu delta based on a NMU', 341s Repo( 341s commits=[ 341s Commit.from_spec( 341s name='fork_point' 341s ), 341s Commit.from_spec( 341s parents=[Placeholder('fork_point')], 341s name='old/debian', 341s changelog_versions=['1-1.1', '1-1'], 341s ), 341s Commit.from_spec( 341s parents=[Placeholder('old/debian')], 341s name='old/ubuntu', 341s changelog_versions=['1-1.1ubuntu1', '1-1.1', '1-1'], 341s ), 341s Commit.from_spec( 341s parents=[Placeholder('fork_point')], 341s name='new/debian', 341s changelog_versions=['2-1', '1-1'], 341s ), 341s ], 341s tags={ 341s 'pkg/import/1-1': Placeholder('fork_point'), 341s 'pkg/import/1-1.1': Placeholder('old/debian'), 341s 'pkg/import/1-1.1ubuntu1': Placeholder('old/ubuntu'), 341s 'pkg/import/2-1': Placeholder('new/debian'), 341s }, 341s ), 341s 'pkg/import/1-1.1ubuntu1', 341s 'pkg/import/2-1', 341s 'pkg/import/1-1.1', 341s ), 341s ( 341s 'Ubuntu upstream version head of Debian', 341s Repo( 341s commits=[ 341s Commit.from_spec( 341s name='old/debian' 341s ), 341s Commit.from_spec( 341s parents=[Placeholder('old/debian')], 341s name='mid_ubuntu', 341s changelog_versions=['1-1ubuntu1', '1-1'], 341s ), 341s Commit.from_spec( 341s parents=[Placeholder('mid_ubuntu')], 341s name='old/ubuntu', 341s changelog_versions=['2-0ubuntu1', '1-1ubuntu1', '1-1'], 341s ), 341s Commit.from_spec( 341s parents=[Placeholder('old/debian')], 341s name='new/debian', 341s changelog_versions=['3-1', '1-1'], 341s ), 341s ], 341s tags={ 341s 'pkg/import/1-1': Placeholder('old/debian'), 341s 'pkg/import/1-1ubuntu1': Placeholder('mid_ubuntu'), 341s 'pkg/import/2-0ubuntu1': Placeholder('old/ubuntu'), 341s 'pkg/import/3-1': Placeholder('new/debian'), 341s }, 341s ), 341s 'pkg/import/2-0ubuntu1', 341s 'pkg/import/3-1', 341s 'pkg/import/1-1', 341s ), 341s ], 341s ) 341s def test_repo_find_ubuntu_merge( 341s description, 341s repo, 341s input_data, 341s old_ubuntu, 341s new_debian, 341s expected, 341s ): 341s > input_data.write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository_test.py:889: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmpp361m2ss/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1ubuntu1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1ubuntu1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_2.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_2-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_2-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: Version number suggests Ubuntu changes, but there is no XSBC-Original-Maintainer field 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s _ 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] _ 341s 341s description = 'Ubuntu delta based on a NMU' 341s repo = 341s input_data = 341s old_ubuntu = 'pkg/import/1-1.1ubuntu1', new_debian = 'pkg/import/2-1' 341s expected = 'pkg/import/1-1.1' 341s 341s @pytest.mark.parametrize( 341s 'description, input_data, old_ubuntu, new_debian, expected', 341s [ 341s ( 341s 'Common case', 341s Repo( 341s commits=[ 341s Commit.from_spec( 341s name='old/debian' 341s ), 341s Commit.from_spec( 341s parents=[Placeholder('old/debian')], 341s name='old/ubuntu', 341s changelog_versions=['1-1ubuntu1', '1-1'], 341s ), 341s Commit.from_spec( 341s parents=[Placeholder('old/debian')], 341s name='new/debian', 341s changelog_versions=['2-1', '1-1'], 341s ), 341s ], 341s tags={ 341s 'pkg/import/1-1': Placeholder('old/debian'), 341s 'pkg/import/1-1ubuntu1': Placeholder('old/ubuntu'), 341s 'pkg/import/2-1': Placeholder('new/debian'), 341s }, 341s ), 341s 'pkg/import/1-1ubuntu1', 341s 'pkg/import/2-1', 341s 'pkg/import/1-1', 341s ), 341s ( 341s 'Ubuntu delta based on a NMU', 341s Repo( 341s commits=[ 341s Commit.from_spec( 341s name='fork_point' 341s ), 341s Commit.from_spec( 341s parents=[Placeholder('fork_point')], 341s name='old/debian', 341s changelog_versions=['1-1.1', '1-1'], 341s ), 341s Commit.from_spec( 341s parents=[Placeholder('old/debian')], 341s name='old/ubuntu', 341s changelog_versions=['1-1.1ubuntu1', '1-1.1', '1-1'], 341s ), 341s Commit.from_spec( 341s parents=[Placeholder('fork_point')], 341s name='new/debian', 341s changelog_versions=['2-1', '1-1'], 341s ), 341s ], 341s tags={ 341s 'pkg/import/1-1': Placeholder('fork_point'), 341s 'pkg/import/1-1.1': Placeholder('old/debian'), 341s 'pkg/import/1-1.1ubuntu1': Placeholder('old/ubuntu'), 341s 'pkg/import/2-1': Placeholder('new/debian'), 341s }, 341s ), 341s 'pkg/import/1-1.1ubuntu1', 341s 'pkg/import/2-1', 341s 'pkg/import/1-1.1', 341s ), 341s ( 341s 'Ubuntu upstream version head of Debian', 341s Repo( 341s commits=[ 341s Commit.from_spec( 341s name='old/debian' 341s ), 341s Commit.from_spec( 341s parents=[Placeholder('old/debian')], 341s name='mid_ubuntu', 341s changelog_versions=['1-1ubuntu1', '1-1'], 341s ), 341s Commit.from_spec( 341s parents=[Placeholder('mid_ubuntu')], 341s name='old/ubuntu', 341s changelog_versions=['2-0ubuntu1', '1-1ubuntu1', '1-1'], 341s ), 341s Commit.from_spec( 341s parents=[Placeholder('old/debian')], 341s name='new/debian', 341s changelog_versions=['3-1', '1-1'], 341s ), 341s ], 341s tags={ 341s 'pkg/import/1-1': Placeholder('old/debian'), 341s 'pkg/import/1-1ubuntu1': Placeholder('mid_ubuntu'), 341s 'pkg/import/2-0ubuntu1': Placeholder('old/ubuntu'), 341s 'pkg/import/3-1': Placeholder('new/debian'), 341s }, 341s ), 341s 'pkg/import/2-0ubuntu1', 341s 'pkg/import/3-1', 341s 'pkg/import/1-1', 341s ), 341s ], 341s ) 341s def test_repo_find_ubuntu_merge( 341s description, 341s repo, 341s input_data, 341s old_ubuntu, 341s new_debian, 341s expected, 341s ): 341s > input_data.write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository_test.py:889: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmp8rk4l7h_/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.1ubuntu1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.1ubuntu1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_2.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_2-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_2-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: Version number suggests Ubuntu changes, but there is no XSBC-Original-Maintainer field 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s _ 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] _ 341s 341s description = 'Ubuntu upstream version head of Debian' 341s repo = 341s input_data = 341s old_ubuntu = 'pkg/import/2-0ubuntu1', new_debian = 'pkg/import/3-1' 341s expected = 'pkg/import/1-1' 341s 341s @pytest.mark.parametrize( 341s 'description, input_data, old_ubuntu, new_debian, expected', 341s [ 341s ( 341s 'Common case', 341s Repo( 341s commits=[ 341s Commit.from_spec( 341s name='old/debian' 341s ), 341s Commit.from_spec( 341s parents=[Placeholder('old/debian')], 341s name='old/ubuntu', 341s changelog_versions=['1-1ubuntu1', '1-1'], 341s ), 341s Commit.from_spec( 341s parents=[Placeholder('old/debian')], 341s name='new/debian', 341s changelog_versions=['2-1', '1-1'], 341s ), 341s ], 341s tags={ 341s 'pkg/import/1-1': Placeholder('old/debian'), 341s 'pkg/import/1-1ubuntu1': Placeholder('old/ubuntu'), 341s 'pkg/import/2-1': Placeholder('new/debian'), 341s }, 341s ), 341s 'pkg/import/1-1ubuntu1', 341s 'pkg/import/2-1', 341s 'pkg/import/1-1', 341s ), 341s ( 341s 'Ubuntu delta based on a NMU', 341s Repo( 341s commits=[ 341s Commit.from_spec( 341s name='fork_point' 341s ), 341s Commit.from_spec( 341s parents=[Placeholder('fork_point')], 341s name='old/debian', 341s changelog_versions=['1-1.1', '1-1'], 341s ), 341s Commit.from_spec( 341s parents=[Placeholder('old/debian')], 341s name='old/ubuntu', 341s changelog_versions=['1-1.1ubuntu1', '1-1.1', '1-1'], 341s ), 341s Commit.from_spec( 341s parents=[Placeholder('fork_point')], 341s name='new/debian', 341s changelog_versions=['2-1', '1-1'], 341s ), 341s ], 341s tags={ 341s 'pkg/import/1-1': Placeholder('fork_point'), 341s 'pkg/import/1-1.1': Placeholder('old/debian'), 341s 'pkg/import/1-1.1ubuntu1': Placeholder('old/ubuntu'), 341s 'pkg/import/2-1': Placeholder('new/debian'), 341s }, 341s ), 341s 'pkg/import/1-1.1ubuntu1', 341s 'pkg/import/2-1', 341s 'pkg/import/1-1.1', 341s ), 341s ( 341s 'Ubuntu upstream version head of Debian', 341s Repo( 341s commits=[ 341s Commit.from_spec( 341s name='old/debian' 341s ), 341s Commit.from_spec( 341s parents=[Placeholder('old/debian')], 341s name='mid_ubuntu', 341s changelog_versions=['1-1ubuntu1', '1-1'], 341s ), 341s Commit.from_spec( 341s parents=[Placeholder('mid_ubuntu')], 341s name='old/ubuntu', 341s changelog_versions=['2-0ubuntu1', '1-1ubuntu1', '1-1'], 341s ), 341s Commit.from_spec( 341s parents=[Placeholder('old/debian')], 341s name='new/debian', 341s changelog_versions=['3-1', '1-1'], 341s ), 341s ], 341s tags={ 341s 'pkg/import/1-1': Placeholder('old/debian'), 341s 'pkg/import/1-1ubuntu1': Placeholder('mid_ubuntu'), 341s 'pkg/import/2-0ubuntu1': Placeholder('old/ubuntu'), 341s 'pkg/import/3-1': Placeholder('new/debian'), 341s }, 341s ), 341s 'pkg/import/2-0ubuntu1', 341s 'pkg/import/3-1', 341s 'pkg/import/1-1', 341s ), 341s ], 341s ) 341s def test_repo_find_ubuntu_merge( 341s description, 341s repo, 341s input_data, 341s old_ubuntu, 341s new_debian, 341s expected, 341s ): 341s > input_data.write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository_test.py:889: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmp3zdq73qi/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1ubuntu1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1ubuntu1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_2.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_2-0ubuntu1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_2-0ubuntu1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1ubuntu1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1ubuntu1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_3.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_3-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_3-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: Version number suggests Ubuntu changes, but there is no XSBC-Original-Maintainer field 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: Version number suggests Ubuntu changes, but there is no XSBC-Original-Maintainer field 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: Version number suggests Ubuntu changes, but there is no XSBC-Original-Maintainer field 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s _______________________________ test_commit_tree _______________________________ 341s 341s repo = 341s 341s def test_commit_tree(repo): 341s # Construct a repository with an initial commit on the master branch so 341s # that we can verify later parentage and lack of branch movement 341s parent_commit_oid = Repo( 341s commits=[Commit(name='master')], 341s branches={'master': Placeholder('master')} 341s ).write(repo.raw_repo) 341s repo.raw_repo.lookup_reference('HEAD').set_target('refs/heads/master') 341s 341s # Construct a tree inside the repository with a debian/changelog in it to 341s # feed to the method under test 341s test_changelog_path = os.path.join( 341s pkg_resources.resource_filename('gitubuntu', 'changelog_tests'), 341s 'test_date_1', 341s ) 341s with open(test_changelog_path, 'rb') as f: 341s test_changelog_bytes = f.read() 341s test_changelog_blob = Blob(test_changelog_bytes) 341s source_tree = Tree({'debian': Tree({'changelog': test_changelog_blob})}) 341s source_tree_oid = source_tree.write(repo.raw_repo) 341s 341s # Call the method under test 341s > commit_oid = repo.commit_source_tree( 341s tree=source_tree_oid, 341s parents=[parent_commit_oid], 341s log_message='test_commit_msg', 341s commit_date=datetime.datetime( 341s 1971, # year 341s 2, # month 341s 3, # day 341s 4, # hours 341s 5, # minutes 341s 6, # seconds 341s 7, # milliseconds (this should get truncated down to 0) 341s datetime.timezone(datetime.timedelta(hours=-8)) 341s ), 341s ) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository_test.py:993: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:2299: in commit_source_tree 341s changelog = self.get_changelog_from_treeish(str(tree)) 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 341s return Changelog.from_treeish( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:569: in from_treeish 341s blob = follow_symlinks_to_blob( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 341s return _follow_symlinks_to_blob( 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s repo = pygit2.Repository('/tmp/tmpsmp7e66b/.git/') 341s top_tree_object = 341s search_path = 'debian/changelog' 341s _rel_tree = 341s _rel_path = '' 341s 341s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 341s _rel_tree=None, _rel_path='' 341s ): 341s '''Recursively follow a path down a tree, following symlinks, to find blob 341s 341s repo: pygit2.Repository object 341s top_tree: pygit2.Tree object of the top of the tree structure 341s search_path: '/'-separated path string of blob to find 341s _rel_tree: (internal) which tree to look further into 341s _rel_path: (internal) the path we are in so far 341s ''' 341s 341s NORMAL_BLOB_MODES = set([ 341s pygit2.GIT_FILEMODE_BLOB, 341s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 341s ]) 341s 341s _rel_tree = _rel_tree or top_tree_object 341s head, tail = posixpath.split(search_path) 341s 341s # A traditional functional split would put a single entry in head with tail 341s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 341s # to make it appear to have traditional semantics. 341s if not head: 341s head = tail 341s tail = None 341s 341s entry = _rel_tree[head] 341s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:68: AttributeError 341s _____________________ test_descendant_of[root-root-False] ______________________ 341s 341s pygit2_repo = pygit2.Repository('/tmp/tmpa9vhow48/.git/'), a = 'root' 341s b = 'root', expected = False 341s 341s @pytest.mark.parametrize(['a', 'b', 'expected'], 341s [ 341s ('root', 'root', False), 341s ('child1', 'root', True), 341s ('root', 'child1', False), 341s ('grandchild1', 'root', True), 341s ('child1', 'child2', False), 341s ('root', 'disjoint', False), 341s ] 341s ) 341s def test_descendant_of(pygit2_repo, a, b, expected): 341s """ 341s General test for pygit2.Repository.descendant_of(). 341s 341s This test was formerly for a temporary alternative implementation of 341s pygit2.Repository.descendant_of() in our GitUbuntuRepository wrapper for 341s use until we updated our pinning to use a newer version of pygit2 that 341s included the pygit2.Repository.descendant_of() method. After the pinning 341s was removed and this implementation replacement took place, we kept the 341s test to ensure that actual behaviour did not change. 341s 341s This unit tests validate_upload_tag() for various parameterized cases. The 341s paramater sets assume the repository structure encoded in the Repo() call 341s below. 341s 341s :param pygit2.Repository pygit2_repo: fixture providing a temporary 341s pygit2.Repository instance to use 341s :param str a: tag name of the first commit to pass to descendant_of() 341s :param str b: tag name of the second commit to pass to descendant_of() 341s :param bool expected: the expected result of descendant_of() 341s """ 341s Repo( 341s # Unique message parameters are used in each entry here in order to 341s # ensure that otherwise-identical commits do not end up being the same 341s # commit (with the same hash, etc). 341s commits=[ 341s Commit(name='root', message='1'), 341s Commit(name='child1', parents=[Placeholder('root')], message='2'), 341s Commit(name='child2', parents=[Placeholder('root')], message='3'), 341s Commit( 341s name='grandchild1', 341s parents=[Placeholder('child1')], 341s message='4' 341s ), 341s Commit(name='disjoint', message='5'), 341s ], 341s tags={ 341s 'root': Placeholder('root'), 341s 'child1': Placeholder('child1'), 341s 'child2': Placeholder('child2'), 341s 'grandchild1': Placeholder('grandchild1'), 341s 'disjoint': Placeholder('disjoint'), 341s } 341s > ).write(pygit2_repo) 341s 341s gitubuntu/git_repository_test.py:1099: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmpa9vhow48/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s gitubuntu/repo_builder.py:389: AttributeError 341s _____________________ test_descendant_of[child1-root-True] _____________________ 341s 341s pygit2_repo = pygit2.Repository('/tmp/tmpol0m2x9s/.git/'), a = 'child1' 341s b = 'root', expected = True 341s 341s @pytest.mark.parametrize(['a', 'b', 'expected'], 341s [ 341s ('root', 'root', False), 341s ('child1', 'root', True), 341s ('root', 'child1', False), 341s ('grandchild1', 'root', True), 341s ('child1', 'child2', False), 341s ('root', 'disjoint', False), 341s ] 341s ) 341s def test_descendant_of(pygit2_repo, a, b, expected): 341s """ 341s General test for pygit2.Repository.descendant_of(). 341s 341s This test was formerly for a temporary alternative implementation of 341s pygit2.Repository.descendant_of() in our GitUbuntuRepository wrapper for 341s use until we updated our pinning to use a newer version of pygit2 that 341s included the pygit2.Repository.descendant_of() method. After the pinning 341s was removed and this implementation replacement took place, we kept the 341s test to ensure that actual behaviour did not change. 341s 341s This unit tests validate_upload_tag() for various parameterized cases. The 341s paramater sets assume the repository structure encoded in the Repo() call 341s below. 341s 341s :param pygit2.Repository pygit2_repo: fixture providing a temporary 341s pygit2.Repository instance to use 341s :param str a: tag name of the first commit to pass to descendant_of() 341s :param str b: tag name of the second commit to pass to descendant_of() 341s :param bool expected: the expected result of descendant_of() 341s """ 341s Repo( 341s # Unique message parameters are used in each entry here in order to 341s # ensure that otherwise-identical commits do not end up being the same 341s # commit (with the same hash, etc). 341s commits=[ 341s Commit(name='root', message='1'), 341s Commit(name='child1', parents=[Placeholder('root')], message='2'), 341s Commit(name='child2', parents=[Placeholder('root')], message='3'), 341s Commit( 341s name='grandchild1', 341s parents=[Placeholder('child1')], 341s message='4' 341s ), 341s Commit(name='disjoint', message='5'), 341s ], 341s tags={ 341s 'root': Placeholder('root'), 341s 'child1': Placeholder('child1'), 341s 'child2': Placeholder('child2'), 341s 'grandchild1': Placeholder('grandchild1'), 341s 'disjoint': Placeholder('disjoint'), 341s } 341s > ).write(pygit2_repo) 341s 341s gitubuntu/git_repository_test.py:1099: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmpol0m2x9s/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s gitubuntu/repo_builder.py:389: AttributeError 341s ____________________ test_descendant_of[root-child1-False] _____________________ 341s 341s pygit2_repo = pygit2.Repository('/tmp/tmpvnbup2i6/.git/'), a = 'root' 341s b = 'child1', expected = False 341s 341s @pytest.mark.parametrize(['a', 'b', 'expected'], 341s [ 341s ('root', 'root', False), 341s ('child1', 'root', True), 341s ('root', 'child1', False), 341s ('grandchild1', 'root', True), 341s ('child1', 'child2', False), 341s ('root', 'disjoint', False), 341s ] 341s ) 341s def test_descendant_of(pygit2_repo, a, b, expected): 341s """ 341s General test for pygit2.Repository.descendant_of(). 341s 341s This test was formerly for a temporary alternative implementation of 341s pygit2.Repository.descendant_of() in our GitUbuntuRepository wrapper for 341s use until we updated our pinning to use a newer version of pygit2 that 341s included the pygit2.Repository.descendant_of() method. After the pinning 341s was removed and this implementation replacement took place, we kept the 341s test to ensure that actual behaviour did not change. 341s 341s This unit tests validate_upload_tag() for various parameterized cases. The 341s paramater sets assume the repository structure encoded in the Repo() call 341s below. 341s 341s :param pygit2.Repository pygit2_repo: fixture providing a temporary 341s pygit2.Repository instance to use 341s :param str a: tag name of the first commit to pass to descendant_of() 341s :param str b: tag name of the second commit to pass to descendant_of() 341s :param bool expected: the expected result of descendant_of() 341s """ 341s Repo( 341s # Unique message parameters are used in each entry here in order to 341s # ensure that otherwise-identical commits do not end up being the same 341s # commit (with the same hash, etc). 341s commits=[ 341s Commit(name='root', message='1'), 341s Commit(name='child1', parents=[Placeholder('root')], message='2'), 341s Commit(name='child2', parents=[Placeholder('root')], message='3'), 341s Commit( 341s name='grandchild1', 341s parents=[Placeholder('child1')], 341s message='4' 341s ), 341s Commit(name='disjoint', message='5'), 341s ], 341s tags={ 341s 'root': Placeholder('root'), 341s 'child1': Placeholder('child1'), 341s 'child2': Placeholder('child2'), 341s 'grandchild1': Placeholder('grandchild1'), 341s 'disjoint': Placeholder('disjoint'), 341s } 341s > ).write(pygit2_repo) 341s 341s gitubuntu/git_repository_test.py:1099: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmpvnbup2i6/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s gitubuntu/repo_builder.py:389: AttributeError 341s __________________ test_descendant_of[grandchild1-root-True] ___________________ 341s 341s pygit2_repo = pygit2.Repository('/tmp/tmpw2lbtfzl/.git/'), a = 'grandchild1' 341s b = 'root', expected = True 341s 341s @pytest.mark.parametrize(['a', 'b', 'expected'], 341s [ 341s ('root', 'root', False), 341s ('child1', 'root', True), 341s ('root', 'child1', False), 341s ('grandchild1', 'root', True), 341s ('child1', 'child2', False), 341s ('root', 'disjoint', False), 341s ] 341s ) 341s def test_descendant_of(pygit2_repo, a, b, expected): 341s """ 341s General test for pygit2.Repository.descendant_of(). 341s 341s This test was formerly for a temporary alternative implementation of 341s pygit2.Repository.descendant_of() in our GitUbuntuRepository wrapper for 341s use until we updated our pinning to use a newer version of pygit2 that 341s included the pygit2.Repository.descendant_of() method. After the pinning 341s was removed and this implementation replacement took place, we kept the 341s test to ensure that actual behaviour did not change. 341s 341s This unit tests validate_upload_tag() for various parameterized cases. The 341s paramater sets assume the repository structure encoded in the Repo() call 341s below. 341s 341s :param pygit2.Repository pygit2_repo: fixture providing a temporary 341s pygit2.Repository instance to use 341s :param str a: tag name of the first commit to pass to descendant_of() 341s :param str b: tag name of the second commit to pass to descendant_of() 341s :param bool expected: the expected result of descendant_of() 341s """ 341s Repo( 341s # Unique message parameters are used in each entry here in order to 341s # ensure that otherwise-identical commits do not end up being the same 341s # commit (with the same hash, etc). 341s commits=[ 341s Commit(name='root', message='1'), 341s Commit(name='child1', parents=[Placeholder('root')], message='2'), 341s Commit(name='child2', parents=[Placeholder('root')], message='3'), 341s Commit( 341s name='grandchild1', 341s parents=[Placeholder('child1')], 341s message='4' 341s ), 341s Commit(name='disjoint', message='5'), 341s ], 341s tags={ 341s 'root': Placeholder('root'), 341s 'child1': Placeholder('child1'), 341s 'child2': Placeholder('child2'), 341s 'grandchild1': Placeholder('grandchild1'), 341s 'disjoint': Placeholder('disjoint'), 341s } 341s > ).write(pygit2_repo) 341s 341s gitubuntu/git_repository_test.py:1099: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmpw2lbtfzl/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s gitubuntu/repo_builder.py:389: AttributeError 341s ___________________ test_descendant_of[child1-child2-False] ____________________ 341s 341s pygit2_repo = pygit2.Repository('/tmp/tmpjmvuxfdi/.git/'), a = 'child1' 341s b = 'child2', expected = False 341s 341s @pytest.mark.parametrize(['a', 'b', 'expected'], 341s [ 341s ('root', 'root', False), 341s ('child1', 'root', True), 341s ('root', 'child1', False), 341s ('grandchild1', 'root', True), 341s ('child1', 'child2', False), 341s ('root', 'disjoint', False), 341s ] 341s ) 341s def test_descendant_of(pygit2_repo, a, b, expected): 341s """ 341s General test for pygit2.Repository.descendant_of(). 341s 341s This test was formerly for a temporary alternative implementation of 341s pygit2.Repository.descendant_of() in our GitUbuntuRepository wrapper for 341s use until we updated our pinning to use a newer version of pygit2 that 341s included the pygit2.Repository.descendant_of() method. After the pinning 341s was removed and this implementation replacement took place, we kept the 341s test to ensure that actual behaviour did not change. 341s 341s This unit tests validate_upload_tag() for various parameterized cases. The 341s paramater sets assume the repository structure encoded in the Repo() call 341s below. 341s 341s :param pygit2.Repository pygit2_repo: fixture providing a temporary 341s pygit2.Repository instance to use 341s :param str a: tag name of the first commit to pass to descendant_of() 341s :param str b: tag name of the second commit to pass to descendant_of() 341s :param bool expected: the expected result of descendant_of() 341s """ 341s Repo( 341s # Unique message parameters are used in each entry here in order to 341s # ensure that otherwise-identical commits do not end up being the same 341s # commit (with the same hash, etc). 341s commits=[ 341s Commit(name='root', message='1'), 341s Commit(name='child1', parents=[Placeholder('root')], message='2'), 341s Commit(name='child2', parents=[Placeholder('root')], message='3'), 341s Commit( 341s name='grandchild1', 341s parents=[Placeholder('child1')], 341s message='4' 341s ), 341s Commit(name='disjoint', message='5'), 341s ], 341s tags={ 341s 'root': Placeholder('root'), 341s 'child1': Placeholder('child1'), 341s 'child2': Placeholder('child2'), 341s 'grandchild1': Placeholder('grandchild1'), 341s 'disjoint': Placeholder('disjoint'), 341s } 341s > ).write(pygit2_repo) 341s 341s gitubuntu/git_repository_test.py:1099: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmpjmvuxfdi/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s gitubuntu/repo_builder.py:389: AttributeError 341s ___________________ test_descendant_of[root-disjoint-False] ____________________ 341s 341s pygit2_repo = pygit2.Repository('/tmp/tmp68zfixcu/.git/'), a = 'root' 341s b = 'disjoint', expected = False 341s 341s @pytest.mark.parametrize(['a', 'b', 'expected'], 341s [ 341s ('root', 'root', False), 341s ('child1', 'root', True), 341s ('root', 'child1', False), 341s ('grandchild1', 'root', True), 341s ('child1', 'child2', False), 341s ('root', 'disjoint', False), 341s ] 341s ) 341s def test_descendant_of(pygit2_repo, a, b, expected): 341s """ 341s General test for pygit2.Repository.descendant_of(). 341s 341s This test was formerly for a temporary alternative implementation of 341s pygit2.Repository.descendant_of() in our GitUbuntuRepository wrapper for 341s use until we updated our pinning to use a newer version of pygit2 that 341s included the pygit2.Repository.descendant_of() method. After the pinning 341s was removed and this implementation replacement took place, we kept the 341s test to ensure that actual behaviour did not change. 341s 341s This unit tests validate_upload_tag() for various parameterized cases. The 341s paramater sets assume the repository structure encoded in the Repo() call 341s below. 341s 341s :param pygit2.Repository pygit2_repo: fixture providing a temporary 341s pygit2.Repository instance to use 341s :param str a: tag name of the first commit to pass to descendant_of() 341s :param str b: tag name of the second commit to pass to descendant_of() 341s :param bool expected: the expected result of descendant_of() 341s """ 341s Repo( 341s # Unique message parameters are used in each entry here in order to 341s # ensure that otherwise-identical commits do not end up being the same 341s # commit (with the same hash, etc). 341s commits=[ 341s Commit(name='root', message='1'), 341s Commit(name='child1', parents=[Placeholder('root')], message='2'), 341s Commit(name='child2', parents=[Placeholder('root')], message='3'), 341s Commit( 341s name='grandchild1', 341s parents=[Placeholder('child1')], 341s message='4' 341s ), 341s Commit(name='disjoint', message='5'), 341s ], 341s tags={ 341s 'root': Placeholder('root'), 341s 'child1': Placeholder('child1'), 341s 'child2': Placeholder('child2'), 341s 'grandchild1': Placeholder('grandchild1'), 341s 'disjoint': Placeholder('disjoint'), 341s } 341s > ).write(pygit2_repo) 341s 341s gitubuntu/git_repository_test.py:1099: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmp68zfixcu/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s gitubuntu/repo_builder.py:389: AttributeError 341s _______________________________ test_create_tag ________________________________ 341s 341s repo = 341s 341s def test_create_tag(repo): 341s """create_tag() should create a tag 341s 341s :param GitUbuntuRepository repo: fixture providing a temporary 341s GitUbuntuRepository instance to use 341s """ 341s Repo( 341s commits=[Commit(name='root')], 341s tags={'root': Placeholder('root')}, 341s > ).write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository_test.py:1127: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmpysa5xc2k/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s __________________________ test_get_all_reimport_tags __________________________ 341s 341s repo = 341s 341s def test_get_all_reimport_tags(repo): 341s """get_all_reimport_tags() should return only matching reimport tags 341s 341s :param GitUbuntuRepository repo: fixture providing a temporary 341s GitUbuntuRepository instance to use 341s """ 341s Repo( 341s commits=[Commit(name='root')], 341s tags={ 341s 'importer/reimport/import/1/0': Placeholder('root'), 341s 'importer/reimport/import/1/1': Placeholder('root'), 341s 341s # This entry must not be identified as one of version 1's reimport 341s # tags, even though it shares the same base prefix. 341s 'importer/reimport/import/11/0': Placeholder('root'), 341s }, 341s > ).write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository_test.py:1165: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmptf5x41mc/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s ______________________________ test_get_head_info ______________________________ 341s 341s repo = 341s 341s def test_get_head_info(repo): 341s """get_head_info() extracts expected commit and version info from the head 341s commit 341s """ 341s Repo( 341s commits=[ 341s Commit(name='foo', tree=SourceTree(source=Source())), 341s ], 341s branches={ 341s 'importer/ubuntu/foo': Placeholder('foo'), 341s 'importer/debian/bar': Placeholder('foo'), 341s 'other/ubuntu/baz': Placeholder('foo'), 341s }, 341s ).write(repo.raw_repo) 341s foo_commit_id = ( 341s repo.raw_repo 341s .lookup_reference('refs/heads/importer/ubuntu/foo') 341s .peel(pygit2.Commit).id 341s ) 341s > assert repo.get_head_info('ubuntu', 'importer') == { 341s 'importer/ubuntu/foo': HeadInfoItem( 341s version='1-1', 341s commit_time=0, 341s commit_id=foo_commit_id, 341s ), 341s } 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository_test.py:1193: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:1952: in get_head_info 341s self.get_changelog_versions_from_treeish(str(head.peel().id)) 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:1888: in get_changelog_versions_from_treeish 341s changelog = self.get_changelog_from_treeish(treeish_string) 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 341s return Changelog.from_treeish( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:569: in from_treeish 341s blob = follow_symlinks_to_blob( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 341s return _follow_symlinks_to_blob( 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s repo = pygit2.Repository('/tmp/tmpmlmtltmj/.git/') 341s top_tree_object = 341s search_path = 'debian/changelog' 341s _rel_tree = 341s _rel_path = '' 341s 341s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 341s _rel_tree=None, _rel_path='' 341s ): 341s '''Recursively follow a path down a tree, following symlinks, to find blob 341s 341s repo: pygit2.Repository object 341s top_tree: pygit2.Tree object of the top of the tree structure 341s search_path: '/'-separated path string of blob to find 341s _rel_tree: (internal) which tree to look further into 341s _rel_path: (internal) the path we are in so far 341s ''' 341s 341s NORMAL_BLOB_MODES = set([ 341s pygit2.GIT_FILEMODE_BLOB, 341s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 341s ]) 341s 341s _rel_tree = _rel_tree or top_tree_object 341s head, tail = posixpath.split(search_path) 341s 341s # A traditional functional split would put a single entry in head with tail 341s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 341s # to make it appear to have traditional semantics. 341s if not head: 341s head = tail 341s tail = None 341s 341s entry = _rel_tree[head] 341s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:68: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s _ test_import_unapplied_spi_tags[input_repo0-expected_output_refs0-validation_repo_delta0-validation_repo_expected_identical_refs0-True] _ 341s 341s get_import_commit_msg_mock = 341s get_import_tag_msg_mock = 341s repo = 341s input_repo = 341s 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'] 341s validation_repo_delta = {'update_branches': {'importer/ubuntu/trusty': }} 341s validation_repo_expected_identical_refs = ['refs/heads/importer/ubuntu/trusty-proposed', 'refs/heads/importer/ubuntu/trusty', 'refs/tags/importer/import/1-1'] 341s reuse = True 341s 341s @pytest.mark.parametrize( 341s [ 341s 'input_repo', 341s 'expected_output_refs', 341s 'validation_repo_delta', 341s 'validation_repo_expected_identical_refs', 341s 'reuse', 341s ], 341s [ 341s # 1) An existing import tag (or reimport tag) with the same Git tree 341s # - Reuse import tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[Commit.from_spec(name='import')], 341s branches={ 341s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 341s }, 341s tags={'importer/import/1-1': Placeholder('import')}, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s ], 341s # validation_repo_delta: 341s { 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('import'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty-proposed', 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s ], 341s # reuse: 341s True, 341s ), 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec( 341s name='import', 341s mutate='import tag contents', 341s ), 341s Commit.from_spec(name='reimport'), 341s ], 341s branches={ 341s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 341s }, 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 341s }, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s ], 341s # validation_repo_delta: 341s { 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('reimport'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty-proposed', 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s # reuse: 341s True, 341s ), 341s 341s # 2) An existing import tag with a different Git tree and an existing 341s # upload tag with the same Git tree 341s # - Reuse upload tag, create reimport tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec( 341s name='import', 341s mutate='The import tag contents', 341s ), 341s Commit.from_spec(name='upload'), 341s ], 341s branches={ 341s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 341s }, 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/upload/1-1': Placeholder('upload'), 341s }, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'update_tags': { 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('upload'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('upload'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty-proposed', 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/upload/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s # reuse: 341s True, 341s ), 341s 341s # 3) An existing import tag with a different Git tree and an existing 341s # upload tag with a different Git tree 341s # - Create reimport tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec( 341s name='import', 341s mutate='The import tag contents', 341s ), 341s Commit.from_spec( 341s name='upload', 341s mutate='The upload tag contents', 341s ), 341s ], 341s branches={ 341s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 341s }, 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/upload/1-1': Placeholder('upload'), 341s }, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/changelog', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'add_commits': [Commit.from_spec( 341s name='reimport', 341s message='Test commit (new)', 341s )], 341s 'update_tags': { 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('reimport'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty-proposed', 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/upload/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s # reuse: 341s False, 341s ), 341s 341s # 4) An existing import tag with a different Git tree and no upload tag 341s # - Create reimport tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec( 341s name='import', 341s mutate='The import tag contents', 341s ), 341s ], 341s branches={ 341s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 341s }, 341s tags={'importer/import/1-1': Placeholder('import')}, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/changelog', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'add_commits': [Commit.from_spec( 341s name='reimport', 341s message='Test commit (new)', 341s )], 341s 'update_tags': { 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('reimport'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty-proposed', 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s # reuse: 341s False, 341s ), 341s 341s # 5) No import tag and an existing upload tag with the same Git tree 341s # - Reuse upload tag, create import tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[Commit.from_spec(name='upload')], 341s tags={'importer/upload/1-1': Placeholder('upload')}, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'update_tags': { 341s 'importer/import/1-1': Placeholder('upload'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('upload'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/upload/1-1', 341s ], 341s # reuse: 341s True, 341s ), 341s 341s # 6) No import tag and an existing upload tag with a different Git tree 341s # - Create import tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec( 341s name='upload', 341s mutate='The upload tag contents', 341s ), 341s ], 341s tags={'importer/upload/1-1': Placeholder('upload')}, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/changelog', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'add_commits': [ 341s Commit.from_spec( 341s name='publish', 341s message='Test commit (new)', 341s ), 341s ], 341s 'update_tags': { 341s 'importer/import/1-1': Placeholder('publish'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('publish'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/upload/1-1', 341s ], 341s # reuse: 341s False, 341s ), 341s 341s # 7) No import tags or upload tags 341s # - Create import tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo(), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/changelog', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'add_commits': [ 341s Commit.from_spec( 341s name='publish', 341s message='Test commit (new)', 341s ), 341s ], 341s 'update_tags': { 341s 'importer/import/1-1': Placeholder('publish'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('publish'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1' 341s ], 341s # reuse: 341s False, 341s ), 341s ] 341s ) 341s @patch('gitubuntu.importer.get_import_tag_msg') 341s @patch('gitubuntu.importer.get_import_commit_msg') 341s def test_import_unapplied_spi_tags( 341s get_import_commit_msg_mock, 341s get_import_tag_msg_mock, 341s repo, 341s input_repo, 341s expected_output_refs, 341s validation_repo_delta, 341s validation_repo_expected_identical_refs, 341s reuse, 341s ): 341s """Test that unapplied tags are correctly created, adjusted and/or reused 341s 341s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 341s that determines the commit message to use for a given import 341s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 341s that determines the tag message to use for a given import 341s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 341s temporary output repository 341s :param repo_builder.Repo input_repo: input repository data 341s :param list(str) expected_output_refs: refs that must exist in the output 341s repository 341s :param dict validation_repo_delta: how to transform the input 341s repository into a "validation repository", expressed as a dict to 341s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 341s input repository. The validation repository is then used for the 341s purposes of comparison against the output repository. 341s :param list(str) validation_repo_expected_identical_refs: refs that must be 341s identical between the validation repository and the output repository 341s :param bool reuse: if set, the output ref importer/ubuntu/trusty must be 341s one supplied by the input repository (assumed to have a commit message 341s of "Test commit") and not one created by the importer in this run 341s (arranged by this test to have a different commit message) 341s 341s The input repository data is written into the output repository and then a 341s fake non-native source package publication of version 1-1 in the Trusty 341s release pocket is imported into it by calling import_unapplied_spi() 341s directly. expected_output_refs, validation_repo_expected_identical_refs and 341s reuse are then asserted. It is further asserted that no other refs exist in 341s the output repository except for those listed in expected_output_refs and 341s validation_repo_expected_identical_refs. 341s """ 341s # Match the repo_builder objects 341s get_import_tag_msg_mock.return_value = 'Test tag' 341s # Importantly, the following commit message must not be the same as the 341s # commit messages used by the test input repository commits, so that we can 341s # later detect the difference between commits that were already there and 341s # new commits created by the importer for the purposes of asserting the 341s # reuse parameter correctly. 341s get_import_commit_msg_mock.return_value = b'Test commit (new)' 341s 341s > input_repo.write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_tag_test.py:463: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmpx52smzzr/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s _ test_import_unapplied_spi_tags[input_repo1-expected_output_refs1-validation_repo_delta1-validation_repo_expected_identical_refs1-True] _ 341s 341s get_import_commit_msg_mock = 341s get_import_tag_msg_mock = 341s repo = 341s input_repo = 341s 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'] 341s validation_repo_delta = {'update_branches': {'importer/ubuntu/trusty': }} 341s 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'] 341s reuse = True 341s 341s @pytest.mark.parametrize( 341s [ 341s 'input_repo', 341s 'expected_output_refs', 341s 'validation_repo_delta', 341s 'validation_repo_expected_identical_refs', 341s 'reuse', 341s ], 341s [ 341s # 1) An existing import tag (or reimport tag) with the same Git tree 341s # - Reuse import tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[Commit.from_spec(name='import')], 341s branches={ 341s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 341s }, 341s tags={'importer/import/1-1': Placeholder('import')}, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s ], 341s # validation_repo_delta: 341s { 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('import'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty-proposed', 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s ], 341s # reuse: 341s True, 341s ), 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec( 341s name='import', 341s mutate='import tag contents', 341s ), 341s Commit.from_spec(name='reimport'), 341s ], 341s branches={ 341s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 341s }, 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 341s }, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s ], 341s # validation_repo_delta: 341s { 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('reimport'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty-proposed', 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s # reuse: 341s True, 341s ), 341s 341s # 2) An existing import tag with a different Git tree and an existing 341s # upload tag with the same Git tree 341s # - Reuse upload tag, create reimport tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec( 341s name='import', 341s mutate='The import tag contents', 341s ), 341s Commit.from_spec(name='upload'), 341s ], 341s branches={ 341s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 341s }, 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/upload/1-1': Placeholder('upload'), 341s }, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'update_tags': { 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('upload'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('upload'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty-proposed', 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/upload/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s # reuse: 341s True, 341s ), 341s 341s # 3) An existing import tag with a different Git tree and an existing 341s # upload tag with a different Git tree 341s # - Create reimport tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec( 341s name='import', 341s mutate='The import tag contents', 341s ), 341s Commit.from_spec( 341s name='upload', 341s mutate='The upload tag contents', 341s ), 341s ], 341s branches={ 341s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 341s }, 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/upload/1-1': Placeholder('upload'), 341s }, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/changelog', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'add_commits': [Commit.from_spec( 341s name='reimport', 341s message='Test commit (new)', 341s )], 341s 'update_tags': { 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('reimport'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty-proposed', 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/upload/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s # reuse: 341s False, 341s ), 341s 341s # 4) An existing import tag with a different Git tree and no upload tag 341s # - Create reimport tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec( 341s name='import', 341s mutate='The import tag contents', 341s ), 341s ], 341s branches={ 341s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 341s }, 341s tags={'importer/import/1-1': Placeholder('import')}, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/changelog', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'add_commits': [Commit.from_spec( 341s name='reimport', 341s message='Test commit (new)', 341s )], 341s 'update_tags': { 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('reimport'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty-proposed', 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s # reuse: 341s False, 341s ), 341s 341s # 5) No import tag and an existing upload tag with the same Git tree 341s # - Reuse upload tag, create import tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[Commit.from_spec(name='upload')], 341s tags={'importer/upload/1-1': Placeholder('upload')}, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'update_tags': { 341s 'importer/import/1-1': Placeholder('upload'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('upload'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/upload/1-1', 341s ], 341s # reuse: 341s True, 341s ), 341s 341s # 6) No import tag and an existing upload tag with a different Git tree 341s # - Create import tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec( 341s name='upload', 341s mutate='The upload tag contents', 341s ), 341s ], 341s tags={'importer/upload/1-1': Placeholder('upload')}, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/changelog', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'add_commits': [ 341s Commit.from_spec( 341s name='publish', 341s message='Test commit (new)', 341s ), 341s ], 341s 'update_tags': { 341s 'importer/import/1-1': Placeholder('publish'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('publish'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/upload/1-1', 341s ], 341s # reuse: 341s False, 341s ), 341s 341s # 7) No import tags or upload tags 341s # - Create import tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo(), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/changelog', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'add_commits': [ 341s Commit.from_spec( 341s name='publish', 341s message='Test commit (new)', 341s ), 341s ], 341s 'update_tags': { 341s 'importer/import/1-1': Placeholder('publish'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('publish'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1' 341s ], 341s # reuse: 341s False, 341s ), 341s ] 341s ) 341s @patch('gitubuntu.importer.get_import_tag_msg') 341s @patch('gitubuntu.importer.get_import_commit_msg') 341s def test_import_unapplied_spi_tags( 341s get_import_commit_msg_mock, 341s get_import_tag_msg_mock, 341s repo, 341s input_repo, 341s expected_output_refs, 341s validation_repo_delta, 341s validation_repo_expected_identical_refs, 341s reuse, 341s ): 341s """Test that unapplied tags are correctly created, adjusted and/or reused 341s 341s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 341s that determines the commit message to use for a given import 341s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 341s that determines the tag message to use for a given import 341s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 341s temporary output repository 341s :param repo_builder.Repo input_repo: input repository data 341s :param list(str) expected_output_refs: refs that must exist in the output 341s repository 341s :param dict validation_repo_delta: how to transform the input 341s repository into a "validation repository", expressed as a dict to 341s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 341s input repository. The validation repository is then used for the 341s purposes of comparison against the output repository. 341s :param list(str) validation_repo_expected_identical_refs: refs that must be 341s identical between the validation repository and the output repository 341s :param bool reuse: if set, the output ref importer/ubuntu/trusty must be 341s one supplied by the input repository (assumed to have a commit message 341s of "Test commit") and not one created by the importer in this run 341s (arranged by this test to have a different commit message) 341s 341s The input repository data is written into the output repository and then a 341s fake non-native source package publication of version 1-1 in the Trusty 341s release pocket is imported into it by calling import_unapplied_spi() 341s directly. expected_output_refs, validation_repo_expected_identical_refs and 341s reuse are then asserted. It is further asserted that no other refs exist in 341s the output repository except for those listed in expected_output_refs and 341s validation_repo_expected_identical_refs. 341s """ 341s # Match the repo_builder objects 341s get_import_tag_msg_mock.return_value = 'Test tag' 341s # Importantly, the following commit message must not be the same as the 341s # commit messages used by the test input repository commits, so that we can 341s # later detect the difference between commits that were already there and 341s # new commits created by the importer for the purposes of asserting the 341s # reuse parameter correctly. 341s get_import_commit_msg_mock.return_value = b'Test commit (new)' 341s 341s > input_repo.write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_tag_test.py:463: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmpxpxwxt8y/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s _ test_import_unapplied_spi_tags[input_repo2-expected_output_refs2-validation_repo_delta2-validation_repo_expected_identical_refs2-True] _ 341s 341s get_import_commit_msg_mock = 341s get_import_tag_msg_mock = 341s repo = 341s input_repo = 341s 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'] 341s validation_repo_delta = {'update_branches': {'importer/ubuntu/trusty': }, 'update...t at 0xeb3a4aad1e80>, 'importer/reimport/import/1-1/1': }} 341s 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'] 341s reuse = True 341s 341s @pytest.mark.parametrize( 341s [ 341s 'input_repo', 341s 'expected_output_refs', 341s 'validation_repo_delta', 341s 'validation_repo_expected_identical_refs', 341s 'reuse', 341s ], 341s [ 341s # 1) An existing import tag (or reimport tag) with the same Git tree 341s # - Reuse import tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[Commit.from_spec(name='import')], 341s branches={ 341s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 341s }, 341s tags={'importer/import/1-1': Placeholder('import')}, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s ], 341s # validation_repo_delta: 341s { 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('import'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty-proposed', 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s ], 341s # reuse: 341s True, 341s ), 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec( 341s name='import', 341s mutate='import tag contents', 341s ), 341s Commit.from_spec(name='reimport'), 341s ], 341s branches={ 341s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 341s }, 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 341s }, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s ], 341s # validation_repo_delta: 341s { 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('reimport'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty-proposed', 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s # reuse: 341s True, 341s ), 341s 341s # 2) An existing import tag with a different Git tree and an existing 341s # upload tag with the same Git tree 341s # - Reuse upload tag, create reimport tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec( 341s name='import', 341s mutate='The import tag contents', 341s ), 341s Commit.from_spec(name='upload'), 341s ], 341s branches={ 341s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 341s }, 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/upload/1-1': Placeholder('upload'), 341s }, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'update_tags': { 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('upload'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('upload'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty-proposed', 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/upload/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s # reuse: 341s True, 341s ), 341s 341s # 3) An existing import tag with a different Git tree and an existing 341s # upload tag with a different Git tree 341s # - Create reimport tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec( 341s name='import', 341s mutate='The import tag contents', 341s ), 341s Commit.from_spec( 341s name='upload', 341s mutate='The upload tag contents', 341s ), 341s ], 341s branches={ 341s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 341s }, 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/upload/1-1': Placeholder('upload'), 341s }, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/changelog', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'add_commits': [Commit.from_spec( 341s name='reimport', 341s message='Test commit (new)', 341s )], 341s 'update_tags': { 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('reimport'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty-proposed', 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/upload/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s # reuse: 341s False, 341s ), 341s 341s # 4) An existing import tag with a different Git tree and no upload tag 341s # - Create reimport tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec( 341s name='import', 341s mutate='The import tag contents', 341s ), 341s ], 341s branches={ 341s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 341s }, 341s tags={'importer/import/1-1': Placeholder('import')}, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/changelog', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'add_commits': [Commit.from_spec( 341s name='reimport', 341s message='Test commit (new)', 341s )], 341s 'update_tags': { 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('reimport'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty-proposed', 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s # reuse: 341s False, 341s ), 341s 341s # 5) No import tag and an existing upload tag with the same Git tree 341s # - Reuse upload tag, create import tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[Commit.from_spec(name='upload')], 341s tags={'importer/upload/1-1': Placeholder('upload')}, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'update_tags': { 341s 'importer/import/1-1': Placeholder('upload'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('upload'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/upload/1-1', 341s ], 341s # reuse: 341s True, 341s ), 341s 341s # 6) No import tag and an existing upload tag with a different Git tree 341s # - Create import tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec( 341s name='upload', 341s mutate='The upload tag contents', 341s ), 341s ], 341s tags={'importer/upload/1-1': Placeholder('upload')}, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/changelog', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'add_commits': [ 341s Commit.from_spec( 341s name='publish', 341s message='Test commit (new)', 341s ), 341s ], 341s 'update_tags': { 341s 'importer/import/1-1': Placeholder('publish'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('publish'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/upload/1-1', 341s ], 341s # reuse: 341s False, 341s ), 341s 341s # 7) No import tags or upload tags 341s # - Create import tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo(), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/changelog', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'add_commits': [ 341s Commit.from_spec( 341s name='publish', 341s message='Test commit (new)', 341s ), 341s ], 341s 'update_tags': { 341s 'importer/import/1-1': Placeholder('publish'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('publish'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1' 341s ], 341s # reuse: 341s False, 341s ), 341s ] 341s ) 341s @patch('gitubuntu.importer.get_import_tag_msg') 341s @patch('gitubuntu.importer.get_import_commit_msg') 341s def test_import_unapplied_spi_tags( 341s get_import_commit_msg_mock, 341s get_import_tag_msg_mock, 341s repo, 341s input_repo, 341s expected_output_refs, 341s validation_repo_delta, 341s validation_repo_expected_identical_refs, 341s reuse, 341s ): 341s """Test that unapplied tags are correctly created, adjusted and/or reused 341s 341s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 341s that determines the commit message to use for a given import 341s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 341s that determines the tag message to use for a given import 341s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 341s temporary output repository 341s :param repo_builder.Repo input_repo: input repository data 341s :param list(str) expected_output_refs: refs that must exist in the output 341s repository 341s :param dict validation_repo_delta: how to transform the input 341s repository into a "validation repository", expressed as a dict to 341s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 341s input repository. The validation repository is then used for the 341s purposes of comparison against the output repository. 341s :param list(str) validation_repo_expected_identical_refs: refs that must be 341s identical between the validation repository and the output repository 341s :param bool reuse: if set, the output ref importer/ubuntu/trusty must be 341s one supplied by the input repository (assumed to have a commit message 341s of "Test commit") and not one created by the importer in this run 341s (arranged by this test to have a different commit message) 341s 341s The input repository data is written into the output repository and then a 341s fake non-native source package publication of version 1-1 in the Trusty 341s release pocket is imported into it by calling import_unapplied_spi() 341s directly. expected_output_refs, validation_repo_expected_identical_refs and 341s reuse are then asserted. It is further asserted that no other refs exist in 341s the output repository except for those listed in expected_output_refs and 341s validation_repo_expected_identical_refs. 341s """ 341s # Match the repo_builder objects 341s get_import_tag_msg_mock.return_value = 'Test tag' 341s # Importantly, the following commit message must not be the same as the 341s # commit messages used by the test input repository commits, so that we can 341s # later detect the difference between commits that were already there and 341s # new commits created by the importer for the purposes of asserting the 341s # reuse parameter correctly. 341s get_import_commit_msg_mock.return_value = b'Test commit (new)' 341s 341s > input_repo.write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_tag_test.py:463: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmpouwrphek/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s _ test_import_unapplied_spi_tags[input_repo3-expected_output_refs3-validation_repo_delta3-validation_repo_expected_identical_refs3-False] _ 341s 341s get_import_commit_msg_mock = 341s get_import_tag_msg_mock = 341s repo = 341s input_repo = 341s 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'] 341s validation_repo_delta = {'add_commits': [], 'update_branches': {'importer/ubuntu/trust...t at 0xeb3a4aad24b0>, 'importer/reimport/import/1-1/1': }} 341s 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'] 341s reuse = False 341s 341s @pytest.mark.parametrize( 341s [ 341s 'input_repo', 341s 'expected_output_refs', 341s 'validation_repo_delta', 341s 'validation_repo_expected_identical_refs', 341s 'reuse', 341s ], 341s [ 341s # 1) An existing import tag (or reimport tag) with the same Git tree 341s # - Reuse import tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[Commit.from_spec(name='import')], 341s branches={ 341s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 341s }, 341s tags={'importer/import/1-1': Placeholder('import')}, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s ], 341s # validation_repo_delta: 341s { 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('import'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty-proposed', 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s ], 341s # reuse: 341s True, 341s ), 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec( 341s name='import', 341s mutate='import tag contents', 341s ), 341s Commit.from_spec(name='reimport'), 341s ], 341s branches={ 341s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 341s }, 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 341s }, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s ], 341s # validation_repo_delta: 341s { 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('reimport'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty-proposed', 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s # reuse: 341s True, 341s ), 341s 341s # 2) An existing import tag with a different Git tree and an existing 341s # upload tag with the same Git tree 341s # - Reuse upload tag, create reimport tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec( 341s name='import', 341s mutate='The import tag contents', 341s ), 341s Commit.from_spec(name='upload'), 341s ], 341s branches={ 341s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 341s }, 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/upload/1-1': Placeholder('upload'), 341s }, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'update_tags': { 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('upload'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('upload'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty-proposed', 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/upload/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s # reuse: 341s True, 341s ), 341s 341s # 3) An existing import tag with a different Git tree and an existing 341s # upload tag with a different Git tree 341s # - Create reimport tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec( 341s name='import', 341s mutate='The import tag contents', 341s ), 341s Commit.from_spec( 341s name='upload', 341s mutate='The upload tag contents', 341s ), 341s ], 341s branches={ 341s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 341s }, 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/upload/1-1': Placeholder('upload'), 341s }, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/changelog', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'add_commits': [Commit.from_spec( 341s name='reimport', 341s message='Test commit (new)', 341s )], 341s 'update_tags': { 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('reimport'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty-proposed', 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/upload/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s # reuse: 341s False, 341s ), 341s 341s # 4) An existing import tag with a different Git tree and no upload tag 341s # - Create reimport tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec( 341s name='import', 341s mutate='The import tag contents', 341s ), 341s ], 341s branches={ 341s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 341s }, 341s tags={'importer/import/1-1': Placeholder('import')}, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/changelog', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'add_commits': [Commit.from_spec( 341s name='reimport', 341s message='Test commit (new)', 341s )], 341s 'update_tags': { 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('reimport'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty-proposed', 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s # reuse: 341s False, 341s ), 341s 341s # 5) No import tag and an existing upload tag with the same Git tree 341s # - Reuse upload tag, create import tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[Commit.from_spec(name='upload')], 341s tags={'importer/upload/1-1': Placeholder('upload')}, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'update_tags': { 341s 'importer/import/1-1': Placeholder('upload'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('upload'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/upload/1-1', 341s ], 341s # reuse: 341s True, 341s ), 341s 341s # 6) No import tag and an existing upload tag with a different Git tree 341s # - Create import tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec( 341s name='upload', 341s mutate='The upload tag contents', 341s ), 341s ], 341s tags={'importer/upload/1-1': Placeholder('upload')}, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/changelog', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'add_commits': [ 341s Commit.from_spec( 341s name='publish', 341s message='Test commit (new)', 341s ), 341s ], 341s 'update_tags': { 341s 'importer/import/1-1': Placeholder('publish'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('publish'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/upload/1-1', 341s ], 341s # reuse: 341s False, 341s ), 341s 341s # 7) No import tags or upload tags 341s # - Create import tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo(), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/changelog', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'add_commits': [ 341s Commit.from_spec( 341s name='publish', 341s message='Test commit (new)', 341s ), 341s ], 341s 'update_tags': { 341s 'importer/import/1-1': Placeholder('publish'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('publish'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1' 341s ], 341s # reuse: 341s False, 341s ), 341s ] 341s ) 341s @patch('gitubuntu.importer.get_import_tag_msg') 341s @patch('gitubuntu.importer.get_import_commit_msg') 341s def test_import_unapplied_spi_tags( 341s get_import_commit_msg_mock, 341s get_import_tag_msg_mock, 341s repo, 341s input_repo, 341s expected_output_refs, 341s validation_repo_delta, 341s validation_repo_expected_identical_refs, 341s reuse, 341s ): 341s """Test that unapplied tags are correctly created, adjusted and/or reused 341s 341s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 341s that determines the commit message to use for a given import 341s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 341s that determines the tag message to use for a given import 341s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 341s temporary output repository 341s :param repo_builder.Repo input_repo: input repository data 341s :param list(str) expected_output_refs: refs that must exist in the output 341s repository 341s :param dict validation_repo_delta: how to transform the input 341s repository into a "validation repository", expressed as a dict to 341s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 341s input repository. The validation repository is then used for the 341s purposes of comparison against the output repository. 341s :param list(str) validation_repo_expected_identical_refs: refs that must be 341s identical between the validation repository and the output repository 341s :param bool reuse: if set, the output ref importer/ubuntu/trusty must be 341s one supplied by the input repository (assumed to have a commit message 341s of "Test commit") and not one created by the importer in this run 341s (arranged by this test to have a different commit message) 341s 341s The input repository data is written into the output repository and then a 341s fake non-native source package publication of version 1-1 in the Trusty 341s release pocket is imported into it by calling import_unapplied_spi() 341s directly. expected_output_refs, validation_repo_expected_identical_refs and 341s reuse are then asserted. It is further asserted that no other refs exist in 341s the output repository except for those listed in expected_output_refs and 341s validation_repo_expected_identical_refs. 341s """ 341s # Match the repo_builder objects 341s get_import_tag_msg_mock.return_value = 'Test tag' 341s # Importantly, the following commit message must not be the same as the 341s # commit messages used by the test input repository commits, so that we can 341s # later detect the difference between commits that were already there and 341s # new commits created by the importer for the purposes of asserting the 341s # reuse parameter correctly. 341s get_import_commit_msg_mock.return_value = b'Test commit (new)' 341s 341s > input_repo.write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_tag_test.py:463: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmpj3tvi497/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s _ test_import_unapplied_spi_tags[input_repo4-expected_output_refs4-validation_repo_delta4-validation_repo_expected_identical_refs4-False] _ 341s 341s get_import_commit_msg_mock = 341s get_import_tag_msg_mock = 341s repo = 341s input_repo = 341s 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'] 341s validation_repo_delta = {'add_commits': [], 'update_branches': {'importer/ubuntu/trust...t at 0xeb3a4aad29f0>, 'importer/reimport/import/1-1/1': }} 341s 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'] 341s reuse = False 341s 341s @pytest.mark.parametrize( 341s [ 341s 'input_repo', 341s 'expected_output_refs', 341s 'validation_repo_delta', 341s 'validation_repo_expected_identical_refs', 341s 'reuse', 341s ], 341s [ 341s # 1) An existing import tag (or reimport tag) with the same Git tree 341s # - Reuse import tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[Commit.from_spec(name='import')], 341s branches={ 341s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 341s }, 341s tags={'importer/import/1-1': Placeholder('import')}, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s ], 341s # validation_repo_delta: 341s { 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('import'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty-proposed', 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s ], 341s # reuse: 341s True, 341s ), 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec( 341s name='import', 341s mutate='import tag contents', 341s ), 341s Commit.from_spec(name='reimport'), 341s ], 341s branches={ 341s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 341s }, 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 341s }, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s ], 341s # validation_repo_delta: 341s { 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('reimport'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty-proposed', 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s # reuse: 341s True, 341s ), 341s 341s # 2) An existing import tag with a different Git tree and an existing 341s # upload tag with the same Git tree 341s # - Reuse upload tag, create reimport tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec( 341s name='import', 341s mutate='The import tag contents', 341s ), 341s Commit.from_spec(name='upload'), 341s ], 341s branches={ 341s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 341s }, 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/upload/1-1': Placeholder('upload'), 341s }, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'update_tags': { 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('upload'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('upload'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty-proposed', 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/upload/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s # reuse: 341s True, 341s ), 341s 341s # 3) An existing import tag with a different Git tree and an existing 341s # upload tag with a different Git tree 341s # - Create reimport tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec( 341s name='import', 341s mutate='The import tag contents', 341s ), 341s Commit.from_spec( 341s name='upload', 341s mutate='The upload tag contents', 341s ), 341s ], 341s branches={ 341s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 341s }, 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/upload/1-1': Placeholder('upload'), 341s }, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/changelog', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'add_commits': [Commit.from_spec( 341s name='reimport', 341s message='Test commit (new)', 341s )], 341s 'update_tags': { 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('reimport'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty-proposed', 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/upload/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s # reuse: 341s False, 341s ), 341s 341s # 4) An existing import tag with a different Git tree and no upload tag 341s # - Create reimport tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec( 341s name='import', 341s mutate='The import tag contents', 341s ), 341s ], 341s branches={ 341s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 341s }, 341s tags={'importer/import/1-1': Placeholder('import')}, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/changelog', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'add_commits': [Commit.from_spec( 341s name='reimport', 341s message='Test commit (new)', 341s )], 341s 'update_tags': { 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('reimport'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty-proposed', 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s # reuse: 341s False, 341s ), 341s 341s # 5) No import tag and an existing upload tag with the same Git tree 341s # - Reuse upload tag, create import tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[Commit.from_spec(name='upload')], 341s tags={'importer/upload/1-1': Placeholder('upload')}, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'update_tags': { 341s 'importer/import/1-1': Placeholder('upload'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('upload'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/upload/1-1', 341s ], 341s # reuse: 341s True, 341s ), 341s 341s # 6) No import tag and an existing upload tag with a different Git tree 341s # - Create import tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec( 341s name='upload', 341s mutate='The upload tag contents', 341s ), 341s ], 341s tags={'importer/upload/1-1': Placeholder('upload')}, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/changelog', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'add_commits': [ 341s Commit.from_spec( 341s name='publish', 341s message='Test commit (new)', 341s ), 341s ], 341s 'update_tags': { 341s 'importer/import/1-1': Placeholder('publish'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('publish'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/upload/1-1', 341s ], 341s # reuse: 341s False, 341s ), 341s 341s # 7) No import tags or upload tags 341s # - Create import tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo(), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/changelog', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'add_commits': [ 341s Commit.from_spec( 341s name='publish', 341s message='Test commit (new)', 341s ), 341s ], 341s 'update_tags': { 341s 'importer/import/1-1': Placeholder('publish'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('publish'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1' 341s ], 341s # reuse: 341s False, 341s ), 341s ] 341s ) 341s @patch('gitubuntu.importer.get_import_tag_msg') 341s @patch('gitubuntu.importer.get_import_commit_msg') 341s def test_import_unapplied_spi_tags( 341s get_import_commit_msg_mock, 341s get_import_tag_msg_mock, 341s repo, 341s input_repo, 341s expected_output_refs, 341s validation_repo_delta, 341s validation_repo_expected_identical_refs, 341s reuse, 341s ): 341s """Test that unapplied tags are correctly created, adjusted and/or reused 341s 341s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 341s that determines the commit message to use for a given import 341s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 341s that determines the tag message to use for a given import 341s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 341s temporary output repository 341s :param repo_builder.Repo input_repo: input repository data 341s :param list(str) expected_output_refs: refs that must exist in the output 341s repository 341s :param dict validation_repo_delta: how to transform the input 341s repository into a "validation repository", expressed as a dict to 341s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 341s input repository. The validation repository is then used for the 341s purposes of comparison against the output repository. 341s :param list(str) validation_repo_expected_identical_refs: refs that must be 341s identical between the validation repository and the output repository 341s :param bool reuse: if set, the output ref importer/ubuntu/trusty must be 341s one supplied by the input repository (assumed to have a commit message 341s of "Test commit") and not one created by the importer in this run 341s (arranged by this test to have a different commit message) 341s 341s The input repository data is written into the output repository and then a 341s fake non-native source package publication of version 1-1 in the Trusty 341s release pocket is imported into it by calling import_unapplied_spi() 341s directly. expected_output_refs, validation_repo_expected_identical_refs and 341s reuse are then asserted. It is further asserted that no other refs exist in 341s the output repository except for those listed in expected_output_refs and 341s validation_repo_expected_identical_refs. 341s """ 341s # Match the repo_builder objects 341s get_import_tag_msg_mock.return_value = 'Test tag' 341s # Importantly, the following commit message must not be the same as the 341s # commit messages used by the test input repository commits, so that we can 341s # later detect the difference between commits that were already there and 341s # new commits created by the importer for the purposes of asserting the 341s # reuse parameter correctly. 341s get_import_commit_msg_mock.return_value = b'Test commit (new)' 341s 341s > input_repo.write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_tag_test.py:463: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmpc7kyodza/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s _ test_import_unapplied_spi_tags[input_repo5-expected_output_refs5-validation_repo_delta5-validation_repo_expected_identical_refs5-True] _ 341s 341s get_import_commit_msg_mock = 341s get_import_tag_msg_mock = 341s repo = 341s input_repo = 341s 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'] 341s validation_repo_delta = {'update_branches': {'importer/ubuntu/trusty': }, 'update_tags': {'importer/import/1-1': }} 341s validation_repo_expected_identical_refs = ['refs/heads/importer/ubuntu/trusty', 'refs/tags/importer/import/1-1', 'refs/tags/importer/upload/1-1'] 341s reuse = True 341s 341s @pytest.mark.parametrize( 341s [ 341s 'input_repo', 341s 'expected_output_refs', 341s 'validation_repo_delta', 341s 'validation_repo_expected_identical_refs', 341s 'reuse', 341s ], 341s [ 341s # 1) An existing import tag (or reimport tag) with the same Git tree 341s # - Reuse import tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[Commit.from_spec(name='import')], 341s branches={ 341s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 341s }, 341s tags={'importer/import/1-1': Placeholder('import')}, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s ], 341s # validation_repo_delta: 341s { 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('import'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty-proposed', 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s ], 341s # reuse: 341s True, 341s ), 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec( 341s name='import', 341s mutate='import tag contents', 341s ), 341s Commit.from_spec(name='reimport'), 341s ], 341s branches={ 341s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 341s }, 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 341s }, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s ], 341s # validation_repo_delta: 341s { 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('reimport'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty-proposed', 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s # reuse: 341s True, 341s ), 341s 341s # 2) An existing import tag with a different Git tree and an existing 341s # upload tag with the same Git tree 341s # - Reuse upload tag, create reimport tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec( 341s name='import', 341s mutate='The import tag contents', 341s ), 341s Commit.from_spec(name='upload'), 341s ], 341s branches={ 341s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 341s }, 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/upload/1-1': Placeholder('upload'), 341s }, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'update_tags': { 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('upload'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('upload'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty-proposed', 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/upload/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s # reuse: 341s True, 341s ), 341s 341s # 3) An existing import tag with a different Git tree and an existing 341s # upload tag with a different Git tree 341s # - Create reimport tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec( 341s name='import', 341s mutate='The import tag contents', 341s ), 341s Commit.from_spec( 341s name='upload', 341s mutate='The upload tag contents', 341s ), 341s ], 341s branches={ 341s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 341s }, 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/upload/1-1': Placeholder('upload'), 341s }, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/changelog', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'add_commits': [Commit.from_spec( 341s name='reimport', 341s message='Test commit (new)', 341s )], 341s 'update_tags': { 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('reimport'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty-proposed', 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/upload/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s # reuse: 341s False, 341s ), 341s 341s # 4) An existing import tag with a different Git tree and no upload tag 341s # - Create reimport tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec( 341s name='import', 341s mutate='The import tag contents', 341s ), 341s ], 341s branches={ 341s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 341s }, 341s tags={'importer/import/1-1': Placeholder('import')}, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/changelog', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'add_commits': [Commit.from_spec( 341s name='reimport', 341s message='Test commit (new)', 341s )], 341s 'update_tags': { 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('reimport'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty-proposed', 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s # reuse: 341s False, 341s ), 341s 341s # 5) No import tag and an existing upload tag with the same Git tree 341s # - Reuse upload tag, create import tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[Commit.from_spec(name='upload')], 341s tags={'importer/upload/1-1': Placeholder('upload')}, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'update_tags': { 341s 'importer/import/1-1': Placeholder('upload'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('upload'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/upload/1-1', 341s ], 341s # reuse: 341s True, 341s ), 341s 341s # 6) No import tag and an existing upload tag with a different Git tree 341s # - Create import tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec( 341s name='upload', 341s mutate='The upload tag contents', 341s ), 341s ], 341s tags={'importer/upload/1-1': Placeholder('upload')}, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/changelog', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'add_commits': [ 341s Commit.from_spec( 341s name='publish', 341s message='Test commit (new)', 341s ), 341s ], 341s 'update_tags': { 341s 'importer/import/1-1': Placeholder('publish'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('publish'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/upload/1-1', 341s ], 341s # reuse: 341s False, 341s ), 341s 341s # 7) No import tags or upload tags 341s # - Create import tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo(), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/changelog', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'add_commits': [ 341s Commit.from_spec( 341s name='publish', 341s message='Test commit (new)', 341s ), 341s ], 341s 'update_tags': { 341s 'importer/import/1-1': Placeholder('publish'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('publish'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1' 341s ], 341s # reuse: 341s False, 341s ), 341s ] 341s ) 341s @patch('gitubuntu.importer.get_import_tag_msg') 341s @patch('gitubuntu.importer.get_import_commit_msg') 341s def test_import_unapplied_spi_tags( 341s get_import_commit_msg_mock, 341s get_import_tag_msg_mock, 341s repo, 341s input_repo, 341s expected_output_refs, 341s validation_repo_delta, 341s validation_repo_expected_identical_refs, 341s reuse, 341s ): 341s """Test that unapplied tags are correctly created, adjusted and/or reused 341s 341s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 341s that determines the commit message to use for a given import 341s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 341s that determines the tag message to use for a given import 341s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 341s temporary output repository 341s :param repo_builder.Repo input_repo: input repository data 341s :param list(str) expected_output_refs: refs that must exist in the output 341s repository 341s :param dict validation_repo_delta: how to transform the input 341s repository into a "validation repository", expressed as a dict to 341s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 341s input repository. The validation repository is then used for the 341s purposes of comparison against the output repository. 341s :param list(str) validation_repo_expected_identical_refs: refs that must be 341s identical between the validation repository and the output repository 341s :param bool reuse: if set, the output ref importer/ubuntu/trusty must be 341s one supplied by the input repository (assumed to have a commit message 341s of "Test commit") and not one created by the importer in this run 341s (arranged by this test to have a different commit message) 341s 341s The input repository data is written into the output repository and then a 341s fake non-native source package publication of version 1-1 in the Trusty 341s release pocket is imported into it by calling import_unapplied_spi() 341s directly. expected_output_refs, validation_repo_expected_identical_refs and 341s reuse are then asserted. It is further asserted that no other refs exist in 341s the output repository except for those listed in expected_output_refs and 341s validation_repo_expected_identical_refs. 341s """ 341s # Match the repo_builder objects 341s get_import_tag_msg_mock.return_value = 'Test tag' 341s # Importantly, the following commit message must not be the same as the 341s # commit messages used by the test input repository commits, so that we can 341s # later detect the difference between commits that were already there and 341s # new commits created by the importer for the purposes of asserting the 341s # reuse parameter correctly. 341s get_import_commit_msg_mock.return_value = b'Test commit (new)' 341s 341s > input_repo.write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_tag_test.py:463: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmp8w4_8zd4/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s _ test_import_unapplied_spi_tags[input_repo6-expected_output_refs6-validation_repo_delta6-validation_repo_expected_identical_refs6-False] _ 341s 341s get_import_commit_msg_mock = 341s get_import_tag_msg_mock = 341s repo = 341s input_repo = 341s 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'] 341s validation_repo_delta = {'add_commits': [], 'update_branches': {'importer/ubuntu/trust...xeb3a4aad3230>}, 'update_tags': {'importer/import/1-1': }} 341s validation_repo_expected_identical_refs = ['refs/heads/importer/ubuntu/trusty', 'refs/tags/importer/import/1-1', 'refs/tags/importer/upload/1-1'] 341s reuse = False 341s 341s @pytest.mark.parametrize( 341s [ 341s 'input_repo', 341s 'expected_output_refs', 341s 'validation_repo_delta', 341s 'validation_repo_expected_identical_refs', 341s 'reuse', 341s ], 341s [ 341s # 1) An existing import tag (or reimport tag) with the same Git tree 341s # - Reuse import tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[Commit.from_spec(name='import')], 341s branches={ 341s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 341s }, 341s tags={'importer/import/1-1': Placeholder('import')}, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s ], 341s # validation_repo_delta: 341s { 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('import'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty-proposed', 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s ], 341s # reuse: 341s True, 341s ), 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec( 341s name='import', 341s mutate='import tag contents', 341s ), 341s Commit.from_spec(name='reimport'), 341s ], 341s branches={ 341s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 341s }, 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 341s }, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s ], 341s # validation_repo_delta: 341s { 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('reimport'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty-proposed', 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s # reuse: 341s True, 341s ), 341s 341s # 2) An existing import tag with a different Git tree and an existing 341s # upload tag with the same Git tree 341s # - Reuse upload tag, create reimport tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec( 341s name='import', 341s mutate='The import tag contents', 341s ), 341s Commit.from_spec(name='upload'), 341s ], 341s branches={ 341s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 341s }, 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/upload/1-1': Placeholder('upload'), 341s }, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'update_tags': { 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('upload'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('upload'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty-proposed', 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/upload/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s # reuse: 341s True, 341s ), 341s 341s # 3) An existing import tag with a different Git tree and an existing 341s # upload tag with a different Git tree 341s # - Create reimport tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec( 341s name='import', 341s mutate='The import tag contents', 341s ), 341s Commit.from_spec( 341s name='upload', 341s mutate='The upload tag contents', 341s ), 341s ], 341s branches={ 341s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 341s }, 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/upload/1-1': Placeholder('upload'), 341s }, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/changelog', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'add_commits': [Commit.from_spec( 341s name='reimport', 341s message='Test commit (new)', 341s )], 341s 'update_tags': { 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('reimport'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty-proposed', 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/upload/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s # reuse: 341s False, 341s ), 341s 341s # 4) An existing import tag with a different Git tree and no upload tag 341s # - Create reimport tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec( 341s name='import', 341s mutate='The import tag contents', 341s ), 341s ], 341s branches={ 341s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 341s }, 341s tags={'importer/import/1-1': Placeholder('import')}, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/changelog', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'add_commits': [Commit.from_spec( 341s name='reimport', 341s message='Test commit (new)', 341s )], 341s 'update_tags': { 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('reimport'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty-proposed', 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s # reuse: 341s False, 341s ), 341s 341s # 5) No import tag and an existing upload tag with the same Git tree 341s # - Reuse upload tag, create import tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[Commit.from_spec(name='upload')], 341s tags={'importer/upload/1-1': Placeholder('upload')}, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'update_tags': { 341s 'importer/import/1-1': Placeholder('upload'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('upload'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/upload/1-1', 341s ], 341s # reuse: 341s True, 341s ), 341s 341s # 6) No import tag and an existing upload tag with a different Git tree 341s # - Create import tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec( 341s name='upload', 341s mutate='The upload tag contents', 341s ), 341s ], 341s tags={'importer/upload/1-1': Placeholder('upload')}, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/changelog', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'add_commits': [ 341s Commit.from_spec( 341s name='publish', 341s message='Test commit (new)', 341s ), 341s ], 341s 'update_tags': { 341s 'importer/import/1-1': Placeholder('publish'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('publish'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/upload/1-1', 341s ], 341s # reuse: 341s False, 341s ), 341s 341s # 7) No import tags or upload tags 341s # - Create import tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo(), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/changelog', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'add_commits': [ 341s Commit.from_spec( 341s name='publish', 341s message='Test commit (new)', 341s ), 341s ], 341s 'update_tags': { 341s 'importer/import/1-1': Placeholder('publish'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('publish'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1' 341s ], 341s # reuse: 341s False, 341s ), 341s ] 341s ) 341s @patch('gitubuntu.importer.get_import_tag_msg') 341s @patch('gitubuntu.importer.get_import_commit_msg') 341s def test_import_unapplied_spi_tags( 341s get_import_commit_msg_mock, 341s get_import_tag_msg_mock, 341s repo, 341s input_repo, 341s expected_output_refs, 341s validation_repo_delta, 341s validation_repo_expected_identical_refs, 341s reuse, 341s ): 341s """Test that unapplied tags are correctly created, adjusted and/or reused 341s 341s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 341s that determines the commit message to use for a given import 341s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 341s that determines the tag message to use for a given import 341s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 341s temporary output repository 341s :param repo_builder.Repo input_repo: input repository data 341s :param list(str) expected_output_refs: refs that must exist in the output 341s repository 341s :param dict validation_repo_delta: how to transform the input 341s repository into a "validation repository", expressed as a dict to 341s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 341s input repository. The validation repository is then used for the 341s purposes of comparison against the output repository. 341s :param list(str) validation_repo_expected_identical_refs: refs that must be 341s identical between the validation repository and the output repository 341s :param bool reuse: if set, the output ref importer/ubuntu/trusty must be 341s one supplied by the input repository (assumed to have a commit message 341s of "Test commit") and not one created by the importer in this run 341s (arranged by this test to have a different commit message) 341s 341s The input repository data is written into the output repository and then a 341s fake non-native source package publication of version 1-1 in the Trusty 341s release pocket is imported into it by calling import_unapplied_spi() 341s directly. expected_output_refs, validation_repo_expected_identical_refs and 341s reuse are then asserted. It is further asserted that no other refs exist in 341s the output repository except for those listed in expected_output_refs and 341s validation_repo_expected_identical_refs. 341s """ 341s # Match the repo_builder objects 341s get_import_tag_msg_mock.return_value = 'Test tag' 341s # Importantly, the following commit message must not be the same as the 341s # commit messages used by the test input repository commits, so that we can 341s # later detect the difference between commits that were already there and 341s # new commits created by the importer for the purposes of asserting the 341s # reuse parameter correctly. 341s get_import_commit_msg_mock.return_value = b'Test commit (new)' 341s 341s > input_repo.write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_tag_test.py:463: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmp5l_mpdx9/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s _ test_import_unapplied_spi_tags[input_repo7-expected_output_refs7-validation_repo_delta7-validation_repo_expected_identical_refs7-False] _ 341s 341s get_import_commit_msg_mock = 341s get_import_tag_msg_mock = 341s repo = 341s input_repo = 341s 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'] 341s validation_repo_delta = {'add_commits': [], 'update_branches': {'importer/ubuntu/trust...xeb3a4aad34d0>}, 'update_tags': {'importer/import/1-1': }} 341s validation_repo_expected_identical_refs = ['refs/heads/importer/ubuntu/trusty', 'refs/tags/importer/import/1-1'] 341s reuse = False 341s 341s @pytest.mark.parametrize( 341s [ 341s 'input_repo', 341s 'expected_output_refs', 341s 'validation_repo_delta', 341s 'validation_repo_expected_identical_refs', 341s 'reuse', 341s ], 341s [ 341s # 1) An existing import tag (or reimport tag) with the same Git tree 341s # - Reuse import tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[Commit.from_spec(name='import')], 341s branches={ 341s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 341s }, 341s tags={'importer/import/1-1': Placeholder('import')}, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s ], 341s # validation_repo_delta: 341s { 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('import'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty-proposed', 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s ], 341s # reuse: 341s True, 341s ), 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec( 341s name='import', 341s mutate='import tag contents', 341s ), 341s Commit.from_spec(name='reimport'), 341s ], 341s branches={ 341s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 341s }, 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 341s }, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s ], 341s # validation_repo_delta: 341s { 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('reimport'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty-proposed', 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s # reuse: 341s True, 341s ), 341s 341s # 2) An existing import tag with a different Git tree and an existing 341s # upload tag with the same Git tree 341s # - Reuse upload tag, create reimport tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec( 341s name='import', 341s mutate='The import tag contents', 341s ), 341s Commit.from_spec(name='upload'), 341s ], 341s branches={ 341s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 341s }, 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/upload/1-1': Placeholder('upload'), 341s }, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'update_tags': { 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('upload'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('upload'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty-proposed', 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/upload/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s # reuse: 341s True, 341s ), 341s 341s # 3) An existing import tag with a different Git tree and an existing 341s # upload tag with a different Git tree 341s # - Create reimport tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec( 341s name='import', 341s mutate='The import tag contents', 341s ), 341s Commit.from_spec( 341s name='upload', 341s mutate='The upload tag contents', 341s ), 341s ], 341s branches={ 341s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 341s }, 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/upload/1-1': Placeholder('upload'), 341s }, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/changelog', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'add_commits': [Commit.from_spec( 341s name='reimport', 341s message='Test commit (new)', 341s )], 341s 'update_tags': { 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('reimport'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty-proposed', 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/upload/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s # reuse: 341s False, 341s ), 341s 341s # 4) An existing import tag with a different Git tree and no upload tag 341s # - Create reimport tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec( 341s name='import', 341s mutate='The import tag contents', 341s ), 341s ], 341s branches={ 341s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 341s }, 341s tags={'importer/import/1-1': Placeholder('import')}, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/changelog', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'add_commits': [Commit.from_spec( 341s name='reimport', 341s message='Test commit (new)', 341s )], 341s 'update_tags': { 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('reimport'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty-proposed', 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s # reuse: 341s False, 341s ), 341s 341s # 5) No import tag and an existing upload tag with the same Git tree 341s # - Reuse upload tag, create import tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[Commit.from_spec(name='upload')], 341s tags={'importer/upload/1-1': Placeholder('upload')}, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'update_tags': { 341s 'importer/import/1-1': Placeholder('upload'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('upload'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/upload/1-1', 341s ], 341s # reuse: 341s True, 341s ), 341s 341s # 6) No import tag and an existing upload tag with a different Git tree 341s # - Create import tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec( 341s name='upload', 341s mutate='The upload tag contents', 341s ), 341s ], 341s tags={'importer/upload/1-1': Placeholder('upload')}, 341s ), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/changelog', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'add_commits': [ 341s Commit.from_spec( 341s name='publish', 341s message='Test commit (new)', 341s ), 341s ], 341s 'update_tags': { 341s 'importer/import/1-1': Placeholder('publish'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('publish'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/upload/1-1', 341s ], 341s # reuse: 341s False, 341s ), 341s 341s # 7) No import tags or upload tags 341s # - Create import tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo(), 341s # expected_output_refs: 341s [ 341s 'refs/heads/do-not-push', 341s 'refs/tags/importer/upstream/ubuntu/1.gz', 341s 'refs/heads/importer/importer/ubuntu/dsc', 341s 'refs/heads/importer/importer/ubuntu/pristine-tar', 341s 'refs/notes/importer/changelog', 341s 'refs/notes/importer/importer', 341s ], 341s # validation_repo_delta: 341s { 341s 'add_commits': [ 341s Commit.from_spec( 341s name='publish', 341s message='Test commit (new)', 341s ), 341s ], 341s 'update_tags': { 341s 'importer/import/1-1': Placeholder('publish'), 341s }, 341s 'update_branches': { 341s 'importer/ubuntu/trusty': Placeholder('publish'), 341s }, 341s }, 341s # validation_repo_expected_identical_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1' 341s ], 341s # reuse: 341s False, 341s ), 341s ] 341s ) 341s @patch('gitubuntu.importer.get_import_tag_msg') 341s @patch('gitubuntu.importer.get_import_commit_msg') 341s def test_import_unapplied_spi_tags( 341s get_import_commit_msg_mock, 341s get_import_tag_msg_mock, 341s repo, 341s input_repo, 341s expected_output_refs, 341s validation_repo_delta, 341s validation_repo_expected_identical_refs, 341s reuse, 341s ): 341s """Test that unapplied tags are correctly created, adjusted and/or reused 341s 341s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 341s that determines the commit message to use for a given import 341s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 341s that determines the tag message to use for a given import 341s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 341s temporary output repository 341s :param repo_builder.Repo input_repo: input repository data 341s :param list(str) expected_output_refs: refs that must exist in the output 341s repository 341s :param dict validation_repo_delta: how to transform the input 341s repository into a "validation repository", expressed as a dict to 341s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 341s input repository. The validation repository is then used for the 341s purposes of comparison against the output repository. 341s :param list(str) validation_repo_expected_identical_refs: refs that must be 341s identical between the validation repository and the output repository 341s :param bool reuse: if set, the output ref importer/ubuntu/trusty must be 341s one supplied by the input repository (assumed to have a commit message 341s of "Test commit") and not one created by the importer in this run 341s (arranged by this test to have a different commit message) 341s 341s The input repository data is written into the output repository and then a 341s fake non-native source package publication of version 1-1 in the Trusty 341s release pocket is imported into it by calling import_unapplied_spi() 341s directly. expected_output_refs, validation_repo_expected_identical_refs and 341s reuse are then asserted. It is further asserted that no other refs exist in 341s the output repository except for those listed in expected_output_refs and 341s validation_repo_expected_identical_refs. 341s """ 341s # Match the repo_builder objects 341s get_import_tag_msg_mock.return_value = 'Test tag' 341s # Importantly, the following commit message must not be the same as the 341s # commit messages used by the test input repository commits, so that we can 341s # later detect the difference between commits that were already there and 341s # new commits created by the importer for the purposes of asserting the 341s # reuse parameter correctly. 341s get_import_commit_msg_mock.return_value = b'Test commit (new)' 341s 341s input_repo.write(repo.raw_repo) 341s 341s publish_spec = source_builder.SourceSpec( 341s version='1-1', 341s native=False, 341s ) 341s 341s with source_builder.Source(publish_spec) as dsc_path: 341s > target.import_unapplied_spi( 341s repo=repo, 341s spi=MockSPI(dsc_path, publish_spec.version), 341s namespace='importer', 341s skip_orig=False, 341s parent_overrides={}, 341s ) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_tag_test.py:471: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer.py:2308: in import_unapplied_spi 341s import_unapplied_dsc( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer.py:2230: in import_unapplied_dsc 341s commit, tag = find_or_create_unapplied_commit( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer.py:2052: in find_or_create_unapplied_commit 341s changelog_parents = get_unapplied_import_parents( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer.py:1503: in get_unapplied_import_parents 341s import_tree_versions = repo.get_all_changelog_versions_from_treeish( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:2230: in get_all_changelog_versions_from_treeish 341s changelog = self.get_changelog_from_treeish(treeish) 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 341s return Changelog.from_treeish( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:569: in from_treeish 341s blob = follow_symlinks_to_blob( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 341s return _follow_symlinks_to_blob( 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s repo = pygit2.Repository('/tmp/tmp1_bw2d2l/.git/') 341s top_tree_object = 341s search_path = 'debian/changelog' 341s _rel_tree = 341s _rel_path = '' 341s 341s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 341s _rel_tree=None, _rel_path='' 341s ): 341s '''Recursively follow a path down a tree, following symlinks, to find blob 341s 341s repo: pygit2.Repository object 341s top_tree: pygit2.Tree object of the top of the tree structure 341s search_path: '/'-separated path string of blob to find 341s _rel_tree: (internal) which tree to look further into 341s _rel_path: (internal) the path we are in so far 341s ''' 341s 341s NORMAL_BLOB_MODES = set([ 341s pygit2.GIT_FILEMODE_BLOB, 341s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 341s ]) 341s 341s _rel_tree = _rel_tree or top_tree_object 341s head, tail = posixpath.split(search_path) 341s 341s # A traditional functional split would put a single entry in head with tail 341s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 341s # to make it appear to have traditional semantics. 341s if not head: 341s head = tail 341s tail = None 341s 341s entry = _rel_tree[head] 341s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:68: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s _ test_import_applied_spi_tags[input_repo0-validation_repo_delta0-validation_repo_expected_treewise_refs0-True] _ 341s 341s get_import_commit_msg_mock = 341s get_import_tag_msg_mock = 341s repo = 341s input_repo = 341s validation_repo_delta = {} 341s 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'] 341s reuse = True 341s 341s @pytest.mark.parametrize( 341s [ 341s 'input_repo', 341s 'validation_repo_delta', 341s 'validation_repo_expected_treewise_refs', 341s 'reuse', 341s ], 341s [ 341s # 1) An existing applied tag (or reimport tag) with the same Git tree 341s # - Reuse applied tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec(name='unapplied', has_patches=True), 341s Commit.from_spec(name='applied', patches_applied=True), 341s ], 341s branches={ 341s 'importer/ubuntu/trusty': Placeholder('unapplied'), 341s 'importer/applied/ubuntu/trusty': Placeholder('applied'), 341s }, 341s tags={ 341s 'importer/import/1-1': Placeholder('unapplied'), 341s 'importer/applied/1-1': Placeholder('applied'), 341s }, 341s ), 341s # validation_repo_delta: 341s { 341s # no output repository delta 341s }, 341s # validation_repo_expected_treewise_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/heads/importer/applied/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/applied/1-1', 341s ], 341s # reuse: 341s True, 341s ), 341s 341s # 2) An existing applied tag with a different Git tree 341s # - Create reimport tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec( 341s name='unapplied', 341s has_patches=True, 341s mutate='import tag contents', 341s ), 341s Commit.from_spec( 341s name='unapplied_reimport', 341s has_patches=True, 341s ), 341s Commit.from_spec( 341s name='applied', 341s patches_applied=True, 341s mutate='import tag contents', 341s ) 341s ], 341s branches={'importer/ubuntu/trusty': Placeholder('unapplied')}, 341s tags={ 341s 'importer/import/1-1': 341s Placeholder('unapplied'), 341s 'importer/reimport/import/1-1/0': 341s Placeholder('unapplied'), 341s 'importer/reimport/import/1-1/1': 341s Placeholder('unapplied_reimport'), 341s 'importer/applied/1-1': 341s Placeholder('applied'), 341s }, 341s ), 341s # validation_repo_delta: 341s { 341s 'add_commits': [ 341s Commit.from_spec( 341s name='applied_reimport', 341s patches_applied=True, 341s parents=[Placeholder('unapplied_reimport')], 341s ), 341s ], 341s 'update_tags': { 341s 'importer/reimport/applied/1-1/0': 341s Placeholder('applied'), 341s 'importer/reimport/applied/1-1/1': 341s Placeholder('applied_reimport'), 341s }, 341s 'update_branches': { 341s 'importer/applied/ubuntu/trusty': 341s Placeholder('applied_reimport'), 341s }, 341s }, 341s # validation_repo_expected_treewise_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/heads/importer/applied/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s 'refs/tags/importer/applied/1-1', 341s 'refs/tags/importer/reimport/applied/1-1/0', 341s 'refs/tags/importer/reimport/applied/1-1/1', 341s ], 341s # reuse: 341s False, 341s 341s marks=pytest.mark.xfail(reason='LP: #1755247'), 341s ), 341s 341s # 3) No applied tags 341s # - Create applied tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[Commit.from_spec(name='unapplied', has_patches=True)], 341s branches={'importer/ubuntu/trusty': Placeholder('unapplied')}, 341s tags={'importer/import/1-1': Placeholder('unapplied')}, 341s ), 341s # validation_repo_delta: 341s { 341s 'add_commits': [ 341s Commit.from_spec( 341s name='applied', 341s patches_applied=True, 341s parents=[Placeholder('unapplied')], 341s ), 341s ], 341s 'update_tags': { 341s 'importer/applied/1-1': Placeholder('applied') 341s }, 341s 'update_branches': { 341s 'importer/applied/ubuntu/trusty': Placeholder('applied'), 341s }, 341s }, 341s # validation_repo_expected_treewise_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/heads/importer/applied/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/applied/1-1' 341s ], 341s # reuse: 341s False, 341s ), 341s ] 341s ) 341s @patch('gitubuntu.importer.get_import_tag_msg') 341s @patch('gitubuntu.importer.get_import_commit_msg') 341s def test_import_applied_spi_tags( 341s get_import_commit_msg_mock, 341s get_import_tag_msg_mock, 341s repo, 341s input_repo, 341s validation_repo_delta, 341s validation_repo_expected_treewise_refs, 341s reuse, 341s ): 341s """Test that applied tags are correctly created, adjusted and/or reused 341s 341s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 341s that determines the commit message to use for a given import 341s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 341s that determines the tag message to use for a given import 341s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 341s temporary output repository 341s :param repo_builder.Repo input_repo: input repository data 341s :param dict validation_repo_delta: how to transform the input repository 341s into a "validation repository", expressed as a dict to 341s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 341s input repository. The validation repository is then used for the 341s purposes of comparison against the output repository. 341s :param list(str) validation_repo_expected_treewise_refs: refs whose trees 341s must be identical between the validation repository and the output 341s repository 341s :param bool reuse: if set, the output ref importer/ubuntu/trusty must be 341s one supplied by the input repository (assumed to have a commit message 341s of "Test commit") and not one created by the importer in this run 341s (arranged by this test to have a different commit message) 341s 341s The input repository data is written into the output repository and then a 341s fake non-native source package publication of version 1-1 in the Trusty 341s release pocket is imported into it by calling import_applied_spi() 341s directly. reuse and validation_repo_expected_treewise_refs are then 341s asserted. 341s 341s This is similar to test_unapplied_spi_tags except that it calls 341s import_applied_spi() instead of import_unapplied_spi() and only treewise 341s ref comparisons are made. 341s """ 341s # Match the repo_builder objects 341s get_import_tag_msg_mock.return_value = 'Test tag' 341s # Importantly, the following commit message must not be the same as the 341s # commit messages used by the test input repository commits, so that we can 341s # later detect the difference between commits that were already there and 341s # new commits created by the importer for the purposes of asserting the 341s # reuse parameter correctly. 341s get_import_commit_msg_mock.return_value = b'Test commit (new)' 341s 341s > input_repo.write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_tag_test.py:711: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmptblcg6l0/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: using patch list from debian/patches/series 341s dpkg-source: info: applying a 341s dpkg-source: info: applying b 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: using patch list from debian/patches/series 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: using patch list from debian/patches/series 341s dpkg-source: info: applying a 341s dpkg-source: info: applying b 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: using patch list from debian/patches/series 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: using patch list from debian/patches/series 341s dpkg-source: info: applying a 341s dpkg-source: info: applying b 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: using patch list from debian/patches/series 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: using patch list from debian/patches/series 341s dpkg-source: info: applying a 341s dpkg-source: info: applying b 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: using patch list from debian/patches/series 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: using patch list from debian/patches/series 341s dpkg-source: info: applying a 341s dpkg-source: info: applying b 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: using patch list from debian/patches/series 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s _ test_import_applied_spi_tags[input_repo2-validation_repo_delta2-validation_repo_expected_treewise_refs2-False] _ 341s 341s get_import_commit_msg_mock = 341s get_import_tag_msg_mock = 341s repo = 341s input_repo = 341s validation_repo_delta = {'add_commits': [], 'update_branches': {'importer/applied/ubun...eb3a4aadf8c0>}, 'update_tags': {'importer/applied/1-1': }} 341s 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'] 341s reuse = False 341s 341s @pytest.mark.parametrize( 341s [ 341s 'input_repo', 341s 'validation_repo_delta', 341s 'validation_repo_expected_treewise_refs', 341s 'reuse', 341s ], 341s [ 341s # 1) An existing applied tag (or reimport tag) with the same Git tree 341s # - Reuse applied tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec(name='unapplied', has_patches=True), 341s Commit.from_spec(name='applied', patches_applied=True), 341s ], 341s branches={ 341s 'importer/ubuntu/trusty': Placeholder('unapplied'), 341s 'importer/applied/ubuntu/trusty': Placeholder('applied'), 341s }, 341s tags={ 341s 'importer/import/1-1': Placeholder('unapplied'), 341s 'importer/applied/1-1': Placeholder('applied'), 341s }, 341s ), 341s # validation_repo_delta: 341s { 341s # no output repository delta 341s }, 341s # validation_repo_expected_treewise_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/heads/importer/applied/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/applied/1-1', 341s ], 341s # reuse: 341s True, 341s ), 341s 341s # 2) An existing applied tag with a different Git tree 341s # - Create reimport tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[ 341s Commit.from_spec( 341s name='unapplied', 341s has_patches=True, 341s mutate='import tag contents', 341s ), 341s Commit.from_spec( 341s name='unapplied_reimport', 341s has_patches=True, 341s ), 341s Commit.from_spec( 341s name='applied', 341s patches_applied=True, 341s mutate='import tag contents', 341s ) 341s ], 341s branches={'importer/ubuntu/trusty': Placeholder('unapplied')}, 341s tags={ 341s 'importer/import/1-1': 341s Placeholder('unapplied'), 341s 'importer/reimport/import/1-1/0': 341s Placeholder('unapplied'), 341s 'importer/reimport/import/1-1/1': 341s Placeholder('unapplied_reimport'), 341s 'importer/applied/1-1': 341s Placeholder('applied'), 341s }, 341s ), 341s # validation_repo_delta: 341s { 341s 'add_commits': [ 341s Commit.from_spec( 341s name='applied_reimport', 341s patches_applied=True, 341s parents=[Placeholder('unapplied_reimport')], 341s ), 341s ], 341s 'update_tags': { 341s 'importer/reimport/applied/1-1/0': 341s Placeholder('applied'), 341s 'importer/reimport/applied/1-1/1': 341s Placeholder('applied_reimport'), 341s }, 341s 'update_branches': { 341s 'importer/applied/ubuntu/trusty': 341s Placeholder('applied_reimport'), 341s }, 341s }, 341s # validation_repo_expected_treewise_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/heads/importer/applied/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s 'refs/tags/importer/applied/1-1', 341s 'refs/tags/importer/reimport/applied/1-1/0', 341s 'refs/tags/importer/reimport/applied/1-1/1', 341s ], 341s # reuse: 341s False, 341s 341s marks=pytest.mark.xfail(reason='LP: #1755247'), 341s ), 341s 341s # 3) No applied tags 341s # - Create applied tag 341s pytest.param( 341s # input_repo: 341s repo_builder.Repo( 341s commits=[Commit.from_spec(name='unapplied', has_patches=True)], 341s branches={'importer/ubuntu/trusty': Placeholder('unapplied')}, 341s tags={'importer/import/1-1': Placeholder('unapplied')}, 341s ), 341s # validation_repo_delta: 341s { 341s 'add_commits': [ 341s Commit.from_spec( 341s name='applied', 341s patches_applied=True, 341s parents=[Placeholder('unapplied')], 341s ), 341s ], 341s 'update_tags': { 341s 'importer/applied/1-1': Placeholder('applied') 341s }, 341s 'update_branches': { 341s 'importer/applied/ubuntu/trusty': Placeholder('applied'), 341s }, 341s }, 341s # validation_repo_expected_treewise_refs: 341s [ 341s 'refs/heads/importer/ubuntu/trusty', 341s 'refs/heads/importer/applied/ubuntu/trusty', 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/applied/1-1' 341s ], 341s # reuse: 341s False, 341s ), 341s ] 341s ) 341s @patch('gitubuntu.importer.get_import_tag_msg') 341s @patch('gitubuntu.importer.get_import_commit_msg') 341s def test_import_applied_spi_tags( 341s get_import_commit_msg_mock, 341s get_import_tag_msg_mock, 341s repo, 341s input_repo, 341s validation_repo_delta, 341s validation_repo_expected_treewise_refs, 341s reuse, 341s ): 341s """Test that applied tags are correctly created, adjusted and/or reused 341s 341s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 341s that determines the commit message to use for a given import 341s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 341s that determines the tag message to use for a given import 341s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 341s temporary output repository 341s :param repo_builder.Repo input_repo: input repository data 341s :param dict validation_repo_delta: how to transform the input repository 341s into a "validation repository", expressed as a dict to 341s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 341s input repository. The validation repository is then used for the 341s purposes of comparison against the output repository. 341s :param list(str) validation_repo_expected_treewise_refs: refs whose trees 341s must be identical between the validation repository and the output 341s repository 341s :param bool reuse: if set, the output ref importer/ubuntu/trusty must be 341s one supplied by the input repository (assumed to have a commit message 341s of "Test commit") and not one created by the importer in this run 341s (arranged by this test to have a different commit message) 341s 341s The input repository data is written into the output repository and then a 341s fake non-native source package publication of version 1-1 in the Trusty 341s release pocket is imported into it by calling import_applied_spi() 341s directly. reuse and validation_repo_expected_treewise_refs are then 341s asserted. 341s 341s This is similar to test_unapplied_spi_tags except that it calls 341s import_applied_spi() instead of import_unapplied_spi() and only treewise 341s ref comparisons are made. 341s """ 341s # Match the repo_builder objects 341s get_import_tag_msg_mock.return_value = 'Test tag' 341s # Importantly, the following commit message must not be the same as the 341s # commit messages used by the test input repository commits, so that we can 341s # later detect the difference between commits that were already there and 341s # new commits created by the importer for the purposes of asserting the 341s # reuse parameter correctly. 341s get_import_commit_msg_mock.return_value = b'Test commit (new)' 341s 341s > input_repo.write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_tag_test.py:711: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmpnn01l3a4/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: using patch list from debian/patches/series 341s dpkg-source: info: applying a 341s dpkg-source: info: applying b 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: using patch list from debian/patches/series 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: using patch list from debian/patches/series 341s dpkg-source: info: applying a 341s dpkg-source: info: applying b 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: using patch list from debian/patches/series 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: using patch list from debian/patches/series 341s dpkg-source: info: applying a 341s dpkg-source: info: applying b 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: using patch list from debian/patches/series 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s __ test_get_existing_import_tags[input_repo1-PatchState.UNAPPLIED-expected1] ___ 341s 341s repo = 341s patch_state = 341s input_repo = 341s expected = ['refs/tags/importer/import/1-1'] 341s 341s @pytest.mark.parametrize( 341s 'input_repo, patch_state, expected', [ 341s ( 341s repo_builder.Repo(), 341s PatchState.UNAPPLIED, 341s [], 341s ), 341s ( 341s repo_builder.Repo( 341s tags={'importer/import/1-1': repo_builder.Commit()}, 341s ), 341s PatchState.UNAPPLIED, 341s ['refs/tags/importer/import/1-1'], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit(name='import'), 341s repo_builder.Commit(name='reimport1'), 341s ], 341s tags={ 341s 'importer/import/1-1': repo_builder.Commit(), 341s 'importer/reimport/import/1-1/0': repo_builder.Commit(), 341s 'importer/reimport/import/1-1/1': repo_builder.Commit(), 341s }, 341s ), 341s PatchState.UNAPPLIED, 341s [ 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s ), 341s ( 341s repo_builder.Repo(), 341s PatchState.APPLIED, 341s [], 341s ), 341s ( 341s repo_builder.Repo( 341s tags={'importer/applied/1-1': repo_builder.Commit()}, 341s ), 341s PatchState.APPLIED, 341s ['refs/tags/importer/applied/1-1'], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit(name='applied'), 341s repo_builder.Commit(name='reimport1'), 341s ], 341s tags={ 341s 'importer/applied/1-1': repo_builder.Commit(), 341s 'importer/reimport/applied/1-1/0': repo_builder.Commit(), 341s 'importer/reimport/applied/1-1/1': repo_builder.Commit(), 341s }, 341s ), 341s PatchState.APPLIED, 341s [ 341s 'refs/tags/importer/reimport/applied/1-1/0', 341s 'refs/tags/importer/reimport/applied/1-1/1', 341s ], 341s ), 341s ], 341s ) 341s def test_get_existing_import_tags(repo, patch_state, input_repo, expected): 341s """Test that get_existing_import_tags is generally correct 341s 341s This is the general parameterised test for the common case uses of 341s target.get_existing_import_tags. 341s 341s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 341s temporary output repository 341s :param PatchState patch_state: passed through to get_existing_import_tags 341s :param repo_builder.Repo input_repo: input repository data 341s :param list(str) expected: the names of the references that are expected to 341s be returned, in order. 341s """ 341s > input_repo.write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:214: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmpug037pl9/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s __ test_get_existing_import_tags[input_repo2-PatchState.UNAPPLIED-expected2] ___ 341s 341s repo = 341s patch_state = 341s input_repo = 341s expected = ['refs/tags/importer/reimport/import/1-1/0', 'refs/tags/importer/reimport/import/1-1/1'] 341s 341s @pytest.mark.parametrize( 341s 'input_repo, patch_state, expected', [ 341s ( 341s repo_builder.Repo(), 341s PatchState.UNAPPLIED, 341s [], 341s ), 341s ( 341s repo_builder.Repo( 341s tags={'importer/import/1-1': repo_builder.Commit()}, 341s ), 341s PatchState.UNAPPLIED, 341s ['refs/tags/importer/import/1-1'], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit(name='import'), 341s repo_builder.Commit(name='reimport1'), 341s ], 341s tags={ 341s 'importer/import/1-1': repo_builder.Commit(), 341s 'importer/reimport/import/1-1/0': repo_builder.Commit(), 341s 'importer/reimport/import/1-1/1': repo_builder.Commit(), 341s }, 341s ), 341s PatchState.UNAPPLIED, 341s [ 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s ), 341s ( 341s repo_builder.Repo(), 341s PatchState.APPLIED, 341s [], 341s ), 341s ( 341s repo_builder.Repo( 341s tags={'importer/applied/1-1': repo_builder.Commit()}, 341s ), 341s PatchState.APPLIED, 341s ['refs/tags/importer/applied/1-1'], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit(name='applied'), 341s repo_builder.Commit(name='reimport1'), 341s ], 341s tags={ 341s 'importer/applied/1-1': repo_builder.Commit(), 341s 'importer/reimport/applied/1-1/0': repo_builder.Commit(), 341s 'importer/reimport/applied/1-1/1': repo_builder.Commit(), 341s }, 341s ), 341s PatchState.APPLIED, 341s [ 341s 'refs/tags/importer/reimport/applied/1-1/0', 341s 'refs/tags/importer/reimport/applied/1-1/1', 341s ], 341s ), 341s ], 341s ) 341s def test_get_existing_import_tags(repo, patch_state, input_repo, expected): 341s """Test that get_existing_import_tags is generally correct 341s 341s This is the general parameterised test for the common case uses of 341s target.get_existing_import_tags. 341s 341s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 341s temporary output repository 341s :param PatchState patch_state: passed through to get_existing_import_tags 341s :param repo_builder.Repo input_repo: input repository data 341s :param list(str) expected: the names of the references that are expected to 341s be returned, in order. 341s """ 341s > input_repo.write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:214: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmpdu8a2inx/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s ___ test_get_existing_import_tags[input_repo4-PatchState.APPLIED-expected4] ____ 341s 341s repo = 341s patch_state = 341s input_repo = 341s expected = ['refs/tags/importer/applied/1-1'] 341s 341s @pytest.mark.parametrize( 341s 'input_repo, patch_state, expected', [ 341s ( 341s repo_builder.Repo(), 341s PatchState.UNAPPLIED, 341s [], 341s ), 341s ( 341s repo_builder.Repo( 341s tags={'importer/import/1-1': repo_builder.Commit()}, 341s ), 341s PatchState.UNAPPLIED, 341s ['refs/tags/importer/import/1-1'], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit(name='import'), 341s repo_builder.Commit(name='reimport1'), 341s ], 341s tags={ 341s 'importer/import/1-1': repo_builder.Commit(), 341s 'importer/reimport/import/1-1/0': repo_builder.Commit(), 341s 'importer/reimport/import/1-1/1': repo_builder.Commit(), 341s }, 341s ), 341s PatchState.UNAPPLIED, 341s [ 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s ), 341s ( 341s repo_builder.Repo(), 341s PatchState.APPLIED, 341s [], 341s ), 341s ( 341s repo_builder.Repo( 341s tags={'importer/applied/1-1': repo_builder.Commit()}, 341s ), 341s PatchState.APPLIED, 341s ['refs/tags/importer/applied/1-1'], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit(name='applied'), 341s repo_builder.Commit(name='reimport1'), 341s ], 341s tags={ 341s 'importer/applied/1-1': repo_builder.Commit(), 341s 'importer/reimport/applied/1-1/0': repo_builder.Commit(), 341s 'importer/reimport/applied/1-1/1': repo_builder.Commit(), 341s }, 341s ), 341s PatchState.APPLIED, 341s [ 341s 'refs/tags/importer/reimport/applied/1-1/0', 341s 'refs/tags/importer/reimport/applied/1-1/1', 341s ], 341s ), 341s ], 341s ) 341s def test_get_existing_import_tags(repo, patch_state, input_repo, expected): 341s """Test that get_existing_import_tags is generally correct 341s 341s This is the general parameterised test for the common case uses of 341s target.get_existing_import_tags. 341s 341s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 341s temporary output repository 341s :param PatchState patch_state: passed through to get_existing_import_tags 341s :param repo_builder.Repo input_repo: input repository data 341s :param list(str) expected: the names of the references that are expected to 341s be returned, in order. 341s """ 341s > input_repo.write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:214: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmpn1kojv77/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s ___ test_get_existing_import_tags[input_repo5-PatchState.APPLIED-expected5] ____ 341s 341s repo = 341s patch_state = 341s input_repo = 341s expected = ['refs/tags/importer/reimport/applied/1-1/0', 'refs/tags/importer/reimport/applied/1-1/1'] 341s 341s @pytest.mark.parametrize( 341s 'input_repo, patch_state, expected', [ 341s ( 341s repo_builder.Repo(), 341s PatchState.UNAPPLIED, 341s [], 341s ), 341s ( 341s repo_builder.Repo( 341s tags={'importer/import/1-1': repo_builder.Commit()}, 341s ), 341s PatchState.UNAPPLIED, 341s ['refs/tags/importer/import/1-1'], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit(name='import'), 341s repo_builder.Commit(name='reimport1'), 341s ], 341s tags={ 341s 'importer/import/1-1': repo_builder.Commit(), 341s 'importer/reimport/import/1-1/0': repo_builder.Commit(), 341s 'importer/reimport/import/1-1/1': repo_builder.Commit(), 341s }, 341s ), 341s PatchState.UNAPPLIED, 341s [ 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s ), 341s ( 341s repo_builder.Repo(), 341s PatchState.APPLIED, 341s [], 341s ), 341s ( 341s repo_builder.Repo( 341s tags={'importer/applied/1-1': repo_builder.Commit()}, 341s ), 341s PatchState.APPLIED, 341s ['refs/tags/importer/applied/1-1'], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit(name='applied'), 341s repo_builder.Commit(name='reimport1'), 341s ], 341s tags={ 341s 'importer/applied/1-1': repo_builder.Commit(), 341s 'importer/reimport/applied/1-1/0': repo_builder.Commit(), 341s 'importer/reimport/applied/1-1/1': repo_builder.Commit(), 341s }, 341s ), 341s PatchState.APPLIED, 341s [ 341s 'refs/tags/importer/reimport/applied/1-1/0', 341s 'refs/tags/importer/reimport/applied/1-1/1', 341s ], 341s ), 341s ], 341s ) 341s def test_get_existing_import_tags(repo, patch_state, input_repo, expected): 341s """Test that get_existing_import_tags is generally correct 341s 341s This is the general parameterised test for the common case uses of 341s target.get_existing_import_tags. 341s 341s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 341s temporary output repository 341s :param PatchState patch_state: passed through to get_existing_import_tags 341s :param repo_builder.Repo input_repo: input repository data 341s :param list(str) expected: the names of the references that are expected to 341s be returned, in order. 341s """ 341s > input_repo.write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:214: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmprs0xxaz2/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s ____________________ test_get_existing_import_tags_ordering ____________________ 341s 341s repo = 341s 341s def test_get_existing_import_tags_ordering(repo): 341s """Test that get_existing_import_tags returns results in the correct order 341s 341s To maintain hash stability, the spec defines that multiple changelog 341s parents must appear in the order that they were published. For this to 341s work, get_existing_import_tags must return the tags in the correct order 341s even if the underlying git repository tags appear in an arbitrary order. 341s 341s :param GitUbuntuRepository repo: fixture of a temporary repository to use 341s """ 341s 341s # Construct a synthetic git repository containing tags 341s repo_builder.Repo( 341s tags={ 341s 'importer/import/1-1': repo_builder.Commit(), 341s 'importer/reimport/import/1-1/0': repo_builder.Commit(), 341s 'importer/reimport/import/1-1/1': repo_builder.Commit(), 341s } 341s > ).write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:240: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmphytsb32n/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s _ test_create_import_tag[input_repo0-validation_repo_delta0-validation_repo_expected_identical_refs0] _ 341s 341s repo = 341s input_repo = 341s validation_repo_delta = {'add_commits': [], 'update_tags': {'importer/import/1-1': }} 341s validation_repo_expected_identical_refs = ['refs/tags/importer/import/1-1'] 341s 341s @pytest.mark.parametrize( 341s [ 341s 'input_repo', 341s 'validation_repo_delta', 341s 'validation_repo_expected_identical_refs', 341s ], 341s [ 341s ( 341s repo_builder.Repo(), 341s { 341s 'add_commits': [ 341s repo_builder.Commit(name='import'), 341s ], 341s 'update_tags': { 341s 'importer/import/1-1': Placeholder('import'), 341s }, 341s }, 341s [ 341s 'refs/tags/importer/import/1-1', 341s ], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[repo_builder.Commit(name='import')], 341s tags={'importer/import/1-1': Placeholder('import')}, 341s ), 341s { 341s 'add_commits': [ 341s repo_builder.Commit(name='reimport'), 341s ], 341s 'update_tags': { 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 341s }, 341s }, 341s [ 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit(name='import'), 341s repo_builder.Commit(name='reimport1'), 341s ], 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('reimport1'), 341s }, 341s ), 341s { 341s 'add_commits': [ 341s repo_builder.Commit(name='reimport2'), 341s ], 341s 'update_tags': { 341s 'importer/reimport/import/1-1/2': Placeholder('reimport2'), 341s }, 341s }, 341s [ 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s 'refs/tags/importer/reimport/import/1-1/2', 341s ], 341s ), 341s ], 341s ) 341s def test_create_import_tag( 341s repo, 341s input_repo, 341s validation_repo_delta, 341s validation_repo_expected_identical_refs, 341s ): 341s """ 341s Unit test that create_import_tag creates the correct import tag 341s 341s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 341s temporary output repository 341s :param repo_builder.Repo input_repo: input repository data 341s :param dict validation_repo_delta: how to transform the input repository 341s into a "validation repository", expressed as a dict to 341s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 341s input repository. The validation repository is then used for the 341s purposes of comparison against the output repository. 341s :param list(str) validation_repo_expected_identical_refs: refs that must be 341s identical between the validation repository and the output repository 341s """ 341s publish_commit = repo.raw_repo.get( 341s repo_builder.Commit().write(repo.raw_repo) 341s ).peel(pygit2.Commit) 341s input_repo.write(repo.raw_repo) 341s 341s > target.create_import_tag(repo, publish_commit, '1-1', 'importer') 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:370: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer.py:1379: in create_import_tag 341s repo.create_tag( 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s commit_hash = '240dd844a69653244edb52c57c42d709512d64cd' 341s tag_name = 'importer/import/1-1', tag_msg = 'git-ubuntu import' 341s tagger = pygit2.Signature('git-ubuntu importer', 'ubuntu-devel-discuss@lists.ubuntu.com', 0, 0, None) 341s 341s def create_tag(self, 341s commit_hash, 341s tag_name, 341s tag_msg, 341s tagger=None, 341s ): 341s """Create a tag in the repository 341s 341s :param str commit_hash: the commit hash the tag will point to. 341s :param str tag_name: the name of the tag to be created. 341s :param str tag_msg: the text of the tag annotation. 341s :param pygit2.Signature tagger: if supplied, use this signature in the 341s created tag's "tagger" metadata. If not supplied, an arbitrary name 341s and email address is used with the current time. 341s :returns: None 341s """ 341s if not tagger: 341s tagger_time, tagger_offset = datetime_to_signature_spec( 341s datetime.datetime.now(), 341s ) 341s tagger = pygit2.Signature( 341s gitubuntu.spec.SYNTHESIZED_COMMITTER_NAME, 341s gitubuntu.spec.SYNTHESIZED_COMMITTER_EMAIL, 341s tagger_time, 341s tagger_offset, 341s ) 341s 341s logging.debug("Creating tag %s pointing to %s", tag_name, commit_hash) 341s self.raw_repo.create_tag( 341s tag_name, 341s pygit2.Oid(hex=commit_hash), 341s > pygit2.GIT_OBJ_COMMIT, 341s tagger, 341s tag_msg, 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:2114: AttributeError 341s _ test_create_import_tag[input_repo1-validation_repo_delta1-validation_repo_expected_identical_refs1] _ 341s 341s repo = 341s input_repo = 341s validation_repo_delta = {'add_commits': [], 'update_tags': {'importer/reimport/import/...t at 0xeb3a4aab2ba0>, 'importer/reimport/import/1-1/1': }} 341s 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'] 341s 341s @pytest.mark.parametrize( 341s [ 341s 'input_repo', 341s 'validation_repo_delta', 341s 'validation_repo_expected_identical_refs', 341s ], 341s [ 341s ( 341s repo_builder.Repo(), 341s { 341s 'add_commits': [ 341s repo_builder.Commit(name='import'), 341s ], 341s 'update_tags': { 341s 'importer/import/1-1': Placeholder('import'), 341s }, 341s }, 341s [ 341s 'refs/tags/importer/import/1-1', 341s ], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[repo_builder.Commit(name='import')], 341s tags={'importer/import/1-1': Placeholder('import')}, 341s ), 341s { 341s 'add_commits': [ 341s repo_builder.Commit(name='reimport'), 341s ], 341s 'update_tags': { 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 341s }, 341s }, 341s [ 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit(name='import'), 341s repo_builder.Commit(name='reimport1'), 341s ], 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('reimport1'), 341s }, 341s ), 341s { 341s 'add_commits': [ 341s repo_builder.Commit(name='reimport2'), 341s ], 341s 'update_tags': { 341s 'importer/reimport/import/1-1/2': Placeholder('reimport2'), 341s }, 341s }, 341s [ 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s 'refs/tags/importer/reimport/import/1-1/2', 341s ], 341s ), 341s ], 341s ) 341s def test_create_import_tag( 341s repo, 341s input_repo, 341s validation_repo_delta, 341s validation_repo_expected_identical_refs, 341s ): 341s """ 341s Unit test that create_import_tag creates the correct import tag 341s 341s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 341s temporary output repository 341s :param repo_builder.Repo input_repo: input repository data 341s :param dict validation_repo_delta: how to transform the input repository 341s into a "validation repository", expressed as a dict to 341s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 341s input repository. The validation repository is then used for the 341s purposes of comparison against the output repository. 341s :param list(str) validation_repo_expected_identical_refs: refs that must be 341s identical between the validation repository and the output repository 341s """ 341s publish_commit = repo.raw_repo.get( 341s repo_builder.Commit().write(repo.raw_repo) 341s ).peel(pygit2.Commit) 341s > input_repo.write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:368: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmpwaowqkhg/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s _ test_create_import_tag[input_repo2-validation_repo_delta2-validation_repo_expected_identical_refs2] _ 341s 341s repo = 341s input_repo = 341s validation_repo_delta = {'add_commits': [], 'update_tags': {'importer/reimport/import/1-1/2': }} 341s 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'] 341s 341s @pytest.mark.parametrize( 341s [ 341s 'input_repo', 341s 'validation_repo_delta', 341s 'validation_repo_expected_identical_refs', 341s ], 341s [ 341s ( 341s repo_builder.Repo(), 341s { 341s 'add_commits': [ 341s repo_builder.Commit(name='import'), 341s ], 341s 'update_tags': { 341s 'importer/import/1-1': Placeholder('import'), 341s }, 341s }, 341s [ 341s 'refs/tags/importer/import/1-1', 341s ], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[repo_builder.Commit(name='import')], 341s tags={'importer/import/1-1': Placeholder('import')}, 341s ), 341s { 341s 'add_commits': [ 341s repo_builder.Commit(name='reimport'), 341s ], 341s 'update_tags': { 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 341s }, 341s }, 341s [ 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit(name='import'), 341s repo_builder.Commit(name='reimport1'), 341s ], 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('reimport1'), 341s }, 341s ), 341s { 341s 'add_commits': [ 341s repo_builder.Commit(name='reimport2'), 341s ], 341s 'update_tags': { 341s 'importer/reimport/import/1-1/2': Placeholder('reimport2'), 341s }, 341s }, 341s [ 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s 'refs/tags/importer/reimport/import/1-1/2', 341s ], 341s ), 341s ], 341s ) 341s def test_create_import_tag( 341s repo, 341s input_repo, 341s validation_repo_delta, 341s validation_repo_expected_identical_refs, 341s ): 341s """ 341s Unit test that create_import_tag creates the correct import tag 341s 341s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 341s temporary output repository 341s :param repo_builder.Repo input_repo: input repository data 341s :param dict validation_repo_delta: how to transform the input repository 341s into a "validation repository", expressed as a dict to 341s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 341s input repository. The validation repository is then used for the 341s purposes of comparison against the output repository. 341s :param list(str) validation_repo_expected_identical_refs: refs that must be 341s identical between the validation repository and the output repository 341s """ 341s publish_commit = repo.raw_repo.get( 341s repo_builder.Commit().write(repo.raw_repo) 341s ).peel(pygit2.Commit) 341s > input_repo.write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:368: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmpudu1kznz/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s ____________ test_create_import_tag_hash_stability_on_first_import _____________ 341s 341s repo = 341s 341s def test_create_import_tag_hash_stability_on_first_import(repo): 341s """Created import tags should be hash stable on first import 341s 341s :param GitUbuntuRepository repo: fixture providing a temporary 341s GitUbuntuRepository instance to use 341s """ 341s publish_commit = repo.raw_repo.get( 341s repo_builder.Commit( 341s author=pygit2.Signature( 341s 'Hash stability test author', 341s 'newauthor@example.com', 341s 1, 341s 2, 341s ), 341s committer=pygit2.Signature( 341s 'Hash stability test committer', 341s 'newcommitter@example.com', 341s 3, 341s 4, 341s ), 341s ).write(repo.raw_repo) 341s ).peel(pygit2.Commit) 341s > target.create_import_tag(repo, publish_commit, '1-1', 'importer') 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:402: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer.py:1379: in create_import_tag 341s repo.create_tag( 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s commit_hash = '65729a1dca101328820bf4f49fbca4e9571a772a' 341s tag_name = 'importer/import/1-1', tag_msg = 'git-ubuntu import' 341s tagger = pygit2.Signature('git-ubuntu importer', 'ubuntu-devel-discuss@lists.ubuntu.com', 3, 4, None) 341s 341s def create_tag(self, 341s commit_hash, 341s tag_name, 341s tag_msg, 341s tagger=None, 341s ): 341s """Create a tag in the repository 341s 341s :param str commit_hash: the commit hash the tag will point to. 341s :param str tag_name: the name of the tag to be created. 341s :param str tag_msg: the text of the tag annotation. 341s :param pygit2.Signature tagger: if supplied, use this signature in the 341s created tag's "tagger" metadata. If not supplied, an arbitrary name 341s and email address is used with the current time. 341s :returns: None 341s """ 341s if not tagger: 341s tagger_time, tagger_offset = datetime_to_signature_spec( 341s datetime.datetime.now(), 341s ) 341s tagger = pygit2.Signature( 341s gitubuntu.spec.SYNTHESIZED_COMMITTER_NAME, 341s gitubuntu.spec.SYNTHESIZED_COMMITTER_EMAIL, 341s tagger_time, 341s tagger_offset, 341s ) 341s 341s logging.debug("Creating tag %s pointing to %s", tag_name, commit_hash) 341s self.raw_repo.create_tag( 341s tag_name, 341s pygit2.Oid(hex=commit_hash), 341s > pygit2.GIT_OBJ_COMMIT, 341s tagger, 341s tag_msg, 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:2114: AttributeError 341s ______________ test_create_import_tag_hash_stability_on_reimport _______________ 341s 341s repo = 341s 341s def test_create_import_tag_hash_stability_on_reimport(repo): 341s """Created import tags should be hash stable on reimport 341s 341s This includes both the /0 duplicate reimport tag of the original import tag 341s as well as the /1 reimport tag being created. 341s 341s :param GitUbuntuRepository repo: fixture providing a temporary 341s GitUbuntuRepository instance to use 341s """ 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit( 341s name='root', 341s author=pygit2.Signature( 341s 'Hash stability test author', 341s 'author@example.com', 341s 1, 341s 2, 341s ), 341s committer=pygit2.Signature( 341s 'Hash stability test committer', 341s 'committer@example.com', 341s 3, 341s 4, 341s ), 341s ), 341s ], 341s tags={ 341s 'importer/import/1-1': Placeholder('root'), 341s }, 341s tagger=pygit2.Signature( 341s 'Hash stability test name', 341s 'stability@example.com', 341s 5, 341s 6, 341s ), 341s > ).write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:449: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmp4jbpkvsb/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s _ test_create_applied_tag[input_repo0-validation_repo_delta0-validation_repo_expected_identical_refs0] _ 341s 341s repo = 341s input_repo = 341s validation_repo_delta = {'add_commits': [], 'update_tags': {'importer/applied/1-1': }} 341s validation_repo_expected_identical_refs = ['refs/tags/importer/applied/1-1'] 341s 341s @pytest.mark.parametrize( 341s [ 341s 'input_repo', 341s 'validation_repo_delta', 341s 'validation_repo_expected_identical_refs', 341s ], 341s [ 341s ( 341s repo_builder.Repo(), 341s { 341s 'add_commits': [repo_builder.Commit(name='import')], 341s 'update_tags': {'importer/applied/1-1': Placeholder('import')}, 341s }, 341s [ 341s 'refs/tags/importer/applied/1-1', 341s ], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[repo_builder.Commit(name='import')], 341s tags={'importer/applied/1-1': Placeholder('import')}, 341s ), 341s { 341s 'add_commits': [repo_builder.Commit(name='reimport')], 341s 'update_tags': { 341s 'importer/reimport/applied/1-1/0': Placeholder('import'), 341s 'importer/reimport/applied/1-1/1': Placeholder('reimport'), 341s }, 341s }, 341s [ 341s 'refs/tags/importer/applied/1-1', 341s 'refs/tags/importer/reimport/applied/1-1/0', 341s 'refs/tags/importer/reimport/applied/1-1/1', 341s ], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit(name='import'), 341s repo_builder.Commit(name='reimport1'), 341s ], 341s tags={ 341s 'importer/applied/1-1': Placeholder('import'), 341s 'importer/reimport/applied/1-1/0': Placeholder('import'), 341s 'importer/reimport/applied/1-1/1': Placeholder('reimport1'), 341s }, 341s ), 341s { 341s 'add_commits': [ 341s repo_builder.Commit(name='reimport2') 341s ], 341s 'update_tags': { 341s 'importer/reimport/applied/1-1/2': Placeholder('reimport2'), 341s }, 341s }, 341s [ 341s 'refs/tags/importer/applied/1-1', 341s 'refs/tags/importer/reimport/applied/1-1/0', 341s 'refs/tags/importer/reimport/applied/1-1/1', 341s 'refs/tags/importer/reimport/applied/1-1/2', 341s ], 341s ), 341s ], 341s ) 341s def test_create_applied_tag( 341s repo, 341s input_repo, 341s validation_repo_delta, 341s validation_repo_expected_identical_refs, 341s ): 341s """ 341s Unit test that create_applied_tag creates the correct import tag 341s 341s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 341s temporary output repository 341s :param repo_builder.Repo input_repo: input repository data 341s :param dict validation_repo_delta: how to transform the input repository 341s into a "validation repository", expressed as a dict to 341s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 341s input repository. The validation repository is then used for the 341s purposes of comparison against the output repository. 341s :param list(str) validation_repo_expected_identical_refs: refs that must be 341s identical between the validation repository and the output repository 341s """ 341s publish_commit_str = str( 341s repo.raw_repo.get( 341s repo_builder.Commit().write(repo.raw_repo) 341s ).peel(pygit2.Commit).id 341s ) 341s 341s input_repo.write(repo.raw_repo) 341s 341s > target.create_applied_tag(repo, publish_commit_str, '1-1', 'importer') 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:577: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer.py:1309: in create_applied_tag 341s repo.create_tag( 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s commit_hash = '240dd844a69653244edb52c57c42d709512d64cd' 341s tag_name = 'importer/applied/1-1', tag_msg = 'git-ubuntu import' 341s tagger = pygit2.Signature('git-ubuntu importer', 'ubuntu-devel-discuss@lists.ubuntu.com', 1733218791, 0, None) 341s 341s def create_tag(self, 341s commit_hash, 341s tag_name, 341s tag_msg, 341s tagger=None, 341s ): 341s """Create a tag in the repository 341s 341s :param str commit_hash: the commit hash the tag will point to. 341s :param str tag_name: the name of the tag to be created. 341s :param str tag_msg: the text of the tag annotation. 341s :param pygit2.Signature tagger: if supplied, use this signature in the 341s created tag's "tagger" metadata. If not supplied, an arbitrary name 341s and email address is used with the current time. 341s :returns: None 341s """ 341s if not tagger: 341s tagger_time, tagger_offset = datetime_to_signature_spec( 341s datetime.datetime.now(), 341s ) 341s tagger = pygit2.Signature( 341s gitubuntu.spec.SYNTHESIZED_COMMITTER_NAME, 341s gitubuntu.spec.SYNTHESIZED_COMMITTER_EMAIL, 341s tagger_time, 341s tagger_offset, 341s ) 341s 341s logging.debug("Creating tag %s pointing to %s", tag_name, commit_hash) 341s self.raw_repo.create_tag( 341s tag_name, 341s pygit2.Oid(hex=commit_hash), 341s > pygit2.GIT_OBJ_COMMIT, 341s tagger, 341s tag_msg, 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:2114: AttributeError 341s _ test_create_applied_tag[input_repo1-validation_repo_delta1-validation_repo_expected_identical_refs1] _ 341s 341s repo = 341s input_repo = 341s validation_repo_delta = {'add_commits': [], 'update_tags': {'importer/reimport/applied... at 0xeb3a4aab1e50>, 'importer/reimport/applied/1-1/1': }} 341s 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'] 341s 341s @pytest.mark.parametrize( 341s [ 341s 'input_repo', 341s 'validation_repo_delta', 341s 'validation_repo_expected_identical_refs', 341s ], 341s [ 341s ( 341s repo_builder.Repo(), 341s { 341s 'add_commits': [repo_builder.Commit(name='import')], 341s 'update_tags': {'importer/applied/1-1': Placeholder('import')}, 341s }, 341s [ 341s 'refs/tags/importer/applied/1-1', 341s ], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[repo_builder.Commit(name='import')], 341s tags={'importer/applied/1-1': Placeholder('import')}, 341s ), 341s { 341s 'add_commits': [repo_builder.Commit(name='reimport')], 341s 'update_tags': { 341s 'importer/reimport/applied/1-1/0': Placeholder('import'), 341s 'importer/reimport/applied/1-1/1': Placeholder('reimport'), 341s }, 341s }, 341s [ 341s 'refs/tags/importer/applied/1-1', 341s 'refs/tags/importer/reimport/applied/1-1/0', 341s 'refs/tags/importer/reimport/applied/1-1/1', 341s ], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit(name='import'), 341s repo_builder.Commit(name='reimport1'), 341s ], 341s tags={ 341s 'importer/applied/1-1': Placeholder('import'), 341s 'importer/reimport/applied/1-1/0': Placeholder('import'), 341s 'importer/reimport/applied/1-1/1': Placeholder('reimport1'), 341s }, 341s ), 341s { 341s 'add_commits': [ 341s repo_builder.Commit(name='reimport2') 341s ], 341s 'update_tags': { 341s 'importer/reimport/applied/1-1/2': Placeholder('reimport2'), 341s }, 341s }, 341s [ 341s 'refs/tags/importer/applied/1-1', 341s 'refs/tags/importer/reimport/applied/1-1/0', 341s 'refs/tags/importer/reimport/applied/1-1/1', 341s 'refs/tags/importer/reimport/applied/1-1/2', 341s ], 341s ), 341s ], 341s ) 341s def test_create_applied_tag( 341s repo, 341s input_repo, 341s validation_repo_delta, 341s validation_repo_expected_identical_refs, 341s ): 341s """ 341s Unit test that create_applied_tag creates the correct import tag 341s 341s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 341s temporary output repository 341s :param repo_builder.Repo input_repo: input repository data 341s :param dict validation_repo_delta: how to transform the input repository 341s into a "validation repository", expressed as a dict to 341s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 341s input repository. The validation repository is then used for the 341s purposes of comparison against the output repository. 341s :param list(str) validation_repo_expected_identical_refs: refs that must be 341s identical between the validation repository and the output repository 341s """ 341s publish_commit_str = str( 341s repo.raw_repo.get( 341s repo_builder.Commit().write(repo.raw_repo) 341s ).peel(pygit2.Commit).id 341s ) 341s 341s > input_repo.write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:575: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmpnkogm2qx/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s _ test_create_applied_tag[input_repo2-validation_repo_delta2-validation_repo_expected_identical_refs2] _ 341s 341s repo = 341s input_repo = 341s validation_repo_delta = {'add_commits': [], 'update_tags': {'importer/reimport/applied/1-1/2': }} 341s 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'] 341s 341s @pytest.mark.parametrize( 341s [ 341s 'input_repo', 341s 'validation_repo_delta', 341s 'validation_repo_expected_identical_refs', 341s ], 341s [ 341s ( 341s repo_builder.Repo(), 341s { 341s 'add_commits': [repo_builder.Commit(name='import')], 341s 'update_tags': {'importer/applied/1-1': Placeholder('import')}, 341s }, 341s [ 341s 'refs/tags/importer/applied/1-1', 341s ], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[repo_builder.Commit(name='import')], 341s tags={'importer/applied/1-1': Placeholder('import')}, 341s ), 341s { 341s 'add_commits': [repo_builder.Commit(name='reimport')], 341s 'update_tags': { 341s 'importer/reimport/applied/1-1/0': Placeholder('import'), 341s 'importer/reimport/applied/1-1/1': Placeholder('reimport'), 341s }, 341s }, 341s [ 341s 'refs/tags/importer/applied/1-1', 341s 'refs/tags/importer/reimport/applied/1-1/0', 341s 'refs/tags/importer/reimport/applied/1-1/1', 341s ], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit(name='import'), 341s repo_builder.Commit(name='reimport1'), 341s ], 341s tags={ 341s 'importer/applied/1-1': Placeholder('import'), 341s 'importer/reimport/applied/1-1/0': Placeholder('import'), 341s 'importer/reimport/applied/1-1/1': Placeholder('reimport1'), 341s }, 341s ), 341s { 341s 'add_commits': [ 341s repo_builder.Commit(name='reimport2') 341s ], 341s 'update_tags': { 341s 'importer/reimport/applied/1-1/2': Placeholder('reimport2'), 341s }, 341s }, 341s [ 341s 'refs/tags/importer/applied/1-1', 341s 'refs/tags/importer/reimport/applied/1-1/0', 341s 'refs/tags/importer/reimport/applied/1-1/1', 341s 'refs/tags/importer/reimport/applied/1-1/2', 341s ], 341s ), 341s ], 341s ) 341s def test_create_applied_tag( 341s repo, 341s input_repo, 341s validation_repo_delta, 341s validation_repo_expected_identical_refs, 341s ): 341s """ 341s Unit test that create_applied_tag creates the correct import tag 341s 341s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 341s temporary output repository 341s :param repo_builder.Repo input_repo: input repository data 341s :param dict validation_repo_delta: how to transform the input repository 341s into a "validation repository", expressed as a dict to 341s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 341s input repository. The validation repository is then used for the 341s purposes of comparison against the output repository. 341s :param list(str) validation_repo_expected_identical_refs: refs that must be 341s identical between the validation repository and the output repository 341s """ 341s publish_commit_str = str( 341s repo.raw_repo.get( 341s repo_builder.Commit().write(repo.raw_repo) 341s ).peel(pygit2.Commit).id 341s ) 341s 341s > input_repo.write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:575: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmpbdjf7qiw/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s _ test_get_changelog_parent_commits[input_repo1-parent_overrides1-changelog_versions1-PatchState.UNAPPLIED-expected_refs1] _ 341s 341s repo = 341s input_repo = 341s parent_overrides = {}, changelog_versions = ['1-2', '1-1'] 341s patch_state = 341s expected_refs = ['refs/tags/importer/import/1-1'] 341s 341s @pytest.mark.parametrize( 341s [ 341s 'input_repo', 341s 'parent_overrides', 341s 'changelog_versions', 341s 'patch_state', 341s 'expected_refs', 341s ], 341s [ 341s ( 341s repo_builder.Repo(), 341s {}, 341s ['1-2', '1-1',], 341s PatchState.UNAPPLIED, 341s [], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[repo_builder.Commit.from_spec(name='import')], 341s tags={'importer/import/1-1': Placeholder('import')}, 341s ), 341s {}, 341s ['1-2', '1-1'], 341s PatchState.UNAPPLIED, 341s ['refs/tags/importer/import/1-1'], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit.from_spec(name='import'), 341s repo_builder.Commit.from_spec(name='reimport', mutate=1), 341s ], 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 341s }, 341s ), 341s {}, 341s ['1-2', '1-1'], 341s PatchState.UNAPPLIED, 341s [ 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[repo_builder.Commit.from_spec(name='import')], 341s tags={'importer/import/1-1': Placeholder('import')}, 341s ), 341s {}, 341s ['1-3', '1-2', '1-1'], 341s PatchState.UNAPPLIED, 341s ['refs/tags/importer/import/1-1'], 341s ), 341s ( 341s repo_builder.Repo(), 341s {}, 341s ['1-2', '1-1',], 341s PatchState.APPLIED, 341s [], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[repo_builder.Commit.from_spec(name='applied')], 341s tags={'importer/applied/1-1': Placeholder('applied')}, 341s ), 341s {}, 341s ['1-2', '1-1'], 341s PatchState.APPLIED, 341s ['refs/tags/importer/applied/1-1'], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit.from_spec(name='import'), 341s repo_builder.Commit.from_spec(name='reimport', mutate=1), 341s ], 341s tags={ 341s 'importer/applied/1-1': Placeholder('import'), 341s 'importer/reimport/applied/1-1/0': Placeholder('import'), 341s 'importer/reimport/applied/1-1/1': Placeholder('reimport'), 341s }, 341s ), 341s {}, 341s ['1-2', '1-1'], 341s PatchState.APPLIED, 341s [ 341s 'refs/tags/importer/reimport/applied/1-1/0', 341s 'refs/tags/importer/reimport/applied/1-1/1', 341s ], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[repo_builder.Commit.from_spec(name='applied')], 341s tags={'importer/applied/1-1': Placeholder('applied')}, 341s ), 341s {}, 341s ['1-3', '1-2', '1-1'], 341s PatchState.APPLIED, 341s ['refs/tags/importer/applied/1-1'], 341s ), 341s ], 341s ) 341s def test_get_changelog_parent_commits( 341s repo, 341s input_repo, 341s parent_overrides, 341s changelog_versions, 341s patch_state, 341s expected_refs, 341s ): 341s """Test that get_changelog_parent_commits is generally correct 341s 341s This is the general parameterised test for the common case uses of 341s target.get_changelog_parent_commits. 341s 341s :param GitUbuntuRepository repo: fixture providing a temporary 341s GitUbuntuRepository instance to use 341s :param repo_builder.Repo input_repo: the input repository data to use that 341s will be populated into @repo before @repo is passed through to 341s get_changelog_parent_commits 341s :param dict parent_overrides: passed through to 341s get_changelog_parent_commits. 341s :param PatchState patch_state: passed through to 341s get_changelog_parent_commits 341s :param list(str) expected_refs: the expected return value of 341s get_changelog_parent_commits expressed using a list of reference names. 341s Since get_changelog_parent_commits returns a list of commit hash 341s strings, the reference names will need to be dereferenced before 341s comparison; this way the test parameters don't need to be opaque hash 341s strings. 341s """ 341s > input_repo.write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:721: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmpi70pfbs4/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s _ test_get_changelog_parent_commits[input_repo2-parent_overrides2-changelog_versions2-PatchState.UNAPPLIED-expected_refs2] _ 341s 341s repo = 341s input_repo = 341s parent_overrides = {}, changelog_versions = ['1-2', '1-1'] 341s patch_state = 341s expected_refs = ['refs/tags/importer/reimport/import/1-1/0', 'refs/tags/importer/reimport/import/1-1/1'] 341s 341s @pytest.mark.parametrize( 341s [ 341s 'input_repo', 341s 'parent_overrides', 341s 'changelog_versions', 341s 'patch_state', 341s 'expected_refs', 341s ], 341s [ 341s ( 341s repo_builder.Repo(), 341s {}, 341s ['1-2', '1-1',], 341s PatchState.UNAPPLIED, 341s [], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[repo_builder.Commit.from_spec(name='import')], 341s tags={'importer/import/1-1': Placeholder('import')}, 341s ), 341s {}, 341s ['1-2', '1-1'], 341s PatchState.UNAPPLIED, 341s ['refs/tags/importer/import/1-1'], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit.from_spec(name='import'), 341s repo_builder.Commit.from_spec(name='reimport', mutate=1), 341s ], 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 341s }, 341s ), 341s {}, 341s ['1-2', '1-1'], 341s PatchState.UNAPPLIED, 341s [ 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[repo_builder.Commit.from_spec(name='import')], 341s tags={'importer/import/1-1': Placeholder('import')}, 341s ), 341s {}, 341s ['1-3', '1-2', '1-1'], 341s PatchState.UNAPPLIED, 341s ['refs/tags/importer/import/1-1'], 341s ), 341s ( 341s repo_builder.Repo(), 341s {}, 341s ['1-2', '1-1',], 341s PatchState.APPLIED, 341s [], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[repo_builder.Commit.from_spec(name='applied')], 341s tags={'importer/applied/1-1': Placeholder('applied')}, 341s ), 341s {}, 341s ['1-2', '1-1'], 341s PatchState.APPLIED, 341s ['refs/tags/importer/applied/1-1'], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit.from_spec(name='import'), 341s repo_builder.Commit.from_spec(name='reimport', mutate=1), 341s ], 341s tags={ 341s 'importer/applied/1-1': Placeholder('import'), 341s 'importer/reimport/applied/1-1/0': Placeholder('import'), 341s 'importer/reimport/applied/1-1/1': Placeholder('reimport'), 341s }, 341s ), 341s {}, 341s ['1-2', '1-1'], 341s PatchState.APPLIED, 341s [ 341s 'refs/tags/importer/reimport/applied/1-1/0', 341s 'refs/tags/importer/reimport/applied/1-1/1', 341s ], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[repo_builder.Commit.from_spec(name='applied')], 341s tags={'importer/applied/1-1': Placeholder('applied')}, 341s ), 341s {}, 341s ['1-3', '1-2', '1-1'], 341s PatchState.APPLIED, 341s ['refs/tags/importer/applied/1-1'], 341s ), 341s ], 341s ) 341s def test_get_changelog_parent_commits( 341s repo, 341s input_repo, 341s parent_overrides, 341s changelog_versions, 341s patch_state, 341s expected_refs, 341s ): 341s """Test that get_changelog_parent_commits is generally correct 341s 341s This is the general parameterised test for the common case uses of 341s target.get_changelog_parent_commits. 341s 341s :param GitUbuntuRepository repo: fixture providing a temporary 341s GitUbuntuRepository instance to use 341s :param repo_builder.Repo input_repo: the input repository data to use that 341s will be populated into @repo before @repo is passed through to 341s get_changelog_parent_commits 341s :param dict parent_overrides: passed through to 341s get_changelog_parent_commits. 341s :param PatchState patch_state: passed through to 341s get_changelog_parent_commits 341s :param list(str) expected_refs: the expected return value of 341s get_changelog_parent_commits expressed using a list of reference names. 341s Since get_changelog_parent_commits returns a list of commit hash 341s strings, the reference names will need to be dereferenced before 341s comparison; this way the test parameters don't need to be opaque hash 341s strings. 341s """ 341s > input_repo.write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:721: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmpahm0oney/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s _ test_get_changelog_parent_commits[input_repo3-parent_overrides3-changelog_versions3-PatchState.UNAPPLIED-expected_refs3] _ 341s 341s repo = 341s input_repo = 341s parent_overrides = {}, changelog_versions = ['1-3', '1-2', '1-1'] 341s patch_state = 341s expected_refs = ['refs/tags/importer/import/1-1'] 341s 341s @pytest.mark.parametrize( 341s [ 341s 'input_repo', 341s 'parent_overrides', 341s 'changelog_versions', 341s 'patch_state', 341s 'expected_refs', 341s ], 341s [ 341s ( 341s repo_builder.Repo(), 341s {}, 341s ['1-2', '1-1',], 341s PatchState.UNAPPLIED, 341s [], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[repo_builder.Commit.from_spec(name='import')], 341s tags={'importer/import/1-1': Placeholder('import')}, 341s ), 341s {}, 341s ['1-2', '1-1'], 341s PatchState.UNAPPLIED, 341s ['refs/tags/importer/import/1-1'], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit.from_spec(name='import'), 341s repo_builder.Commit.from_spec(name='reimport', mutate=1), 341s ], 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 341s }, 341s ), 341s {}, 341s ['1-2', '1-1'], 341s PatchState.UNAPPLIED, 341s [ 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[repo_builder.Commit.from_spec(name='import')], 341s tags={'importer/import/1-1': Placeholder('import')}, 341s ), 341s {}, 341s ['1-3', '1-2', '1-1'], 341s PatchState.UNAPPLIED, 341s ['refs/tags/importer/import/1-1'], 341s ), 341s ( 341s repo_builder.Repo(), 341s {}, 341s ['1-2', '1-1',], 341s PatchState.APPLIED, 341s [], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[repo_builder.Commit.from_spec(name='applied')], 341s tags={'importer/applied/1-1': Placeholder('applied')}, 341s ), 341s {}, 341s ['1-2', '1-1'], 341s PatchState.APPLIED, 341s ['refs/tags/importer/applied/1-1'], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit.from_spec(name='import'), 341s repo_builder.Commit.from_spec(name='reimport', mutate=1), 341s ], 341s tags={ 341s 'importer/applied/1-1': Placeholder('import'), 341s 'importer/reimport/applied/1-1/0': Placeholder('import'), 341s 'importer/reimport/applied/1-1/1': Placeholder('reimport'), 341s }, 341s ), 341s {}, 341s ['1-2', '1-1'], 341s PatchState.APPLIED, 341s [ 341s 'refs/tags/importer/reimport/applied/1-1/0', 341s 'refs/tags/importer/reimport/applied/1-1/1', 341s ], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[repo_builder.Commit.from_spec(name='applied')], 341s tags={'importer/applied/1-1': Placeholder('applied')}, 341s ), 341s {}, 341s ['1-3', '1-2', '1-1'], 341s PatchState.APPLIED, 341s ['refs/tags/importer/applied/1-1'], 341s ), 341s ], 341s ) 341s def test_get_changelog_parent_commits( 341s repo, 341s input_repo, 341s parent_overrides, 341s changelog_versions, 341s patch_state, 341s expected_refs, 341s ): 341s """Test that get_changelog_parent_commits is generally correct 341s 341s This is the general parameterised test for the common case uses of 341s target.get_changelog_parent_commits. 341s 341s :param GitUbuntuRepository repo: fixture providing a temporary 341s GitUbuntuRepository instance to use 341s :param repo_builder.Repo input_repo: the input repository data to use that 341s will be populated into @repo before @repo is passed through to 341s get_changelog_parent_commits 341s :param dict parent_overrides: passed through to 341s get_changelog_parent_commits. 341s :param PatchState patch_state: passed through to 341s get_changelog_parent_commits 341s :param list(str) expected_refs: the expected return value of 341s get_changelog_parent_commits expressed using a list of reference names. 341s Since get_changelog_parent_commits returns a list of commit hash 341s strings, the reference names will need to be dereferenced before 341s comparison; this way the test parameters don't need to be opaque hash 341s strings. 341s """ 341s > input_repo.write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:721: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmp9umfb3fx/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s _ test_get_changelog_parent_commits[input_repo5-parent_overrides5-changelog_versions5-PatchState.APPLIED-expected_refs5] _ 341s 341s repo = 341s input_repo = 341s parent_overrides = {}, changelog_versions = ['1-2', '1-1'] 341s patch_state = 341s expected_refs = ['refs/tags/importer/applied/1-1'] 341s 341s @pytest.mark.parametrize( 341s [ 341s 'input_repo', 341s 'parent_overrides', 341s 'changelog_versions', 341s 'patch_state', 341s 'expected_refs', 341s ], 341s [ 341s ( 341s repo_builder.Repo(), 341s {}, 341s ['1-2', '1-1',], 341s PatchState.UNAPPLIED, 341s [], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[repo_builder.Commit.from_spec(name='import')], 341s tags={'importer/import/1-1': Placeholder('import')}, 341s ), 341s {}, 341s ['1-2', '1-1'], 341s PatchState.UNAPPLIED, 341s ['refs/tags/importer/import/1-1'], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit.from_spec(name='import'), 341s repo_builder.Commit.from_spec(name='reimport', mutate=1), 341s ], 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 341s }, 341s ), 341s {}, 341s ['1-2', '1-1'], 341s PatchState.UNAPPLIED, 341s [ 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[repo_builder.Commit.from_spec(name='import')], 341s tags={'importer/import/1-1': Placeholder('import')}, 341s ), 341s {}, 341s ['1-3', '1-2', '1-1'], 341s PatchState.UNAPPLIED, 341s ['refs/tags/importer/import/1-1'], 341s ), 341s ( 341s repo_builder.Repo(), 341s {}, 341s ['1-2', '1-1',], 341s PatchState.APPLIED, 341s [], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[repo_builder.Commit.from_spec(name='applied')], 341s tags={'importer/applied/1-1': Placeholder('applied')}, 341s ), 341s {}, 341s ['1-2', '1-1'], 341s PatchState.APPLIED, 341s ['refs/tags/importer/applied/1-1'], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit.from_spec(name='import'), 341s repo_builder.Commit.from_spec(name='reimport', mutate=1), 341s ], 341s tags={ 341s 'importer/applied/1-1': Placeholder('import'), 341s 'importer/reimport/applied/1-1/0': Placeholder('import'), 341s 'importer/reimport/applied/1-1/1': Placeholder('reimport'), 341s }, 341s ), 341s {}, 341s ['1-2', '1-1'], 341s PatchState.APPLIED, 341s [ 341s 'refs/tags/importer/reimport/applied/1-1/0', 341s 'refs/tags/importer/reimport/applied/1-1/1', 341s ], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[repo_builder.Commit.from_spec(name='applied')], 341s tags={'importer/applied/1-1': Placeholder('applied')}, 341s ), 341s {}, 341s ['1-3', '1-2', '1-1'], 341s PatchState.APPLIED, 341s ['refs/tags/importer/applied/1-1'], 341s ), 341s ], 341s ) 341s def test_get_changelog_parent_commits( 341s repo, 341s input_repo, 341s parent_overrides, 341s changelog_versions, 341s patch_state, 341s expected_refs, 341s ): 341s """Test that get_changelog_parent_commits is generally correct 341s 341s This is the general parameterised test for the common case uses of 341s target.get_changelog_parent_commits. 341s 341s :param GitUbuntuRepository repo: fixture providing a temporary 341s GitUbuntuRepository instance to use 341s :param repo_builder.Repo input_repo: the input repository data to use that 341s will be populated into @repo before @repo is passed through to 341s get_changelog_parent_commits 341s :param dict parent_overrides: passed through to 341s get_changelog_parent_commits. 341s :param PatchState patch_state: passed through to 341s get_changelog_parent_commits 341s :param list(str) expected_refs: the expected return value of 341s get_changelog_parent_commits expressed using a list of reference names. 341s Since get_changelog_parent_commits returns a list of commit hash 341s strings, the reference names will need to be dereferenced before 341s comparison; this way the test parameters don't need to be opaque hash 341s strings. 341s """ 341s > input_repo.write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:721: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmpus0qd_h_/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s _ test_get_changelog_parent_commits[input_repo6-parent_overrides6-changelog_versions6-PatchState.APPLIED-expected_refs6] _ 341s 341s repo = 341s input_repo = 341s parent_overrides = {}, changelog_versions = ['1-2', '1-1'] 341s patch_state = 341s expected_refs = ['refs/tags/importer/reimport/applied/1-1/0', 'refs/tags/importer/reimport/applied/1-1/1'] 341s 341s @pytest.mark.parametrize( 341s [ 341s 'input_repo', 341s 'parent_overrides', 341s 'changelog_versions', 341s 'patch_state', 341s 'expected_refs', 341s ], 341s [ 341s ( 341s repo_builder.Repo(), 341s {}, 341s ['1-2', '1-1',], 341s PatchState.UNAPPLIED, 341s [], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[repo_builder.Commit.from_spec(name='import')], 341s tags={'importer/import/1-1': Placeholder('import')}, 341s ), 341s {}, 341s ['1-2', '1-1'], 341s PatchState.UNAPPLIED, 341s ['refs/tags/importer/import/1-1'], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit.from_spec(name='import'), 341s repo_builder.Commit.from_spec(name='reimport', mutate=1), 341s ], 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 341s }, 341s ), 341s {}, 341s ['1-2', '1-1'], 341s PatchState.UNAPPLIED, 341s [ 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[repo_builder.Commit.from_spec(name='import')], 341s tags={'importer/import/1-1': Placeholder('import')}, 341s ), 341s {}, 341s ['1-3', '1-2', '1-1'], 341s PatchState.UNAPPLIED, 341s ['refs/tags/importer/import/1-1'], 341s ), 341s ( 341s repo_builder.Repo(), 341s {}, 341s ['1-2', '1-1',], 341s PatchState.APPLIED, 341s [], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[repo_builder.Commit.from_spec(name='applied')], 341s tags={'importer/applied/1-1': Placeholder('applied')}, 341s ), 341s {}, 341s ['1-2', '1-1'], 341s PatchState.APPLIED, 341s ['refs/tags/importer/applied/1-1'], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit.from_spec(name='import'), 341s repo_builder.Commit.from_spec(name='reimport', mutate=1), 341s ], 341s tags={ 341s 'importer/applied/1-1': Placeholder('import'), 341s 'importer/reimport/applied/1-1/0': Placeholder('import'), 341s 'importer/reimport/applied/1-1/1': Placeholder('reimport'), 341s }, 341s ), 341s {}, 341s ['1-2', '1-1'], 341s PatchState.APPLIED, 341s [ 341s 'refs/tags/importer/reimport/applied/1-1/0', 341s 'refs/tags/importer/reimport/applied/1-1/1', 341s ], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[repo_builder.Commit.from_spec(name='applied')], 341s tags={'importer/applied/1-1': Placeholder('applied')}, 341s ), 341s {}, 341s ['1-3', '1-2', '1-1'], 341s PatchState.APPLIED, 341s ['refs/tags/importer/applied/1-1'], 341s ), 341s ], 341s ) 341s def test_get_changelog_parent_commits( 341s repo, 341s input_repo, 341s parent_overrides, 341s changelog_versions, 341s patch_state, 341s expected_refs, 341s ): 341s """Test that get_changelog_parent_commits is generally correct 341s 341s This is the general parameterised test for the common case uses of 341s target.get_changelog_parent_commits. 341s 341s :param GitUbuntuRepository repo: fixture providing a temporary 341s GitUbuntuRepository instance to use 341s :param repo_builder.Repo input_repo: the input repository data to use that 341s will be populated into @repo before @repo is passed through to 341s get_changelog_parent_commits 341s :param dict parent_overrides: passed through to 341s get_changelog_parent_commits. 341s :param PatchState patch_state: passed through to 341s get_changelog_parent_commits 341s :param list(str) expected_refs: the expected return value of 341s get_changelog_parent_commits expressed using a list of reference names. 341s Since get_changelog_parent_commits returns a list of commit hash 341s strings, the reference names will need to be dereferenced before 341s comparison; this way the test parameters don't need to be opaque hash 341s strings. 341s """ 341s > input_repo.write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:721: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmpkn7ky4mu/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s _ test_get_changelog_parent_commits[input_repo7-parent_overrides7-changelog_versions7-PatchState.APPLIED-expected_refs7] _ 341s 341s repo = 341s input_repo = 341s parent_overrides = {}, changelog_versions = ['1-3', '1-2', '1-1'] 341s patch_state = 341s expected_refs = ['refs/tags/importer/applied/1-1'] 341s 341s @pytest.mark.parametrize( 341s [ 341s 'input_repo', 341s 'parent_overrides', 341s 'changelog_versions', 341s 'patch_state', 341s 'expected_refs', 341s ], 341s [ 341s ( 341s repo_builder.Repo(), 341s {}, 341s ['1-2', '1-1',], 341s PatchState.UNAPPLIED, 341s [], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[repo_builder.Commit.from_spec(name='import')], 341s tags={'importer/import/1-1': Placeholder('import')}, 341s ), 341s {}, 341s ['1-2', '1-1'], 341s PatchState.UNAPPLIED, 341s ['refs/tags/importer/import/1-1'], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit.from_spec(name='import'), 341s repo_builder.Commit.from_spec(name='reimport', mutate=1), 341s ], 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 341s }, 341s ), 341s {}, 341s ['1-2', '1-1'], 341s PatchState.UNAPPLIED, 341s [ 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s ], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[repo_builder.Commit.from_spec(name='import')], 341s tags={'importer/import/1-1': Placeholder('import')}, 341s ), 341s {}, 341s ['1-3', '1-2', '1-1'], 341s PatchState.UNAPPLIED, 341s ['refs/tags/importer/import/1-1'], 341s ), 341s ( 341s repo_builder.Repo(), 341s {}, 341s ['1-2', '1-1',], 341s PatchState.APPLIED, 341s [], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[repo_builder.Commit.from_spec(name='applied')], 341s tags={'importer/applied/1-1': Placeholder('applied')}, 341s ), 341s {}, 341s ['1-2', '1-1'], 341s PatchState.APPLIED, 341s ['refs/tags/importer/applied/1-1'], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit.from_spec(name='import'), 341s repo_builder.Commit.from_spec(name='reimport', mutate=1), 341s ], 341s tags={ 341s 'importer/applied/1-1': Placeholder('import'), 341s 'importer/reimport/applied/1-1/0': Placeholder('import'), 341s 'importer/reimport/applied/1-1/1': Placeholder('reimport'), 341s }, 341s ), 341s {}, 341s ['1-2', '1-1'], 341s PatchState.APPLIED, 341s [ 341s 'refs/tags/importer/reimport/applied/1-1/0', 341s 'refs/tags/importer/reimport/applied/1-1/1', 341s ], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[repo_builder.Commit.from_spec(name='applied')], 341s tags={'importer/applied/1-1': Placeholder('applied')}, 341s ), 341s {}, 341s ['1-3', '1-2', '1-1'], 341s PatchState.APPLIED, 341s ['refs/tags/importer/applied/1-1'], 341s ), 341s ], 341s ) 341s def test_get_changelog_parent_commits( 341s repo, 341s input_repo, 341s parent_overrides, 341s changelog_versions, 341s patch_state, 341s expected_refs, 341s ): 341s """Test that get_changelog_parent_commits is generally correct 341s 341s This is the general parameterised test for the common case uses of 341s target.get_changelog_parent_commits. 341s 341s :param GitUbuntuRepository repo: fixture providing a temporary 341s GitUbuntuRepository instance to use 341s :param repo_builder.Repo input_repo: the input repository data to use that 341s will be populated into @repo before @repo is passed through to 341s get_changelog_parent_commits 341s :param dict parent_overrides: passed through to 341s get_changelog_parent_commits. 341s :param PatchState patch_state: passed through to 341s get_changelog_parent_commits 341s :param list(str) expected_refs: the expected return value of 341s get_changelog_parent_commits expressed using a list of reference names. 341s Since get_changelog_parent_commits returns a list of commit hash 341s strings, the reference names will need to be dereferenced before 341s comparison; this way the test parameters don't need to be opaque hash 341s strings. 341s """ 341s > input_repo.write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:721: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmpeor7ty9d/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s _________ test_validate_rich_history[input_repo0-published_spec0-True] _________ 341s 341s repo = 341s input_repo = 341s published_spec = {'changelog_versions': ['1-2', '1-1']}, expected_result = True 341s 341s @pytest.mark.parametrize( 341s [ 341s 'input_repo', 341s 'published_spec', 341s 'expected_result', 341s ], 341s [ 341s ( 341s # Common case: upload tag has a changelog parent as an ancestor 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit.from_spec(name='import'), 341s repo_builder.Commit.from_spec( 341s name='upload', 341s changelog_versions=['1-2', '1-1'], 341s parents=[Placeholder('import')], 341s ), 341s ], 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/upload/1-2': Placeholder('upload'), 341s }, 341s ), 341s {'changelog_versions': ['1-2', '1-1']}, 341s True, 341s ), 341s ( 341s # Upload tag is the first one, with no parents present 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit.from_spec( 341s name='upload', 341s version='1-2', 341s ), 341s ], 341s tags={ 341s 'importer/upload/1-2': Placeholder('upload'), 341s }, 341s ), 341s {'changelog_versions': ['1-2']}, 341s True, 341s ), 341s ( 341s # Upload tag mismatches published tree but is otherwise correct 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit.from_spec(name='import'), 341s repo_builder.Commit.from_spec( 341s name='upload', 341s changelog_versions=['1-2', '1-1'], 341s parents=[Placeholder('import')], 341s mutate=True, 341s ), 341s ], 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/upload/1-2': Placeholder('upload'), 341s }, 341s ), 341s {'changelog_versions': ['1-2', '1-1']}, 341s target.RichHistoryTreeMismatch, 341s ), 341s ( 341s # Upload tag doesn't have a changelog parent as an ancestor but is 341s # otherwise correct 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit.from_spec(name='import'), 341s repo_builder.Commit.from_spec( 341s name='upload', 341s changelog_versions=['1-2', '1-1'], 341s ), 341s ], 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/upload/1-2': Placeholder('upload'), 341s }, 341s ), 341s {'changelog_versions': ['1-2', '1-1']}, 341s target.RichHistoryHasNoChangelogParentAncestor, 341s ), 341s ], 341s ) 341s def test_validate_rich_history( 341s repo, 341s input_repo, 341s published_spec, 341s expected_result, 341s ): 341s """ 341s General test for validate_rich_history(). 341s 341s This unit tests validate_rich_history() for various parameterized cases. 341s Given an input repository and the specification of a Launchpad publication 341s of a source package, we check that validate_rich_history() correctly 341s accepts or rejects the rich history corresponding to the upload tag named 341s 'importer/upload/1-2'. It is assumed that the package being imported is 341s always of version '1-2' for all parameter sets. 341s 341s Since the target function requires rich history, the case of there not 341s being rich history does not need to be tested here, as it wouldn't be 341s called in this case. 341s 341s validate_rich_history() is generic for all sourced rich history, not just 341s rich history sourced from an upload tag. But since it is independent of how 341s the rich history commit arrived, it is easiest to use upload tags to test 341s it; this results in coverage for all sources. 341s 341s :param GitUbuntuRepository repo: fixture providing a temporary 341s GitUbuntuRepository instance to use 341s :param repo_builder.Repo input_repo: input repository data 341s :param dict published_spec: the package simulated being imported from the 341s archive, specified as a dict to pass as **kwargs to 341s repo_builder.Commit.from_spec() 341s :param bool expected_result: the expected return value of, or exception 341s raised by, the call to validate_rich_history() 341s """ 341s > input_repo.write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:910: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmpk1im1l9m/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-2.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-2.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s _________ test_validate_rich_history[input_repo1-published_spec1-True] _________ 341s 341s repo = 341s input_repo = 341s published_spec = {'changelog_versions': ['1-2']}, expected_result = True 341s 341s @pytest.mark.parametrize( 341s [ 341s 'input_repo', 341s 'published_spec', 341s 'expected_result', 341s ], 341s [ 341s ( 341s # Common case: upload tag has a changelog parent as an ancestor 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit.from_spec(name='import'), 341s repo_builder.Commit.from_spec( 341s name='upload', 341s changelog_versions=['1-2', '1-1'], 341s parents=[Placeholder('import')], 341s ), 341s ], 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/upload/1-2': Placeholder('upload'), 341s }, 341s ), 341s {'changelog_versions': ['1-2', '1-1']}, 341s True, 341s ), 341s ( 341s # Upload tag is the first one, with no parents present 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit.from_spec( 341s name='upload', 341s version='1-2', 341s ), 341s ], 341s tags={ 341s 'importer/upload/1-2': Placeholder('upload'), 341s }, 341s ), 341s {'changelog_versions': ['1-2']}, 341s True, 341s ), 341s ( 341s # Upload tag mismatches published tree but is otherwise correct 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit.from_spec(name='import'), 341s repo_builder.Commit.from_spec( 341s name='upload', 341s changelog_versions=['1-2', '1-1'], 341s parents=[Placeholder('import')], 341s mutate=True, 341s ), 341s ], 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/upload/1-2': Placeholder('upload'), 341s }, 341s ), 341s {'changelog_versions': ['1-2', '1-1']}, 341s target.RichHistoryTreeMismatch, 341s ), 341s ( 341s # Upload tag doesn't have a changelog parent as an ancestor but is 341s # otherwise correct 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit.from_spec(name='import'), 341s repo_builder.Commit.from_spec( 341s name='upload', 341s changelog_versions=['1-2', '1-1'], 341s ), 341s ], 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/upload/1-2': Placeholder('upload'), 341s }, 341s ), 341s {'changelog_versions': ['1-2', '1-1']}, 341s target.RichHistoryHasNoChangelogParentAncestor, 341s ), 341s ], 341s ) 341s def test_validate_rich_history( 341s repo, 341s input_repo, 341s published_spec, 341s expected_result, 341s ): 341s """ 341s General test for validate_rich_history(). 341s 341s This unit tests validate_rich_history() for various parameterized cases. 341s Given an input repository and the specification of a Launchpad publication 341s of a source package, we check that validate_rich_history() correctly 341s accepts or rejects the rich history corresponding to the upload tag named 341s 'importer/upload/1-2'. It is assumed that the package being imported is 341s always of version '1-2' for all parameter sets. 341s 341s Since the target function requires rich history, the case of there not 341s being rich history does not need to be tested here, as it wouldn't be 341s called in this case. 341s 341s validate_rich_history() is generic for all sourced rich history, not just 341s rich history sourced from an upload tag. But since it is independent of how 341s the rich history commit arrived, it is easiest to use upload tags to test 341s it; this results in coverage for all sources. 341s 341s :param GitUbuntuRepository repo: fixture providing a temporary 341s GitUbuntuRepository instance to use 341s :param repo_builder.Repo input_repo: input repository data 341s :param dict published_spec: the package simulated being imported from the 341s archive, specified as a dict to pass as **kwargs to 341s repo_builder.Commit.from_spec() 341s :param bool expected_result: the expected return value of, or exception 341s raised by, the call to validate_rich_history() 341s """ 341s > input_repo.write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:910: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmp_qvoa_3s/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-2.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-2.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-2.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-2.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s _ test_validate_rich_history[input_repo2-published_spec2-RichHistoryTreeMismatch] _ 341s 341s repo = 341s input_repo = 341s published_spec = {'changelog_versions': ['1-2', '1-1']} 341s expected_result = 341s 341s @pytest.mark.parametrize( 341s [ 341s 'input_repo', 341s 'published_spec', 341s 'expected_result', 341s ], 341s [ 341s ( 341s # Common case: upload tag has a changelog parent as an ancestor 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit.from_spec(name='import'), 341s repo_builder.Commit.from_spec( 341s name='upload', 341s changelog_versions=['1-2', '1-1'], 341s parents=[Placeholder('import')], 341s ), 341s ], 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/upload/1-2': Placeholder('upload'), 341s }, 341s ), 341s {'changelog_versions': ['1-2', '1-1']}, 341s True, 341s ), 341s ( 341s # Upload tag is the first one, with no parents present 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit.from_spec( 341s name='upload', 341s version='1-2', 341s ), 341s ], 341s tags={ 341s 'importer/upload/1-2': Placeholder('upload'), 341s }, 341s ), 341s {'changelog_versions': ['1-2']}, 341s True, 341s ), 341s ( 341s # Upload tag mismatches published tree but is otherwise correct 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit.from_spec(name='import'), 341s repo_builder.Commit.from_spec( 341s name='upload', 341s changelog_versions=['1-2', '1-1'], 341s parents=[Placeholder('import')], 341s mutate=True, 341s ), 341s ], 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/upload/1-2': Placeholder('upload'), 341s }, 341s ), 341s {'changelog_versions': ['1-2', '1-1']}, 341s target.RichHistoryTreeMismatch, 341s ), 341s ( 341s # Upload tag doesn't have a changelog parent as an ancestor but is 341s # otherwise correct 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit.from_spec(name='import'), 341s repo_builder.Commit.from_spec( 341s name='upload', 341s changelog_versions=['1-2', '1-1'], 341s ), 341s ], 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/upload/1-2': Placeholder('upload'), 341s }, 341s ), 341s {'changelog_versions': ['1-2', '1-1']}, 341s target.RichHistoryHasNoChangelogParentAncestor, 341s ), 341s ], 341s ) 341s def test_validate_rich_history( 341s repo, 341s input_repo, 341s published_spec, 341s expected_result, 341s ): 341s """ 341s General test for validate_rich_history(). 341s 341s This unit tests validate_rich_history() for various parameterized cases. 341s Given an input repository and the specification of a Launchpad publication 341s of a source package, we check that validate_rich_history() correctly 341s accepts or rejects the rich history corresponding to the upload tag named 341s 'importer/upload/1-2'. It is assumed that the package being imported is 341s always of version '1-2' for all parameter sets. 341s 341s Since the target function requires rich history, the case of there not 341s being rich history does not need to be tested here, as it wouldn't be 341s called in this case. 341s 341s validate_rich_history() is generic for all sourced rich history, not just 341s rich history sourced from an upload tag. But since it is independent of how 341s the rich history commit arrived, it is easiest to use upload tags to test 341s it; this results in coverage for all sources. 341s 341s :param GitUbuntuRepository repo: fixture providing a temporary 341s GitUbuntuRepository instance to use 341s :param repo_builder.Repo input_repo: input repository data 341s :param dict published_spec: the package simulated being imported from the 341s archive, specified as a dict to pass as **kwargs to 341s repo_builder.Commit.from_spec() 341s :param bool expected_result: the expected return value of, or exception 341s raised by, the call to validate_rich_history() 341s """ 341s > input_repo.write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:910: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmp0jmms4yx/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-2.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-2.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s _ test_validate_rich_history[input_repo3-published_spec3-RichHistoryHasNoChangelogParentAncestor] _ 341s 341s repo = 341s input_repo = 341s published_spec = {'changelog_versions': ['1-2', '1-1']} 341s expected_result = 341s 341s @pytest.mark.parametrize( 341s [ 341s 'input_repo', 341s 'published_spec', 341s 'expected_result', 341s ], 341s [ 341s ( 341s # Common case: upload tag has a changelog parent as an ancestor 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit.from_spec(name='import'), 341s repo_builder.Commit.from_spec( 341s name='upload', 341s changelog_versions=['1-2', '1-1'], 341s parents=[Placeholder('import')], 341s ), 341s ], 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/upload/1-2': Placeholder('upload'), 341s }, 341s ), 341s {'changelog_versions': ['1-2', '1-1']}, 341s True, 341s ), 341s ( 341s # Upload tag is the first one, with no parents present 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit.from_spec( 341s name='upload', 341s version='1-2', 341s ), 341s ], 341s tags={ 341s 'importer/upload/1-2': Placeholder('upload'), 341s }, 341s ), 341s {'changelog_versions': ['1-2']}, 341s True, 341s ), 341s ( 341s # Upload tag mismatches published tree but is otherwise correct 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit.from_spec(name='import'), 341s repo_builder.Commit.from_spec( 341s name='upload', 341s changelog_versions=['1-2', '1-1'], 341s parents=[Placeholder('import')], 341s mutate=True, 341s ), 341s ], 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/upload/1-2': Placeholder('upload'), 341s }, 341s ), 341s {'changelog_versions': ['1-2', '1-1']}, 341s target.RichHistoryTreeMismatch, 341s ), 341s ( 341s # Upload tag doesn't have a changelog parent as an ancestor but is 341s # otherwise correct 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit.from_spec(name='import'), 341s repo_builder.Commit.from_spec( 341s name='upload', 341s changelog_versions=['1-2', '1-1'], 341s ), 341s ], 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/upload/1-2': Placeholder('upload'), 341s }, 341s ), 341s {'changelog_versions': ['1-2', '1-1']}, 341s target.RichHistoryHasNoChangelogParentAncestor, 341s ), 341s ], 341s ) 341s def test_validate_rich_history( 341s repo, 341s input_repo, 341s published_spec, 341s expected_result, 341s ): 341s """ 341s General test for validate_rich_history(). 341s 341s This unit tests validate_rich_history() for various parameterized cases. 341s Given an input repository and the specification of a Launchpad publication 341s of a source package, we check that validate_rich_history() correctly 341s accepts or rejects the rich history corresponding to the upload tag named 341s 'importer/upload/1-2'. It is assumed that the package being imported is 341s always of version '1-2' for all parameter sets. 341s 341s Since the target function requires rich history, the case of there not 341s being rich history does not need to be tested here, as it wouldn't be 341s called in this case. 341s 341s validate_rich_history() is generic for all sourced rich history, not just 341s rich history sourced from an upload tag. But since it is independent of how 341s the rich history commit arrived, it is easiest to use upload tags to test 341s it; this results in coverage for all sources. 341s 341s :param GitUbuntuRepository repo: fixture providing a temporary 341s GitUbuntuRepository instance to use 341s :param repo_builder.Repo input_repo: input repository data 341s :param dict published_spec: the package simulated being imported from the 341s archive, specified as a dict to pass as **kwargs to 341s repo_builder.Commit.from_spec() 341s :param bool expected_result: the expected return value of, or exception 341s raised by, the call to validate_rich_history() 341s """ 341s > input_repo.write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:910: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmpqj5g6xr5/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-2.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-2.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s ______________________ test_add_changelog_note_to_commit _______________________ 341s 341s repo = 341s 341s def test_add_changelog_note_to_commit(repo): 341s """add_changelog_note_to_commit should add the expected note""" 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit.from_spec(name='1-1'), 341s repo_builder.Commit.from_spec( 341s name='1-2', 341s changelog_versions=['1-1', '1-2'], 341s parents=[Placeholder('1-1')], 341s ), 341s ], 341s tags={'1-1': Placeholder('1-1'), '1-2': Placeholder('1-2')}, 341s > ).write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:953: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmp5y52ndun/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s ____________________ test_add_changelog_note_to_commit_utf8 ____________________ 341s 341s repo = 341s 341s def test_add_changelog_note_to_commit_utf8(repo): 341s """A changelog file with non-UTF8 should have such characters substituted 341s 341s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 341s temporary output repository 341s """ 341s test_utf8_error_changelog_path = os.path.join( 341s pkg_resources.resource_filename('gitubuntu', 'changelog_tests'), 341s 'test_utf8_error', 341s ) 341s with open(test_utf8_error_changelog_path, 'rb') as f: 341s utf8_changelog_blob = f.read() 341s 341s # We only need an example child commit with a debian/changelog file since 341s # this is the only file accessed by add_changelog_note_to_commit(). 341s # Further, the parent need only exist and can be empty. 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit(name='parent'), 341s repo_builder.Commit( 341s tree=repo_builder.Tree({'debian': repo_builder.Tree( 341s {'changelog': repo_builder.Blob(utf8_changelog_blob)} 341s )}), 341s name='child', 341s ) 341s ], 341s tags={'parent': Placeholder('parent'), 'child': Placeholder('child')}, 341s > ).write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:1002: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmp3x2q2rbx/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s _________________ test_double_changelog_note_add_does_not_fail _________________ 341s 341s repo = 341s 341s def test_double_changelog_note_add_does_not_fail(repo): 341s """add_changelog_note_to_commit shouldn't fail if a note already exists""" 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit.from_spec(name='1-1'), 341s repo_builder.Commit.from_spec( 341s name='1-2', 341s changelog_versions=['1-1', '1-2'], 341s parents=[Placeholder('1-1')], 341s ), 341s ], 341s tags={'1-1': Placeholder('1-1'), '1-2': Placeholder('1-2')}, 341s > ).write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:1035: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmpqd8mv275/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s ___________________________ test_create_import_note ____________________________ 341s 341s repo = 341s 341s def test_create_import_note(repo): 341s """create_import_note() should create a note in the correct ref""" 341s repo_builder.Repo( 341s commits=[repo_builder.Commit(name='root')], 341s tags={'root': repo_builder.Placeholder('root')}, 341s > ).write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:1066: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmpemciy51s/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s ______________________ test_create_import_note_timestamp _______________________ 341s 341s repo = 341s 341s def test_create_import_note_timestamp(repo): 341s """create_import_note() should include the timestamp in the note""" 341s repo_builder.Repo( 341s commits=[repo_builder.Commit(name='root')], 341s tags={'root': repo_builder.Placeholder('root')}, 341s > ).write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:1082: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmp6m31e7bh/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s _______________________ test_import_creates_import_note ________________________ 341s 341s repo = 341s 341s def test_import_creates_import_note(repo): 341s """When an import runs, the note should appear in the correct ref""" 341s with source_builder.Source() as dsc_pathname: 341s > target.import_unapplied_dsc( 341s repo=repo, 341s version='1-1', 341s namespace='importer', 341s dist='ubuntu', 341s dsc_pathname=dsc_pathname, 341s head_name='ubuntu/focal', 341s skip_orig=True, 341s parent_overrides={}, 341s ) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:1102: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer.py:2230: in import_unapplied_dsc 341s commit, tag = find_or_create_unapplied_commit( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer.py:2052: in find_or_create_unapplied_commit 341s changelog_parents = get_unapplied_import_parents( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer.py:1503: in get_unapplied_import_parents 341s import_tree_versions = repo.get_all_changelog_versions_from_treeish( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:2230: in get_all_changelog_versions_from_treeish 341s changelog = self.get_changelog_from_treeish(treeish) 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 341s return Changelog.from_treeish( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:569: in from_treeish 341s blob = follow_symlinks_to_blob( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 341s return _follow_symlinks_to_blob( 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s repo = pygit2.Repository('/tmp/tmpgsc22pg6/.git/') 341s top_tree_object = 341s search_path = 'debian/changelog' 341s _rel_tree = 341s _rel_path = '' 341s 341s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 341s _rel_tree=None, _rel_path='' 341s ): 341s '''Recursively follow a path down a tree, following symlinks, to find blob 341s 341s repo: pygit2.Repository object 341s top_tree: pygit2.Tree object of the top of the tree structure 341s search_path: '/'-separated path string of blob to find 341s _rel_tree: (internal) which tree to look further into 341s _rel_path: (internal) the path we are in so far 341s ''' 341s 341s NORMAL_BLOB_MODES = set([ 341s pygit2.GIT_FILEMODE_BLOB, 341s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 341s ]) 341s 341s _rel_tree = _rel_tree or top_tree_object 341s head, tail = posixpath.split(search_path) 341s 341s # A traditional functional split would put a single entry in head with tail 341s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 341s # to make it appear to have traditional semantics. 341s if not head: 341s head = tail 341s tail = None 341s 341s entry = _rel_tree[head] 341s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:68: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s ___________________ test_import_unapplied_spi_quilt_patches ____________________ 341s 341s get_import_commit_msg_mock = 341s get_import_tag_msg_mock = 341s repo = 341s 341s @patch('gitubuntu.importer.get_import_tag_msg') 341s @patch('gitubuntu.importer.get_import_commit_msg') 341s def test_import_unapplied_spi_quilt_patches( 341s get_import_commit_msg_mock, 341s get_import_tag_msg_mock, 341s repo, 341s ): 341s """Test that a package with quilt patches is imported with correct 341s unapplied refs 341s 341s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 341s that determines the commit message to use for a given import 341s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 341s that determines the tag message to use for a given import 341s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 341s temporary output repository 341s """ 341s # Match the repo_builder objects 341s get_import_tag_msg_mock.return_value = 'Test tag' 341s get_import_commit_msg_mock.return_value = b'Test commit' 341s 341s publish_spec = source_builder.SourceSpec(has_patches=True) 341s 341s input_repo = repo_builder.Repo() 341s input_repo.write(repo.raw_repo) 341s expected_result = repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit( 341s tree=repo_builder.SourceTree( 341s source_builder.Source(publish_spec) 341s ), 341s name='publish' 341s ), 341s ], 341s tags={'importer/import/1-1': Placeholder('publish')}, 341s branches={'importer/ubuntu/trusty': Placeholder('publish')}, 341s ) 341s 341s with source_builder.Source(publish_spec) as dsc_path: 341s # import_unapplied_spi currently assumes it is called from the 341s # repository directory (pristine-tar and other commands rely on 341s # this) 341s > target.import_unapplied_spi( 341s repo=repo, 341s spi=MockSPI(dsc_path, publish_spec.version), 341s namespace='importer', 341s skip_orig=False, 341s parent_overrides={}, 341s ) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:1222: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer.py:2308: in import_unapplied_spi 341s import_unapplied_dsc( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer.py:2230: in import_unapplied_dsc 341s commit, tag = find_or_create_unapplied_commit( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer.py:2052: in find_or_create_unapplied_commit 341s changelog_parents = get_unapplied_import_parents( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer.py:1503: in get_unapplied_import_parents 341s import_tree_versions = repo.get_all_changelog_versions_from_treeish( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:2230: in get_all_changelog_versions_from_treeish 341s changelog = self.get_changelog_from_treeish(treeish) 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 341s return Changelog.from_treeish( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:569: in from_treeish 341s blob = follow_symlinks_to_blob( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 341s return _follow_symlinks_to_blob( 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s repo = pygit2.Repository('/tmp/tmpptrbf4_w/.git/') 341s top_tree_object = 341s search_path = 'debian/changelog' 341s _rel_tree = 341s _rel_path = '' 341s 341s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 341s _rel_tree=None, _rel_path='' 341s ): 341s '''Recursively follow a path down a tree, following symlinks, to find blob 341s 341s repo: pygit2.Repository object 341s top_tree: pygit2.Tree object of the top of the tree structure 341s search_path: '/'-separated path string of blob to find 341s _rel_tree: (internal) which tree to look further into 341s _rel_path: (internal) the path we are in so far 341s ''' 341s 341s NORMAL_BLOB_MODES = set([ 341s pygit2.GIT_FILEMODE_BLOB, 341s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 341s ]) 341s 341s _rel_tree = _rel_tree or top_tree_object 341s head, tail = posixpath.split(search_path) 341s 341s # A traditional functional split would put a single entry in head with tail 341s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 341s # to make it appear to have traditional semantics. 341s if not head: 341s head = tail 341s tail = None 341s 341s entry = _rel_tree[head] 341s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:68: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: using patch list from debian/patches/series 341s dpkg-source: info: applying a 341s dpkg-source: info: applying b 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: using patch list from debian/patches/series 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s _ test_import_unapplied_spi_parenting[input_repo0-changelog_versions0-validation_repo_delta0-validation_repo_expected_identical_refs0] _ 341s 341s get_import_commit_msg_mock = 341s get_import_tag_msg_mock = 341s repo = 341s input_repo = 341s changelog_versions = ['1-1'] 341s validation_repo_delta = {'add_commits': [], 'update_tags': {'importer/import/1-1': }} 341s validation_repo_expected_identical_refs = ['refs/tags/importer/import/1-1'] 341s 341s @pytest.mark.parametrize( 341s [ 341s 'input_repo', 341s 'changelog_versions', 341s 'validation_repo_delta', 341s 'validation_repo_expected_identical_refs', 341s ], 341s [ 341s pytest.param( 341s repo_builder.Repo(), 341s ['1-1'], 341s { 341s 'add_commits': [ 341s repo_builder.Commit.from_spec(name='publish'), 341s ], 341s 'update_tags': {'importer/import/1-1': Placeholder('publish')}, 341s }, 341s [ 341s 'refs/tags/importer/import/1-1', 341s ] 341s ), 341s pytest.param( 341s repo_builder.Repo( 341s commits=[repo_builder.Commit.from_spec(name='import')], 341s tags={'importer/import/1-1': Placeholder('import')}, 341s ), 341s ['1-2', '1-1'], 341s { 341s 'add_commits': [ 341s repo_builder.Commit.from_spec( 341s name='publish', 341s parents=[Placeholder('import')], 341s changelog_versions=['1-2', '1-1'], 341s ), 341s ], 341s 'update_tags': {'importer/import/1-2': Placeholder('publish')}, 341s }, 341s [ 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/import/1-2', 341s ], 341s ), 341s pytest.param( 341s repo_builder.Repo( 341s commits=[repo_builder.Commit.from_spec(name='import')], 341s tags={'importer/import/1-1': Placeholder('import')}, 341s ), 341s ['1-3', '1-2', '1-1'], 341s { 341s 'add_commits': [ 341s repo_builder.Commit.from_spec( 341s parents=[Placeholder('import')], 341s name='publish', 341s changelog_versions=['1-3', '1-2', '1-1'], 341s ), 341s ], 341s 'update_tags': {'importer/import/1-3': Placeholder('publish')}, 341s }, 341s [ 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/import/1-3', 341s ], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit.from_spec(name='import'), 341s repo_builder.Commit.from_spec( 341s name='reimport', 341s mutate='Reimport tag contents', 341s ), 341s ], 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 341s }, 341s ), 341s ['1-2', '1-1'], 341s { 341s 'add_commits': [ 341s repo_builder.Commit.from_spec( 341s parents=[ 341s Placeholder('import'), 341s Placeholder('reimport'), 341s ], 341s name='publish', 341s changelog_versions=['1-2', '1-1'], 341s ), 341s ], 341s 'update_tags': {'importer/import/1-2': Placeholder('publish')}, 341s }, 341s [ 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s 'refs/tags/importer/import/1-2', 341s ], 341s ), 341s ] 341s ) 341s @patch('gitubuntu.importer.get_import_tag_msg') 341s @patch('gitubuntu.importer.get_import_commit_msg') 341s def test_import_unapplied_spi_parenting( 341s get_import_commit_msg_mock, 341s get_import_tag_msg_mock, 341s repo, 341s input_repo, 341s changelog_versions, 341s validation_repo_delta, 341s validation_repo_expected_identical_refs, 341s ): 341s """Test that unapplied import commits have the correct parents 341s 341s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 341s that determines the commit message to use for a given import 341s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 341s that determines the tag message to use for a given import 341s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 341s temporary output repository 341s :param repo_builder.Repo input_repo: input repository data 341s :param list(str) changelog_versions: the versions in the changelog of a 341s fake package to test import 341s :param dict validation_repo_delta: how to transform the input 341s repository into a "validation repository", expressed as a dict to 341s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 341s input repository. The validation repository is then used for the 341s purposes of comparison against the output repository. 341s :param list(str) validation_repo_expected_identical_refs: refs that must be 341s identical between the validation repository and the output repository 341s 341s Verify that if an import of a package is made into input_repo where the 341s package being imported has the given changelog_versions, then the output 341s repository has commits with the parents we expect. This is tested by 341s comparing specific output references against the validation repository. 341s """ 341s 341s # Match the repo_builder objects 341s get_import_tag_msg_mock.return_value = 'Test tag' 341s get_import_commit_msg_mock.return_value = b'Test commit' 341s 341s input_repo.write(repo.raw_repo) 341s 341s publish_spec = source_builder.SourceSpec( 341s changelog_versions=changelog_versions, 341s ) 341s 341s with source_builder.Source(publish_spec) as dsc_path: 341s # import_unapplied_spi currently assumes it is called from the 341s # repository directory (pristine-tar and other commands rely on 341s # this) 341s > target.import_unapplied_spi( 341s repo=repo, 341s spi=MockSPI(dsc_path, publish_spec.version), 341s namespace='importer', 341s skip_orig=False, 341s parent_overrides={}, 341s ) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:1391: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer.py:2308: in import_unapplied_spi 341s import_unapplied_dsc( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer.py:2230: in import_unapplied_dsc 341s commit, tag = find_or_create_unapplied_commit( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer.py:2052: in find_or_create_unapplied_commit 341s changelog_parents = get_unapplied_import_parents( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer.py:1503: in get_unapplied_import_parents 341s import_tree_versions = repo.get_all_changelog_versions_from_treeish( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:2230: in get_all_changelog_versions_from_treeish 341s changelog = self.get_changelog_from_treeish(treeish) 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 341s return Changelog.from_treeish( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:569: in from_treeish 341s blob = follow_symlinks_to_blob( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 341s return _follow_symlinks_to_blob( 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s repo = pygit2.Repository('/tmp/tmp6ejesswn/.git/') 341s top_tree_object = 341s search_path = 'debian/changelog' 341s _rel_tree = 341s _rel_path = '' 341s 341s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 341s _rel_tree=None, _rel_path='' 341s ): 341s '''Recursively follow a path down a tree, following symlinks, to find blob 341s 341s repo: pygit2.Repository object 341s top_tree: pygit2.Tree object of the top of the tree structure 341s search_path: '/'-separated path string of blob to find 341s _rel_tree: (internal) which tree to look further into 341s _rel_path: (internal) the path we are in so far 341s ''' 341s 341s NORMAL_BLOB_MODES = set([ 341s pygit2.GIT_FILEMODE_BLOB, 341s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 341s ]) 341s 341s _rel_tree = _rel_tree or top_tree_object 341s head, tail = posixpath.split(search_path) 341s 341s # A traditional functional split would put a single entry in head with tail 341s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 341s # to make it appear to have traditional semantics. 341s if not head: 341s head = tail 341s tail = None 341s 341s entry = _rel_tree[head] 341s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:68: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s _ test_import_unapplied_spi_parenting[input_repo1-changelog_versions1-validation_repo_delta1-validation_repo_expected_identical_refs1] _ 341s 341s get_import_commit_msg_mock = 341s get_import_tag_msg_mock = 341s repo = 341s input_repo = 341s changelog_versions = ['1-2', '1-1'] 341s validation_repo_delta = {'add_commits': [], 'update_tags': {'importer/import/1-2': }} 341s validation_repo_expected_identical_refs = ['refs/tags/importer/import/1-1', 'refs/tags/importer/import/1-2'] 341s 341s @pytest.mark.parametrize( 341s [ 341s 'input_repo', 341s 'changelog_versions', 341s 'validation_repo_delta', 341s 'validation_repo_expected_identical_refs', 341s ], 341s [ 341s pytest.param( 341s repo_builder.Repo(), 341s ['1-1'], 341s { 341s 'add_commits': [ 341s repo_builder.Commit.from_spec(name='publish'), 341s ], 341s 'update_tags': {'importer/import/1-1': Placeholder('publish')}, 341s }, 341s [ 341s 'refs/tags/importer/import/1-1', 341s ] 341s ), 341s pytest.param( 341s repo_builder.Repo( 341s commits=[repo_builder.Commit.from_spec(name='import')], 341s tags={'importer/import/1-1': Placeholder('import')}, 341s ), 341s ['1-2', '1-1'], 341s { 341s 'add_commits': [ 341s repo_builder.Commit.from_spec( 341s name='publish', 341s parents=[Placeholder('import')], 341s changelog_versions=['1-2', '1-1'], 341s ), 341s ], 341s 'update_tags': {'importer/import/1-2': Placeholder('publish')}, 341s }, 341s [ 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/import/1-2', 341s ], 341s ), 341s pytest.param( 341s repo_builder.Repo( 341s commits=[repo_builder.Commit.from_spec(name='import')], 341s tags={'importer/import/1-1': Placeholder('import')}, 341s ), 341s ['1-3', '1-2', '1-1'], 341s { 341s 'add_commits': [ 341s repo_builder.Commit.from_spec( 341s parents=[Placeholder('import')], 341s name='publish', 341s changelog_versions=['1-3', '1-2', '1-1'], 341s ), 341s ], 341s 'update_tags': {'importer/import/1-3': Placeholder('publish')}, 341s }, 341s [ 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/import/1-3', 341s ], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit.from_spec(name='import'), 341s repo_builder.Commit.from_spec( 341s name='reimport', 341s mutate='Reimport tag contents', 341s ), 341s ], 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 341s }, 341s ), 341s ['1-2', '1-1'], 341s { 341s 'add_commits': [ 341s repo_builder.Commit.from_spec( 341s parents=[ 341s Placeholder('import'), 341s Placeholder('reimport'), 341s ], 341s name='publish', 341s changelog_versions=['1-2', '1-1'], 341s ), 341s ], 341s 'update_tags': {'importer/import/1-2': Placeholder('publish')}, 341s }, 341s [ 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s 'refs/tags/importer/import/1-2', 341s ], 341s ), 341s ] 341s ) 341s @patch('gitubuntu.importer.get_import_tag_msg') 341s @patch('gitubuntu.importer.get_import_commit_msg') 341s def test_import_unapplied_spi_parenting( 341s get_import_commit_msg_mock, 341s get_import_tag_msg_mock, 341s repo, 341s input_repo, 341s changelog_versions, 341s validation_repo_delta, 341s validation_repo_expected_identical_refs, 341s ): 341s """Test that unapplied import commits have the correct parents 341s 341s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 341s that determines the commit message to use for a given import 341s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 341s that determines the tag message to use for a given import 341s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 341s temporary output repository 341s :param repo_builder.Repo input_repo: input repository data 341s :param list(str) changelog_versions: the versions in the changelog of a 341s fake package to test import 341s :param dict validation_repo_delta: how to transform the input 341s repository into a "validation repository", expressed as a dict to 341s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 341s input repository. The validation repository is then used for the 341s purposes of comparison against the output repository. 341s :param list(str) validation_repo_expected_identical_refs: refs that must be 341s identical between the validation repository and the output repository 341s 341s Verify that if an import of a package is made into input_repo where the 341s package being imported has the given changelog_versions, then the output 341s repository has commits with the parents we expect. This is tested by 341s comparing specific output references against the validation repository. 341s """ 341s 341s # Match the repo_builder objects 341s get_import_tag_msg_mock.return_value = 'Test tag' 341s get_import_commit_msg_mock.return_value = b'Test commit' 341s 341s > input_repo.write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:1381: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmpzdr1dorn/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s _ test_import_unapplied_spi_parenting[input_repo2-changelog_versions2-validation_repo_delta2-validation_repo_expected_identical_refs2] _ 341s 341s get_import_commit_msg_mock = 341s get_import_tag_msg_mock = 341s repo = 341s input_repo = 341s changelog_versions = ['1-3', '1-2', '1-1'] 341s validation_repo_delta = {'add_commits': [], 'update_tags': {'importer/import/1-3': }} 341s validation_repo_expected_identical_refs = ['refs/tags/importer/import/1-1', 'refs/tags/importer/import/1-3'] 341s 341s @pytest.mark.parametrize( 341s [ 341s 'input_repo', 341s 'changelog_versions', 341s 'validation_repo_delta', 341s 'validation_repo_expected_identical_refs', 341s ], 341s [ 341s pytest.param( 341s repo_builder.Repo(), 341s ['1-1'], 341s { 341s 'add_commits': [ 341s repo_builder.Commit.from_spec(name='publish'), 341s ], 341s 'update_tags': {'importer/import/1-1': Placeholder('publish')}, 341s }, 341s [ 341s 'refs/tags/importer/import/1-1', 341s ] 341s ), 341s pytest.param( 341s repo_builder.Repo( 341s commits=[repo_builder.Commit.from_spec(name='import')], 341s tags={'importer/import/1-1': Placeholder('import')}, 341s ), 341s ['1-2', '1-1'], 341s { 341s 'add_commits': [ 341s repo_builder.Commit.from_spec( 341s name='publish', 341s parents=[Placeholder('import')], 341s changelog_versions=['1-2', '1-1'], 341s ), 341s ], 341s 'update_tags': {'importer/import/1-2': Placeholder('publish')}, 341s }, 341s [ 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/import/1-2', 341s ], 341s ), 341s pytest.param( 341s repo_builder.Repo( 341s commits=[repo_builder.Commit.from_spec(name='import')], 341s tags={'importer/import/1-1': Placeholder('import')}, 341s ), 341s ['1-3', '1-2', '1-1'], 341s { 341s 'add_commits': [ 341s repo_builder.Commit.from_spec( 341s parents=[Placeholder('import')], 341s name='publish', 341s changelog_versions=['1-3', '1-2', '1-1'], 341s ), 341s ], 341s 'update_tags': {'importer/import/1-3': Placeholder('publish')}, 341s }, 341s [ 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/import/1-3', 341s ], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit.from_spec(name='import'), 341s repo_builder.Commit.from_spec( 341s name='reimport', 341s mutate='Reimport tag contents', 341s ), 341s ], 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 341s }, 341s ), 341s ['1-2', '1-1'], 341s { 341s 'add_commits': [ 341s repo_builder.Commit.from_spec( 341s parents=[ 341s Placeholder('import'), 341s Placeholder('reimport'), 341s ], 341s name='publish', 341s changelog_versions=['1-2', '1-1'], 341s ), 341s ], 341s 'update_tags': {'importer/import/1-2': Placeholder('publish')}, 341s }, 341s [ 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s 'refs/tags/importer/import/1-2', 341s ], 341s ), 341s ] 341s ) 341s @patch('gitubuntu.importer.get_import_tag_msg') 341s @patch('gitubuntu.importer.get_import_commit_msg') 341s def test_import_unapplied_spi_parenting( 341s get_import_commit_msg_mock, 341s get_import_tag_msg_mock, 341s repo, 341s input_repo, 341s changelog_versions, 341s validation_repo_delta, 341s validation_repo_expected_identical_refs, 341s ): 341s """Test that unapplied import commits have the correct parents 341s 341s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 341s that determines the commit message to use for a given import 341s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 341s that determines the tag message to use for a given import 341s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 341s temporary output repository 341s :param repo_builder.Repo input_repo: input repository data 341s :param list(str) changelog_versions: the versions in the changelog of a 341s fake package to test import 341s :param dict validation_repo_delta: how to transform the input 341s repository into a "validation repository", expressed as a dict to 341s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 341s input repository. The validation repository is then used for the 341s purposes of comparison against the output repository. 341s :param list(str) validation_repo_expected_identical_refs: refs that must be 341s identical between the validation repository and the output repository 341s 341s Verify that if an import of a package is made into input_repo where the 341s package being imported has the given changelog_versions, then the output 341s repository has commits with the parents we expect. This is tested by 341s comparing specific output references against the validation repository. 341s """ 341s 341s # Match the repo_builder objects 341s get_import_tag_msg_mock.return_value = 'Test tag' 341s get_import_commit_msg_mock.return_value = b'Test commit' 341s 341s > input_repo.write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:1381: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmplgzm87g3/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s _ test_import_unapplied_spi_parenting[input_repo3-changelog_versions3-validation_repo_delta3-validation_repo_expected_identical_refs3] _ 341s 341s get_import_commit_msg_mock = 341s get_import_tag_msg_mock = 341s repo = 341s input_repo = 341s changelog_versions = ['1-2', '1-1'] 341s validation_repo_delta = {'add_commits': [], 'update_tags': {'importer/import/1-2': }} 341s 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'] 341s 341s @pytest.mark.parametrize( 341s [ 341s 'input_repo', 341s 'changelog_versions', 341s 'validation_repo_delta', 341s 'validation_repo_expected_identical_refs', 341s ], 341s [ 341s pytest.param( 341s repo_builder.Repo(), 341s ['1-1'], 341s { 341s 'add_commits': [ 341s repo_builder.Commit.from_spec(name='publish'), 341s ], 341s 'update_tags': {'importer/import/1-1': Placeholder('publish')}, 341s }, 341s [ 341s 'refs/tags/importer/import/1-1', 341s ] 341s ), 341s pytest.param( 341s repo_builder.Repo( 341s commits=[repo_builder.Commit.from_spec(name='import')], 341s tags={'importer/import/1-1': Placeholder('import')}, 341s ), 341s ['1-2', '1-1'], 341s { 341s 'add_commits': [ 341s repo_builder.Commit.from_spec( 341s name='publish', 341s parents=[Placeholder('import')], 341s changelog_versions=['1-2', '1-1'], 341s ), 341s ], 341s 'update_tags': {'importer/import/1-2': Placeholder('publish')}, 341s }, 341s [ 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/import/1-2', 341s ], 341s ), 341s pytest.param( 341s repo_builder.Repo( 341s commits=[repo_builder.Commit.from_spec(name='import')], 341s tags={'importer/import/1-1': Placeholder('import')}, 341s ), 341s ['1-3', '1-2', '1-1'], 341s { 341s 'add_commits': [ 341s repo_builder.Commit.from_spec( 341s parents=[Placeholder('import')], 341s name='publish', 341s changelog_versions=['1-3', '1-2', '1-1'], 341s ), 341s ], 341s 'update_tags': {'importer/import/1-3': Placeholder('publish')}, 341s }, 341s [ 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/import/1-3', 341s ], 341s ), 341s ( 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit.from_spec(name='import'), 341s repo_builder.Commit.from_spec( 341s name='reimport', 341s mutate='Reimport tag contents', 341s ), 341s ], 341s tags={ 341s 'importer/import/1-1': Placeholder('import'), 341s 'importer/reimport/import/1-1/0': Placeholder('import'), 341s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 341s }, 341s ), 341s ['1-2', '1-1'], 341s { 341s 'add_commits': [ 341s repo_builder.Commit.from_spec( 341s parents=[ 341s Placeholder('import'), 341s Placeholder('reimport'), 341s ], 341s name='publish', 341s changelog_versions=['1-2', '1-1'], 341s ), 341s ], 341s 'update_tags': {'importer/import/1-2': Placeholder('publish')}, 341s }, 341s [ 341s 'refs/tags/importer/import/1-1', 341s 'refs/tags/importer/reimport/import/1-1/0', 341s 'refs/tags/importer/reimport/import/1-1/1', 341s 'refs/tags/importer/import/1-2', 341s ], 341s ), 341s ] 341s ) 341s @patch('gitubuntu.importer.get_import_tag_msg') 341s @patch('gitubuntu.importer.get_import_commit_msg') 341s def test_import_unapplied_spi_parenting( 341s get_import_commit_msg_mock, 341s get_import_tag_msg_mock, 341s repo, 341s input_repo, 341s changelog_versions, 341s validation_repo_delta, 341s validation_repo_expected_identical_refs, 341s ): 341s """Test that unapplied import commits have the correct parents 341s 341s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 341s that determines the commit message to use for a given import 341s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 341s that determines the tag message to use for a given import 341s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 341s temporary output repository 341s :param repo_builder.Repo input_repo: input repository data 341s :param list(str) changelog_versions: the versions in the changelog of a 341s fake package to test import 341s :param dict validation_repo_delta: how to transform the input 341s repository into a "validation repository", expressed as a dict to 341s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 341s input repository. The validation repository is then used for the 341s purposes of comparison against the output repository. 341s :param list(str) validation_repo_expected_identical_refs: refs that must be 341s identical between the validation repository and the output repository 341s 341s Verify that if an import of a package is made into input_repo where the 341s package being imported has the given changelog_versions, then the output 341s repository has commits with the parents we expect. This is tested by 341s comparing specific output references against the validation repository. 341s """ 341s 341s # Match the repo_builder objects 341s get_import_tag_msg_mock.return_value = 'Test tag' 341s get_import_commit_msg_mock.return_value = b'Test commit' 341s 341s > input_repo.write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:1381: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmpy0wdckpi/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s __________________ test_import_unapplied_spi_parent_override ___________________ 341s 341s get_import_commit_msg_mock = 341s get_import_tag_msg_mock = 341s repo = 341s 341s @patch('gitubuntu.importer.get_import_tag_msg') 341s @patch('gitubuntu.importer.get_import_commit_msg') 341s def test_import_unapplied_spi_parent_override( 341s get_import_commit_msg_mock, 341s get_import_tag_msg_mock, 341s repo, 341s ): 341s """Test import_unapplied_spi() parent_override functionality 341s 341s Test that if parent_overrides is used in the import_unapplied_spi call then 341s the resulting commit correctly uses the overridden parents specified. 341s 341s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 341s that determines the commit message to use for a given import 341s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 341s that determines the tag message to use for a given import 341s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 341s temporary output repository 341s :param repo_builder.Repo input_repo: input repository data 341s """ 341s # Match the repo_builder objects 341s get_import_tag_msg_mock.return_value = 'Test tag' 341s get_import_commit_msg_mock.return_value = b'Test commit' 341s 341s input_repo = repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit.from_spec(name='import1-1', version='1-1'), 341s repo_builder.Commit.from_spec(name='import1-2', version='1-2'), 341s ], 341s tags={ 341s 'importer/import/1-1': Placeholder('import1-1'), 341s 'importer/import/1-2': Placeholder('import1-2'), 341s }, 341s ) 341s > input_repo.write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:1444: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmpfbneec4n/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-2.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-2.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s ______________ test_import_unapplied_spi_parent_override_failure _______________ 341s 341s repo = 341s 341s def test_import_unapplied_spi_parent_override_failure(repo): 341s """ 341s Test override_parents ParentOverrideError raise 341s 341s When a parent override is specified but the specified version doesn't have 341s an import tag, an exception should be raised. 341s 341s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 341s temporary output repository 341s """ 341s repo_builder.Repo( 341s commits=[repo_builder.Commit.from_spec(name='import1-1')], 341s tags={'importer/import/1-1': Placeholder('import1-1')}, 341s > ).write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:1499: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmpykqkb2oo/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s _ test_import_applied_spi_parenting[input_repo0-expected_ancestor_commits0-expected_parent_commits0] _ 341s 341s get_import_commit_msg_mock = 341s get_import_tag_msg_mock = 341s repo = 341s input_repo = 341s expected_ancestor_commits = ['refs/tags/importer/import/1-2'] 341s expected_parent_commits = ['refs/tags/importer/applied/1-1'] 341s 341s @pytest.mark.parametrize( 341s 'input_repo, expected_ancestor_commits, expected_parent_commits', [ 341s # In general, these tests do not set applied commit parents in the 341s # input repository since we have no mechanism to do that correctly, but 341s # this doesn't matter for the purposes of these tests. 341s 341s # if only one import tag exists, then it is the parent 341s pytest.param( 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit.from_spec( 341s name='unapplied1', 341s has_patches=True, 341s ), 341s repo_builder.Commit.from_spec( 341s parents=[Placeholder('unapplied1')], 341s name='unapplied2', 341s changelog_versions=['1-2', '1-1'], 341s has_patches=True, 341s ), 341s repo_builder.Commit.from_spec( 341s name='applied1', 341s patches_applied=True, 341s ), 341s ], 341s # no branches: technically not possible but branches are not 341s # relevant to the test 341s branches={}, 341s tags={ 341s 'importer/import/1-1': Placeholder('unapplied1'), 341s 'importer/import/1-2': Placeholder('unapplied2'), 341s 'importer/applied/1-1': Placeholder('applied1'), 341s }, 341s ), 341s ['refs/tags/importer/import/1-2'], 341s ['refs/tags/importer/applied/1-1'], 341s ), 341s 341s # if multiple import tags exist, then do they all end up as parents? 341s pytest.param( 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit.from_spec( 341s name='unapplied1', 341s has_patches=True, 341s ), 341s repo_builder.Commit.from_spec( 341s parents=[Placeholder('unapplied1')], 341s name='unapplied2', 341s changelog_versions=['1-2', '1-1'], 341s has_patches=True, 341s ), 341s repo_builder.Commit.from_spec( 341s parents=[Placeholder('unapplied1')], 341s name='unapplied2reimport', 341s changelog_versions=['1-2', '1-1'], 341s has_patches=True, 341s mutate='reimport tag', 341s ), 341s repo_builder.Commit.from_spec( 341s name='applied1', 341s patches_applied=True, 341s ), 341s ], 341s # no branches: technically not possible but branches are not 341s # relevant to the test 341s branches={}, 341s tags={ 341s 'importer/import/1-1': 341s Placeholder('unapplied1'), 341s 'importer/import/1-2': 341s Placeholder('unapplied2'), 341s 'importer/reimport/import/1-2/0': 341s Placeholder('unapplied2'), 341s 'importer/reimport/import/1-2/1': 341s Placeholder('unapplied2reimport'), 341s 'importer/applied/1-1': 341s Placeholder('applied1'), 341s }, 341s ), 341s [ 341s 'refs/tags/importer/reimport/import/1-2/0', 341s 'refs/tags/importer/reimport/import/1-2/1', 341s ], 341s [ 341s 'refs/tags/importer/applied/1-1', 341s ], 341s marks=pytest.mark.xfail(reason='LP: #1755247'), 341s ), 341s 341s # do we correctly create a reimport tag because a different import 341s # already exists? 341s pytest.param( 341s repo_builder.Repo( 341s commits=[ 341s repo_builder.Commit.from_spec( 341s name='unapplied1', 341s has_patches=True, 341s ), 341s repo_builder.Commit.from_spec( 341s name='unapplied1_reimport', 341s has_patches=True, 341s mutate='reimport contents', 341s ), 341s repo_builder.Commit.from_spec( 341s parents=[Placeholder('unapplied1')], 341s name='unapplied2', 341s changelog_versions=['1-2', '1-1'], 341s has_patches=True, 341s ), 341s repo_builder.Commit.from_spec( 341s name='applied1', 341s patches_applied=True, 341s ), 341s repo_builder.Commit.from_spec( 341s name='applied1_reimport', 341s patches_applied=True, 341s mutate='reimport contents', 341s ), 341s ], 341s # no branches: technically not possible but branches are not 341s # relevant to the test 341s branches={}, 341s tags={ 341s 'importer/import/1-1': 341s Placeholder('unapplied1'), 341s 'importer/reimport/import/1-1/0': 341s Placeholder('unapplied1'), 341s 'importer/reimport/import/1-1/1': 341s Placeholder('unapplied1_reimport'), 341s 'importer/import/1-2': 341s Placeholder('unapplied2'), 341s 'importer/applied/1-1': 341s Placeholder('applied1'), 341s 'importer/reimport/applied/1-1/0': 341s Placeholder('applied1'), 341s 'importer/reimport/applied/1-1/1': 341s Placeholder('applied1_reimport'), 341s }, 341s ), 341s [ 341s 'refs/tags/importer/reimport/import/1-2/0', 341s 'refs/tags/importer/reimport/import/1-2/1', 341s ], 341s [ 341s 'refs/tags/importer/reimport/applied/1-1/0', 341s 'refs/tags/importer/reimport/applied/1-1/1', 341s ], 341s marks=pytest.mark.xfail(reason='LP: #1755247'), 341s ), 341s ], 341s ) 341s @patch('gitubuntu.importer.get_import_tag_msg') 341s @patch('gitubuntu.importer.get_import_commit_msg') 341s def test_import_applied_spi_parenting( 341s get_import_commit_msg_mock, 341s get_import_tag_msg_mock, 341s repo, 341s input_repo, 341s expected_ancestor_commits, 341s expected_parent_commits, 341s ): 341s """Test that applied import commits have the right parents 341s 341s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 341s that determines the commit message to use for a given import 341s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 341s that determines the tag message to use for a given import 341s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 341s temporary output repository 341s :param repo_builder.Repo input_repo: input repository data 341s :param list(str) expected_ancestor_commits: list of commit-ish strings that 341s must be ancestors of the 'applied/1-2' tag following the applied import 341s :param list(str) expected_parent_commits: list of commit-ish strings that 341s must be parents of the 'applied/1-2' tag following the applied import. 341s 341s A fake package with version '1-2' that has a changelog parent of '1-1' is 341s imported on top of the provided input_repo. The test fails if any 341s of the expected_ancestor_commits or expected_parent_commits are not 341s present. 341s 341s This test is ugly because we do not yet have a programmatic way 341s to get the interstitial commits of the patch applications. 341s """ 341s # Match the repo_builder objects 341s get_import_tag_msg_mock.return_value = 'Test tag' 341s get_import_commit_msg_mock.return_value = b'Test commit' 341s 341s > input_repo.write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:1698: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmp5zpq8rt9/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: using patch list from debian/patches/series 341s dpkg-source: info: applying a 341s dpkg-source: info: applying b 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: using patch list from debian/patches/series 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: using patch list from debian/patches/series 341s dpkg-source: info: applying a 341s dpkg-source: info: applying b 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: using patch list from debian/patches/series 341s dpkg-source: info: building source-builder-package in source-builder-package_1-2.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-2.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: using patch list from debian/patches/series 341s dpkg-source: info: applying a 341s dpkg-source: info: applying b 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: using patch list from debian/patches/series 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: using patch list from debian/patches/series 341s dpkg-source: info: applying a 341s dpkg-source: info: applying b 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: using patch list from debian/patches/series 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: using patch list from debian/patches/series 341s dpkg-source: info: applying a 341s dpkg-source: info: applying b 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: using patch list from debian/patches/series 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s _ test_authorship_date[False-Fri, 2 Feb 1971 12:34:56 +0100-expected_result0] __ 341s 341s repo = 341s override = False, input_string = 'Fri, 2 Feb 1971 12:34:56 +0100' 341s expected_result = (1971, 2, 2, 11, 34, 56, ...) 341s 341s @pytest.mark.parametrize(['override', 'input_string', 'expected_result'], [ 341s # Standard date that should parse and be used 341s (False, 'Fri, 2 Feb 1971 12:34:56 +0100', (1971, 2, 2, 11, 34, 56, 60)), 341s # Deliberately illegal date that cannot be parsed 341s (True, 'Failday, 30 Feb 1971 99:99:99 +9999', (1972, 3, 3, 12, 45, 57, 0)), 341s ]) 341s def test_authorship_date(repo, override, input_string, expected_result): 341s """Synthesized commit should use changelog or override when provided 341s 341s A synthesized commit should use the date of the changelog entry in the 341s usual case, or commit_date when an override is requested. 341s 341s :param GitUbuntuRepository repo: fixture providing a temporary 341s GitUbuntuRepository instance to use 341s :param bool override: whether a changelog date override should be requested 341s from import_unapplied_dsc() 341s :param str input_string: the timestamp part of the changelog entry to use 341s :param tuple expected_result: the expected author date of the synthesized 341s commit, specified as six parameters to datetime.datetime() followed by 341s the expected tz offset in minutes. 341s """ 341s spec = source_builder.SourceSpec(changelog_date=input_string) 341s with source_builder.Source(spec) as dsc_pathname: 341s > target.import_unapplied_dsc( 341s repo=repo, 341s version='1-1', 341s namespace='importer', 341s dist='ubuntu', 341s dsc_pathname=dsc_pathname, 341s head_name='ubuntu/focal', 341s skip_orig=True, 341s parent_overrides={}, 341s commit_date=datetime.datetime( 341s 1972, 341s 3, 341s 3, 341s 12, 341s 45, 341s 57, 341s tzinfo=datetime.timezone.utc, 341s ), 341s changelog_date_overrides=( 341s frozenset({'1-1'}) if override else frozenset() 341s ), 341s ) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:1815: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer.py:2230: in import_unapplied_dsc 341s commit, tag = find_or_create_unapplied_commit( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer.py:2052: in find_or_create_unapplied_commit 341s changelog_parents = get_unapplied_import_parents( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer.py:1503: in get_unapplied_import_parents 341s import_tree_versions = repo.get_all_changelog_versions_from_treeish( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:2230: in get_all_changelog_versions_from_treeish 341s changelog = self.get_changelog_from_treeish(treeish) 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 341s return Changelog.from_treeish( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:569: in from_treeish 341s blob = follow_symlinks_to_blob( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 341s return _follow_symlinks_to_blob( 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s repo = pygit2.Repository('/tmp/tmpxf8i7kul/.git/') 341s top_tree_object = 341s search_path = 'debian/changelog' 341s _rel_tree = 341s _rel_path = '' 341s 341s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 341s _rel_tree=None, _rel_path='' 341s ): 341s '''Recursively follow a path down a tree, following symlinks, to find blob 341s 341s repo: pygit2.Repository object 341s top_tree: pygit2.Tree object of the top of the tree structure 341s search_path: '/'-separated path string of blob to find 341s _rel_tree: (internal) which tree to look further into 341s _rel_path: (internal) the path we are in so far 341s ''' 341s 341s NORMAL_BLOB_MODES = set([ 341s pygit2.GIT_FILEMODE_BLOB, 341s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 341s ]) 341s 341s _rel_tree = _rel_tree or top_tree_object 341s head, tail = posixpath.split(search_path) 341s 341s # A traditional functional split would put a single entry in head with tail 341s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 341s # to make it appear to have traditional semantics. 341s if not head: 341s head = tail 341s tail = None 341s 341s entry = _rel_tree[head] 341s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:68: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s _ test_authorship_date[True-Failday, 30 Feb 1971 99:99:99 +9999-expected_result1] _ 341s 341s repo = 341s override = True, input_string = 'Failday, 30 Feb 1971 99:99:99 +9999' 341s expected_result = (1972, 3, 3, 12, 45, 57, ...) 341s 341s @pytest.mark.parametrize(['override', 'input_string', 'expected_result'], [ 341s # Standard date that should parse and be used 341s (False, 'Fri, 2 Feb 1971 12:34:56 +0100', (1971, 2, 2, 11, 34, 56, 60)), 341s # Deliberately illegal date that cannot be parsed 341s (True, 'Failday, 30 Feb 1971 99:99:99 +9999', (1972, 3, 3, 12, 45, 57, 0)), 341s ]) 341s def test_authorship_date(repo, override, input_string, expected_result): 341s """Synthesized commit should use changelog or override when provided 341s 341s A synthesized commit should use the date of the changelog entry in the 341s usual case, or commit_date when an override is requested. 341s 341s :param GitUbuntuRepository repo: fixture providing a temporary 341s GitUbuntuRepository instance to use 341s :param bool override: whether a changelog date override should be requested 341s from import_unapplied_dsc() 341s :param str input_string: the timestamp part of the changelog entry to use 341s :param tuple expected_result: the expected author date of the synthesized 341s commit, specified as six parameters to datetime.datetime() followed by 341s the expected tz offset in minutes. 341s """ 341s spec = source_builder.SourceSpec(changelog_date=input_string) 341s with source_builder.Source(spec) as dsc_pathname: 341s > target.import_unapplied_dsc( 341s repo=repo, 341s version='1-1', 341s namespace='importer', 341s dist='ubuntu', 341s dsc_pathname=dsc_pathname, 341s head_name='ubuntu/focal', 341s skip_orig=True, 341s parent_overrides={}, 341s commit_date=datetime.datetime( 341s 1972, 341s 3, 341s 3, 341s 12, 341s 45, 341s 57, 341s tzinfo=datetime.timezone.utc, 341s ), 341s changelog_date_overrides=( 341s frozenset({'1-1'}) if override else frozenset() 341s ), 341s ) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:1815: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer.py:2230: in import_unapplied_dsc 341s commit, tag = find_or_create_unapplied_commit( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer.py:2052: in find_or_create_unapplied_commit 341s changelog_parents = get_unapplied_import_parents( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer.py:1503: in get_unapplied_import_parents 341s import_tree_versions = repo.get_all_changelog_versions_from_treeish( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:2230: in get_all_changelog_versions_from_treeish 341s changelog = self.get_changelog_from_treeish(treeish) 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 341s return Changelog.from_treeish( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:569: in from_treeish 341s blob = follow_symlinks_to_blob( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 341s return _follow_symlinks_to_blob( 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s repo = pygit2.Repository('/tmp/tmptpm0pvfx/.git/') 341s top_tree_object = 341s search_path = 'debian/changelog' 341s _rel_tree = 341s _rel_path = '' 341s 341s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 341s _rel_tree=None, _rel_path='' 341s ): 341s '''Recursively follow a path down a tree, following symlinks, to find blob 341s 341s repo: pygit2.Repository object 341s top_tree: pygit2.Tree object of the top of the tree structure 341s search_path: '/'-separated path string of blob to find 341s _rel_tree: (internal) which tree to look further into 341s _rel_path: (internal) the path we are in so far 341s ''' 341s 341s NORMAL_BLOB_MODES = set([ 341s pygit2.GIT_FILEMODE_BLOB, 341s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 341s ]) 341s 341s _rel_tree = _rel_tree or top_tree_object 341s head, tail = posixpath.split(search_path) 341s 341s # A traditional functional split would put a single entry in head with tail 341s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 341s # to make it appear to have traditional semantics. 341s if not head: 341s head = tail 341s tail = None 341s 341s entry = _rel_tree[head] 341s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:68: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: srcpkg/debian/changelog(l4): ignoring invalid week day 'Failday' 341s LINE: -- git ubuntu Failday, 30 Feb 1971 99:99:99 +9999 341s dpkg-source: warning: srcpkg/debian/changelog(l4): cannot parse non-conformant date '30 Feb 1971 99:99:99 +9999' 341s LINE: -- git ubuntu Failday, 30 Feb 1971 99:99:99 +9999 341s dpkg-source: warning: missing information for output field Standards-Version 341s __________________ test_fetch_rich_history_from_changes_file ___________________ 341s 341s repo = 341s pygit2_repo = pygit2.Repository('/tmp/tmpm5s5wv23/.git/') 341s 341s @patch('gitubuntu.importer.LAUNCHPAD_GIT_HOSTING_URL_PREFIX', 'file://') 341s @patch('gitubuntu.importer.VCS_GIT_URL_VALIDATION', re.compile(r'.*')) 341s def test_fetch_rich_history_from_changes_file(repo, pygit2_repo): 341s """Rich history specified in a changes file is found and validated""" 341s > rich_commit, parent_commit, import_tree = populate_rich_history( 341s import_repo=repo.raw_repo, 341s uploader_repo=pygit2_repo, 341s ) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:2111: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:2080: in populate_rich_history 341s ).write(import_repo) 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmpt_2zf_fg/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s ________ test_fetch_rich_history_from_changes_file_fetch_failure_retry _________ 341s 341s repo = 341s pygit2_repo = pygit2.Repository('/tmp/tmpkwakh7rp/.git/') 341s 341s @patch('gitubuntu.importer.LAUNCHPAD_GIT_HOSTING_URL_PREFIX', 'file://') 341s @patch('gitubuntu.importer.VCS_GIT_URL_VALIDATION', re.compile(r'.*')) 341s def test_fetch_rich_history_from_changes_file_fetch_failure_retry( 341s repo, 341s pygit2_repo, 341s ): 341s """If rich history cannot be fetched once, it is retried""" 341s > rich_commit, parent_commit, import_tree = populate_rich_history( 341s import_repo=repo.raw_repo, 341s uploader_repo=pygit2_repo, 341s ) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:2204: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:2080: in populate_rich_history 341s ).write(import_repo) 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmps9ddd6x8/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s ____________ test_fetch_rich_history_from_changes_file_missing_ref _____________ 341s 341s repo = 341s pygit2_repo = pygit2.Repository('/tmp/tmpgf9qmqti/.git/') 341s 341s @patch('gitubuntu.importer.LAUNCHPAD_GIT_HOSTING_URL_PREFIX', 'file://') 341s @patch('gitubuntu.importer.VCS_GIT_URL_VALIDATION', re.compile(r'.*')) 341s def test_fetch_rich_history_from_changes_file_missing_ref( 341s repo, 341s pygit2_repo, 341s ): 341s """If rich history is specified but the ref cannot be found, a hard 341s exception is raised 341s """ 341s > rich_commit, _, _ = populate_rich_history( 341s import_repo=repo.raw_repo, 341s uploader_repo=pygit2_repo, 341s ) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:2243: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:2080: in populate_rich_history 341s ).write(import_repo) 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmptt2yhhg_/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s ___________ test_fetch_rich_history_from_changes_file_missing_commit ___________ 341s 341s repo = 341s pygit2_repo = pygit2.Repository('/tmp/tmphhs159oz/.git/') 341s 341s @patch('gitubuntu.importer.LAUNCHPAD_GIT_HOSTING_URL_PREFIX', 'file://') 341s @patch('gitubuntu.importer.VCS_GIT_URL_VALIDATION', re.compile(r'.*')) 341s def test_fetch_rich_history_from_changes_file_missing_commit( 341s repo, 341s pygit2_repo, 341s ): 341s """If rich history is specified but the commit cannot be found, an 341s exception is raised 341s """ 341s > rich_commit, _, _ = populate_rich_history( 341s import_repo=repo.raw_repo, 341s uploader_repo=pygit2_repo, 341s ) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:2271: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:2080: in populate_rich_history 341s ).write(import_repo) 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmpf2foqp01/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s ____________ test_fetch_rich_history_from_changes_file_not_a_commit ____________ 341s 341s repo = 341s pygit2_repo = pygit2.Repository('/tmp/tmp3ox3sbv9/.git/') 341s 341s @patch('gitubuntu.importer.LAUNCHPAD_GIT_HOSTING_URL_PREFIX', 'file://') 341s @patch('gitubuntu.importer.VCS_GIT_URL_VALIDATION', re.compile(r'.*')) 341s def test_fetch_rich_history_from_changes_file_not_a_commit(repo, pygit2_repo): 341s """If rich history is specified but the commit hash resolves to something 341s other than a commit, an exception is raised 341s """ 341s > rich_commit, _, _ = populate_rich_history( 341s import_repo=repo.raw_repo, 341s uploader_repo=pygit2_repo, 341s ) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:2297: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/importer_test.py:2080: in populate_rich_history 341s ).write(import_repo) 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmp1pjoggoy/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s __________________________ test_reconstruct_changelog __________________________ 341s 341s pygit2_repo = pygit2.Repository('/tmp/tmps2_nl340/.git/') 341s monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0xeb3a4a1798e0> 341s 341s @pytest.mark.skipif( 341s ENTRY_POINT_TYPE is None, 341s reason="Entry point testing not available", 341s ) 341s def test_reconstruct_changelog(pygit2_repo, monkeypatch): 341s '''The reconstruct-changelog endpoint should add the expected commit''' 341s monkeypatch.setenv('DEBFULLNAME', 'Test User') 341s monkeypatch.setenv('DEBEMAIL', 'test@example.com') 341s Repo( 341s commits=[ 341s Commit(tree=SourceTree(Source()), name='root'), 341s Commit( 341s tree=SourceTree(Source(spec=SourceSpec(mutate=1))), 341s message=' * Test changelog entry', 341s name='child', 341s parents=[Placeholder('root')], 341s ), 341s ], 341s tags={'root': Placeholder('root'), 'child': Placeholder('child')}, 341s > ).write(pygit2_repo) 341s 341s gitubuntu/integration_test.py:219: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmps2_nl340/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s gitubuntu/repo_builder.py:389: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s dpkg-source: warning: missing information for output field Standards-Version 341s ___________________ TestObjectCreation.testRepoBranchesTags ____________________ 341s 341s self = 341s 341s def testRepoBranchesTags(self): 341s graph = Repo( 341s commits=[ 341s Commit( 341s Tree({}), 341s parents=[Placeholder('parent')], 341s name='child', 341s ), 341s Commit(Tree({}), name='parent'), 341s ], 341s branches={ 341s 'branch1': Placeholder('parent'), 341s 'branch2': Commit(Tree({'foo': Blob(b'qux')})), 341s }, 341s tags={ 341s 'tag1': Placeholder('child'), 341s 'tag2': Commit(Tree({'foo': Blob(b'quz')})), 341s }, 341s ) 341s > child_ref = graph.write(self.repo) 341s 341s gitubuntu/repo_builder_test.py:154: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmp455yjt4k/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s gitubuntu/repo_builder.py:389: AttributeError 341s ______________________ TestObjectCreation.testRepoTagger _______________________ 341s 341s self = 341s 341s def testRepoTagger(self): 341s """The tagger parameter should make it through to the tag""" 341s input_repo = Repo( 341s commits=[Commit(name='root')], 341s tags={'root': Placeholder('root')}, 341s tagger=pygit2.Signature( 341s 'Test Tagger', 341s 'test@example.com', 341s 1, 341s 2, 341s ), 341s ) 341s > input_repo.write(self.repo) 341s 341s gitubuntu/repo_builder_test.py:178: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmpd641t4h1/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s gitubuntu/repo_builder.py:389: AttributeError 341s _______________________________ test_source_tree _______________________________ 341s 341s pygit2_repo = pygit2.Repository('/tmp/tmptqumopex/.git/') 341s 341s def test_source_tree(pygit2_repo): 341s commit_str = Commit(SourceTree(Source())).write(pygit2_repo) 341s commit = pygit2_repo.get(commit_str) 341s > assert gitubuntu.git_repository.follow_symlinks_to_blob( 341s repo=pygit2_repo, 341s treeish_object=commit, 341s path='debian/changelog', 341s ) 341s 341s gitubuntu/repo_builder_test.py:190: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 341s return _follow_symlinks_to_blob( 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s repo = pygit2.Repository('/tmp/tmptqumopex/.git/') 341s top_tree_object = 341s search_path = 'debian/changelog' 341s _rel_tree = 341s _rel_path = '' 341s 341s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 341s _rel_tree=None, _rel_path='' 341s ): 341s '''Recursively follow a path down a tree, following symlinks, to find blob 341s 341s repo: pygit2.Repository object 341s top_tree: pygit2.Tree object of the top of the tree structure 341s search_path: '/'-separated path string of blob to find 341s _rel_tree: (internal) which tree to look further into 341s _rel_path: (internal) the path we are in so far 341s ''' 341s 341s NORMAL_BLOB_MODES = set([ 341s pygit2.GIT_FILEMODE_BLOB, 341s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 341s ]) 341s 341s _rel_tree = _rel_tree or top_tree_object 341s head, tail = posixpath.split(search_path) 341s 341s # A traditional functional split would put a single entry in head with tail 341s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 341s # to make it appear to have traditional semantics. 341s if not head: 341s head = tail 341s tail = None 341s 341s entry = _rel_tree[head] 341s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 341s 341s gitubuntu/git_repository.py:68: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s ______________________________ test_preservation _______________________________ 341s 341s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_preservation0') 341s repo = 341s 341s def test_preservation(tmpdir, repo): 341s """An export followed by an import should preserve rich history 341s 341s Given a minimal repository that should be able to have upload tags be 341s exported, when we import the export result into a similar repository with a 341s subtly different upload tag in which the rich history should still apply, 341s the result should be a correctly reconstructed upload tag. 341s 341s :param py.path tmpdir: the pytest standard tmpdir fixture. 341s :param repo: our standard repo fixture. 341s """ 341s Repo( 341s commits=[ 341s Commit( 341s name='1', 341s tree=Tree({ 341s 'a': Blob(b'a'), 341s }), 341s ), 341s Commit( 341s name='2', 341s parents=[Placeholder('1')], 341s tree=Tree({ 341s 'a': Blob(b'ab'), 341s }), 341s ), 341s Commit( 341s name='3', 341s parents=[Placeholder('2')], 341s tree=Tree({ 341s 'a': Blob(b'abc'), 341s }), 341s ), 341s ], 341s tags={ 341s 'importer/import/1': Placeholder('1'), 341s 'importer/upload/2': Placeholder('3'), 341s } 341s > ).write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/rich_history_test.py:51: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmpefajqtxr/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s ______________________ test_preservation_multiple_parents ______________________ 341s 341s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_preservation_multiple_par0') 341s repo = 341s 341s def test_preservation_multiple_parents(tmpdir, repo): 341s """An export of rich history should omit multiple parent cases 341s 341s If an upload tag leads to multiple parents before we reach an import tag, 341s it should be excluded from the export as this type of upload tag is not 341s supported for rich history preservation. This test also serves to verify 341s code paths that handle the MultipleParentError exception in the export 341s code. 341s 341s :param py.path tmpdir: the pytest standard tmpdir fixture. 341s :param repo: our standard repo fixture. 341s """ 341s Repo( 341s commits=[ 341s Commit(name='1', message='a'), 341s Commit(name='2', message='b'), 341s Commit(name='child', parents=[Placeholder('1'), Placeholder('2')]), 341s ], 341s tags={ 341s 'importer/import/1': Placeholder('1'), 341s 'importer/upload/2': Placeholder('child'), 341s } 341s > ).write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/rich_history_test.py:102: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmp_995c4z9/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s _________________________ test_preservation_no_parents _________________________ 341s 341s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_preservation_no_parents0') 341s repo = 341s 341s def test_preservation_no_parents(tmpdir, repo): 341s """An export of rich history should omit no parent cases 341s 341s If an upload tag leads to no parents before we reach an import tag, 341s it should be excluded from the export as this type of upload tag is not 341s supported for rich history preservation. This test also serves to verify 341s code paths that handle the NoParentError exception in the export 341s code. 341s 341s :param py.path tmpdir: the pytest standard tmpdir fixture. 341s :param repo: our standard repo fixture. 341s """ 341s Repo( 341s commits=[ 341s Commit(name='1', message='a'), 341s Commit(name='2', message='b'), 341s ], 341s tags={ 341s 'importer/import/1': Placeholder('1'), 341s 'importer/upload/2': Placeholder('2'), 341s } 341s > ).write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/rich_history_test.py:129: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmpg8g6qc7h/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s _____________ test_input_edge_cases[before_export0-before_import0] _____________ 341s 341s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_input_edge_cases_before_e0') 341s repo = 341s before_export = {'commits': [, , 'importer/upload/2': }} 341s before_import = {'commits': [], 'tags': {'importer/import/1': }} 341s 341s @pytest.mark.parametrize(['before_export', 'before_import'], [ 341s ( 341s # Commit messages with patch-like contents should not fail 341s 341s # If a commit message in rich history contains text in a patch-like 341s # format (such as a diff of some file), it should not prevent correct 341s # round-tripping. "git format-patch" followed by "git am" fails this 341s # test, for example. 341s { 341s 'commits': [ 341s Commit(name='1', message='a', tree=Tree({'a': Blob(b'a')})), 341s Commit( 341s name='2', 341s message='''First line 341s 341s Inline patch that isn't part of the real patch starts here 341s 341s --- a/foo 341s +++ b/foo 341s @@ -1 +1,2 @@ 341s foo 341s +bar 341s ''', 341s tree=Tree({'a': Blob(b'ab')}), 341s parents=[Placeholder('1')], 341s ), 341s ], 341s 'tags': { 341s 'importer/import/1': Placeholder('1'), 341s 'importer/upload/2': Placeholder('2'), 341s } 341s }, 341s { 341s 'commits': [ 341s Commit(name='b1', message='c', tree=Tree({'a': Blob(b'a')})), 341s ], 341s 'tags': {'importer/import/1': Placeholder('b1')}, 341s }, 341s ), 341s ( 341s # Commits that have no changes should round trip 341s { 341s 'commits': [ 341s Commit( 341s name='1', 341s message='a', 341s ), 341s Commit( 341s name='2', 341s message='b', 341s parents=[Placeholder('1')], 341s ), 341s ], 341s 'tags': { 341s 'importer/import/1': Placeholder('1'), 341s 'importer/upload/2': Placeholder('2'), 341s }, 341s }, 341s { 341s 'commits': [Commit(name='b1', message='c')], 341s 'tags': {'importer/import/1': Placeholder('b1')}, 341s }, 341s ), 341s ( 341s # Commits that have no commit message should round trip 341s { 341s 'commits': [ 341s Commit( 341s name='1', 341s message='a', 341s ), 341s Commit( 341s name='2', 341s message='', 341s tree=Tree({'a': Blob(b'a')}), 341s parents=[Placeholder('1')], 341s ), 341s ], 341s 'tags': { 341s 'importer/import/1': Placeholder('1'), 341s 'importer/upload/2': Placeholder('2'), 341s } 341s }, 341s { 341s 'commits': [Commit(name='b1', message='c')], 341s 'tags': {'importer/import/1': Placeholder('b1')}, 341s }, 341s ), 341s ]) 341s def test_input_edge_cases(tmpdir, repo, before_export, before_import): 341s """ 341s Edge cases in input rich history should reimport without failure 341s 341s Check that rich history preservation completes without an exception in 341s various cases. Details of each case are described in comments in the test 341s parameters above. 341s 341s Since these tests generally cover the mutated case (where rich history has 341s to be ported forward because parent commits have mutated), we must remove 341s and recreate the 'importer/import/1' tag so that it is different before 341s attempting reimport. This is done by deleting all ('importer/*') tags and 341s then using the before_import parameter to recreate it again. 341s 341s :param py.path tmpdir: the pytest standard tmpdir fixture. 341s :param GitUbuntuRepository repo: our standard repo fixture. 341s :param dict before_export: the parameters to supply to Repo() to construct 341s the repository that will be exported. 341s :param dict before_import: the parametsrs to supply to Repo() to add to the 341s repository before attempting reimport. 341s """ 341s > Repo(**before_export).write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/rich_history_test.py:260: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmpnj_mhxlm/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s _____________ test_input_edge_cases[before_export1-before_import1] _____________ 341s 341s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_input_edge_cases_before_e1') 341s repo = 341s before_export = {'commits': [, , 'importer/upload/2': }} 341s before_import = {'commits': [], 'tags': {'importer/import/1': }} 341s 341s @pytest.mark.parametrize(['before_export', 'before_import'], [ 341s ( 341s # Commit messages with patch-like contents should not fail 341s 341s # If a commit message in rich history contains text in a patch-like 341s # format (such as a diff of some file), it should not prevent correct 341s # round-tripping. "git format-patch" followed by "git am" fails this 341s # test, for example. 341s { 341s 'commits': [ 341s Commit(name='1', message='a', tree=Tree({'a': Blob(b'a')})), 341s Commit( 341s name='2', 341s message='''First line 341s 341s Inline patch that isn't part of the real patch starts here 341s 341s --- a/foo 341s +++ b/foo 341s @@ -1 +1,2 @@ 341s foo 341s +bar 341s ''', 341s tree=Tree({'a': Blob(b'ab')}), 341s parents=[Placeholder('1')], 341s ), 341s ], 341s 'tags': { 341s 'importer/import/1': Placeholder('1'), 341s 'importer/upload/2': Placeholder('2'), 341s } 341s }, 341s { 341s 'commits': [ 341s Commit(name='b1', message='c', tree=Tree({'a': Blob(b'a')})), 341s ], 341s 'tags': {'importer/import/1': Placeholder('b1')}, 341s }, 341s ), 341s ( 341s # Commits that have no changes should round trip 341s { 341s 'commits': [ 341s Commit( 341s name='1', 341s message='a', 341s ), 341s Commit( 341s name='2', 341s message='b', 341s parents=[Placeholder('1')], 341s ), 341s ], 341s 'tags': { 341s 'importer/import/1': Placeholder('1'), 341s 'importer/upload/2': Placeholder('2'), 341s }, 341s }, 341s { 341s 'commits': [Commit(name='b1', message='c')], 341s 'tags': {'importer/import/1': Placeholder('b1')}, 341s }, 341s ), 341s ( 341s # Commits that have no commit message should round trip 341s { 341s 'commits': [ 341s Commit( 341s name='1', 341s message='a', 341s ), 341s Commit( 341s name='2', 341s message='', 341s tree=Tree({'a': Blob(b'a')}), 341s parents=[Placeholder('1')], 341s ), 341s ], 341s 'tags': { 341s 'importer/import/1': Placeholder('1'), 341s 'importer/upload/2': Placeholder('2'), 341s } 341s }, 341s { 341s 'commits': [Commit(name='b1', message='c')], 341s 'tags': {'importer/import/1': Placeholder('b1')}, 341s }, 341s ), 341s ]) 341s def test_input_edge_cases(tmpdir, repo, before_export, before_import): 341s """ 341s Edge cases in input rich history should reimport without failure 341s 341s Check that rich history preservation completes without an exception in 341s various cases. Details of each case are described in comments in the test 341s parameters above. 341s 341s Since these tests generally cover the mutated case (where rich history has 341s to be ported forward because parent commits have mutated), we must remove 341s and recreate the 'importer/import/1' tag so that it is different before 341s attempting reimport. This is done by deleting all ('importer/*') tags and 341s then using the before_import parameter to recreate it again. 341s 341s :param py.path tmpdir: the pytest standard tmpdir fixture. 341s :param GitUbuntuRepository repo: our standard repo fixture. 341s :param dict before_export: the parameters to supply to Repo() to construct 341s the repository that will be exported. 341s :param dict before_import: the parametsrs to supply to Repo() to add to the 341s repository before attempting reimport. 341s """ 341s > Repo(**before_export).write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/rich_history_test.py:260: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmpg3_gnvsz/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s _____________ test_input_edge_cases[before_export2-before_import2] _____________ 341s 341s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_input_edge_cases_before_e2') 341s repo = 341s before_export = {'commits': [, , 'importer/upload/2': }} 341s before_import = {'commits': [], 'tags': {'importer/import/1': }} 341s 341s @pytest.mark.parametrize(['before_export', 'before_import'], [ 341s ( 341s # Commit messages with patch-like contents should not fail 341s 341s # If a commit message in rich history contains text in a patch-like 341s # format (such as a diff of some file), it should not prevent correct 341s # round-tripping. "git format-patch" followed by "git am" fails this 341s # test, for example. 341s { 341s 'commits': [ 341s Commit(name='1', message='a', tree=Tree({'a': Blob(b'a')})), 341s Commit( 341s name='2', 341s message='''First line 341s 341s Inline patch that isn't part of the real patch starts here 341s 341s --- a/foo 341s +++ b/foo 341s @@ -1 +1,2 @@ 341s foo 341s +bar 341s ''', 341s tree=Tree({'a': Blob(b'ab')}), 341s parents=[Placeholder('1')], 341s ), 341s ], 341s 'tags': { 341s 'importer/import/1': Placeholder('1'), 341s 'importer/upload/2': Placeholder('2'), 341s } 341s }, 341s { 341s 'commits': [ 341s Commit(name='b1', message='c', tree=Tree({'a': Blob(b'a')})), 341s ], 341s 'tags': {'importer/import/1': Placeholder('b1')}, 341s }, 341s ), 341s ( 341s # Commits that have no changes should round trip 341s { 341s 'commits': [ 341s Commit( 341s name='1', 341s message='a', 341s ), 341s Commit( 341s name='2', 341s message='b', 341s parents=[Placeholder('1')], 341s ), 341s ], 341s 'tags': { 341s 'importer/import/1': Placeholder('1'), 341s 'importer/upload/2': Placeholder('2'), 341s }, 341s }, 341s { 341s 'commits': [Commit(name='b1', message='c')], 341s 'tags': {'importer/import/1': Placeholder('b1')}, 341s }, 341s ), 341s ( 341s # Commits that have no commit message should round trip 341s { 341s 'commits': [ 341s Commit( 341s name='1', 341s message='a', 341s ), 341s Commit( 341s name='2', 341s message='', 341s tree=Tree({'a': Blob(b'a')}), 341s parents=[Placeholder('1')], 341s ), 341s ], 341s 'tags': { 341s 'importer/import/1': Placeholder('1'), 341s 'importer/upload/2': Placeholder('2'), 341s } 341s }, 341s { 341s 'commits': [Commit(name='b1', message='c')], 341s 'tags': {'importer/import/1': Placeholder('b1')}, 341s }, 341s ), 341s ]) 341s def test_input_edge_cases(tmpdir, repo, before_export, before_import): 341s """ 341s Edge cases in input rich history should reimport without failure 341s 341s Check that rich history preservation completes without an exception in 341s various cases. Details of each case are described in comments in the test 341s parameters above. 341s 341s Since these tests generally cover the mutated case (where rich history has 341s to be ported forward because parent commits have mutated), we must remove 341s and recreate the 'importer/import/1' tag so that it is different before 341s attempting reimport. This is done by deleting all ('importer/*') tags and 341s then using the before_import parameter to recreate it again. 341s 341s :param py.path tmpdir: the pytest standard tmpdir fixture. 341s :param GitUbuntuRepository repo: our standard repo fixture. 341s :param dict before_export: the parameters to supply to Repo() to construct 341s the repository that will be exported. 341s :param dict before_import: the parametsrs to supply to Repo() to add to the 341s repository before attempting reimport. 341s """ 341s > Repo(**before_export).write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/rich_history_test.py:260: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmpzxyy9mnh/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s _______________________ test_preservation_fast_forwards ________________________ 341s 341s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_preservation_fast_forward0') 341s repo = 341s 341s def test_preservation_fast_forwards(tmpdir, repo): 341s """Rich history that can be fast forwarded should not mutate 341s 341s :param py.path tmpdir: the pytest standard tmpdir fixture. 341s :param GitUbuntuRepository repo: our standard repo fixture. 341s """ 341s Repo( 341s commits=[ 341s Commit( 341s name='1', 341s message='a', 341s ), 341s Commit( 341s name='2', 341s message='', 341s tree=Tree({'a': Blob(b'a')}), 341s parents=[Placeholder('1')], 341s ), 341s ], 341s tags={ 341s 'importer/import/1': Placeholder('1'), 341s 'importer/upload/2': Placeholder('2'), 341s } 341s > ).write(repo.raw_repo) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/rich_history_test.py:294: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s self = 341s repo = pygit2.Repository('/tmp/tmpzuk93tn_/.git/'), record = {} 341s 341s def write(self, repo, record=None): 341s replace_placeholders(self) 341s record = record or dict() 341s written_commits = [ 341s commit.write(repo=repo, record=record) 341s for commit 341s in self.commit_list 341s ] 341s for name, target in self.branches.items(): 341s repo.create_branch( 341s name, 341s repo.get(target.write(repo)).peel(pygit2.Commit), 341s ) 341s for name, target in self.tags.items(): 341s repo.create_tag( 341s name, 341s target.write(repo), 341s > pygit2.GIT_OBJ_COMMIT, 341s self.tagger.signature, 341s 'Tag message', 341s ) 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/repo_builder.py:389: AttributeError 341s _______________________ test_source_create_with_version ________________________ 341s 341s repo = 341s 341s def test_source_create_with_version(repo): 341s > version = get_spec_changelog_version(repo, version='3', native=True) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/source_builder_test.py:57: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/source_builder_test.py:47: in get_spec_changelog_version 341s changelog = repo.get_changelog_from_treeish(tree_hash) 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 341s return Changelog.from_treeish( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:569: in from_treeish 341s blob = follow_symlinks_to_blob( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 341s return _follow_symlinks_to_blob( 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s repo = pygit2.Repository('/tmp/tmpdbya51ow/.git/') 341s top_tree_object = 341s search_path = 'debian/changelog' 341s _rel_tree = 341s _rel_path = '' 341s 341s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 341s _rel_tree=None, _rel_path='' 341s ): 341s '''Recursively follow a path down a tree, following symlinks, to find blob 341s 341s repo: pygit2.Repository object 341s top_tree: pygit2.Tree object of the top of the tree structure 341s search_path: '/'-separated path string of blob to find 341s _rel_tree: (internal) which tree to look further into 341s _rel_path: (internal) the path we are in so far 341s ''' 341s 341s NORMAL_BLOB_MODES = set([ 341s pygit2.GIT_FILEMODE_BLOB, 341s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 341s ]) 341s 341s _rel_tree = _rel_tree or top_tree_object 341s head, tail = posixpath.split(search_path) 341s 341s # A traditional functional split would put a single entry in head with tail 341s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 341s # to make it appear to have traditional semantics. 341s if not head: 341s head = tail 341s tail = None 341s 341s entry = _rel_tree[head] 341s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:68: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (native)' 341s dpkg-source: info: building source-builder-package in source-builder-package_3.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_3.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s _______________________ test_source_create_with_versions _______________________ 341s 341s repo = 341s 341s def test_source_create_with_versions(repo): 341s source_spec = target.SourceSpec(changelog_versions=['3', '4'], native=True) 341s with target.Source(source_spec) as f: 341s tree_hash = importer.dsc_to_tree_hash(repo.raw_repo, f) 341s > changelog = repo.get_changelog_from_treeish(tree_hash) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/source_builder_test.py:65: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 341s return Changelog.from_treeish( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:569: in from_treeish 341s blob = follow_symlinks_to_blob( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 341s return _follow_symlinks_to_blob( 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s repo = pygit2.Repository('/tmp/tmp5p7m7mmz/.git/') 341s top_tree_object = 341s search_path = 'debian/changelog' 341s _rel_tree = 341s _rel_path = '' 341s 341s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 341s _rel_tree=None, _rel_path='' 341s ): 341s '''Recursively follow a path down a tree, following symlinks, to find blob 341s 341s repo: pygit2.Repository object 341s top_tree: pygit2.Tree object of the top of the tree structure 341s search_path: '/'-separated path string of blob to find 341s _rel_tree: (internal) which tree to look further into 341s _rel_path: (internal) the path we are in so far 341s ''' 341s 341s NORMAL_BLOB_MODES = set([ 341s pygit2.GIT_FILEMODE_BLOB, 341s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 341s ]) 341s 341s _rel_tree = _rel_tree or top_tree_object 341s head, tail = posixpath.split(search_path) 341s 341s # A traditional functional split would put a single entry in head with tail 341s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 341s # to make it appear to have traditional semantics. 341s if not head: 341s head = tail 341s tail = None 341s 341s entry = _rel_tree[head] 341s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:68: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (native)' 341s dpkg-source: info: building source-builder-package in source-builder-package_3.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_3.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s ____________ test_source_native_source_format[True-3.0 (native)\n] _____________ 341s 341s repo = 341s native = True, expected = b'3.0 (native)\n' 341s 341s @pytest.mark.parametrize('native,expected', [ 341s (True, b"3.0 (native)\n"), 341s (False, b"3.0 (quilt)\n"), 341s ]) 341s def test_source_native_source_format(repo, native, expected): 341s with target.Source(target.SourceSpec(native=native)) as dsc_path: 341s > blob = git_repository.follow_symlinks_to_blob( 341s repo.raw_repo, 341s dsc_path_to_tree(repo, dsc_path), 341s 'debian/source/format', 341s ) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/source_builder_test.py:133: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 341s return _follow_symlinks_to_blob( 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s repo = pygit2.Repository('/tmp/tmpod_49lja/.git/') 341s top_tree_object = 341s search_path = 'debian/source/format' 341s _rel_tree = 341s _rel_path = '' 341s 341s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 341s _rel_tree=None, _rel_path='' 341s ): 341s '''Recursively follow a path down a tree, following symlinks, to find blob 341s 341s repo: pygit2.Repository object 341s top_tree: pygit2.Tree object of the top of the tree structure 341s search_path: '/'-separated path string of blob to find 341s _rel_tree: (internal) which tree to look further into 341s _rel_path: (internal) the path we are in so far 341s ''' 341s 341s NORMAL_BLOB_MODES = set([ 341s pygit2.GIT_FILEMODE_BLOB, 341s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 341s ]) 341s 341s _rel_tree = _rel_tree or top_tree_object 341s head, tail = posixpath.split(search_path) 341s 341s # A traditional functional split would put a single entry in head with tail 341s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 341s # to make it appear to have traditional semantics. 341s if not head: 341s head = tail 341s tail = None 341s 341s entry = _rel_tree[head] 341s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:68: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (native)' 341s dpkg-source: info: building source-builder-package in source-builder-package_1.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s ____________ test_source_native_source_format[False-3.0 (quilt)\n] _____________ 341s 341s repo = 341s native = False, expected = b'3.0 (quilt)\n' 341s 341s @pytest.mark.parametrize('native,expected', [ 341s (True, b"3.0 (native)\n"), 341s (False, b"3.0 (quilt)\n"), 341s ]) 341s def test_source_native_source_format(repo, native, expected): 341s with target.Source(target.SourceSpec(native=native)) as dsc_path: 341s > blob = git_repository.follow_symlinks_to_blob( 341s repo.raw_repo, 341s dsc_path_to_tree(repo, dsc_path), 341s 'debian/source/format', 341s ) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/source_builder_test.py:133: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 341s return _follow_symlinks_to_blob( 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s repo = pygit2.Repository('/tmp/tmpohto5asa/.git/') 341s top_tree_object = 341s search_path = 'debian/source/format' 341s _rel_tree = 341s _rel_path = '' 341s 341s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 341s _rel_tree=None, _rel_path='' 341s ): 341s '''Recursively follow a path down a tree, following symlinks, to find blob 341s 341s repo: pygit2.Repository object 341s top_tree: pygit2.Tree object of the top of the tree structure 341s search_path: '/'-separated path string of blob to find 341s _rel_tree: (internal) which tree to look further into 341s _rel_path: (internal) the path we are in so far 341s ''' 341s 341s NORMAL_BLOB_MODES = set([ 341s pygit2.GIT_FILEMODE_BLOB, 341s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 341s ]) 341s 341s _rel_tree = _rel_tree or top_tree_object 341s head, tail = posixpath.split(search_path) 341s 341s # A traditional functional split would put a single entry in head with tail 341s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 341s # to make it appear to have traditional semantics. 341s if not head: 341s head = tail 341s tail = None 341s 341s entry = _rel_tree[head] 341s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:68: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s _________________________ test_source_quilt_no_patches _________________________ 341s 341s repo = 341s 341s def test_source_quilt_no_patches(repo): 341s with target.Source(target.SourceSpec()) as dsc_path: 341s top = dsc_path_to_tree(repo, dsc_path) 341s debian_entry = top['debian'] 341s > assert debian_entry.type in [pygit2.GIT_OBJ_TREE, 'tree'] 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/source_builder_test.py:144: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s ________________________ test_source_quilt_with_patches ________________________ 341s 341s repo = 341s 341s def test_source_quilt_with_patches(repo): 341s spec = target.SourceSpec(has_patches=True) 341s with target.Source(spec) as dsc_path: 341s top = dsc_path_to_tree(repo, dsc_path) 341s expected_files = ['series', 'a', 'b'] 341s for basename in expected_files: 341s > assert git_repository.follow_symlinks_to_blob( 341s repo.raw_repo, 341s top, 341s 'debian/patches/%s' % basename, 341s ) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/source_builder_test.py:156: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 341s return _follow_symlinks_to_blob( 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s repo = pygit2.Repository('/tmp/tmpi8x7hgkk/.git/') 341s top_tree_object = 341s search_path = 'debian/patches/series' 341s _rel_tree = 341s _rel_path = '' 341s 341s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 341s _rel_tree=None, _rel_path='' 341s ): 341s '''Recursively follow a path down a tree, following symlinks, to find blob 341s 341s repo: pygit2.Repository object 341s top_tree: pygit2.Tree object of the top of the tree structure 341s search_path: '/'-separated path string of blob to find 341s _rel_tree: (internal) which tree to look further into 341s _rel_path: (internal) the path we are in so far 341s ''' 341s 341s NORMAL_BLOB_MODES = set([ 341s pygit2.GIT_FILEMODE_BLOB, 341s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 341s ]) 341s 341s _rel_tree = _rel_tree or top_tree_object 341s head, tail = posixpath.split(search_path) 341s 341s # A traditional functional split would put a single entry in head with tail 341s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 341s # to make it appear to have traditional semantics. 341s if not head: 341s head = tail 341s tail = None 341s 341s entry = _rel_tree[head] 341s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:68: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: using patch list from debian/patches/series 341s dpkg-source: info: applying a 341s dpkg-source: info: applying b 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: using patch list from debian/patches/series 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s ____________________ test_source_quilt_with_patches_applied ____________________ 341s 341s repo = 341s 341s def test_source_quilt_with_patches_applied(repo): 341s spec = target.SourceSpec(has_patches=True) 341s with target.Source(spec) as dsc_path: 341s top = dsc_path_to_tree(repo, dsc_path, patches_applied=True) 341s expected_files = [ 341s 'debian/patches/series', 341s 'debian/patches/a', 341s 'debian/patches/b', 341s 'a', 341s 'b', 341s ] 341s for filename in expected_files: 341s > assert git_repository.follow_symlinks_to_blob( 341s repo.raw_repo, 341s top, 341s filename, 341s ) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/source_builder_test.py:183: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 341s return _follow_symlinks_to_blob( 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s repo = pygit2.Repository('/tmp/tmppkzq7g_a/.git/') 341s top_tree_object = 341s search_path = 'debian/patches/series' 341s _rel_tree = 341s _rel_path = '' 341s 341s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 341s _rel_tree=None, _rel_path='' 341s ): 341s '''Recursively follow a path down a tree, following symlinks, to find blob 341s 341s repo: pygit2.Repository object 341s top_tree: pygit2.Tree object of the top of the tree structure 341s search_path: '/'-separated path string of blob to find 341s _rel_tree: (internal) which tree to look further into 341s _rel_path: (internal) the path we are in so far 341s ''' 341s 341s NORMAL_BLOB_MODES = set([ 341s pygit2.GIT_FILEMODE_BLOB, 341s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 341s ]) 341s 341s _rel_tree = _rel_tree or top_tree_object 341s head, tail = posixpath.split(search_path) 341s 341s # A traditional functional split would put a single entry in head with tail 341s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 341s # to make it appear to have traditional semantics. 341s if not head: 341s head = tail 341s tail = None 341s 341s entry = _rel_tree[head] 341s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:68: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: using patch list from debian/patches/series 341s dpkg-source: info: applying a 341s dpkg-source: info: applying b 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: using patch list from debian/patches/series 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s ______________________ test_source_version_native_default ______________________ 341s 341s repo = 341s 341s def test_source_version_native_default(repo): 341s """The default version string for a native package should not have a 341s '-' in it. 341s """ 341s > version = get_spec_changelog_version(repo, native=True) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/source_builder_test.py:194: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/source_builder_test.py:47: in get_spec_changelog_version 341s changelog = repo.get_changelog_from_treeish(tree_hash) 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 341s return Changelog.from_treeish( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:569: in from_treeish 341s blob = follow_symlinks_to_blob( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 341s return _follow_symlinks_to_blob( 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s repo = pygit2.Repository('/tmp/tmp2tafl265/.git/') 341s top_tree_object = 341s search_path = 'debian/changelog' 341s _rel_tree = 341s _rel_path = '' 341s 341s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 341s _rel_tree=None, _rel_path='' 341s ): 341s '''Recursively follow a path down a tree, following symlinks, to find blob 341s 341s repo: pygit2.Repository object 341s top_tree: pygit2.Tree object of the top of the tree structure 341s search_path: '/'-separated path string of blob to find 341s _rel_tree: (internal) which tree to look further into 341s _rel_path: (internal) the path we are in so far 341s ''' 341s 341s NORMAL_BLOB_MODES = set([ 341s pygit2.GIT_FILEMODE_BLOB, 341s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 341s ]) 341s 341s _rel_tree = _rel_tree or top_tree_object 341s head, tail = posixpath.split(search_path) 341s 341s # A traditional functional split would put a single entry in head with tail 341s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 341s # to make it appear to have traditional semantics. 341s if not head: 341s head = tail 341s tail = None 341s 341s entry = _rel_tree[head] 341s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:68: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (native)' 341s dpkg-source: info: building source-builder-package in source-builder-package_1.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s ____________________ test_source_version_non_native_default ____________________ 341s 341s repo = 341s 341s def test_source_version_non_native_default(repo): 341s """The default version string for a non-native package should have a 341s '-' in it. 341s """ 341s > version = get_spec_changelog_version(repo, native=False) 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/source_builder_test.py:202: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/source_builder_test.py:47: in get_spec_changelog_version 341s changelog = repo.get_changelog_from_treeish(tree_hash) 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 341s return Changelog.from_treeish( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:569: in from_treeish 341s blob = follow_symlinks_to_blob( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 341s return _follow_symlinks_to_blob( 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s repo = pygit2.Repository('/tmp/tmpb28fabad/.git/') 341s top_tree_object = 341s search_path = 'debian/changelog' 341s _rel_tree = 341s _rel_path = '' 341s 341s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 341s _rel_tree=None, _rel_path='' 341s ): 341s '''Recursively follow a path down a tree, following symlinks, to find blob 341s 341s repo: pygit2.Repository object 341s top_tree: pygit2.Tree object of the top of the tree structure 341s search_path: '/'-separated path string of blob to find 341s _rel_tree: (internal) which tree to look further into 341s _rel_path: (internal) the path we are in so far 341s ''' 341s 341s NORMAL_BLOB_MODES = set([ 341s pygit2.GIT_FILEMODE_BLOB, 341s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 341s ]) 341s 341s _rel_tree = _rel_tree or top_tree_object 341s head, tail = posixpath.split(search_path) 341s 341s # A traditional functional split would put a single entry in head with tail 341s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 341s # to make it appear to have traditional semantics. 341s if not head: 341s head = tail 341s tail = None 341s 341s entry = _rel_tree[head] 341s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:68: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s _____________________ test_source_version_native_specific ______________________ 341s 341s repo = 341s 341s def test_source_version_native_specific(repo): 341s """We should be able to create a native package with a 341s native-looking version string. 341s """ 341s > version = get_spec_changelog_version(repo, native=True, version='1.0') 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/source_builder_test.py:210: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/source_builder_test.py:47: in get_spec_changelog_version 341s changelog = repo.get_changelog_from_treeish(tree_hash) 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 341s return Changelog.from_treeish( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:569: in from_treeish 341s blob = follow_symlinks_to_blob( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 341s return _follow_symlinks_to_blob( 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s repo = pygit2.Repository('/tmp/tmpxpcxdhpj/.git/') 341s top_tree_object = 341s search_path = 'debian/changelog' 341s _rel_tree = 341s _rel_path = '' 341s 341s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 341s _rel_tree=None, _rel_path='' 341s ): 341s '''Recursively follow a path down a tree, following symlinks, to find blob 341s 341s repo: pygit2.Repository object 341s top_tree: pygit2.Tree object of the top of the tree structure 341s search_path: '/'-separated path string of blob to find 341s _rel_tree: (internal) which tree to look further into 341s _rel_path: (internal) the path we are in so far 341s ''' 341s 341s NORMAL_BLOB_MODES = set([ 341s pygit2.GIT_FILEMODE_BLOB, 341s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 341s ]) 341s 341s _rel_tree = _rel_tree or top_tree_object 341s head, tail = posixpath.split(search_path) 341s 341s # A traditional functional split would put a single entry in head with tail 341s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 341s # to make it appear to have traditional semantics. 341s if not head: 341s head = tail 341s tail = None 341s 341s entry = _rel_tree[head] 341s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:68: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (native)' 341s dpkg-source: info: building source-builder-package in source-builder-package_1.0.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1.0.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s ___________________ test_source_version_non_native_specific ____________________ 341s 341s repo = 341s 341s def test_source_version_non_native_specific(repo): 341s """We should be able to create a non-native package with a 341s non-native-looking version string. 341s """ 341s > version = get_spec_changelog_version(repo, native=False, version='1.0-1') 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/source_builder_test.py:218: 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/source_builder_test.py:47: in get_spec_changelog_version 341s changelog = repo.get_changelog_from_treeish(tree_hash) 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 341s return Changelog.from_treeish( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:569: in from_treeish 341s blob = follow_symlinks_to_blob( 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 341s return _follow_symlinks_to_blob( 341s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 341s 341s repo = pygit2.Repository('/tmp/tmp_5_iymc6/.git/') 341s top_tree_object = 341s search_path = 'debian/changelog' 341s _rel_tree = 341s _rel_path = '' 341s 341s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 341s _rel_tree=None, _rel_path='' 341s ): 341s '''Recursively follow a path down a tree, following symlinks, to find blob 341s 341s repo: pygit2.Repository object 341s top_tree: pygit2.Tree object of the top of the tree structure 341s search_path: '/'-separated path string of blob to find 341s _rel_tree: (internal) which tree to look further into 341s _rel_path: (internal) the path we are in so far 341s ''' 341s 341s NORMAL_BLOB_MODES = set([ 341s pygit2.GIT_FILEMODE_BLOB, 341s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 341s ]) 341s 341s _rel_tree = _rel_tree or top_tree_object 341s head, tail = posixpath.split(search_path) 341s 341s # A traditional functional split would put a single entry in head with tail 341s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 341s # to make it appear to have traditional semantics. 341s if not head: 341s head = tail 341s tail = None 341s 341s entry = _rel_tree[head] 341s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 341s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 341s 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/git_repository.py:68: AttributeError 341s ----------------------------- Captured stdout call ----------------------------- 341s dpkg-source: info: using source format '3.0 (quilt)' 341s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.0.orig.tar.gz 341s dpkg-source: info: building source-builder-package in source-builder-package_1.0-1.debian.tar.xz 341s dpkg-source: info: building source-builder-package in source-builder-package_1.0-1.dsc 341s ----------------------------- Captured stderr call ----------------------------- 341s dpkg-source: warning: missing information for output field Standards-Version 341s =============================== warnings summary =============================== 341s gitubuntu/__main__.py:7 341s /tmp/autopkgtest.2Zfyp6/build.8ZM/src/gitubuntu/__main__.py:7: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html 341s import pkg_resources 341s 341s ../../../../usr/lib/python3/dist-packages/pkg_resources/__init__.py:3154 341s /usr/lib/python3/dist-packages/pkg_resources/__init__.py:3154: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('logilab')`. 341s 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 341s declare_namespace(pkg) 341s 341s -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html 341s 341s ---------- coverage: platform linux, python 3.12.7-final-0 ----------- 341s Name Stmts Miss Cover 341s --------------------------------------------------------------- 341s gitubuntu/__init__.py 0 0 100% 341s gitubuntu/__main__.py 103 94 9% 341s gitubuntu/build.py 185 131 29% 341s gitubuntu/cache.py 1 0 100% 341s gitubuntu/clone.py 70 54 23% 341s gitubuntu/dsc.py 65 16 75% 341s gitubuntu/exportorig.py 48 37 23% 341s gitubuntu/git_repository.py 1103 521 53% 341s gitubuntu/git_repository_test.py 316 40 87% 341s gitubuntu/importer.py 707 446 37% 341s gitubuntu/importer_service.py 215 22 90% 341s gitubuntu/importer_service_broker.py 60 49 18% 341s gitubuntu/importer_service_ipc.py 12 2 83% 341s gitubuntu/importer_service_poller.py 37 25 32% 341s gitubuntu/importer_service_test.py 147 0 100% 341s gitubuntu/importer_service_worker.py 87 64 26% 341s gitubuntu/importer_service_worker_test.py 18 0 100% 341s gitubuntu/importer_tag_test.py 47 20 57% 341s gitubuntu/importer_test.py 388 133 66% 341s gitubuntu/integration_test.py 67 26 61% 341s gitubuntu/logging.py 8 4 50% 341s gitubuntu/merge.py 219 192 12% 341s gitubuntu/patch_state.py 2 0 100% 341s gitubuntu/prepare_upload.py 86 3 97% 341s gitubuntu/prepare_upload_test.py 152 0 100% 341s gitubuntu/queue.py 174 148 15% 341s gitubuntu/remote.py 100 85 15% 341s gitubuntu/repo_builder.py 162 0 100% 341s gitubuntu/repo_builder_test.py 159 12 92% 341s gitubuntu/repo_comparator.py 32 25 22% 341s gitubuntu/rich_history.py 67 45 33% 341s gitubuntu/rich_history_test.py 53 31 42% 341s gitubuntu/run.py 72 12 83% 341s gitubuntu/scriptutils.py 11 0 100% 341s gitubuntu/source_builder.py 119 0 100% 341s gitubuntu/source_builder_test.py 105 18 83% 341s gitubuntu/source_information.py 339 133 61% 341s gitubuntu/source_information_test.py 78 3 96% 341s gitubuntu/spec.py 3 0 100% 341s gitubuntu/submit.py 103 86 17% 341s gitubuntu/tag.py 78 69 12% 341s gitubuntu/test_fixtures.py 29 5 83% 341s gitubuntu/test_util.py 5 0 100% 341s gitubuntu/version.py 1 0 100% 341s gitubuntu/versioning.py 124 16 87% 341s --------------------------------------------------------------- 341s TOTAL 5957 2567 57% 341s 341s =========================== short test summary info ============================ 341s FAILED gitubuntu/git_repository_test.py::test_follow_symlinks_to_blob[0] 341s FAILED gitubuntu/git_repository_test.py::test_follow_symlinks_to_blob[1] 341s FAILED gitubuntu/git_repository_test.py::test_follow_symlinks_to_blob[2] 341s FAILED gitubuntu/git_repository_test.py::test_follow_symlinks_to_blob[3] 341s FAILED gitubuntu/git_repository_test.py::test_follow_symlinks_to_blob[4] 341s FAILED gitubuntu/git_repository_test.py::test_follow_symlinks_to_blob_not_found[tree1] 341s FAILED gitubuntu/git_repository_test.py::test_follow_symlinks_to_blob_not_found[tree2] 341s FAILED gitubuntu/git_repository_test.py::test_follow_symlinks_to_blob_not_found[tree3] 341s FAILED gitubuntu/git_repository_test.py::test_git_escape_dir_to_tree - Attrib... 341s FAILED gitubuntu/git_repository_test.py::test_determine_quilt_series_path[tree_data1-debian/patches/series] 341s FAILED gitubuntu/git_repository_test.py::test_determine_quilt_series_path[tree_data2-debian/patches/series] 341s FAILED gitubuntu/git_repository_test.py::test_determine_quilt_series_path[tree_data3-debian/patches/debian.series] 341s FAILED gitubuntu/git_repository_test.py::test_determine_quilt_series_path[tree_data4-debian/patches/debian.series] 341s FAILED gitubuntu/git_repository_test.py::test_quilt_env - AttributeError: mod... 341s FAILED gitubuntu/git_repository_test.py::test_repo_quilt_env - AttributeError... 341s FAILED gitubuntu/git_repository_test.py::test_repo_quilt_env_from_treeish_str 341s 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] 341s 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] 341s 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] 341s FAILED gitubuntu/git_repository_test.py::test_commit_tree - AttributeError: m... 341s FAILED gitubuntu/git_repository_test.py::test_descendant_of[root-root-False] 341s FAILED gitubuntu/git_repository_test.py::test_descendant_of[child1-root-True] 341s FAILED gitubuntu/git_repository_test.py::test_descendant_of[root-child1-False] 341s FAILED gitubuntu/git_repository_test.py::test_descendant_of[grandchild1-root-True] 341s FAILED gitubuntu/git_repository_test.py::test_descendant_of[child1-child2-False] 341s FAILED gitubuntu/git_repository_test.py::test_descendant_of[root-disjoint-False] 341s FAILED gitubuntu/git_repository_test.py::test_create_tag - AttributeError: mo... 341s FAILED gitubuntu/git_repository_test.py::test_get_all_reimport_tags - Attribu... 341s FAILED gitubuntu/git_repository_test.py::test_get_head_info - AttributeError:... 341s 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] 341s 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] 341s 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] 341s 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] 341s 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] 341s 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] 341s 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] 341s 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] 341s FAILED gitubuntu/importer_tag_test.py::test_import_applied_spi_tags[input_repo0-validation_repo_delta0-validation_repo_expected_treewise_refs0-True] 341s FAILED gitubuntu/importer_tag_test.py::test_import_applied_spi_tags[input_repo2-validation_repo_delta2-validation_repo_expected_treewise_refs2-False] 341s FAILED gitubuntu/importer_test.py::test_get_existing_import_tags[input_repo1-PatchState.UNAPPLIED-expected1] 341s FAILED gitubuntu/importer_test.py::test_get_existing_import_tags[input_repo2-PatchState.UNAPPLIED-expected2] 341s FAILED gitubuntu/importer_test.py::test_get_existing_import_tags[input_repo4-PatchState.APPLIED-expected4] 341s FAILED gitubuntu/importer_test.py::test_get_existing_import_tags[input_repo5-PatchState.APPLIED-expected5] 341s FAILED gitubuntu/importer_test.py::test_get_existing_import_tags_ordering - A... 341s FAILED gitubuntu/importer_test.py::test_create_import_tag[input_repo0-validation_repo_delta0-validation_repo_expected_identical_refs0] 341s FAILED gitubuntu/importer_test.py::test_create_import_tag[input_repo1-validation_repo_delta1-validation_repo_expected_identical_refs1] 341s FAILED gitubuntu/importer_test.py::test_create_import_tag[input_repo2-validation_repo_delta2-validation_repo_expected_identical_refs2] 341s FAILED gitubuntu/importer_test.py::test_create_import_tag_hash_stability_on_first_import 341s FAILED gitubuntu/importer_test.py::test_create_import_tag_hash_stability_on_reimport 341s FAILED gitubuntu/importer_test.py::test_create_applied_tag[input_repo0-validation_repo_delta0-validation_repo_expected_identical_refs0] 341s FAILED gitubuntu/importer_test.py::test_create_applied_tag[input_repo1-validation_repo_delta1-validation_repo_expected_identical_refs1] 341s FAILED gitubuntu/importer_test.py::test_create_applied_tag[input_repo2-validation_repo_delta2-validation_repo_expected_identical_refs2] 341s FAILED gitubuntu/importer_test.py::test_get_changelog_parent_commits[input_repo1-parent_overrides1-changelog_versions1-PatchState.UNAPPLIED-expected_refs1] 341s FAILED gitubuntu/importer_test.py::test_get_changelog_parent_commits[input_repo2-parent_overrides2-changelog_versions2-PatchState.UNAPPLIED-expected_refs2] 341s FAILED gitubuntu/importer_test.py::test_get_changelog_parent_commits[input_repo3-parent_overrides3-changelog_versions3-PatchState.UNAPPLIED-expected_refs3] 341s FAILED gitubuntu/importer_test.py::test_get_changelog_parent_commits[input_repo5-parent_overrides5-changelog_versions5-PatchState.APPLIED-expected_refs5] 341s FAILED gitubuntu/importer_test.py::test_get_changelog_parent_commits[input_repo6-parent_overrides6-changelog_versions6-PatchState.APPLIED-expected_refs6] 341s FAILED gitubuntu/importer_test.py::test_get_changelog_parent_commits[input_repo7-parent_overrides7-changelog_versions7-PatchState.APPLIED-expected_refs7] 341s FAILED gitubuntu/importer_test.py::test_validate_rich_history[input_repo0-published_spec0-True] 341s FAILED gitubuntu/importer_test.py::test_validate_rich_history[input_repo1-published_spec1-True] 341s FAILED gitubuntu/importer_test.py::test_validate_rich_history[input_repo2-published_spec2-RichHistoryTreeMismatch] 341s FAILED gitubuntu/importer_test.py::test_validate_rich_history[input_repo3-published_spec3-RichHistoryHasNoChangelogParentAncestor] 341s FAILED gitubuntu/importer_test.py::test_add_changelog_note_to_commit - Attrib... 341s FAILED gitubuntu/importer_test.py::test_add_changelog_note_to_commit_utf8 - A... 341s FAILED gitubuntu/importer_test.py::test_double_changelog_note_add_does_not_fail 341s FAILED gitubuntu/importer_test.py::test_create_import_note - AttributeError: ... 341s FAILED gitubuntu/importer_test.py::test_create_import_note_timestamp - Attrib... 341s FAILED gitubuntu/importer_test.py::test_import_creates_import_note - Attribut... 341s FAILED gitubuntu/importer_test.py::test_import_unapplied_spi_quilt_patches - ... 341s FAILED gitubuntu/importer_test.py::test_import_unapplied_spi_parenting[input_repo0-changelog_versions0-validation_repo_delta0-validation_repo_expected_identical_refs0] 341s FAILED gitubuntu/importer_test.py::test_import_unapplied_spi_parenting[input_repo1-changelog_versions1-validation_repo_delta1-validation_repo_expected_identical_refs1] 341s FAILED gitubuntu/importer_test.py::test_import_unapplied_spi_parenting[input_repo2-changelog_versions2-validation_repo_delta2-validation_repo_expected_identical_refs2] 341s FAILED gitubuntu/importer_test.py::test_import_unapplied_spi_parenting[input_repo3-changelog_versions3-validation_repo_delta3-validation_repo_expected_identical_refs3] 341s FAILED gitubuntu/importer_test.py::test_import_unapplied_spi_parent_override 341s FAILED gitubuntu/importer_test.py::test_import_unapplied_spi_parent_override_failure 341s FAILED gitubuntu/importer_test.py::test_import_applied_spi_parenting[input_repo0-expected_ancestor_commits0-expected_parent_commits0] 341s FAILED gitubuntu/importer_test.py::test_authorship_date[False-Fri, 2 Feb 1971 12:34:56 +0100-expected_result0] 341s FAILED gitubuntu/importer_test.py::test_authorship_date[True-Failday, 30 Feb 1971 99:99:99 +9999-expected_result1] 341s FAILED gitubuntu/importer_test.py::test_fetch_rich_history_from_changes_file 341s FAILED gitubuntu/importer_test.py::test_fetch_rich_history_from_changes_file_fetch_failure_retry 341s FAILED gitubuntu/importer_test.py::test_fetch_rich_history_from_changes_file_missing_ref 341s FAILED gitubuntu/importer_test.py::test_fetch_rich_history_from_changes_file_missing_commit 341s FAILED gitubuntu/importer_test.py::test_fetch_rich_history_from_changes_file_not_a_commit 341s FAILED gitubuntu/integration_test.py::test_reconstruct_changelog - AttributeE... 341s FAILED gitubuntu/repo_builder_test.py::TestObjectCreation::testRepoBranchesTags 341s FAILED gitubuntu/repo_builder_test.py::TestObjectCreation::testRepoTagger - A... 341s FAILED gitubuntu/repo_builder_test.py::test_source_tree - AttributeError: mod... 341s FAILED gitubuntu/rich_history_test.py::test_preservation - AttributeError: mo... 341s FAILED gitubuntu/rich_history_test.py::test_preservation_multiple_parents - A... 341s FAILED gitubuntu/rich_history_test.py::test_preservation_no_parents - Attribu... 341s FAILED gitubuntu/rich_history_test.py::test_input_edge_cases[before_export0-before_import0] 341s FAILED gitubuntu/rich_history_test.py::test_input_edge_cases[before_export1-before_import1] 341s FAILED gitubuntu/rich_history_test.py::test_input_edge_cases[before_export2-before_import2] 341s FAILED gitubuntu/rich_history_test.py::test_preservation_fast_forwards - Attr... 341s FAILED gitubuntu/source_builder_test.py::test_source_create_with_version - At... 341s FAILED gitubuntu/source_builder_test.py::test_source_create_with_versions - A... 341s FAILED gitubuntu/source_builder_test.py::test_source_native_source_format[True-3.0 (native)\n] 341s FAILED gitubuntu/source_builder_test.py::test_source_native_source_format[False-3.0 (quilt)\n] 341s FAILED gitubuntu/source_builder_test.py::test_source_quilt_no_patches - Attri... 341s FAILED gitubuntu/source_builder_test.py::test_source_quilt_with_patches - Att... 341s FAILED gitubuntu/source_builder_test.py::test_source_quilt_with_patches_applied 341s FAILED gitubuntu/source_builder_test.py::test_source_version_native_default 341s FAILED gitubuntu/source_builder_test.py::test_source_version_non_native_default 341s FAILED gitubuntu/source_builder_test.py::test_source_version_native_specific 341s FAILED gitubuntu/source_builder_test.py::test_source_version_non_native_specific 341s = 105 failed, 348 passed, 3 skipped, 3 xfailed, 2 warnings in 84.72s (0:01:24) = 341s pytest failed; self test will fail 342s autopkgtest [09:40:37]: test self-test: -----------------------] 342s self-test FAIL non-zero exit status 1 342s autopkgtest [09:40:37]: test self-test: - - - - - - - - - - results - - - - - - - - - - 343s autopkgtest [09:40:38]: @@@@@@@@@@@@@@@@@@@@ summary 343s self-test FAIL non-zero exit status 1 377s nova [W] Using flock in prodstack6-arm64 377s flock: timeout while waiting to get lock 377s Creating nova instance adt-plucky-arm64-git-ubuntu-20241203-093455-juju-7f2275-prod-proposed-migration-environment-15-6852d306-3960-459b-a94a-a22dbe3d5b2c from image adt/ubuntu-plucky-arm64-server-20241203.img (UUID b9293590-1195-42ea-ba16-5ab4b1e94eab)...