0s autopkgtest [09:34:56]: starting date and time: 2024-12-03 09:34:56+0000 0s autopkgtest [09:34:56]: git checkout: be626eda Fix armhf LXD image generation for plucky 0s autopkgtest [09:34:56]: host juju-7f2275-prod-proposed-migration-environment-9; command line: /home/ubuntu/autopkgtest/runner/autopkgtest --output-dir /tmp/autopkgtest-work.nk0z39z_/out --timeout-copy=6000 --setup-commands 'ln -s /dev/null /etc/systemd/system/bluetooth.service; printf "http_proxy=http://squid.internal:3128\nhttps_proxy=http://squid.internal:3128\nno_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\n" >> /etc/environment' --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 -- lxd -r lxd-armhf-10.145.243.85 lxd-armhf-10.145.243.85:autopkgtest/ubuntu/plucky/armhf 63s autopkgtest [09:35:59]: testbed dpkg architecture: armhf 69s autopkgtest [09:36:05]: testbed apt version: 2.9.14ubuntu1 77s autopkgtest [09:36:13]: @@@@@@@@@@@@@@@@@@@@ test bed setup 82s autopkgtest [09:36:18]: testbed release detected to be: None 97s autopkgtest [09:36:33]: updating testbed package index (apt update) 101s Get:1 http://ftpmaster.internal/ubuntu plucky-proposed InRelease [73.9 kB] 102s Get:2 http://ftpmaster.internal/ubuntu plucky InRelease [213 kB] 102s Hit:3 http://ftpmaster.internal/ubuntu plucky-updates InRelease 102s Hit:4 http://ftpmaster.internal/ubuntu plucky-security InRelease 102s Get:5 http://ftpmaster.internal/ubuntu plucky-proposed/restricted Sources [9708 B] 102s Get:6 http://ftpmaster.internal/ubuntu plucky-proposed/main Sources [65.3 kB] 102s Get:7 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse Sources [15.1 kB] 102s Get:8 http://ftpmaster.internal/ubuntu plucky-proposed/universe Sources [781 kB] 102s Get:9 http://ftpmaster.internal/ubuntu plucky-proposed/main armhf Packages [119 kB] 102s Get:10 http://ftpmaster.internal/ubuntu plucky-proposed/restricted armhf Packages [928 B] 102s Get:11 http://ftpmaster.internal/ubuntu plucky-proposed/universe armhf Packages [622 kB] 102s Get:12 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse armhf Packages [7468 B] 102s Get:13 http://ftpmaster.internal/ubuntu plucky/multiverse Sources [298 kB] 102s Get:14 http://ftpmaster.internal/ubuntu plucky/main Sources [1381 kB] 102s Get:15 http://ftpmaster.internal/ubuntu plucky/universe Sources [20.7 MB] 103s Get:16 http://ftpmaster.internal/ubuntu plucky/main armhf Packages [1353 kB] 103s Get:17 http://ftpmaster.internal/ubuntu plucky/universe armhf Packages [14.9 MB] 103s Get:18 http://ftpmaster.internal/ubuntu plucky/multiverse armhf Packages [174 kB] 107s Fetched 40.7 MB in 5s (7780 kB/s) 108s Reading package lists... 119s autopkgtest [09:36:55]: upgrading testbed (apt dist-upgrade and autopurge) 121s Reading package lists... 121s Building dependency tree... 121s Reading state information... 122s Calculating upgrade...Starting pkgProblemResolver with broken count: 0 122s Starting 2 pkgProblemResolver with broken count: 0 122s Done 123s Entering ResolveByKeep 123s 123s The following packages will be upgraded: 123s fwupd gcc-14-base libatomic1 libfwupd3 libgcc-s1 libstdc++6 123s python3-software-properties software-properties-common 124s 8 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 124s Need to get 6003 kB of archives. 124s After this operation, 1024 B of additional disk space will be used. 124s Get:1 http://ftpmaster.internal/ubuntu plucky/main armhf libatomic1 armhf 14.2.0-9ubuntu1 [7856 B] 124s Get:2 http://ftpmaster.internal/ubuntu plucky/main armhf gcc-14-base armhf 14.2.0-9ubuntu1 [51.9 kB] 124s Get:3 http://ftpmaster.internal/ubuntu plucky/main armhf libstdc++6 armhf 14.2.0-9ubuntu1 [713 kB] 124s Get:4 http://ftpmaster.internal/ubuntu plucky/main armhf libgcc-s1 armhf 14.2.0-9ubuntu1 [40.9 kB] 124s Get:5 http://ftpmaster.internal/ubuntu plucky/main armhf fwupd armhf 2.0.2-2 [5020 kB] 124s Get:6 http://ftpmaster.internal/ubuntu plucky/main armhf libfwupd3 armhf 2.0.2-2 [124 kB] 124s Get:7 http://ftpmaster.internal/ubuntu plucky/main armhf software-properties-common all 0.107 [16.5 kB] 124s Get:8 http://ftpmaster.internal/ubuntu plucky/main armhf python3-software-properties all 0.107 [30.4 kB] 125s Fetched 6003 kB in 1s (7367 kB/s) 125s (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 ... 59970 files and directories currently installed.) 125s Preparing to unpack .../libatomic1_14.2.0-9ubuntu1_armhf.deb ... 125s Unpacking libatomic1:armhf (14.2.0-9ubuntu1) over (14.2.0-8ubuntu1) ... 125s Preparing to unpack .../gcc-14-base_14.2.0-9ubuntu1_armhf.deb ... 125s Unpacking gcc-14-base:armhf (14.2.0-9ubuntu1) over (14.2.0-8ubuntu1) ... 125s Setting up gcc-14-base:armhf (14.2.0-9ubuntu1) ... 125s (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 ... 59970 files and directories currently installed.) 125s Preparing to unpack .../libstdc++6_14.2.0-9ubuntu1_armhf.deb ... 125s Unpacking libstdc++6:armhf (14.2.0-9ubuntu1) over (14.2.0-8ubuntu1) ... 125s Setting up libstdc++6:armhf (14.2.0-9ubuntu1) ... 125s (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 ... 59970 files and directories currently installed.) 125s Preparing to unpack .../libgcc-s1_14.2.0-9ubuntu1_armhf.deb ... 125s Unpacking libgcc-s1:armhf (14.2.0-9ubuntu1) over (14.2.0-8ubuntu1) ... 125s Setting up libgcc-s1:armhf (14.2.0-9ubuntu1) ... 125s (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 ... 59970 files and directories currently installed.) 125s Preparing to unpack .../fwupd_2.0.2-2_armhf.deb ... 125s Unpacking fwupd (2.0.2-2) over (2.0.2-1) ... 125s Preparing to unpack .../libfwupd3_2.0.2-2_armhf.deb ... 125s Unpacking libfwupd3:armhf (2.0.2-2) over (2.0.2-1) ... 125s Preparing to unpack .../software-properties-common_0.107_all.deb ... 126s Unpacking software-properties-common (0.107) over (0.105) ... 126s Preparing to unpack .../python3-software-properties_0.107_all.deb ... 126s Unpacking python3-software-properties (0.107) over (0.105) ... 126s Setting up libfwupd3:armhf (2.0.2-2) ... 126s Setting up python3-software-properties (0.107) ... 126s Setting up libatomic1:armhf (14.2.0-9ubuntu1) ... 126s Setting up fwupd (2.0.2-2) ... 126s fwupd-refresh.service is a disabled or a static unit not running, not starting it. 126s fwupd.service is a disabled or a static unit not running, not starting it. 126s Setting up software-properties-common (0.107) ... 127s Processing triggers for libc-bin (2.40-1ubuntu3) ... 127s Processing triggers for man-db (2.13.0-1) ... 128s Processing triggers for dbus (1.14.10-4ubuntu5) ... 130s Reading package lists... 131s Building dependency tree... 131s Reading state information... 131s Starting pkgProblemResolver with broken count: 0 131s Starting 2 pkgProblemResolver with broken count: 0 131s Done 132s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 134s autopkgtest [09:37:10]: rebooting testbed after setup commands that affected boot 239s autopkgtest [09:38:55]: testbed running kernel: Linux 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 18:12:14 UTC 2 302s autopkgtest [09:39:58]: @@@@@@@@@@@@@@@@@@@@ apt-source git-ubuntu 331s Get:1 http://ftpmaster.internal/ubuntu plucky/universe git-ubuntu 1.1-1 (dsc) [2280 B] 331s Get:2 http://ftpmaster.internal/ubuntu plucky/universe git-ubuntu 1.1-1 (tar) [179 kB] 331s Get:3 http://ftpmaster.internal/ubuntu plucky/universe git-ubuntu 1.1-1 (diff) [5776 B] 331s gpgv: Signature made Wed Jul 3 16:18:24 2024 UTC 331s gpgv: using RSA key A62D2CFBD50B9B5BF360D54B159EB5C4EFC8774C 331s gpgv: Can't check signature: No public key 331s dpkg-source: warning: cannot verify inline signature for ./git-ubuntu_1.1-1.dsc: no acceptable signature found 331s autopkgtest [09:40:27]: testing package git-ubuntu version 1.1-1 335s autopkgtest [09:40:31]: build not needed 341s autopkgtest [09:40:37]: test self-test: preparing testbed 345s Reading package lists... 345s Building dependency tree... 345s Reading state information... 346s Starting pkgProblemResolver with broken count: 0 346s Starting 2 pkgProblemResolver with broken count: 0 346s Done 347s The following NEW packages will be installed: 347s dctrl-tools debian-archive-keyring devscripts diffstat dput gettext git 347s git-buildpackage git-man git-ubuntu libb-hooks-op-check-perl 347s libclass-method-modifiers-perl libclass-xsaccessor-perl libclone-perl 347s libdevel-callchecker-perl libdynaloader-functions-perl libencode-locale-perl 347s liberror-perl libfile-dirlist-perl libfile-homedir-perl libfile-listing-perl 347s libfile-touch-perl libfile-which-perl libgit2-1.8 libgomp1 347s libhtml-parser-perl libhtml-tagset-perl libhtml-tree-perl 347s libhttp-cookies-perl libhttp-date-perl libhttp-message-perl 347s libhttp-negotiate-perl libhttp-parser2.9 libimport-into-perl libio-html-perl 347s libio-pty-perl libio-socket-ssl-perl libipc-run-perl libjs-jquery 347s libjs-jquery-hotkeys libjs-jquery-isonscreen libjs-jquery-metadata 347s libjs-jquery-tablesorter libjs-jquery-throttle-debounce libjs-sphinxdoc 347s libjs-underscore liblwp-mediatypes-perl liblwp-protocol-https-perl 347s libmodule-runtime-perl libmoo-perl libnet-http-perl libnet-ssleay-perl 347s libnorm1t64 libparams-classify-perl libpgm-5.3-0t64 libpython3.13-minimal 347s libpython3.13-stdlib librole-tiny-perl libsodium23 libsub-quote-perl 347s libsys-cpuaffinity-perl libtimedate-perl libtry-tiny-perl liburi-perl 347s libwww-perl libwww-robotrules-perl libxdelta2t64 libzmq5 patchutils pbzip2 347s perl-openssl-defaults pixz pristine-tar pylint python3-argcomplete 347s python3-astroid python3-cachetools python3-coverage python3-dateutil 347s python3-debian python3-debianbts python3-dill python3-gpg 347s python3-importlib-metadata python3-iniconfig python3-isort 347s python3-jaraco.classes python3-jeepney python3-keyring python3-keyrings.alt 347s python3-launchpadlib-desktop python3-logilab-common python3-mccabe 347s python3-mypy-extensions python3-packaging python3-platformdirs 347s python3-pluggy python3-py python3-pycryptodome python3-pygit2 python3-pytest 347s python3-pytest-cov python3-secretstorage python3-tenacity python3-tomlkit 347s python3-ubuntutools python3-xdg python3-zmq python3.13 python3.13-minimal 347s quilt ubuntu-dev-tools wdiff xdelta xdelta3 347s 0 upgraded, 115 newly installed, 0 to remove and 0 not upgraded. 347s Need to get 23.2 MB of archives. 347s After this operation, 92.4 MB of additional disk space will be used. 347s Get:1 http://ftpmaster.internal/ubuntu plucky/main armhf libpython3.13-minimal armhf 3.13.0-2 [866 kB] 347s Get:2 http://ftpmaster.internal/ubuntu plucky/main armhf python3.13-minimal armhf 3.13.0-2 [1854 kB] 348s Get:3 http://ftpmaster.internal/ubuntu plucky/main armhf libjs-jquery all 3.6.1+dfsg+~3.5.14-1 [328 kB] 348s Get:4 http://ftpmaster.internal/ubuntu plucky/universe armhf libjs-jquery-hotkeys all 0~20130707+git2d51e3a9+dfsg-2.1 [11.5 kB] 348s Get:5 http://ftpmaster.internal/ubuntu plucky/main armhf dctrl-tools armhf 2.24-3build3 [94.7 kB] 348s Get:6 http://ftpmaster.internal/ubuntu plucky/universe armhf debian-archive-keyring all 2023.4ubuntu1 [168 kB] 348s Get:7 http://ftpmaster.internal/ubuntu plucky/main armhf libfile-dirlist-perl all 0.05-3 [7286 B] 348s Get:8 http://ftpmaster.internal/ubuntu plucky/main armhf libfile-which-perl all 1.27-2 [12.5 kB] 348s Get:9 http://ftpmaster.internal/ubuntu plucky/main armhf libfile-homedir-perl all 1.006-2 [37.0 kB] 348s Get:10 http://ftpmaster.internal/ubuntu plucky/main armhf libfile-touch-perl all 0.12-2 [7498 B] 348s Get:11 http://ftpmaster.internal/ubuntu plucky/main armhf libio-pty-perl armhf 1:1.20-1build3 [31.0 kB] 348s Get:12 http://ftpmaster.internal/ubuntu plucky/main armhf libipc-run-perl all 20231003.0-2 [91.5 kB] 348s Get:13 http://ftpmaster.internal/ubuntu plucky/main armhf libclass-method-modifiers-perl all 2.15-1 [16.1 kB] 348s Get:14 http://ftpmaster.internal/ubuntu plucky/main armhf libclass-xsaccessor-perl armhf 1.19-4build5 [32.3 kB] 348s Get:15 http://ftpmaster.internal/ubuntu plucky/main armhf libb-hooks-op-check-perl armhf 0.22-3build2 [9174 B] 348s Get:16 http://ftpmaster.internal/ubuntu plucky/main armhf libdynaloader-functions-perl all 0.004-1 [11.4 kB] 348s Get:17 http://ftpmaster.internal/ubuntu plucky/main armhf libdevel-callchecker-perl armhf 0.009-1build1 [14.0 kB] 348s Get:18 http://ftpmaster.internal/ubuntu plucky/main armhf libparams-classify-perl armhf 0.015-2build6 [18.8 kB] 348s Get:19 http://ftpmaster.internal/ubuntu plucky/main armhf libmodule-runtime-perl all 0.016-2 [16.4 kB] 348s Get:20 http://ftpmaster.internal/ubuntu plucky/main armhf libimport-into-perl all 1.002005-2 [10.7 kB] 348s Get:21 http://ftpmaster.internal/ubuntu plucky/main armhf librole-tiny-perl all 2.002004-1 [16.3 kB] 348s Get:22 http://ftpmaster.internal/ubuntu plucky/main armhf libsub-quote-perl all 2.006008-1ubuntu1 [20.7 kB] 348s Get:23 http://ftpmaster.internal/ubuntu plucky/main armhf libmoo-perl all 2.005005-1 [47.4 kB] 348s Get:24 http://ftpmaster.internal/ubuntu plucky/main armhf libencode-locale-perl all 1.05-3 [11.6 kB] 348s Get:25 http://ftpmaster.internal/ubuntu plucky/main armhf libtimedate-perl all 2.3300-2 [34.0 kB] 348s Get:26 http://ftpmaster.internal/ubuntu plucky/main armhf libhttp-date-perl all 6.06-1 [10.2 kB] 348s Get:27 http://ftpmaster.internal/ubuntu plucky/main armhf libfile-listing-perl all 6.16-1 [11.3 kB] 348s Get:28 http://ftpmaster.internal/ubuntu plucky/main armhf libhtml-tagset-perl all 3.24-1 [14.1 kB] 348s Get:29 http://ftpmaster.internal/ubuntu plucky/main armhf liburi-perl all 5.30-1 [94.4 kB] 348s Get:30 http://ftpmaster.internal/ubuntu plucky/main armhf libhtml-parser-perl armhf 3.83-1build1 [83.1 kB] 348s Get:31 http://ftpmaster.internal/ubuntu plucky/main armhf libhtml-tree-perl all 5.07-3 [200 kB] 348s Get:32 http://ftpmaster.internal/ubuntu plucky/main armhf libclone-perl armhf 0.47-1 [10.0 kB] 348s Get:33 http://ftpmaster.internal/ubuntu plucky/main armhf libio-html-perl all 1.004-3 [15.9 kB] 348s Get:34 http://ftpmaster.internal/ubuntu plucky/main armhf liblwp-mediatypes-perl all 6.04-2 [20.1 kB] 348s Get:35 http://ftpmaster.internal/ubuntu plucky/main armhf libhttp-message-perl all 7.00-2ubuntu1 [75.9 kB] 348s Get:36 http://ftpmaster.internal/ubuntu plucky/main armhf libhttp-cookies-perl all 6.11-1 [18.2 kB] 348s Get:37 http://ftpmaster.internal/ubuntu plucky/main armhf libhttp-negotiate-perl all 6.01-2 [12.4 kB] 348s Get:38 http://ftpmaster.internal/ubuntu plucky/main armhf perl-openssl-defaults armhf 7build3 [6628 B] 348s Get:39 http://ftpmaster.internal/ubuntu plucky/main armhf libnet-ssleay-perl armhf 1.94-2 [298 kB] 348s Get:40 http://ftpmaster.internal/ubuntu plucky/main armhf libio-socket-ssl-perl all 2.089-1 [200 kB] 348s Get:41 http://ftpmaster.internal/ubuntu plucky/main armhf libnet-http-perl all 6.23-1 [22.3 kB] 348s Get:42 http://ftpmaster.internal/ubuntu plucky/main armhf liblwp-protocol-https-perl all 6.14-1 [9040 B] 348s Get:43 http://ftpmaster.internal/ubuntu plucky/main armhf libtry-tiny-perl all 0.32-1 [21.2 kB] 348s Get:44 http://ftpmaster.internal/ubuntu plucky/main armhf libwww-robotrules-perl all 6.02-1 [12.6 kB] 348s Get:45 http://ftpmaster.internal/ubuntu plucky/main armhf libwww-perl all 6.77-1 [138 kB] 348s Get:46 http://ftpmaster.internal/ubuntu plucky/main armhf patchutils armhf 0.4.2-1build3 [73.2 kB] 348s Get:47 http://ftpmaster.internal/ubuntu plucky/main armhf wdiff armhf 1.2.2-6build1 [29.0 kB] 348s Get:48 http://ftpmaster.internal/ubuntu plucky/main armhf devscripts all 2.24.5 [1081 kB] 348s Get:49 http://ftpmaster.internal/ubuntu plucky/main armhf diffstat armhf 1.67-1 [28.9 kB] 348s Get:50 http://ftpmaster.internal/ubuntu plucky/main armhf python3-debian all 0.1.49ubuntu3 [116 kB] 348s Get:51 http://ftpmaster.internal/ubuntu plucky/main armhf python3-gpg armhf 1.24.0-2ubuntu1 [239 kB] 348s Get:52 http://ftpmaster.internal/ubuntu plucky/main armhf python3-xdg all 0.28-2 [38.3 kB] 348s Get:53 http://ftpmaster.internal/ubuntu plucky/main armhf dput all 1.2.4ubuntu1 [49.1 kB] 348s Get:54 http://ftpmaster.internal/ubuntu plucky/main armhf libgomp1 armhf 14.2.0-9ubuntu1 [125 kB] 348s Get:55 http://ftpmaster.internal/ubuntu plucky/main armhf gettext armhf 0.22.5-2 [995 kB] 349s Get:56 http://ftpmaster.internal/ubuntu plucky/main armhf liberror-perl all 0.17029-2 [25.6 kB] 349s Get:57 http://ftpmaster.internal/ubuntu plucky/main armhf git-man all 1:2.45.2-1.2ubuntu1 [1122 kB] 349s Get:58 http://ftpmaster.internal/ubuntu plucky/main armhf git armhf 1:2.45.2-1.2ubuntu1 [4509 kB] 349s Get:59 http://ftpmaster.internal/ubuntu plucky/main armhf python3-dateutil all 2.9.0-3 [80.2 kB] 349s Get:60 http://ftpmaster.internal/ubuntu plucky/main armhf python3-importlib-metadata all 8.5.0-1 [20.7 kB] 349s Get:61 http://ftpmaster.internal/ubuntu plucky/universe armhf git-buildpackage all 0.9.35 [677 kB] 349s Get:62 http://ftpmaster.internal/ubuntu plucky/universe armhf libsys-cpuaffinity-perl armhf 1.13~03-2build4 [31.2 kB] 349s Get:63 http://ftpmaster.internal/ubuntu plucky/universe armhf pbzip2 armhf 1.1.13-1build1 [39.0 kB] 349s Get:64 http://ftpmaster.internal/ubuntu plucky/universe armhf pixz armhf 1.0.7-3 [20.4 kB] 349s Get:65 http://ftpmaster.internal/ubuntu plucky/universe armhf libxdelta2t64 armhf 1.1.3-10.7 [43.3 kB] 349s Get:66 http://ftpmaster.internal/ubuntu plucky/universe armhf xdelta armhf 1.1.3-10.7 [23.5 kB] 349s Get:67 http://ftpmaster.internal/ubuntu plucky/universe armhf xdelta3 armhf 3.0.11-dfsg-1.2 [72.8 kB] 349s Get:68 http://ftpmaster.internal/ubuntu plucky/universe armhf pristine-tar armhf 1.50+nmu2build1 [104 kB] 349s Get:69 http://ftpmaster.internal/ubuntu plucky/universe armhf quilt all 0.68-1 [439 kB] 349s Get:70 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-debianbts all 4.1.1 [12.8 kB] 349s Get:71 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-jeepney all 0.8.0-4 [33.1 kB] 349s Get:72 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-secretstorage all 3.3.3-3 [13.7 kB] 349s Get:73 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-jaraco.classes all 3.4.0-1 [7664 B] 349s Get:74 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-keyring all 25.4.1-1 [40.5 kB] 349s Get:75 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-launchpadlib-desktop all 2.0.0-1 [1778 B] 349s Get:76 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-ubuntutools all 0.203 [67.4 kB] 349s Get:77 http://ftpmaster.internal/ubuntu plucky/universe armhf ubuntu-dev-tools all 0.203 [93.2 kB] 349s Get:78 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-astroid all 3.3.5-1 [174 kB] 349s Get:79 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-isort all 5.13.2-2 [59.3 kB] 349s Get:80 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-mypy-extensions all 1.0.0-1 [6148 B] 349s Get:81 http://ftpmaster.internal/ubuntu plucky/main armhf libjs-underscore all 1.13.4~dfsg+~1.11.4-3 [118 kB] 349s Get:82 http://ftpmaster.internal/ubuntu plucky/main armhf libjs-sphinxdoc all 7.4.7-4 [158 kB] 349s Get:83 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-logilab-common all 2.0.0-1 [281 kB] 349s Get:84 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-dill all 0.3.9-1 [84.5 kB] 349s Get:85 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-mccabe all 0.7.0-1 [8678 B] 349s Get:86 http://ftpmaster.internal/ubuntu plucky/main armhf python3-platformdirs all 4.3.6-1 [16.8 kB] 349s Get:87 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-tomlkit all 0.13.2-1 [37.6 kB] 349s Get:88 http://ftpmaster.internal/ubuntu plucky/universe armhf pylint all 3.3.1-2 [345 kB] 349s Get:89 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-argcomplete all 3.5.1-1ubuntu1 [35.6 kB] 349s Get:90 http://ftpmaster.internal/ubuntu plucky/main armhf python3-cachetools all 5.3.3-1 [10.3 kB] 349s Get:91 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-pycryptodome armhf 3.20.0+dfsg-3build1 [1089 kB] 350s Get:92 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-keyrings.alt all 5.0.2-1 [16.6 kB] 350s Get:93 http://ftpmaster.internal/ubuntu plucky/main armhf libhttp-parser2.9 armhf 2.9.4-6build1 [21.1 kB] 350s Get:94 http://ftpmaster.internal/ubuntu plucky-proposed/main armhf libgit2-1.8 armhf 1.8.4+ds-1ubuntu1 [452 kB] 350s Get:95 http://ftpmaster.internal/ubuntu plucky-proposed/universe armhf python3-pygit2 armhf 1.16.0-2 [172 kB] 350s Get:96 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-iniconfig all 1.1.1-2 [6024 B] 350s Get:97 http://ftpmaster.internal/ubuntu plucky/main armhf python3-packaging all 24.2-1 [51.5 kB] 350s Get:98 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-pluggy all 1.5.0-1 [21.0 kB] 350s Get:99 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-pytest all 8.3.3-1 [251 kB] 350s Get:100 http://ftpmaster.internal/ubuntu plucky/main armhf libpython3.13-stdlib armhf 3.13.0-2 [1972 kB] 350s Get:101 http://ftpmaster.internal/ubuntu plucky/main armhf python3.13 armhf 3.13.0-2 [719 kB] 350s Get:102 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-coverage armhf 7.4.4+dfsg1-0ubuntu3 [148 kB] 350s Get:103 http://ftpmaster.internal/ubuntu plucky/universe armhf libjs-jquery-isonscreen all 1.2.0-1.1 [3244 B] 350s Get:104 http://ftpmaster.internal/ubuntu plucky/universe armhf libjs-jquery-metadata all 12-4 [6582 B] 350s Get:105 http://ftpmaster.internal/ubuntu plucky/universe armhf libjs-jquery-tablesorter all 1:2.31.3+dfsg1-4 [192 kB] 350s Get:106 http://ftpmaster.internal/ubuntu plucky/universe armhf libjs-jquery-throttle-debounce all 1.1+dfsg.1-2 [12.5 kB] 350s Get:107 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-pytest-cov all 5.0.0-1 [21.3 kB] 350s Get:108 http://ftpmaster.internal/ubuntu plucky/main armhf python3-tenacity all 8.5.0-0ubuntu1 [17.0 kB] 350s Get:109 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-py all 1.11.0-2 [72.7 kB] 350s Get:110 http://ftpmaster.internal/ubuntu plucky/universe armhf libnorm1t64 armhf 1.5.9+dfsg-3.1build1 [206 kB] 350s Get:111 http://ftpmaster.internal/ubuntu plucky/universe armhf libpgm-5.3-0t64 armhf 5.3.128~dfsg-2.1build1 [171 kB] 350s Get:112 http://ftpmaster.internal/ubuntu plucky/main armhf libsodium23 armhf 1.0.18-1build3 [139 kB] 350s Get:113 http://ftpmaster.internal/ubuntu plucky/universe armhf libzmq5 armhf 4.3.5-1build2 [262 kB] 350s Get:114 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-zmq armhf 24.0.1-5build2 [352 kB] 350s Get:115 http://ftpmaster.internal/ubuntu plucky/universe armhf git-ubuntu all 1.1-1 [152 kB] 351s Fetched 23.2 MB in 4s (6202 kB/s) 351s Selecting previously unselected package libpython3.13-minimal:armhf. 351s (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 ... 59970 files and directories currently installed.) 351s Preparing to unpack .../000-libpython3.13-minimal_3.13.0-2_armhf.deb ... 351s Unpacking libpython3.13-minimal:armhf (3.13.0-2) ... 351s Selecting previously unselected package python3.13-minimal. 351s Preparing to unpack .../001-python3.13-minimal_3.13.0-2_armhf.deb ... 351s Unpacking python3.13-minimal (3.13.0-2) ... 351s Selecting previously unselected package libjs-jquery. 351s Preparing to unpack .../002-libjs-jquery_3.6.1+dfsg+~3.5.14-1_all.deb ... 351s Unpacking libjs-jquery (3.6.1+dfsg+~3.5.14-1) ... 351s Selecting previously unselected package libjs-jquery-hotkeys. 351s Preparing to unpack .../003-libjs-jquery-hotkeys_0~20130707+git2d51e3a9+dfsg-2.1_all.deb ... 351s Unpacking libjs-jquery-hotkeys (0~20130707+git2d51e3a9+dfsg-2.1) ... 351s Selecting previously unselected package dctrl-tools. 351s Preparing to unpack .../004-dctrl-tools_2.24-3build3_armhf.deb ... 351s Unpacking dctrl-tools (2.24-3build3) ... 351s Selecting previously unselected package debian-archive-keyring. 351s Preparing to unpack .../005-debian-archive-keyring_2023.4ubuntu1_all.deb ... 351s Unpacking debian-archive-keyring (2023.4ubuntu1) ... 351s Selecting previously unselected package libfile-dirlist-perl. 351s Preparing to unpack .../006-libfile-dirlist-perl_0.05-3_all.deb ... 351s Unpacking libfile-dirlist-perl (0.05-3) ... 351s Selecting previously unselected package libfile-which-perl. 352s Preparing to unpack .../007-libfile-which-perl_1.27-2_all.deb ... 352s Unpacking libfile-which-perl (1.27-2) ... 352s Selecting previously unselected package libfile-homedir-perl. 352s Preparing to unpack .../008-libfile-homedir-perl_1.006-2_all.deb ... 352s Unpacking libfile-homedir-perl (1.006-2) ... 352s Selecting previously unselected package libfile-touch-perl. 352s Preparing to unpack .../009-libfile-touch-perl_0.12-2_all.deb ... 352s Unpacking libfile-touch-perl (0.12-2) ... 352s Selecting previously unselected package libio-pty-perl. 352s Preparing to unpack .../010-libio-pty-perl_1%3a1.20-1build3_armhf.deb ... 352s Unpacking libio-pty-perl (1:1.20-1build3) ... 352s Selecting previously unselected package libipc-run-perl. 352s Preparing to unpack .../011-libipc-run-perl_20231003.0-2_all.deb ... 352s Unpacking libipc-run-perl (20231003.0-2) ... 352s Selecting previously unselected package libclass-method-modifiers-perl. 352s Preparing to unpack .../012-libclass-method-modifiers-perl_2.15-1_all.deb ... 352s Unpacking libclass-method-modifiers-perl (2.15-1) ... 352s Selecting previously unselected package libclass-xsaccessor-perl. 352s Preparing to unpack .../013-libclass-xsaccessor-perl_1.19-4build5_armhf.deb ... 352s Unpacking libclass-xsaccessor-perl (1.19-4build5) ... 352s Selecting previously unselected package libb-hooks-op-check-perl:armhf. 352s Preparing to unpack .../014-libb-hooks-op-check-perl_0.22-3build2_armhf.deb ... 352s Unpacking libb-hooks-op-check-perl:armhf (0.22-3build2) ... 352s Selecting previously unselected package libdynaloader-functions-perl. 352s Preparing to unpack .../015-libdynaloader-functions-perl_0.004-1_all.deb ... 352s Unpacking libdynaloader-functions-perl (0.004-1) ... 352s Selecting previously unselected package libdevel-callchecker-perl:armhf. 352s Preparing to unpack .../016-libdevel-callchecker-perl_0.009-1build1_armhf.deb ... 352s Unpacking libdevel-callchecker-perl:armhf (0.009-1build1) ... 352s Selecting previously unselected package libparams-classify-perl:armhf. 352s Preparing to unpack .../017-libparams-classify-perl_0.015-2build6_armhf.deb ... 352s Unpacking libparams-classify-perl:armhf (0.015-2build6) ... 352s Selecting previously unselected package libmodule-runtime-perl. 352s Preparing to unpack .../018-libmodule-runtime-perl_0.016-2_all.deb ... 352s Unpacking libmodule-runtime-perl (0.016-2) ... 352s Selecting previously unselected package libimport-into-perl. 352s Preparing to unpack .../019-libimport-into-perl_1.002005-2_all.deb ... 352s Unpacking libimport-into-perl (1.002005-2) ... 352s Selecting previously unselected package librole-tiny-perl. 352s Preparing to unpack .../020-librole-tiny-perl_2.002004-1_all.deb ... 352s Unpacking librole-tiny-perl (2.002004-1) ... 352s Selecting previously unselected package libsub-quote-perl. 352s Preparing to unpack .../021-libsub-quote-perl_2.006008-1ubuntu1_all.deb ... 352s Unpacking libsub-quote-perl (2.006008-1ubuntu1) ... 352s Selecting previously unselected package libmoo-perl. 352s Preparing to unpack .../022-libmoo-perl_2.005005-1_all.deb ... 352s Unpacking libmoo-perl (2.005005-1) ... 352s Selecting previously unselected package libencode-locale-perl. 352s Preparing to unpack .../023-libencode-locale-perl_1.05-3_all.deb ... 352s Unpacking libencode-locale-perl (1.05-3) ... 352s Selecting previously unselected package libtimedate-perl. 352s Preparing to unpack .../024-libtimedate-perl_2.3300-2_all.deb ... 352s Unpacking libtimedate-perl (2.3300-2) ... 352s Selecting previously unselected package libhttp-date-perl. 352s Preparing to unpack .../025-libhttp-date-perl_6.06-1_all.deb ... 352s Unpacking libhttp-date-perl (6.06-1) ... 352s Selecting previously unselected package libfile-listing-perl. 352s Preparing to unpack .../026-libfile-listing-perl_6.16-1_all.deb ... 352s Unpacking libfile-listing-perl (6.16-1) ... 352s Selecting previously unselected package libhtml-tagset-perl. 352s Preparing to unpack .../027-libhtml-tagset-perl_3.24-1_all.deb ... 352s Unpacking libhtml-tagset-perl (3.24-1) ... 352s Selecting previously unselected package liburi-perl. 352s Preparing to unpack .../028-liburi-perl_5.30-1_all.deb ... 352s Unpacking liburi-perl (5.30-1) ... 352s Selecting previously unselected package libhtml-parser-perl:armhf. 352s Preparing to unpack .../029-libhtml-parser-perl_3.83-1build1_armhf.deb ... 352s Unpacking libhtml-parser-perl:armhf (3.83-1build1) ... 352s Selecting previously unselected package libhtml-tree-perl. 352s Preparing to unpack .../030-libhtml-tree-perl_5.07-3_all.deb ... 352s Unpacking libhtml-tree-perl (5.07-3) ... 352s Selecting previously unselected package libclone-perl:armhf. 352s Preparing to unpack .../031-libclone-perl_0.47-1_armhf.deb ... 352s Unpacking libclone-perl:armhf (0.47-1) ... 352s Selecting previously unselected package libio-html-perl. 352s Preparing to unpack .../032-libio-html-perl_1.004-3_all.deb ... 352s Unpacking libio-html-perl (1.004-3) ... 352s Selecting previously unselected package liblwp-mediatypes-perl. 352s Preparing to unpack .../033-liblwp-mediatypes-perl_6.04-2_all.deb ... 352s Unpacking liblwp-mediatypes-perl (6.04-2) ... 352s Selecting previously unselected package libhttp-message-perl. 352s Preparing to unpack .../034-libhttp-message-perl_7.00-2ubuntu1_all.deb ... 352s Unpacking libhttp-message-perl (7.00-2ubuntu1) ... 352s Selecting previously unselected package libhttp-cookies-perl. 352s Preparing to unpack .../035-libhttp-cookies-perl_6.11-1_all.deb ... 352s Unpacking libhttp-cookies-perl (6.11-1) ... 352s Selecting previously unselected package libhttp-negotiate-perl. 352s Preparing to unpack .../036-libhttp-negotiate-perl_6.01-2_all.deb ... 352s Unpacking libhttp-negotiate-perl (6.01-2) ... 352s Selecting previously unselected package perl-openssl-defaults:armhf. 352s Preparing to unpack .../037-perl-openssl-defaults_7build3_armhf.deb ... 352s Unpacking perl-openssl-defaults:armhf (7build3) ... 353s Selecting previously unselected package libnet-ssleay-perl:armhf. 353s Preparing to unpack .../038-libnet-ssleay-perl_1.94-2_armhf.deb ... 353s Unpacking libnet-ssleay-perl:armhf (1.94-2) ... 353s Selecting previously unselected package libio-socket-ssl-perl. 353s Preparing to unpack .../039-libio-socket-ssl-perl_2.089-1_all.deb ... 353s Unpacking libio-socket-ssl-perl (2.089-1) ... 353s Selecting previously unselected package libnet-http-perl. 353s Preparing to unpack .../040-libnet-http-perl_6.23-1_all.deb ... 353s Unpacking libnet-http-perl (6.23-1) ... 353s Selecting previously unselected package liblwp-protocol-https-perl. 353s Preparing to unpack .../041-liblwp-protocol-https-perl_6.14-1_all.deb ... 353s Unpacking liblwp-protocol-https-perl (6.14-1) ... 353s Selecting previously unselected package libtry-tiny-perl. 353s Preparing to unpack .../042-libtry-tiny-perl_0.32-1_all.deb ... 353s Unpacking libtry-tiny-perl (0.32-1) ... 353s Selecting previously unselected package libwww-robotrules-perl. 353s Preparing to unpack .../043-libwww-robotrules-perl_6.02-1_all.deb ... 353s Unpacking libwww-robotrules-perl (6.02-1) ... 353s Selecting previously unselected package libwww-perl. 353s Preparing to unpack .../044-libwww-perl_6.77-1_all.deb ... 353s Unpacking libwww-perl (6.77-1) ... 353s Selecting previously unselected package patchutils. 353s Preparing to unpack .../045-patchutils_0.4.2-1build3_armhf.deb ... 353s Unpacking patchutils (0.4.2-1build3) ... 353s Selecting previously unselected package wdiff. 353s Preparing to unpack .../046-wdiff_1.2.2-6build1_armhf.deb ... 353s Unpacking wdiff (1.2.2-6build1) ... 353s Selecting previously unselected package devscripts. 353s Preparing to unpack .../047-devscripts_2.24.5_all.deb ... 353s Unpacking devscripts (2.24.5) ... 353s Selecting previously unselected package diffstat. 353s Preparing to unpack .../048-diffstat_1.67-1_armhf.deb ... 353s Unpacking diffstat (1.67-1) ... 353s Selecting previously unselected package python3-debian. 353s Preparing to unpack .../049-python3-debian_0.1.49ubuntu3_all.deb ... 353s Unpacking python3-debian (0.1.49ubuntu3) ... 353s Selecting previously unselected package python3-gpg. 353s Preparing to unpack .../050-python3-gpg_1.24.0-2ubuntu1_armhf.deb ... 353s Unpacking python3-gpg (1.24.0-2ubuntu1) ... 353s Selecting previously unselected package python3-xdg. 353s Preparing to unpack .../051-python3-xdg_0.28-2_all.deb ... 353s Unpacking python3-xdg (0.28-2) ... 353s Selecting previously unselected package dput. 353s Preparing to unpack .../052-dput_1.2.4ubuntu1_all.deb ... 353s Unpacking dput (1.2.4ubuntu1) ... 353s Selecting previously unselected package libgomp1:armhf. 353s Preparing to unpack .../053-libgomp1_14.2.0-9ubuntu1_armhf.deb ... 353s Unpacking libgomp1:armhf (14.2.0-9ubuntu1) ... 353s Selecting previously unselected package gettext. 353s Preparing to unpack .../054-gettext_0.22.5-2_armhf.deb ... 353s Unpacking gettext (0.22.5-2) ... 353s Selecting previously unselected package liberror-perl. 353s Preparing to unpack .../055-liberror-perl_0.17029-2_all.deb ... 353s Unpacking liberror-perl (0.17029-2) ... 353s Selecting previously unselected package git-man. 353s Preparing to unpack .../056-git-man_1%3a2.45.2-1.2ubuntu1_all.deb ... 353s Unpacking git-man (1:2.45.2-1.2ubuntu1) ... 353s Selecting previously unselected package git. 353s Preparing to unpack .../057-git_1%3a2.45.2-1.2ubuntu1_armhf.deb ... 353s Unpacking git (1:2.45.2-1.2ubuntu1) ... 354s Selecting previously unselected package python3-dateutil. 354s Preparing to unpack .../058-python3-dateutil_2.9.0-3_all.deb ... 354s Unpacking python3-dateutil (2.9.0-3) ... 354s Selecting previously unselected package python3-importlib-metadata. 354s Preparing to unpack .../059-python3-importlib-metadata_8.5.0-1_all.deb ... 354s Unpacking python3-importlib-metadata (8.5.0-1) ... 354s Selecting previously unselected package git-buildpackage. 354s Preparing to unpack .../060-git-buildpackage_0.9.35_all.deb ... 354s Unpacking git-buildpackage (0.9.35) ... 354s Selecting previously unselected package libsys-cpuaffinity-perl. 354s Preparing to unpack .../061-libsys-cpuaffinity-perl_1.13~03-2build4_armhf.deb ... 354s Unpacking libsys-cpuaffinity-perl (1.13~03-2build4) ... 354s Selecting previously unselected package pbzip2. 354s Preparing to unpack .../062-pbzip2_1.1.13-1build1_armhf.deb ... 354s Unpacking pbzip2 (1.1.13-1build1) ... 354s Selecting previously unselected package pixz. 354s Preparing to unpack .../063-pixz_1.0.7-3_armhf.deb ... 354s Unpacking pixz (1.0.7-3) ... 354s Selecting previously unselected package libxdelta2t64:armhf. 354s Preparing to unpack .../064-libxdelta2t64_1.1.3-10.7_armhf.deb ... 354s Unpacking libxdelta2t64:armhf (1.1.3-10.7) ... 354s Selecting previously unselected package xdelta. 354s Preparing to unpack .../065-xdelta_1.1.3-10.7_armhf.deb ... 354s Unpacking xdelta (1.1.3-10.7) ... 354s Selecting previously unselected package xdelta3. 354s Preparing to unpack .../066-xdelta3_3.0.11-dfsg-1.2_armhf.deb ... 354s Unpacking xdelta3 (3.0.11-dfsg-1.2) ... 354s Selecting previously unselected package pristine-tar. 354s Preparing to unpack .../067-pristine-tar_1.50+nmu2build1_armhf.deb ... 354s Unpacking pristine-tar (1.50+nmu2build1) ... 354s Selecting previously unselected package quilt. 354s Preparing to unpack .../068-quilt_0.68-1_all.deb ... 354s Unpacking quilt (0.68-1) ... 354s Selecting previously unselected package python3-debianbts. 354s Preparing to unpack .../069-python3-debianbts_4.1.1_all.deb ... 354s Unpacking python3-debianbts (4.1.1) ... 354s Selecting previously unselected package python3-jeepney. 354s Preparing to unpack .../070-python3-jeepney_0.8.0-4_all.deb ... 354s Unpacking python3-jeepney (0.8.0-4) ... 354s Selecting previously unselected package python3-secretstorage. 354s Preparing to unpack .../071-python3-secretstorage_3.3.3-3_all.deb ... 354s Unpacking python3-secretstorage (3.3.3-3) ... 354s Selecting previously unselected package python3-jaraco.classes. 354s Preparing to unpack .../072-python3-jaraco.classes_3.4.0-1_all.deb ... 354s Unpacking python3-jaraco.classes (3.4.0-1) ... 354s Selecting previously unselected package python3-keyring. 354s Preparing to unpack .../073-python3-keyring_25.4.1-1_all.deb ... 354s Unpacking python3-keyring (25.4.1-1) ... 354s Selecting previously unselected package python3-launchpadlib-desktop. 354s Preparing to unpack .../074-python3-launchpadlib-desktop_2.0.0-1_all.deb ... 354s Unpacking python3-launchpadlib-desktop (2.0.0-1) ... 354s Selecting previously unselected package python3-ubuntutools. 354s Preparing to unpack .../075-python3-ubuntutools_0.203_all.deb ... 354s Unpacking python3-ubuntutools (0.203) ... 354s Selecting previously unselected package ubuntu-dev-tools. 354s Preparing to unpack .../076-ubuntu-dev-tools_0.203_all.deb ... 354s Unpacking ubuntu-dev-tools (0.203) ... 354s Selecting previously unselected package python3-astroid. 354s Preparing to unpack .../077-python3-astroid_3.3.5-1_all.deb ... 354s Unpacking python3-astroid (3.3.5-1) ... 354s Selecting previously unselected package python3-isort. 354s Preparing to unpack .../078-python3-isort_5.13.2-2_all.deb ... 354s Unpacking python3-isort (5.13.2-2) ... 354s Selecting previously unselected package python3-mypy-extensions. 354s Preparing to unpack .../079-python3-mypy-extensions_1.0.0-1_all.deb ... 354s Unpacking python3-mypy-extensions (1.0.0-1) ... 354s Selecting previously unselected package libjs-underscore. 354s Preparing to unpack .../080-libjs-underscore_1.13.4~dfsg+~1.11.4-3_all.deb ... 354s Unpacking libjs-underscore (1.13.4~dfsg+~1.11.4-3) ... 354s Selecting previously unselected package libjs-sphinxdoc. 354s Preparing to unpack .../081-libjs-sphinxdoc_7.4.7-4_all.deb ... 354s Unpacking libjs-sphinxdoc (7.4.7-4) ... 354s Selecting previously unselected package python3-logilab-common. 354s Preparing to unpack .../082-python3-logilab-common_2.0.0-1_all.deb ... 354s Unpacking python3-logilab-common (2.0.0-1) ... 355s Selecting previously unselected package python3-dill. 355s Preparing to unpack .../083-python3-dill_0.3.9-1_all.deb ... 355s Unpacking python3-dill (0.3.9-1) ... 355s Selecting previously unselected package python3-mccabe. 355s Preparing to unpack .../084-python3-mccabe_0.7.0-1_all.deb ... 355s Unpacking python3-mccabe (0.7.0-1) ... 355s Selecting previously unselected package python3-platformdirs. 355s Preparing to unpack .../085-python3-platformdirs_4.3.6-1_all.deb ... 355s Unpacking python3-platformdirs (4.3.6-1) ... 355s Selecting previously unselected package python3-tomlkit. 355s Preparing to unpack .../086-python3-tomlkit_0.13.2-1_all.deb ... 355s Unpacking python3-tomlkit (0.13.2-1) ... 355s Selecting previously unselected package pylint. 355s Preparing to unpack .../087-pylint_3.3.1-2_all.deb ... 355s Unpacking pylint (3.3.1-2) ... 355s Selecting previously unselected package python3-argcomplete. 355s Preparing to unpack .../088-python3-argcomplete_3.5.1-1ubuntu1_all.deb ... 355s Unpacking python3-argcomplete (3.5.1-1ubuntu1) ... 355s Selecting previously unselected package python3-cachetools. 355s Preparing to unpack .../089-python3-cachetools_5.3.3-1_all.deb ... 355s Unpacking python3-cachetools (5.3.3-1) ... 355s Selecting previously unselected package python3-pycryptodome. 355s Preparing to unpack .../090-python3-pycryptodome_3.20.0+dfsg-3build1_armhf.deb ... 355s Unpacking python3-pycryptodome (3.20.0+dfsg-3build1) ... 355s Selecting previously unselected package python3-keyrings.alt. 355s Preparing to unpack .../091-python3-keyrings.alt_5.0.2-1_all.deb ... 355s Unpacking python3-keyrings.alt (5.0.2-1) ... 355s Selecting previously unselected package libhttp-parser2.9:armhf. 355s Preparing to unpack .../092-libhttp-parser2.9_2.9.4-6build1_armhf.deb ... 355s Unpacking libhttp-parser2.9:armhf (2.9.4-6build1) ... 355s Selecting previously unselected package libgit2-1.8:armhf. 355s Preparing to unpack .../093-libgit2-1.8_1.8.4+ds-1ubuntu1_armhf.deb ... 355s Unpacking libgit2-1.8:armhf (1.8.4+ds-1ubuntu1) ... 355s Selecting previously unselected package python3-pygit2. 355s Preparing to unpack .../094-python3-pygit2_1.16.0-2_armhf.deb ... 355s Unpacking python3-pygit2 (1.16.0-2) ... 355s Selecting previously unselected package python3-iniconfig. 355s Preparing to unpack .../095-python3-iniconfig_1.1.1-2_all.deb ... 355s Unpacking python3-iniconfig (1.1.1-2) ... 355s Selecting previously unselected package python3-packaging. 355s Preparing to unpack .../096-python3-packaging_24.2-1_all.deb ... 355s Unpacking python3-packaging (24.2-1) ... 355s Selecting previously unselected package python3-pluggy. 355s Preparing to unpack .../097-python3-pluggy_1.5.0-1_all.deb ... 355s Unpacking python3-pluggy (1.5.0-1) ... 355s Selecting previously unselected package python3-pytest. 355s Preparing to unpack .../098-python3-pytest_8.3.3-1_all.deb ... 355s Unpacking python3-pytest (8.3.3-1) ... 355s Selecting previously unselected package libpython3.13-stdlib:armhf. 355s Preparing to unpack .../099-libpython3.13-stdlib_3.13.0-2_armhf.deb ... 355s Unpacking libpython3.13-stdlib:armhf (3.13.0-2) ... 355s Selecting previously unselected package python3.13. 355s Preparing to unpack .../100-python3.13_3.13.0-2_armhf.deb ... 355s Unpacking python3.13 (3.13.0-2) ... 355s Selecting previously unselected package python3-coverage. 355s Preparing to unpack .../101-python3-coverage_7.4.4+dfsg1-0ubuntu3_armhf.deb ... 355s Unpacking python3-coverage (7.4.4+dfsg1-0ubuntu3) ... 355s Selecting previously unselected package libjs-jquery-isonscreen. 355s Preparing to unpack .../102-libjs-jquery-isonscreen_1.2.0-1.1_all.deb ... 355s Unpacking libjs-jquery-isonscreen (1.2.0-1.1) ... 355s Selecting previously unselected package libjs-jquery-metadata. 355s Preparing to unpack .../103-libjs-jquery-metadata_12-4_all.deb ... 355s Unpacking libjs-jquery-metadata (12-4) ... 356s Selecting previously unselected package libjs-jquery-tablesorter. 356s Preparing to unpack .../104-libjs-jquery-tablesorter_1%3a2.31.3+dfsg1-4_all.deb ... 356s Unpacking libjs-jquery-tablesorter (1:2.31.3+dfsg1-4) ... 356s Selecting previously unselected package libjs-jquery-throttle-debounce. 356s Preparing to unpack .../105-libjs-jquery-throttle-debounce_1.1+dfsg.1-2_all.deb ... 356s Unpacking libjs-jquery-throttle-debounce (1.1+dfsg.1-2) ... 356s Selecting previously unselected package python3-pytest-cov. 356s Preparing to unpack .../106-python3-pytest-cov_5.0.0-1_all.deb ... 356s Unpacking python3-pytest-cov (5.0.0-1) ... 356s Selecting previously unselected package python3-tenacity. 356s Preparing to unpack .../107-python3-tenacity_8.5.0-0ubuntu1_all.deb ... 356s Unpacking python3-tenacity (8.5.0-0ubuntu1) ... 356s Selecting previously unselected package python3-py. 356s Preparing to unpack .../108-python3-py_1.11.0-2_all.deb ... 356s Unpacking python3-py (1.11.0-2) ... 356s Selecting previously unselected package libnorm1t64:armhf. 356s Preparing to unpack .../109-libnorm1t64_1.5.9+dfsg-3.1build1_armhf.deb ... 356s Unpacking libnorm1t64:armhf (1.5.9+dfsg-3.1build1) ... 356s Selecting previously unselected package libpgm-5.3-0t64:armhf. 356s Preparing to unpack .../110-libpgm-5.3-0t64_5.3.128~dfsg-2.1build1_armhf.deb ... 356s Unpacking libpgm-5.3-0t64:armhf (5.3.128~dfsg-2.1build1) ... 356s Selecting previously unselected package libsodium23:armhf. 356s Preparing to unpack .../111-libsodium23_1.0.18-1build3_armhf.deb ... 356s Unpacking libsodium23:armhf (1.0.18-1build3) ... 356s Selecting previously unselected package libzmq5:armhf. 356s Preparing to unpack .../112-libzmq5_4.3.5-1build2_armhf.deb ... 356s Unpacking libzmq5:armhf (4.3.5-1build2) ... 356s Selecting previously unselected package python3-zmq. 356s Preparing to unpack .../113-python3-zmq_24.0.1-5build2_armhf.deb ... 356s Unpacking python3-zmq (24.0.1-5build2) ... 356s Selecting previously unselected package git-ubuntu. 356s Preparing to unpack .../114-git-ubuntu_1.1-1_all.deb ... 356s Unpacking git-ubuntu (1.1-1) ... 356s Setting up python3-iniconfig (1.1.1-2) ... 356s Setting up libnorm1t64:armhf (1.5.9+dfsg-3.1build1) ... 356s Setting up wdiff (1.2.2-6build1) ... 356s Setting up libfile-which-perl (1.27-2) ... 356s Setting up libsodium23:armhf (1.0.18-1build3) ... 356s Setting up python3-jaraco.classes (3.4.0-1) ... 356s Setting up libxdelta2t64:armhf (1.1.3-10.7) ... 356s Setting up python3-importlib-metadata (8.5.0-1) ... 356s Setting up xdelta (1.1.3-10.7) ... 356s Setting up libsys-cpuaffinity-perl (1.13~03-2build4) ... 356s Setting up python3-py (1.11.0-2) ... 357s Setting up libdynaloader-functions-perl (0.004-1) ... 357s Setting up libclass-method-modifiers-perl (2.15-1) ... 357s Setting up libio-pty-perl (1:1.20-1build3) ... 357s Setting up python3-cachetools (5.3.3-1) ... 357s Setting up python3-debianbts (4.1.1) ... 357s Setting up libclone-perl:armhf (0.47-1) ... 357s Setting up libhtml-tagset-perl (3.24-1) ... 357s Setting up python3-mypy-extensions (1.0.0-1) ... 357s Setting up python3-pycryptodome (3.20.0+dfsg-3build1) ... 358s Setting up python3-tenacity (8.5.0-0ubuntu1) ... 358s Setting up liblwp-mediatypes-perl (6.04-2) ... 358s Setting up debian-archive-keyring (2023.4ubuntu1) ... 358s Setting up libtry-tiny-perl (0.32-1) ... 358s Setting up perl-openssl-defaults:armhf (7build3) ... 358s Setting up libencode-locale-perl (1.05-3) ... 358s Setting up libjs-jquery-throttle-debounce (1.1+dfsg.1-2) ... 358s Setting up libgomp1:armhf (14.2.0-9ubuntu1) ... 358s Setting up python3-xdg (0.28-2) ... 358s Setting up pbzip2 (1.1.13-1build1) ... 358s Setting up python3-platformdirs (4.3.6-1) ... 358s Setting up liberror-perl (0.17029-2) ... 358s Setting up libpython3.13-minimal:armhf (3.13.0-2) ... 358s Setting up patchutils (0.4.2-1build3) ... 358s Setting up libpgm-5.3-0t64:armhf (5.3.128~dfsg-2.1build1) ... 358s Setting up python3-packaging (24.2-1) ... 358s Setting up python3-gpg (1.24.0-2ubuntu1) ... 358s Setting up python3-dill (0.3.9-1) ... 359s Setting up python3-debian (0.1.49ubuntu3) ... 359s Setting up diffstat (1.67-1) ... 359s Setting up libio-html-perl (1.004-3) ... 359s Setting up libb-hooks-op-check-perl:armhf (0.22-3build2) ... 359s Setting up libipc-run-perl (20231003.0-2) ... 359s Setting up python3-jeepney (0.8.0-4) ... 359s Setting up python3-isort (5.13.2-2) ... 359s Setting up python3-pluggy (1.5.0-1) ... 359s Setting up libtimedate-perl (2.3300-2) ... 359s Setting up python3-astroid (3.3.5-1) ... 360s Setting up xdelta3 (3.0.11-dfsg-1.2) ... 360s Setting up pixz (1.0.7-3) ... 360s Setting up librole-tiny-perl (2.002004-1) ... 360s Setting up python3.13-minimal (3.13.0-2) ... 361s Setting up git-man (1:2.45.2-1.2ubuntu1) ... 361s Setting up python3-dateutil (2.9.0-3) ... 361s Setting up python3-mccabe (0.7.0-1) ... 361s Setting up libsub-quote-perl (2.006008-1ubuntu1) ... 361s Setting up libclass-xsaccessor-perl (1.19-4build5) ... 361s Setting up libjs-jquery (3.6.1+dfsg+~3.5.14-1) ... 361s Setting up libfile-dirlist-perl (0.05-3) ... 361s Setting up libjs-jquery-hotkeys (0~20130707+git2d51e3a9+dfsg-2.1) ... 361s Setting up python3-argcomplete (3.5.1-1ubuntu1) ... 361s Setting up libfile-homedir-perl (1.006-2) ... 361s Setting up python3-tomlkit (0.13.2-1) ... 361s Setting up libpython3.13-stdlib:armhf (3.13.0-2) ... 361s Setting up liburi-perl (5.30-1) ... 361s Setting up pristine-tar (1.50+nmu2build1) ... 361s Setting up libfile-touch-perl (0.12-2) ... 361s Setting up dctrl-tools (2.24-3build3) ... 361s Setting up libhttp-parser2.9:armhf (2.9.4-6build1) ... 361s Setting up libjs-underscore (1.13.4~dfsg+~1.11.4-3) ... 361s Setting up libnet-ssleay-perl:armhf (1.94-2) ... 361s Setting up libhttp-date-perl (6.06-1) ... 361s Setting up gettext (0.22.5-2) ... 361s Setting up libfile-listing-perl (6.16-1) ... 361s Setting up libzmq5:armhf (4.3.5-1build2) ... 361s Setting up python3.13 (3.13.0-2) ... 363s Setting up python3-pytest (8.3.3-1) ... 363s Setting up libnet-http-perl (6.23-1) ... 363s Setting up python3-coverage (7.4.4+dfsg1-0ubuntu3) ... 363s Setting up quilt (0.68-1) ... 363s Setting up libdevel-callchecker-perl:armhf (0.009-1build1) ... 363s Setting up dput (1.2.4ubuntu1) ... 363s Setting up python3-secretstorage (3.3.3-3) ... 363s Setting up python3-zmq (24.0.1-5build2) ... 364s Setting up libjs-jquery-metadata (12-4) ... 364s Setting up libgit2-1.8:armhf (1.8.4+ds-1ubuntu1) ... 364s Setting up libjs-jquery-isonscreen (1.2.0-1.1) ... 364s Setting up git (1:2.45.2-1.2ubuntu1) ... 364s Setting up libjs-sphinxdoc (7.4.7-4) ... 364s Setting up libwww-robotrules-perl (6.02-1) ... 364s Setting up libjs-jquery-tablesorter (1:2.31.3+dfsg1-4) ... 364s Setting up libhtml-parser-perl:armhf (3.83-1build1) ... 364s Setting up python3-keyring (25.4.1-1) ... 364s Setting up libio-socket-ssl-perl (2.089-1) ... 364s Setting up libhttp-message-perl (7.00-2ubuntu1) ... 364s Setting up libhttp-negotiate-perl (6.01-2) ... 364s Setting up libhttp-cookies-perl (6.11-1) ... 364s Setting up python3-logilab-common (2.0.0-1) ... 364s Setting up python3-pygit2 (1.16.0-2) ... 364s Setting up libhtml-tree-perl (5.07-3) ... 364s Setting up libparams-classify-perl:armhf (0.015-2build6) ... 364s Setting up python3-pytest-cov (5.0.0-1) ... 364s Setting up libmodule-runtime-perl (0.016-2) ... 364s Setting up python3-launchpadlib-desktop (2.0.0-1) ... 364s Setting up python3-keyrings.alt (5.0.2-1) ... 365s Setting up pylint (3.3.1-2) ... 365s Setting up libimport-into-perl (1.002005-2) ... 365s Setting up libmoo-perl (2.005005-1) ... 365s Setting up python3-ubuntutools (0.203) ... 365s Setting up liblwp-protocol-https-perl (6.14-1) ... 365s Setting up libwww-perl (6.77-1) ... 365s Setting up devscripts (2.24.5) ... 365s Setting up git-buildpackage (0.9.35) ... 366s Setting up ubuntu-dev-tools (0.203) ... 366s Setting up git-ubuntu (1.1-1) ... 366s Processing triggers for libc-bin (2.40-1ubuntu3) ... 366s Processing triggers for systemd (256.5-2ubuntu4) ... 366s Processing triggers for man-db (2.13.0-1) ... 367s Processing triggers for install-info (7.1.1-1) ... 381s autopkgtest [09:41:17]: test self-test: TEST_SYSTEM_TREE=1 /usr/share/git-ubuntu/self-test 381s autopkgtest [09:41:17]: test self-test: [----------------------- 384s Testing git-ubuntu system installation. 384s Testing tree in /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu 384s Working dir /tmp/autopkgtest.fX8nmF/build.mOL/src 399s pylint passed! 407s ============================= test session starts ============================== 407s platform linux -- Python 3.12.7, pytest-8.3.3, pluggy-1.5.0 407s rootdir: /tmp/autopkgtest.fX8nmF/build.mOL/src 407s configfile: pytest.ini 407s plugins: typeguard-4.4.1, cov-5.0.0 407s collected 459 items 407s 407s gitubuntu/build.py ..... [ 1%] 409s gitubuntu/git_repository_test.py ....................................... [ 9%] 423s ...FFFFF.FFF...........................F.FFFFFFF.FFF.......FFFFFFFFFF [ 24%] 423s gitubuntu/importer_service_test.py ..................................... [ 32%] 423s ..... [ 33%] 423s gitubuntu/importer_service_worker_test.py ... [ 34%] 439s gitubuntu/importer_tag_test.py FFFFFFFFFxF [ 36%] 458s gitubuntu/importer_test.py .......FF.FFFFFFFFFFF.FFF.FFF..FFFFFFFFFFFFFF [ 46%] 475s FFFFxx..FF.................................................F....FFFF. [ 61%] 477s gitubuntu/integration_test.py ...............Fsss [ 65%] 477s gitubuntu/prepare_upload_test.py .............. [ 68%] 478s gitubuntu/repo_builder_test.py .........FF.F................ [ 75%] 478s gitubuntu/rich_history_test.py FFF.FFFF [ 76%] 484s gitubuntu/source_builder_test.py .FF.......FFFFFFFFF.. [ 81%] 484s gitubuntu/source_information_test.py ................................... [ 89%] 484s ... [ 89%] 485s gitubuntu/versioning.py ............................................... [100%] 485s 485s =================================== FAILURES =================================== 485s ___________________ test_follow_symlinks_to_blob[0] ____________________ 485s 485s pygit2_repo = pygit2.Repository('/tmp/tmp8k9ngbha/.git/') 485s tree_func = at 0xe859fb68> 485s 485s @pytest.mark.parametrize('tree_func', [ 485s # The tree_func parameter is a function that accepts a mock Blob that is to 485s # represent the changelog blob itself and returns a mock Tree with the mock 485s # Blob embedded somewhere within it. The test function can then ensure that 485s # follow_symlinks_to_blob can correctly find the changelog Blob given the 485s # Tree. 485s 485s # Of course this is only expected to work if, after checking out the Tree, 485s # "cat debian/changelog" would work. But this allows us to test the various 485s # permutations of symlink following in Trees that _are_ valid. 485s 485s # Simple case 485s lambda b: Tree({ 485s 'debian': Tree({'changelog': b}), 485s }), 485s 485s # Symlink in debian/ 485s lambda b: Tree({ 485s 'debian': Tree({ 485s 'changelog.real': b, 485s 'changelog': Symlink('changelog.real'), 485s }), 485s }), 485s 485s # Symlink to parent directory 485s lambda b: Tree({ 485s 'changelog': b, 485s 'debian': Tree({ 485s 'changelog': Symlink('../changelog'), 485s }) 485s }), 485s 485s # Symlink to subdirectory 485s lambda b: Tree({ 485s 'debian': Tree({ 485s 'changelog': Symlink('subdirectory/changelog'), 485s 'subdirectory': Tree({'changelog': b}), 485s }) 485s }), 485s 485s # debian/ itself is a symlink to a different directory 485s lambda b: Tree({ 485s 'pkg': Tree({'changelog': b}), 485s 'debian': Symlink('pkg'), 485s }) 485s ]) 485s def test_follow_symlinks_to_blob(pygit2_repo, tree_func): 485s blob = Blob(b'') 485s blob_id = blob.write(pygit2_repo) 485s tree = pygit2_repo.get(tree_func(blob).write(pygit2_repo)) 485s > result_blob = target.follow_symlinks_to_blob( 485s pygit2_repo, 485s tree, 485s 'debian/changelog', 485s ) 485s 485s gitubuntu/git_repository_test.py:342: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 485s return _follow_symlinks_to_blob( 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s repo = pygit2.Repository('/tmp/tmp8k9ngbha/.git/') 485s top_tree_object = 485s search_path = 'debian/changelog' 485s _rel_tree = 485s _rel_path = '' 485s 485s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 485s _rel_tree=None, _rel_path='' 485s ): 485s '''Recursively follow a path down a tree, following symlinks, to find blob 485s 485s repo: pygit2.Repository object 485s top_tree: pygit2.Tree object of the top of the tree structure 485s search_path: '/'-separated path string of blob to find 485s _rel_tree: (internal) which tree to look further into 485s _rel_path: (internal) the path we are in so far 485s ''' 485s 485s NORMAL_BLOB_MODES = set([ 485s pygit2.GIT_FILEMODE_BLOB, 485s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 485s ]) 485s 485s _rel_tree = _rel_tree or top_tree_object 485s head, tail = posixpath.split(search_path) 485s 485s # A traditional functional split would put a single entry in head with tail 485s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 485s # to make it appear to have traditional semantics. 485s if not head: 485s head = tail 485s tail = None 485s 485s entry = _rel_tree[head] 485s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 485s 485s gitubuntu/git_repository.py:68: AttributeError 485s ___________________ test_follow_symlinks_to_blob[1] ____________________ 485s 485s pygit2_repo = pygit2.Repository('/tmp/tmp0bq2vo25/.git/') 485s tree_func = at 0xe859fbb8> 485s 485s @pytest.mark.parametrize('tree_func', [ 485s # The tree_func parameter is a function that accepts a mock Blob that is to 485s # represent the changelog blob itself and returns a mock Tree with the mock 485s # Blob embedded somewhere within it. The test function can then ensure that 485s # follow_symlinks_to_blob can correctly find the changelog Blob given the 485s # Tree. 485s 485s # Of course this is only expected to work if, after checking out the Tree, 485s # "cat debian/changelog" would work. But this allows us to test the various 485s # permutations of symlink following in Trees that _are_ valid. 485s 485s # Simple case 485s lambda b: Tree({ 485s 'debian': Tree({'changelog': b}), 485s }), 485s 485s # Symlink in debian/ 485s lambda b: Tree({ 485s 'debian': Tree({ 485s 'changelog.real': b, 485s 'changelog': Symlink('changelog.real'), 485s }), 485s }), 485s 485s # Symlink to parent directory 485s lambda b: Tree({ 485s 'changelog': b, 485s 'debian': Tree({ 485s 'changelog': Symlink('../changelog'), 485s }) 485s }), 485s 485s # Symlink to subdirectory 485s lambda b: Tree({ 485s 'debian': Tree({ 485s 'changelog': Symlink('subdirectory/changelog'), 485s 'subdirectory': Tree({'changelog': b}), 485s }) 485s }), 485s 485s # debian/ itself is a symlink to a different directory 485s lambda b: Tree({ 485s 'pkg': Tree({'changelog': b}), 485s 'debian': Symlink('pkg'), 485s }) 485s ]) 485s def test_follow_symlinks_to_blob(pygit2_repo, tree_func): 485s blob = Blob(b'') 485s blob_id = blob.write(pygit2_repo) 485s tree = pygit2_repo.get(tree_func(blob).write(pygit2_repo)) 485s > result_blob = target.follow_symlinks_to_blob( 485s pygit2_repo, 485s tree, 485s 'debian/changelog', 485s ) 485s 485s gitubuntu/git_repository_test.py:342: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 485s return _follow_symlinks_to_blob( 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s repo = pygit2.Repository('/tmp/tmp0bq2vo25/.git/') 485s top_tree_object = 485s search_path = 'debian/changelog' 485s _rel_tree = 485s _rel_path = '' 485s 485s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 485s _rel_tree=None, _rel_path='' 485s ): 485s '''Recursively follow a path down a tree, following symlinks, to find blob 485s 485s repo: pygit2.Repository object 485s top_tree: pygit2.Tree object of the top of the tree structure 485s search_path: '/'-separated path string of blob to find 485s _rel_tree: (internal) which tree to look further into 485s _rel_path: (internal) the path we are in so far 485s ''' 485s 485s NORMAL_BLOB_MODES = set([ 485s pygit2.GIT_FILEMODE_BLOB, 485s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 485s ]) 485s 485s _rel_tree = _rel_tree or top_tree_object 485s head, tail = posixpath.split(search_path) 485s 485s # A traditional functional split would put a single entry in head with tail 485s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 485s # to make it appear to have traditional semantics. 485s if not head: 485s head = tail 485s tail = None 485s 485s entry = _rel_tree[head] 485s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 485s 485s gitubuntu/git_repository.py:68: AttributeError 485s ___________________ test_follow_symlinks_to_blob[2] ____________________ 485s 485s pygit2_repo = pygit2.Repository('/tmp/tmpolhw9lit/.git/') 485s tree_func = at 0xe859fc08> 485s 485s @pytest.mark.parametrize('tree_func', [ 485s # The tree_func parameter is a function that accepts a mock Blob that is to 485s # represent the changelog blob itself and returns a mock Tree with the mock 485s # Blob embedded somewhere within it. The test function can then ensure that 485s # follow_symlinks_to_blob can correctly find the changelog Blob given the 485s # Tree. 485s 485s # Of course this is only expected to work if, after checking out the Tree, 485s # "cat debian/changelog" would work. But this allows us to test the various 485s # permutations of symlink following in Trees that _are_ valid. 485s 485s # Simple case 485s lambda b: Tree({ 485s 'debian': Tree({'changelog': b}), 485s }), 485s 485s # Symlink in debian/ 485s lambda b: Tree({ 485s 'debian': Tree({ 485s 'changelog.real': b, 485s 'changelog': Symlink('changelog.real'), 485s }), 485s }), 485s 485s # Symlink to parent directory 485s lambda b: Tree({ 485s 'changelog': b, 485s 'debian': Tree({ 485s 'changelog': Symlink('../changelog'), 485s }) 485s }), 485s 485s # Symlink to subdirectory 485s lambda b: Tree({ 485s 'debian': Tree({ 485s 'changelog': Symlink('subdirectory/changelog'), 485s 'subdirectory': Tree({'changelog': b}), 485s }) 485s }), 485s 485s # debian/ itself is a symlink to a different directory 485s lambda b: Tree({ 485s 'pkg': Tree({'changelog': b}), 485s 'debian': Symlink('pkg'), 485s }) 485s ]) 485s def test_follow_symlinks_to_blob(pygit2_repo, tree_func): 485s blob = Blob(b'') 485s blob_id = blob.write(pygit2_repo) 485s tree = pygit2_repo.get(tree_func(blob).write(pygit2_repo)) 485s > result_blob = target.follow_symlinks_to_blob( 485s pygit2_repo, 485s tree, 485s 'debian/changelog', 485s ) 485s 485s gitubuntu/git_repository_test.py:342: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 485s return _follow_symlinks_to_blob( 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s repo = pygit2.Repository('/tmp/tmpolhw9lit/.git/') 485s top_tree_object = 485s search_path = 'debian/changelog' 485s _rel_tree = 485s _rel_path = '' 485s 485s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 485s _rel_tree=None, _rel_path='' 485s ): 485s '''Recursively follow a path down a tree, following symlinks, to find blob 485s 485s repo: pygit2.Repository object 485s top_tree: pygit2.Tree object of the top of the tree structure 485s search_path: '/'-separated path string of blob to find 485s _rel_tree: (internal) which tree to look further into 485s _rel_path: (internal) the path we are in so far 485s ''' 485s 485s NORMAL_BLOB_MODES = set([ 485s pygit2.GIT_FILEMODE_BLOB, 485s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 485s ]) 485s 485s _rel_tree = _rel_tree or top_tree_object 485s head, tail = posixpath.split(search_path) 485s 485s # A traditional functional split would put a single entry in head with tail 485s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 485s # to make it appear to have traditional semantics. 485s if not head: 485s head = tail 485s tail = None 485s 485s entry = _rel_tree[head] 485s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 485s 485s gitubuntu/git_repository.py:68: AttributeError 485s ___________________ test_follow_symlinks_to_blob[3] ____________________ 485s 485s pygit2_repo = pygit2.Repository('/tmp/tmpohad_58s/.git/') 485s tree_func = at 0xe859fc58> 485s 485s @pytest.mark.parametrize('tree_func', [ 485s # The tree_func parameter is a function that accepts a mock Blob that is to 485s # represent the changelog blob itself and returns a mock Tree with the mock 485s # Blob embedded somewhere within it. The test function can then ensure that 485s # follow_symlinks_to_blob can correctly find the changelog Blob given the 485s # Tree. 485s 485s # Of course this is only expected to work if, after checking out the Tree, 485s # "cat debian/changelog" would work. But this allows us to test the various 485s # permutations of symlink following in Trees that _are_ valid. 485s 485s # Simple case 485s lambda b: Tree({ 485s 'debian': Tree({'changelog': b}), 485s }), 485s 485s # Symlink in debian/ 485s lambda b: Tree({ 485s 'debian': Tree({ 485s 'changelog.real': b, 485s 'changelog': Symlink('changelog.real'), 485s }), 485s }), 485s 485s # Symlink to parent directory 485s lambda b: Tree({ 485s 'changelog': b, 485s 'debian': Tree({ 485s 'changelog': Symlink('../changelog'), 485s }) 485s }), 485s 485s # Symlink to subdirectory 485s lambda b: Tree({ 485s 'debian': Tree({ 485s 'changelog': Symlink('subdirectory/changelog'), 485s 'subdirectory': Tree({'changelog': b}), 485s }) 485s }), 485s 485s # debian/ itself is a symlink to a different directory 485s lambda b: Tree({ 485s 'pkg': Tree({'changelog': b}), 485s 'debian': Symlink('pkg'), 485s }) 485s ]) 485s def test_follow_symlinks_to_blob(pygit2_repo, tree_func): 485s blob = Blob(b'') 485s blob_id = blob.write(pygit2_repo) 485s tree = pygit2_repo.get(tree_func(blob).write(pygit2_repo)) 485s > result_blob = target.follow_symlinks_to_blob( 485s pygit2_repo, 485s tree, 485s 'debian/changelog', 485s ) 485s 485s gitubuntu/git_repository_test.py:342: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 485s return _follow_symlinks_to_blob( 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s repo = pygit2.Repository('/tmp/tmpohad_58s/.git/') 485s top_tree_object = 485s search_path = 'debian/changelog' 485s _rel_tree = 485s _rel_path = '' 485s 485s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 485s _rel_tree=None, _rel_path='' 485s ): 485s '''Recursively follow a path down a tree, following symlinks, to find blob 485s 485s repo: pygit2.Repository object 485s top_tree: pygit2.Tree object of the top of the tree structure 485s search_path: '/'-separated path string of blob to find 485s _rel_tree: (internal) which tree to look further into 485s _rel_path: (internal) the path we are in so far 485s ''' 485s 485s NORMAL_BLOB_MODES = set([ 485s pygit2.GIT_FILEMODE_BLOB, 485s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 485s ]) 485s 485s _rel_tree = _rel_tree or top_tree_object 485s head, tail = posixpath.split(search_path) 485s 485s # A traditional functional split would put a single entry in head with tail 485s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 485s # to make it appear to have traditional semantics. 485s if not head: 485s head = tail 485s tail = None 485s 485s entry = _rel_tree[head] 485s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 485s 485s gitubuntu/git_repository.py:68: AttributeError 485s ___________________ test_follow_symlinks_to_blob[4] ____________________ 485s 485s pygit2_repo = pygit2.Repository('/tmp/tmpgujulmjr/.git/') 485s tree_func = at 0xe859fca8> 485s 485s @pytest.mark.parametrize('tree_func', [ 485s # The tree_func parameter is a function that accepts a mock Blob that is to 485s # represent the changelog blob itself and returns a mock Tree with the mock 485s # Blob embedded somewhere within it. The test function can then ensure that 485s # follow_symlinks_to_blob can correctly find the changelog Blob given the 485s # Tree. 485s 485s # Of course this is only expected to work if, after checking out the Tree, 485s # "cat debian/changelog" would work. But this allows us to test the various 485s # permutations of symlink following in Trees that _are_ valid. 485s 485s # Simple case 485s lambda b: Tree({ 485s 'debian': Tree({'changelog': b}), 485s }), 485s 485s # Symlink in debian/ 485s lambda b: Tree({ 485s 'debian': Tree({ 485s 'changelog.real': b, 485s 'changelog': Symlink('changelog.real'), 485s }), 485s }), 485s 485s # Symlink to parent directory 485s lambda b: Tree({ 485s 'changelog': b, 485s 'debian': Tree({ 485s 'changelog': Symlink('../changelog'), 485s }) 485s }), 485s 485s # Symlink to subdirectory 485s lambda b: Tree({ 485s 'debian': Tree({ 485s 'changelog': Symlink('subdirectory/changelog'), 485s 'subdirectory': Tree({'changelog': b}), 485s }) 485s }), 485s 485s # debian/ itself is a symlink to a different directory 485s lambda b: Tree({ 485s 'pkg': Tree({'changelog': b}), 485s 'debian': Symlink('pkg'), 485s }) 485s ]) 485s def test_follow_symlinks_to_blob(pygit2_repo, tree_func): 485s blob = Blob(b'') 485s blob_id = blob.write(pygit2_repo) 485s tree = pygit2_repo.get(tree_func(blob).write(pygit2_repo)) 485s > result_blob = target.follow_symlinks_to_blob( 485s pygit2_repo, 485s tree, 485s 'debian/changelog', 485s ) 485s 485s gitubuntu/git_repository_test.py:342: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 485s return _follow_symlinks_to_blob( 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s repo = pygit2.Repository('/tmp/tmpgujulmjr/.git/') 485s top_tree_object = 485s search_path = 'debian/changelog' 485s _rel_tree = 485s _rel_path = '' 485s 485s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 485s _rel_tree=None, _rel_path='' 485s ): 485s '''Recursively follow a path down a tree, following symlinks, to find blob 485s 485s repo: pygit2.Repository object 485s top_tree: pygit2.Tree object of the top of the tree structure 485s search_path: '/'-separated path string of blob to find 485s _rel_tree: (internal) which tree to look further into 485s _rel_path: (internal) the path we are in so far 485s ''' 485s 485s NORMAL_BLOB_MODES = set([ 485s pygit2.GIT_FILEMODE_BLOB, 485s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 485s ]) 485s 485s _rel_tree = _rel_tree or top_tree_object 485s head, tail = posixpath.split(search_path) 485s 485s # A traditional functional split would put a single entry in head with tail 485s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 485s # to make it appear to have traditional semantics. 485s if not head: 485s head = tail 485s tail = None 485s 485s entry = _rel_tree[head] 485s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 485s 485s gitubuntu/git_repository.py:68: AttributeError 485s ________________ test_follow_symlinks_to_blob_not_found[tree1] _________________ 485s 485s pygit2_repo = pygit2.Repository('/tmp/tmp3tkzy25g/.git/') 485s tree = 485s 485s @pytest.mark.parametrize('tree', [ 485s Tree({}), 485s Tree({'debian': Tree({})}), 485s Tree({'debian': Tree({'changelog': Symlink('other')})}), 485s Tree({'debian': Tree({'changelog': Symlink('../other')})}), 485s ]) 485s def test_follow_symlinks_to_blob_not_found(pygit2_repo, tree): 485s pygit2_tree = pygit2_repo.get(tree.write(pygit2_repo)) 485s with pytest.raises(KeyError): 485s > target.follow_symlinks_to_blob( 485s pygit2_repo, 485s pygit2_tree, 485s 'debian/changelog', 485s ) 485s 485s gitubuntu/git_repository_test.py:359: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 485s return _follow_symlinks_to_blob( 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s repo = pygit2.Repository('/tmp/tmp3tkzy25g/.git/') 485s top_tree_object = 485s search_path = 'debian/changelog' 485s _rel_tree = 485s _rel_path = '' 485s 485s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 485s _rel_tree=None, _rel_path='' 485s ): 485s '''Recursively follow a path down a tree, following symlinks, to find blob 485s 485s repo: pygit2.Repository object 485s top_tree: pygit2.Tree object of the top of the tree structure 485s search_path: '/'-separated path string of blob to find 485s _rel_tree: (internal) which tree to look further into 485s _rel_path: (internal) the path we are in so far 485s ''' 485s 485s NORMAL_BLOB_MODES = set([ 485s pygit2.GIT_FILEMODE_BLOB, 485s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 485s ]) 485s 485s _rel_tree = _rel_tree or top_tree_object 485s head, tail = posixpath.split(search_path) 485s 485s # A traditional functional split would put a single entry in head with tail 485s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 485s # to make it appear to have traditional semantics. 485s if not head: 485s head = tail 485s tail = None 485s 485s entry = _rel_tree[head] 485s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 485s 485s gitubuntu/git_repository.py:68: AttributeError 485s ________________ test_follow_symlinks_to_blob_not_found[tree2] _________________ 485s 485s pygit2_repo = pygit2.Repository('/tmp/tmps8ai_s4g/.git/') 485s tree = 485s 485s @pytest.mark.parametrize('tree', [ 485s Tree({}), 485s Tree({'debian': Tree({})}), 485s Tree({'debian': Tree({'changelog': Symlink('other')})}), 485s Tree({'debian': Tree({'changelog': Symlink('../other')})}), 485s ]) 485s def test_follow_symlinks_to_blob_not_found(pygit2_repo, tree): 485s pygit2_tree = pygit2_repo.get(tree.write(pygit2_repo)) 485s with pytest.raises(KeyError): 485s > target.follow_symlinks_to_blob( 485s pygit2_repo, 485s pygit2_tree, 485s 'debian/changelog', 485s ) 485s 485s gitubuntu/git_repository_test.py:359: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 485s return _follow_symlinks_to_blob( 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s repo = pygit2.Repository('/tmp/tmps8ai_s4g/.git/') 485s top_tree_object = 485s search_path = 'debian/changelog' 485s _rel_tree = 485s _rel_path = '' 485s 485s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 485s _rel_tree=None, _rel_path='' 485s ): 485s '''Recursively follow a path down a tree, following symlinks, to find blob 485s 485s repo: pygit2.Repository object 485s top_tree: pygit2.Tree object of the top of the tree structure 485s search_path: '/'-separated path string of blob to find 485s _rel_tree: (internal) which tree to look further into 485s _rel_path: (internal) the path we are in so far 485s ''' 485s 485s NORMAL_BLOB_MODES = set([ 485s pygit2.GIT_FILEMODE_BLOB, 485s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 485s ]) 485s 485s _rel_tree = _rel_tree or top_tree_object 485s head, tail = posixpath.split(search_path) 485s 485s # A traditional functional split would put a single entry in head with tail 485s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 485s # to make it appear to have traditional semantics. 485s if not head: 485s head = tail 485s tail = None 485s 485s entry = _rel_tree[head] 485s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 485s 485s gitubuntu/git_repository.py:68: AttributeError 485s ________________ test_follow_symlinks_to_blob_not_found[tree3] _________________ 485s 485s pygit2_repo = pygit2.Repository('/tmp/tmpe1yy2866/.git/') 485s tree = 485s 485s @pytest.mark.parametrize('tree', [ 485s Tree({}), 485s Tree({'debian': Tree({})}), 485s Tree({'debian': Tree({'changelog': Symlink('other')})}), 485s Tree({'debian': Tree({'changelog': Symlink('../other')})}), 485s ]) 485s def test_follow_symlinks_to_blob_not_found(pygit2_repo, tree): 485s pygit2_tree = pygit2_repo.get(tree.write(pygit2_repo)) 485s with pytest.raises(KeyError): 485s > target.follow_symlinks_to_blob( 485s pygit2_repo, 485s pygit2_tree, 485s 'debian/changelog', 485s ) 485s 485s gitubuntu/git_repository_test.py:359: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 485s return _follow_symlinks_to_blob( 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s repo = pygit2.Repository('/tmp/tmpe1yy2866/.git/') 485s top_tree_object = 485s search_path = 'debian/changelog' 485s _rel_tree = 485s _rel_path = '' 485s 485s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 485s _rel_tree=None, _rel_path='' 485s ): 485s '''Recursively follow a path down a tree, following symlinks, to find blob 485s 485s repo: pygit2.Repository object 485s top_tree: pygit2.Tree object of the top of the tree structure 485s search_path: '/'-separated path string of blob to find 485s _rel_tree: (internal) which tree to look further into 485s _rel_path: (internal) the path we are in so far 485s ''' 485s 485s NORMAL_BLOB_MODES = set([ 485s pygit2.GIT_FILEMODE_BLOB, 485s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 485s ]) 485s 485s _rel_tree = _rel_tree or top_tree_object 485s head, tail = posixpath.split(search_path) 485s 485s # A traditional functional split would put a single entry in head with tail 485s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 485s # to make it appear to have traditional semantics. 485s if not head: 485s head = tail 485s tail = None 485s 485s entry = _rel_tree[head] 485s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 485s 485s gitubuntu/git_repository.py:68: AttributeError 485s _________________________ test_git_escape_dir_to_tree __________________________ 485s 485s pygit2_repo = pygit2.Repository('/tmp/tmp683n1poa/.git/') 485s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_git_escape_dir_to_tree0') 485s 485s def test_git_escape_dir_to_tree(pygit2_repo, tmpdir): 485s tmpdir.mkdir('.git') 485s > tree_hash = target.GitUbuntuRepository.dir_to_tree( 485s pygit2_repo, 485s str(tmpdir), 485s escape=True, 485s ) 485s 485s gitubuntu/git_repository_test.py:668: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s gitubuntu/git_repository.py:2463: in dir_to_tree 485s replacement_oid = cls._add_missing_tree_dirs( 485s gitubuntu/git_repository.py:2397: in _add_missing_tree_dirs 485s tree_builder = cls._create_replacement_tree_builder( 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s cls = 485s repo = pygit2.Repository('/tmp/tmp683n1poa/.git/') 485s treeish = 485s sub_path = '' 485s 485s @classmethod 485s def _create_replacement_tree_builder(cls, repo, treeish, sub_path): 485s '''Create a replacement TreeBuilder 485s 485s Create a TreeBuilder based on an existing repository, top-level 485s tree-ish and path inside that tree. 485s 485s A sub_path of '' is taken to mean a request for a replacement 485s TreeBuilder for the top level tree. 485s 485s Returns a TreeBuilder object pre-populated with the previous contents. 485s If the path did not previously exist in the tree-ish, then return an 485s empty TreeBuilder instead. 485s ''' 485s 485s > tree = treeish.peel(pygit2.GIT_OBJ_TREE) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 485s 485s gitubuntu/git_repository.py:2331: AttributeError 485s ______ test_determine_quilt_series_path[tree_data1-debian/patches/series] ______ 485s 485s pygit2_repo = pygit2.Repository('/tmp/tmp8zg5_iwb/.git/') 485s tree_data = 485s expected_path = 'debian/patches/series' 485s 485s @pytest.mark.parametrize('tree_data,expected_path', [ 485s # Empty tree -> default 485s (Tree({}), 'debian/patches/series'), 485s 485s # Empty debian/patches directory -> default 485s (Tree({'debian': Tree({'patches': Tree({})})}), 'debian/patches/series'), 485s 485s # Only debian/patches/series -> that one 485s ( 485s Tree({'debian': Tree({'patches': Tree({'series': Blob(b'')})})}), 485s 'debian/patches/series', 485s ), 485s 485s # Only debian/patches/debian.series -> that one 485s ( 485s Tree({'debian': Tree({'patches': Tree({ 485s 'debian.series': Blob(b'') 485s })})}), 485s 'debian/patches/debian.series', 485s ), 485s 485s # Both -> debian.series 485s ( 485s Tree({'debian': Tree({'patches': Tree({ 485s 'debian.series': Blob(b''), 485s 'series': Blob(b''), 485s })})}), 485s 'debian/patches/debian.series', 485s ), 485s ]) 485s def test_determine_quilt_series_path(pygit2_repo, tree_data, expected_path): 485s tree_obj = pygit2_repo.get(tree_data.write(pygit2_repo)) 485s > path = target.determine_quilt_series_path(pygit2_repo, tree_obj) 485s 485s gitubuntu/git_repository_test.py:708: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s gitubuntu/git_repository.py:991: in determine_quilt_series_path 485s blob = follow_symlinks_to_blob( 485s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 485s return _follow_symlinks_to_blob( 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s repo = pygit2.Repository('/tmp/tmp8zg5_iwb/.git/') 485s top_tree_object = 485s search_path = 'debian/patches/debian.series' 485s _rel_tree = 485s _rel_path = '' 485s 485s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 485s _rel_tree=None, _rel_path='' 485s ): 485s '''Recursively follow a path down a tree, following symlinks, to find blob 485s 485s repo: pygit2.Repository object 485s top_tree: pygit2.Tree object of the top of the tree structure 485s search_path: '/'-separated path string of blob to find 485s _rel_tree: (internal) which tree to look further into 485s _rel_path: (internal) the path we are in so far 485s ''' 485s 485s NORMAL_BLOB_MODES = set([ 485s pygit2.GIT_FILEMODE_BLOB, 485s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 485s ]) 485s 485s _rel_tree = _rel_tree or top_tree_object 485s head, tail = posixpath.split(search_path) 485s 485s # A traditional functional split would put a single entry in head with tail 485s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 485s # to make it appear to have traditional semantics. 485s if not head: 485s head = tail 485s tail = None 485s 485s entry = _rel_tree[head] 485s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 485s 485s gitubuntu/git_repository.py:68: AttributeError 485s ______ test_determine_quilt_series_path[tree_data2-debian/patches/series] ______ 485s 485s pygit2_repo = pygit2.Repository('/tmp/tmp9egh56_0/.git/') 485s tree_data = 485s expected_path = 'debian/patches/series' 485s 485s @pytest.mark.parametrize('tree_data,expected_path', [ 485s # Empty tree -> default 485s (Tree({}), 'debian/patches/series'), 485s 485s # Empty debian/patches directory -> default 485s (Tree({'debian': Tree({'patches': Tree({})})}), 'debian/patches/series'), 485s 485s # Only debian/patches/series -> that one 485s ( 485s Tree({'debian': Tree({'patches': Tree({'series': Blob(b'')})})}), 485s 'debian/patches/series', 485s ), 485s 485s # Only debian/patches/debian.series -> that one 485s ( 485s Tree({'debian': Tree({'patches': Tree({ 485s 'debian.series': Blob(b'') 485s })})}), 485s 'debian/patches/debian.series', 485s ), 485s 485s # Both -> debian.series 485s ( 485s Tree({'debian': Tree({'patches': Tree({ 485s 'debian.series': Blob(b''), 485s 'series': Blob(b''), 485s })})}), 485s 'debian/patches/debian.series', 485s ), 485s ]) 485s def test_determine_quilt_series_path(pygit2_repo, tree_data, expected_path): 485s tree_obj = pygit2_repo.get(tree_data.write(pygit2_repo)) 485s > path = target.determine_quilt_series_path(pygit2_repo, tree_obj) 485s 485s gitubuntu/git_repository_test.py:708: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s gitubuntu/git_repository.py:991: in determine_quilt_series_path 485s blob = follow_symlinks_to_blob( 485s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 485s return _follow_symlinks_to_blob( 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s repo = pygit2.Repository('/tmp/tmp9egh56_0/.git/') 485s top_tree_object = 485s search_path = 'debian/patches/debian.series' 485s _rel_tree = 485s _rel_path = '' 485s 485s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 485s _rel_tree=None, _rel_path='' 485s ): 485s '''Recursively follow a path down a tree, following symlinks, to find blob 485s 485s repo: pygit2.Repository object 485s top_tree: pygit2.Tree object of the top of the tree structure 485s search_path: '/'-separated path string of blob to find 485s _rel_tree: (internal) which tree to look further into 485s _rel_path: (internal) the path we are in so far 485s ''' 485s 485s NORMAL_BLOB_MODES = set([ 485s pygit2.GIT_FILEMODE_BLOB, 485s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 485s ]) 485s 485s _rel_tree = _rel_tree or top_tree_object 485s head, tail = posixpath.split(search_path) 485s 485s # A traditional functional split would put a single entry in head with tail 485s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 485s # to make it appear to have traditional semantics. 485s if not head: 485s head = tail 485s tail = None 485s 485s entry = _rel_tree[head] 485s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 485s 485s gitubuntu/git_repository.py:68: AttributeError 485s __ test_determine_quilt_series_path[tree_data3-debian/patches/debian.series] ___ 485s 485s pygit2_repo = pygit2.Repository('/tmp/tmp2y0ruvrn/.git/') 485s tree_data = 485s expected_path = 'debian/patches/debian.series' 485s 485s @pytest.mark.parametrize('tree_data,expected_path', [ 485s # Empty tree -> default 485s (Tree({}), 'debian/patches/series'), 485s 485s # Empty debian/patches directory -> default 485s (Tree({'debian': Tree({'patches': Tree({})})}), 'debian/patches/series'), 485s 485s # Only debian/patches/series -> that one 485s ( 485s Tree({'debian': Tree({'patches': Tree({'series': Blob(b'')})})}), 485s 'debian/patches/series', 485s ), 485s 485s # Only debian/patches/debian.series -> that one 485s ( 485s Tree({'debian': Tree({'patches': Tree({ 485s 'debian.series': Blob(b'') 485s })})}), 485s 'debian/patches/debian.series', 485s ), 485s 485s # Both -> debian.series 485s ( 485s Tree({'debian': Tree({'patches': Tree({ 485s 'debian.series': Blob(b''), 485s 'series': Blob(b''), 485s })})}), 485s 'debian/patches/debian.series', 485s ), 485s ]) 485s def test_determine_quilt_series_path(pygit2_repo, tree_data, expected_path): 485s tree_obj = pygit2_repo.get(tree_data.write(pygit2_repo)) 485s > path = target.determine_quilt_series_path(pygit2_repo, tree_obj) 485s 485s gitubuntu/git_repository_test.py:708: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s gitubuntu/git_repository.py:991: in determine_quilt_series_path 485s blob = follow_symlinks_to_blob( 485s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 485s return _follow_symlinks_to_blob( 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s repo = pygit2.Repository('/tmp/tmp2y0ruvrn/.git/') 485s top_tree_object = 485s search_path = 'debian/patches/debian.series' 485s _rel_tree = 485s _rel_path = '' 485s 485s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 485s _rel_tree=None, _rel_path='' 485s ): 485s '''Recursively follow a path down a tree, following symlinks, to find blob 485s 485s repo: pygit2.Repository object 485s top_tree: pygit2.Tree object of the top of the tree structure 485s search_path: '/'-separated path string of blob to find 485s _rel_tree: (internal) which tree to look further into 485s _rel_path: (internal) the path we are in so far 485s ''' 485s 485s NORMAL_BLOB_MODES = set([ 485s pygit2.GIT_FILEMODE_BLOB, 485s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 485s ]) 485s 485s _rel_tree = _rel_tree or top_tree_object 485s head, tail = posixpath.split(search_path) 485s 485s # A traditional functional split would put a single entry in head with tail 485s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 485s # to make it appear to have traditional semantics. 485s if not head: 485s head = tail 485s tail = None 485s 485s entry = _rel_tree[head] 485s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 485s 485s gitubuntu/git_repository.py:68: AttributeError 485s __ test_determine_quilt_series_path[tree_data4-debian/patches/debian.series] ___ 485s 485s pygit2_repo = pygit2.Repository('/tmp/tmpu247wd3e/.git/') 485s tree_data = 485s expected_path = 'debian/patches/debian.series' 485s 485s @pytest.mark.parametrize('tree_data,expected_path', [ 485s # Empty tree -> default 485s (Tree({}), 'debian/patches/series'), 485s 485s # Empty debian/patches directory -> default 485s (Tree({'debian': Tree({'patches': Tree({})})}), 'debian/patches/series'), 485s 485s # Only debian/patches/series -> that one 485s ( 485s Tree({'debian': Tree({'patches': Tree({'series': Blob(b'')})})}), 485s 'debian/patches/series', 485s ), 485s 485s # Only debian/patches/debian.series -> that one 485s ( 485s Tree({'debian': Tree({'patches': Tree({ 485s 'debian.series': Blob(b'') 485s })})}), 485s 'debian/patches/debian.series', 485s ), 485s 485s # Both -> debian.series 485s ( 485s Tree({'debian': Tree({'patches': Tree({ 485s 'debian.series': Blob(b''), 485s 'series': Blob(b''), 485s })})}), 485s 'debian/patches/debian.series', 485s ), 485s ]) 485s def test_determine_quilt_series_path(pygit2_repo, tree_data, expected_path): 485s tree_obj = pygit2_repo.get(tree_data.write(pygit2_repo)) 485s > path = target.determine_quilt_series_path(pygit2_repo, tree_obj) 485s 485s gitubuntu/git_repository_test.py:708: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s gitubuntu/git_repository.py:991: in determine_quilt_series_path 485s blob = follow_symlinks_to_blob( 485s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 485s return _follow_symlinks_to_blob( 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s repo = pygit2.Repository('/tmp/tmpu247wd3e/.git/') 485s top_tree_object = 485s search_path = 'debian/patches/debian.series' 485s _rel_tree = 485s _rel_path = '' 485s 485s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 485s _rel_tree=None, _rel_path='' 485s ): 485s '''Recursively follow a path down a tree, following symlinks, to find blob 485s 485s repo: pygit2.Repository object 485s top_tree: pygit2.Tree object of the top of the tree structure 485s search_path: '/'-separated path string of blob to find 485s _rel_tree: (internal) which tree to look further into 485s _rel_path: (internal) the path we are in so far 485s ''' 485s 485s NORMAL_BLOB_MODES = set([ 485s pygit2.GIT_FILEMODE_BLOB, 485s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 485s ]) 485s 485s _rel_tree = _rel_tree or top_tree_object 485s head, tail = posixpath.split(search_path) 485s 485s # A traditional functional split would put a single entry in head with tail 485s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 485s # to make it appear to have traditional semantics. 485s if not head: 485s head = tail 485s tail = None 485s 485s entry = _rel_tree[head] 485s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 485s 485s gitubuntu/git_repository.py:68: AttributeError 485s ________________________________ test_quilt_env ________________________________ 485s 485s pygit2_repo = pygit2.Repository('/tmp/tmpvr1se_ej/.git/') 485s 485s def test_quilt_env(pygit2_repo): 485s tree_builder = Tree({'debian': 485s Tree({'patches': Tree({'debian.series': Blob(b'')})}) 485s }) 485s tree_obj = pygit2_repo.get(tree_builder.write(pygit2_repo)) 485s > env = target.quilt_env(pygit2_repo, tree_obj) 485s 485s gitubuntu/git_repository_test.py:717: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s gitubuntu/git_repository.py:1022: in quilt_env 485s 'QUILT_SERIES': determine_quilt_series_path(pygit2_repo, treeish), 485s gitubuntu/git_repository.py:991: in determine_quilt_series_path 485s blob = follow_symlinks_to_blob( 485s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 485s return _follow_symlinks_to_blob( 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s repo = pygit2.Repository('/tmp/tmpvr1se_ej/.git/') 485s top_tree_object = 485s search_path = 'debian/patches/debian.series' 485s _rel_tree = 485s _rel_path = '' 485s 485s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 485s _rel_tree=None, _rel_path='' 485s ): 485s '''Recursively follow a path down a tree, following symlinks, to find blob 485s 485s repo: pygit2.Repository object 485s top_tree: pygit2.Tree object of the top of the tree structure 485s search_path: '/'-separated path string of blob to find 485s _rel_tree: (internal) which tree to look further into 485s _rel_path: (internal) the path we are in so far 485s ''' 485s 485s NORMAL_BLOB_MODES = set([ 485s pygit2.GIT_FILEMODE_BLOB, 485s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 485s ]) 485s 485s _rel_tree = _rel_tree or top_tree_object 485s head, tail = posixpath.split(search_path) 485s 485s # A traditional functional split would put a single entry in head with tail 485s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 485s # to make it appear to have traditional semantics. 485s if not head: 485s head = tail 485s tail = None 485s 485s entry = _rel_tree[head] 485s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 485s 485s gitubuntu/git_repository.py:68: AttributeError 485s _____________________________ test_repo_quilt_env ______________________________ 485s 485s repo = 485s 485s def test_repo_quilt_env(repo): 485s tree_builder = Tree({'debian': 485s Tree({'patches': Tree({'debian.series': Blob(b'')})}) 485s }) 485s tree_obj = repo.raw_repo.get(tree_builder.write(repo.raw_repo)) 485s > env = repo.quilt_env(tree_obj) 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository_test.py:732: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:2575: in quilt_env 485s env.update(quilt_env(self.raw_repo, treeish)) 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:1022: in quilt_env 485s 'QUILT_SERIES': determine_quilt_series_path(pygit2_repo, treeish), 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:991: in determine_quilt_series_path 485s blob = follow_symlinks_to_blob( 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 485s return _follow_symlinks_to_blob( 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s repo = pygit2.Repository('/tmp/tmpq3fgbc2l/.git/') 485s top_tree_object = 485s search_path = 'debian/patches/debian.series' 485s _rel_tree = 485s _rel_path = '' 485s 485s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 485s _rel_tree=None, _rel_path='' 485s ): 485s '''Recursively follow a path down a tree, following symlinks, to find blob 485s 485s repo: pygit2.Repository object 485s top_tree: pygit2.Tree object of the top of the tree structure 485s search_path: '/'-separated path string of blob to find 485s _rel_tree: (internal) which tree to look further into 485s _rel_path: (internal) the path we are in so far 485s ''' 485s 485s NORMAL_BLOB_MODES = set([ 485s pygit2.GIT_FILEMODE_BLOB, 485s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 485s ]) 485s 485s _rel_tree = _rel_tree or top_tree_object 485s head, tail = posixpath.split(search_path) 485s 485s # A traditional functional split would put a single entry in head with tail 485s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 485s # to make it appear to have traditional semantics. 485s if not head: 485s head = tail 485s tail = None 485s 485s entry = _rel_tree[head] 485s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:68: AttributeError 485s _____________________ test_repo_quilt_env_from_treeish_str _____________________ 485s 485s repo = 485s 485s def test_repo_quilt_env_from_treeish_str(repo): 485s tree_builder = Tree({'debian': 485s Tree({'patches': Tree({'debian.series': Blob(b'')})}) 485s }) 485s tree_obj = repo.raw_repo.get(tree_builder.write(repo.raw_repo)) 485s > env = repo.quilt_env_from_treeish_str(str(tree_obj.id)) 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository_test.py:757: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:2589: in quilt_env_from_treeish_str 485s return self.quilt_env(self.raw_repo.get(treeish_str)) 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:2575: in quilt_env 485s env.update(quilt_env(self.raw_repo, treeish)) 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:1022: in quilt_env 485s 'QUILT_SERIES': determine_quilt_series_path(pygit2_repo, treeish), 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:991: in determine_quilt_series_path 485s blob = follow_symlinks_to_blob( 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 485s return _follow_symlinks_to_blob( 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s repo = pygit2.Repository('/tmp/tmpt0s_cesp/.git/') 485s top_tree_object = 485s search_path = 'debian/patches/debian.series' 485s _rel_tree = 485s _rel_path = '' 485s 485s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 485s _rel_tree=None, _rel_path='' 485s ): 485s '''Recursively follow a path down a tree, following symlinks, to find blob 485s 485s repo: pygit2.Repository object 485s top_tree: pygit2.Tree object of the top of the tree structure 485s search_path: '/'-separated path string of blob to find 485s _rel_tree: (internal) which tree to look further into 485s _rel_path: (internal) the path we are in so far 485s ''' 485s 485s NORMAL_BLOB_MODES = set([ 485s pygit2.GIT_FILEMODE_BLOB, 485s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 485s ]) 485s 485s _rel_tree = _rel_tree or top_tree_object 485s head, tail = posixpath.split(search_path) 485s 485s # A traditional functional split would put a single entry in head with tail 485s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 485s # to make it appear to have traditional semantics. 485s if not head: 485s head = tail 485s tail = None 485s 485s entry = _rel_tree[head] 485s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:68: AttributeError 485s _ test_repo_find_ubuntu_merge[Common case-input_data0-pkg/import/1-1ubuntu1-pkg/import/2-1-pkg/import/1-1] _ 485s 485s description = 'Common case' 485s repo = 485s input_data = 485s old_ubuntu = 'pkg/import/1-1ubuntu1', new_debian = 'pkg/import/2-1' 485s expected = 'pkg/import/1-1' 485s 485s @pytest.mark.parametrize( 485s 'description, input_data, old_ubuntu, new_debian, expected', 485s [ 485s ( 485s 'Common case', 485s Repo( 485s commits=[ 485s Commit.from_spec( 485s name='old/debian' 485s ), 485s Commit.from_spec( 485s parents=[Placeholder('old/debian')], 485s name='old/ubuntu', 485s changelog_versions=['1-1ubuntu1', '1-1'], 485s ), 485s Commit.from_spec( 485s parents=[Placeholder('old/debian')], 485s name='new/debian', 485s changelog_versions=['2-1', '1-1'], 485s ), 485s ], 485s tags={ 485s 'pkg/import/1-1': Placeholder('old/debian'), 485s 'pkg/import/1-1ubuntu1': Placeholder('old/ubuntu'), 485s 'pkg/import/2-1': Placeholder('new/debian'), 485s }, 485s ), 485s 'pkg/import/1-1ubuntu1', 485s 'pkg/import/2-1', 485s 'pkg/import/1-1', 485s ), 485s ( 485s 'Ubuntu delta based on a NMU', 485s Repo( 485s commits=[ 485s Commit.from_spec( 485s name='fork_point' 485s ), 485s Commit.from_spec( 485s parents=[Placeholder('fork_point')], 485s name='old/debian', 485s changelog_versions=['1-1.1', '1-1'], 485s ), 485s Commit.from_spec( 485s parents=[Placeholder('old/debian')], 485s name='old/ubuntu', 485s changelog_versions=['1-1.1ubuntu1', '1-1.1', '1-1'], 485s ), 485s Commit.from_spec( 485s parents=[Placeholder('fork_point')], 485s name='new/debian', 485s changelog_versions=['2-1', '1-1'], 485s ), 485s ], 485s tags={ 485s 'pkg/import/1-1': Placeholder('fork_point'), 485s 'pkg/import/1-1.1': Placeholder('old/debian'), 485s 'pkg/import/1-1.1ubuntu1': Placeholder('old/ubuntu'), 485s 'pkg/import/2-1': Placeholder('new/debian'), 485s }, 485s ), 485s 'pkg/import/1-1.1ubuntu1', 485s 'pkg/import/2-1', 485s 'pkg/import/1-1.1', 485s ), 485s ( 485s 'Ubuntu upstream version head of Debian', 485s Repo( 485s commits=[ 485s Commit.from_spec( 485s name='old/debian' 485s ), 485s Commit.from_spec( 485s parents=[Placeholder('old/debian')], 485s name='mid_ubuntu', 485s changelog_versions=['1-1ubuntu1', '1-1'], 485s ), 485s Commit.from_spec( 485s parents=[Placeholder('mid_ubuntu')], 485s name='old/ubuntu', 485s changelog_versions=['2-0ubuntu1', '1-1ubuntu1', '1-1'], 485s ), 485s Commit.from_spec( 485s parents=[Placeholder('old/debian')], 485s name='new/debian', 485s changelog_versions=['3-1', '1-1'], 485s ), 485s ], 485s tags={ 485s 'pkg/import/1-1': Placeholder('old/debian'), 485s 'pkg/import/1-1ubuntu1': Placeholder('mid_ubuntu'), 485s 'pkg/import/2-0ubuntu1': Placeholder('old/ubuntu'), 485s 'pkg/import/3-1': Placeholder('new/debian'), 485s }, 485s ), 485s 'pkg/import/2-0ubuntu1', 485s 'pkg/import/3-1', 485s 'pkg/import/1-1', 485s ), 485s ], 485s ) 485s def test_repo_find_ubuntu_merge( 485s description, 485s repo, 485s input_data, 485s old_ubuntu, 485s new_debian, 485s expected, 485s ): 485s > input_data.write(repo.raw_repo) 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository_test.py:889: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmpqd870b0g/.git/'), record = {} 485s 485s def write(self, repo, record=None): 485s replace_placeholders(self) 485s record = record or dict() 485s written_commits = [ 485s commit.write(repo=repo, record=record) 485s for commit 485s in self.commit_list 485s ] 485s for name, target in self.branches.items(): 485s repo.create_branch( 485s name, 485s repo.get(target.write(repo)).peel(pygit2.Commit), 485s ) 485s for name, target in self.tags.items(): 485s repo.create_tag( 485s name, 485s target.write(repo), 485s > pygit2.GIT_OBJ_COMMIT, 485s self.tagger.signature, 485s 'Tag message', 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 485s ----------------------------- Captured stdout call ----------------------------- 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1ubuntu1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1ubuntu1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_2.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_2-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_2-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s ----------------------------- Captured stderr call ----------------------------- 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: Version number suggests Ubuntu changes, but there is no XSBC-Original-Maintainer field 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s _ 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] _ 485s 485s description = 'Ubuntu delta based on a NMU' 485s repo = 485s input_data = 485s old_ubuntu = 'pkg/import/1-1.1ubuntu1', new_debian = 'pkg/import/2-1' 485s expected = 'pkg/import/1-1.1' 485s 485s @pytest.mark.parametrize( 485s 'description, input_data, old_ubuntu, new_debian, expected', 485s [ 485s ( 485s 'Common case', 485s Repo( 485s commits=[ 485s Commit.from_spec( 485s name='old/debian' 485s ), 485s Commit.from_spec( 485s parents=[Placeholder('old/debian')], 485s name='old/ubuntu', 485s changelog_versions=['1-1ubuntu1', '1-1'], 485s ), 485s Commit.from_spec( 485s parents=[Placeholder('old/debian')], 485s name='new/debian', 485s changelog_versions=['2-1', '1-1'], 485s ), 485s ], 485s tags={ 485s 'pkg/import/1-1': Placeholder('old/debian'), 485s 'pkg/import/1-1ubuntu1': Placeholder('old/ubuntu'), 485s 'pkg/import/2-1': Placeholder('new/debian'), 485s }, 485s ), 485s 'pkg/import/1-1ubuntu1', 485s 'pkg/import/2-1', 485s 'pkg/import/1-1', 485s ), 485s ( 485s 'Ubuntu delta based on a NMU', 485s Repo( 485s commits=[ 485s Commit.from_spec( 485s name='fork_point' 485s ), 485s Commit.from_spec( 485s parents=[Placeholder('fork_point')], 485s name='old/debian', 485s changelog_versions=['1-1.1', '1-1'], 485s ), 485s Commit.from_spec( 485s parents=[Placeholder('old/debian')], 485s name='old/ubuntu', 485s changelog_versions=['1-1.1ubuntu1', '1-1.1', '1-1'], 485s ), 485s Commit.from_spec( 485s parents=[Placeholder('fork_point')], 485s name='new/debian', 485s changelog_versions=['2-1', '1-1'], 485s ), 485s ], 485s tags={ 485s 'pkg/import/1-1': Placeholder('fork_point'), 485s 'pkg/import/1-1.1': Placeholder('old/debian'), 485s 'pkg/import/1-1.1ubuntu1': Placeholder('old/ubuntu'), 485s 'pkg/import/2-1': Placeholder('new/debian'), 485s }, 485s ), 485s 'pkg/import/1-1.1ubuntu1', 485s 'pkg/import/2-1', 485s 'pkg/import/1-1.1', 485s ), 485s ( 485s 'Ubuntu upstream version head of Debian', 485s Repo( 485s commits=[ 485s Commit.from_spec( 485s name='old/debian' 485s ), 485s Commit.from_spec( 485s parents=[Placeholder('old/debian')], 485s name='mid_ubuntu', 485s changelog_versions=['1-1ubuntu1', '1-1'], 485s ), 485s Commit.from_spec( 485s parents=[Placeholder('mid_ubuntu')], 485s name='old/ubuntu', 485s changelog_versions=['2-0ubuntu1', '1-1ubuntu1', '1-1'], 485s ), 485s Commit.from_spec( 485s parents=[Placeholder('old/debian')], 485s name='new/debian', 485s changelog_versions=['3-1', '1-1'], 485s ), 485s ], 485s tags={ 485s 'pkg/import/1-1': Placeholder('old/debian'), 485s 'pkg/import/1-1ubuntu1': Placeholder('mid_ubuntu'), 485s 'pkg/import/2-0ubuntu1': Placeholder('old/ubuntu'), 485s 'pkg/import/3-1': Placeholder('new/debian'), 485s }, 485s ), 485s 'pkg/import/2-0ubuntu1', 485s 'pkg/import/3-1', 485s 'pkg/import/1-1', 485s ), 485s ], 485s ) 485s def test_repo_find_ubuntu_merge( 485s description, 485s repo, 485s input_data, 485s old_ubuntu, 485s new_debian, 485s expected, 485s ): 485s > input_data.write(repo.raw_repo) 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository_test.py:889: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmp6o1ncxh0/.git/'), record = {} 485s 485s def write(self, repo, record=None): 485s replace_placeholders(self) 485s record = record or dict() 485s written_commits = [ 485s commit.write(repo=repo, record=record) 485s for commit 485s in self.commit_list 485s ] 485s for name, target in self.branches.items(): 485s repo.create_branch( 485s name, 485s repo.get(target.write(repo)).peel(pygit2.Commit), 485s ) 485s for name, target in self.tags.items(): 485s repo.create_tag( 485s name, 485s target.write(repo), 485s > pygit2.GIT_OBJ_COMMIT, 485s self.tagger.signature, 485s 'Tag message', 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 485s ----------------------------- Captured stdout call ----------------------------- 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.1ubuntu1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.1ubuntu1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_2.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_2-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_2-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s ----------------------------- Captured stderr call ----------------------------- 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: Version number suggests Ubuntu changes, but there is no XSBC-Original-Maintainer field 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s _ 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] _ 485s 485s description = 'Ubuntu upstream version head of Debian' 485s repo = 485s input_data = 485s old_ubuntu = 'pkg/import/2-0ubuntu1', new_debian = 'pkg/import/3-1' 485s expected = 'pkg/import/1-1' 485s 485s @pytest.mark.parametrize( 485s 'description, input_data, old_ubuntu, new_debian, expected', 485s [ 485s ( 485s 'Common case', 485s Repo( 485s commits=[ 485s Commit.from_spec( 485s name='old/debian' 485s ), 485s Commit.from_spec( 485s parents=[Placeholder('old/debian')], 485s name='old/ubuntu', 485s changelog_versions=['1-1ubuntu1', '1-1'], 485s ), 485s Commit.from_spec( 485s parents=[Placeholder('old/debian')], 485s name='new/debian', 485s changelog_versions=['2-1', '1-1'], 485s ), 485s ], 485s tags={ 485s 'pkg/import/1-1': Placeholder('old/debian'), 485s 'pkg/import/1-1ubuntu1': Placeholder('old/ubuntu'), 485s 'pkg/import/2-1': Placeholder('new/debian'), 485s }, 485s ), 485s 'pkg/import/1-1ubuntu1', 485s 'pkg/import/2-1', 485s 'pkg/import/1-1', 485s ), 485s ( 485s 'Ubuntu delta based on a NMU', 485s Repo( 485s commits=[ 485s Commit.from_spec( 485s name='fork_point' 485s ), 485s Commit.from_spec( 485s parents=[Placeholder('fork_point')], 485s name='old/debian', 485s changelog_versions=['1-1.1', '1-1'], 485s ), 485s Commit.from_spec( 485s parents=[Placeholder('old/debian')], 485s name='old/ubuntu', 485s changelog_versions=['1-1.1ubuntu1', '1-1.1', '1-1'], 485s ), 485s Commit.from_spec( 485s parents=[Placeholder('fork_point')], 485s name='new/debian', 485s changelog_versions=['2-1', '1-1'], 485s ), 485s ], 485s tags={ 485s 'pkg/import/1-1': Placeholder('fork_point'), 485s 'pkg/import/1-1.1': Placeholder('old/debian'), 485s 'pkg/import/1-1.1ubuntu1': Placeholder('old/ubuntu'), 485s 'pkg/import/2-1': Placeholder('new/debian'), 485s }, 485s ), 485s 'pkg/import/1-1.1ubuntu1', 485s 'pkg/import/2-1', 485s 'pkg/import/1-1.1', 485s ), 485s ( 485s 'Ubuntu upstream version head of Debian', 485s Repo( 485s commits=[ 485s Commit.from_spec( 485s name='old/debian' 485s ), 485s Commit.from_spec( 485s parents=[Placeholder('old/debian')], 485s name='mid_ubuntu', 485s changelog_versions=['1-1ubuntu1', '1-1'], 485s ), 485s Commit.from_spec( 485s parents=[Placeholder('mid_ubuntu')], 485s name='old/ubuntu', 485s changelog_versions=['2-0ubuntu1', '1-1ubuntu1', '1-1'], 485s ), 485s Commit.from_spec( 485s parents=[Placeholder('old/debian')], 485s name='new/debian', 485s changelog_versions=['3-1', '1-1'], 485s ), 485s ], 485s tags={ 485s 'pkg/import/1-1': Placeholder('old/debian'), 485s 'pkg/import/1-1ubuntu1': Placeholder('mid_ubuntu'), 485s 'pkg/import/2-0ubuntu1': Placeholder('old/ubuntu'), 485s 'pkg/import/3-1': Placeholder('new/debian'), 485s }, 485s ), 485s 'pkg/import/2-0ubuntu1', 485s 'pkg/import/3-1', 485s 'pkg/import/1-1', 485s ), 485s ], 485s ) 485s def test_repo_find_ubuntu_merge( 485s description, 485s repo, 485s input_data, 485s old_ubuntu, 485s new_debian, 485s expected, 485s ): 485s > input_data.write(repo.raw_repo) 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository_test.py:889: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmph2pnpjqr/.git/'), record = {} 485s 485s def write(self, repo, record=None): 485s replace_placeholders(self) 485s record = record or dict() 485s written_commits = [ 485s commit.write(repo=repo, record=record) 485s for commit 485s in self.commit_list 485s ] 485s for name, target in self.branches.items(): 485s repo.create_branch( 485s name, 485s repo.get(target.write(repo)).peel(pygit2.Commit), 485s ) 485s for name, target in self.tags.items(): 485s repo.create_tag( 485s name, 485s target.write(repo), 485s > pygit2.GIT_OBJ_COMMIT, 485s self.tagger.signature, 485s 'Tag message', 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 485s ----------------------------- Captured stdout call ----------------------------- 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1ubuntu1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1ubuntu1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_2.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_2-0ubuntu1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_2-0ubuntu1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1ubuntu1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1ubuntu1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_3.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_3-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_3-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s ----------------------------- Captured stderr call ----------------------------- 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: Version number suggests Ubuntu changes, but there is no XSBC-Original-Maintainer field 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: Version number suggests Ubuntu changes, but there is no XSBC-Original-Maintainer field 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: Version number suggests Ubuntu changes, but there is no XSBC-Original-Maintainer field 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s _______________________________ test_commit_tree _______________________________ 485s 485s repo = 485s 485s def test_commit_tree(repo): 485s # Construct a repository with an initial commit on the master branch so 485s # that we can verify later parentage and lack of branch movement 485s parent_commit_oid = Repo( 485s commits=[Commit(name='master')], 485s branches={'master': Placeholder('master')} 485s ).write(repo.raw_repo) 485s repo.raw_repo.lookup_reference('HEAD').set_target('refs/heads/master') 485s 485s # Construct a tree inside the repository with a debian/changelog in it to 485s # feed to the method under test 485s test_changelog_path = os.path.join( 485s pkg_resources.resource_filename('gitubuntu', 'changelog_tests'), 485s 'test_date_1', 485s ) 485s with open(test_changelog_path, 'rb') as f: 485s test_changelog_bytes = f.read() 485s test_changelog_blob = Blob(test_changelog_bytes) 485s source_tree = Tree({'debian': Tree({'changelog': test_changelog_blob})}) 485s source_tree_oid = source_tree.write(repo.raw_repo) 485s 485s # Call the method under test 485s > commit_oid = repo.commit_source_tree( 485s tree=source_tree_oid, 485s parents=[parent_commit_oid], 485s log_message='test_commit_msg', 485s commit_date=datetime.datetime( 485s 1971, # year 485s 2, # month 485s 3, # day 485s 4, # hours 485s 5, # minutes 485s 6, # seconds 485s 7, # milliseconds (this should get truncated down to 0) 485s datetime.timezone(datetime.timedelta(hours=-8)) 485s ), 485s ) 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository_test.py:993: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:2299: in commit_source_tree 485s changelog = self.get_changelog_from_treeish(str(tree)) 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 485s return Changelog.from_treeish( 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:569: in from_treeish 485s blob = follow_symlinks_to_blob( 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 485s return _follow_symlinks_to_blob( 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s repo = pygit2.Repository('/tmp/tmptvyjt5l9/.git/') 485s top_tree_object = 485s search_path = 'debian/changelog' 485s _rel_tree = 485s _rel_path = '' 485s 485s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 485s _rel_tree=None, _rel_path='' 485s ): 485s '''Recursively follow a path down a tree, following symlinks, to find blob 485s 485s repo: pygit2.Repository object 485s top_tree: pygit2.Tree object of the top of the tree structure 485s search_path: '/'-separated path string of blob to find 485s _rel_tree: (internal) which tree to look further into 485s _rel_path: (internal) the path we are in so far 485s ''' 485s 485s NORMAL_BLOB_MODES = set([ 485s pygit2.GIT_FILEMODE_BLOB, 485s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 485s ]) 485s 485s _rel_tree = _rel_tree or top_tree_object 485s head, tail = posixpath.split(search_path) 485s 485s # A traditional functional split would put a single entry in head with tail 485s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 485s # to make it appear to have traditional semantics. 485s if not head: 485s head = tail 485s tail = None 485s 485s entry = _rel_tree[head] 485s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:68: AttributeError 485s _____________________ test_descendant_of[root-root-False] ______________________ 485s 485s pygit2_repo = pygit2.Repository('/tmp/tmp_wlqt_hn/.git/'), a = 'root' 485s b = 'root', expected = False 485s 485s @pytest.mark.parametrize(['a', 'b', 'expected'], 485s [ 485s ('root', 'root', False), 485s ('child1', 'root', True), 485s ('root', 'child1', False), 485s ('grandchild1', 'root', True), 485s ('child1', 'child2', False), 485s ('root', 'disjoint', False), 485s ] 485s ) 485s def test_descendant_of(pygit2_repo, a, b, expected): 485s """ 485s General test for pygit2.Repository.descendant_of(). 485s 485s This test was formerly for a temporary alternative implementation of 485s pygit2.Repository.descendant_of() in our GitUbuntuRepository wrapper for 485s use until we updated our pinning to use a newer version of pygit2 that 485s included the pygit2.Repository.descendant_of() method. After the pinning 485s was removed and this implementation replacement took place, we kept the 485s test to ensure that actual behaviour did not change. 485s 485s This unit tests validate_upload_tag() for various parameterized cases. The 485s paramater sets assume the repository structure encoded in the Repo() call 485s below. 485s 485s :param pygit2.Repository pygit2_repo: fixture providing a temporary 485s pygit2.Repository instance to use 485s :param str a: tag name of the first commit to pass to descendant_of() 485s :param str b: tag name of the second commit to pass to descendant_of() 485s :param bool expected: the expected result of descendant_of() 485s """ 485s Repo( 485s # Unique message parameters are used in each entry here in order to 485s # ensure that otherwise-identical commits do not end up being the same 485s # commit (with the same hash, etc). 485s commits=[ 485s Commit(name='root', message='1'), 485s Commit(name='child1', parents=[Placeholder('root')], message='2'), 485s Commit(name='child2', parents=[Placeholder('root')], message='3'), 485s Commit( 485s name='grandchild1', 485s parents=[Placeholder('child1')], 485s message='4' 485s ), 485s Commit(name='disjoint', message='5'), 485s ], 485s tags={ 485s 'root': Placeholder('root'), 485s 'child1': Placeholder('child1'), 485s 'child2': Placeholder('child2'), 485s 'grandchild1': Placeholder('grandchild1'), 485s 'disjoint': Placeholder('disjoint'), 485s } 485s > ).write(pygit2_repo) 485s 485s gitubuntu/git_repository_test.py:1099: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmp_wlqt_hn/.git/'), record = {} 485s 485s def write(self, repo, record=None): 485s replace_placeholders(self) 485s record = record or dict() 485s written_commits = [ 485s commit.write(repo=repo, record=record) 485s for commit 485s in self.commit_list 485s ] 485s for name, target in self.branches.items(): 485s repo.create_branch( 485s name, 485s repo.get(target.write(repo)).peel(pygit2.Commit), 485s ) 485s for name, target in self.tags.items(): 485s repo.create_tag( 485s name, 485s target.write(repo), 485s > pygit2.GIT_OBJ_COMMIT, 485s self.tagger.signature, 485s 'Tag message', 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s gitubuntu/repo_builder.py:389: AttributeError 485s _____________________ test_descendant_of[child1-root-True] _____________________ 485s 485s pygit2_repo = pygit2.Repository('/tmp/tmpkjky4_u5/.git/'), a = 'child1' 485s b = 'root', expected = True 485s 485s @pytest.mark.parametrize(['a', 'b', 'expected'], 485s [ 485s ('root', 'root', False), 485s ('child1', 'root', True), 485s ('root', 'child1', False), 485s ('grandchild1', 'root', True), 485s ('child1', 'child2', False), 485s ('root', 'disjoint', False), 485s ] 485s ) 485s def test_descendant_of(pygit2_repo, a, b, expected): 485s """ 485s General test for pygit2.Repository.descendant_of(). 485s 485s This test was formerly for a temporary alternative implementation of 485s pygit2.Repository.descendant_of() in our GitUbuntuRepository wrapper for 485s use until we updated our pinning to use a newer version of pygit2 that 485s included the pygit2.Repository.descendant_of() method. After the pinning 485s was removed and this implementation replacement took place, we kept the 485s test to ensure that actual behaviour did not change. 485s 485s This unit tests validate_upload_tag() for various parameterized cases. The 485s paramater sets assume the repository structure encoded in the Repo() call 485s below. 485s 485s :param pygit2.Repository pygit2_repo: fixture providing a temporary 485s pygit2.Repository instance to use 485s :param str a: tag name of the first commit to pass to descendant_of() 485s :param str b: tag name of the second commit to pass to descendant_of() 485s :param bool expected: the expected result of descendant_of() 485s """ 485s Repo( 485s # Unique message parameters are used in each entry here in order to 485s # ensure that otherwise-identical commits do not end up being the same 485s # commit (with the same hash, etc). 485s commits=[ 485s Commit(name='root', message='1'), 485s Commit(name='child1', parents=[Placeholder('root')], message='2'), 485s Commit(name='child2', parents=[Placeholder('root')], message='3'), 485s Commit( 485s name='grandchild1', 485s parents=[Placeholder('child1')], 485s message='4' 485s ), 485s Commit(name='disjoint', message='5'), 485s ], 485s tags={ 485s 'root': Placeholder('root'), 485s 'child1': Placeholder('child1'), 485s 'child2': Placeholder('child2'), 485s 'grandchild1': Placeholder('grandchild1'), 485s 'disjoint': Placeholder('disjoint'), 485s } 485s > ).write(pygit2_repo) 485s 485s gitubuntu/git_repository_test.py:1099: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmpkjky4_u5/.git/'), record = {} 485s 485s def write(self, repo, record=None): 485s replace_placeholders(self) 485s record = record or dict() 485s written_commits = [ 485s commit.write(repo=repo, record=record) 485s for commit 485s in self.commit_list 485s ] 485s for name, target in self.branches.items(): 485s repo.create_branch( 485s name, 485s repo.get(target.write(repo)).peel(pygit2.Commit), 485s ) 485s for name, target in self.tags.items(): 485s repo.create_tag( 485s name, 485s target.write(repo), 485s > pygit2.GIT_OBJ_COMMIT, 485s self.tagger.signature, 485s 'Tag message', 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s gitubuntu/repo_builder.py:389: AttributeError 485s ____________________ test_descendant_of[root-child1-False] _____________________ 485s 485s pygit2_repo = pygit2.Repository('/tmp/tmpxofx0qwn/.git/'), a = 'root' 485s b = 'child1', expected = False 485s 485s @pytest.mark.parametrize(['a', 'b', 'expected'], 485s [ 485s ('root', 'root', False), 485s ('child1', 'root', True), 485s ('root', 'child1', False), 485s ('grandchild1', 'root', True), 485s ('child1', 'child2', False), 485s ('root', 'disjoint', False), 485s ] 485s ) 485s def test_descendant_of(pygit2_repo, a, b, expected): 485s """ 485s General test for pygit2.Repository.descendant_of(). 485s 485s This test was formerly for a temporary alternative implementation of 485s pygit2.Repository.descendant_of() in our GitUbuntuRepository wrapper for 485s use until we updated our pinning to use a newer version of pygit2 that 485s included the pygit2.Repository.descendant_of() method. After the pinning 485s was removed and this implementation replacement took place, we kept the 485s test to ensure that actual behaviour did not change. 485s 485s This unit tests validate_upload_tag() for various parameterized cases. The 485s paramater sets assume the repository structure encoded in the Repo() call 485s below. 485s 485s :param pygit2.Repository pygit2_repo: fixture providing a temporary 485s pygit2.Repository instance to use 485s :param str a: tag name of the first commit to pass to descendant_of() 485s :param str b: tag name of the second commit to pass to descendant_of() 485s :param bool expected: the expected result of descendant_of() 485s """ 485s Repo( 485s # Unique message parameters are used in each entry here in order to 485s # ensure that otherwise-identical commits do not end up being the same 485s # commit (with the same hash, etc). 485s commits=[ 485s Commit(name='root', message='1'), 485s Commit(name='child1', parents=[Placeholder('root')], message='2'), 485s Commit(name='child2', parents=[Placeholder('root')], message='3'), 485s Commit( 485s name='grandchild1', 485s parents=[Placeholder('child1')], 485s message='4' 485s ), 485s Commit(name='disjoint', message='5'), 485s ], 485s tags={ 485s 'root': Placeholder('root'), 485s 'child1': Placeholder('child1'), 485s 'child2': Placeholder('child2'), 485s 'grandchild1': Placeholder('grandchild1'), 485s 'disjoint': Placeholder('disjoint'), 485s } 485s > ).write(pygit2_repo) 485s 485s gitubuntu/git_repository_test.py:1099: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmpxofx0qwn/.git/'), record = {} 485s 485s def write(self, repo, record=None): 485s replace_placeholders(self) 485s record = record or dict() 485s written_commits = [ 485s commit.write(repo=repo, record=record) 485s for commit 485s in self.commit_list 485s ] 485s for name, target in self.branches.items(): 485s repo.create_branch( 485s name, 485s repo.get(target.write(repo)).peel(pygit2.Commit), 485s ) 485s for name, target in self.tags.items(): 485s repo.create_tag( 485s name, 485s target.write(repo), 485s > pygit2.GIT_OBJ_COMMIT, 485s self.tagger.signature, 485s 'Tag message', 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s gitubuntu/repo_builder.py:389: AttributeError 485s __________________ test_descendant_of[grandchild1-root-True] ___________________ 485s 485s pygit2_repo = pygit2.Repository('/tmp/tmp5f97onh9/.git/'), a = 'grandchild1' 485s b = 'root', expected = True 485s 485s @pytest.mark.parametrize(['a', 'b', 'expected'], 485s [ 485s ('root', 'root', False), 485s ('child1', 'root', True), 485s ('root', 'child1', False), 485s ('grandchild1', 'root', True), 485s ('child1', 'child2', False), 485s ('root', 'disjoint', False), 485s ] 485s ) 485s def test_descendant_of(pygit2_repo, a, b, expected): 485s """ 485s General test for pygit2.Repository.descendant_of(). 485s 485s This test was formerly for a temporary alternative implementation of 485s pygit2.Repository.descendant_of() in our GitUbuntuRepository wrapper for 485s use until we updated our pinning to use a newer version of pygit2 that 485s included the pygit2.Repository.descendant_of() method. After the pinning 485s was removed and this implementation replacement took place, we kept the 485s test to ensure that actual behaviour did not change. 485s 485s This unit tests validate_upload_tag() for various parameterized cases. The 485s paramater sets assume the repository structure encoded in the Repo() call 485s below. 485s 485s :param pygit2.Repository pygit2_repo: fixture providing a temporary 485s pygit2.Repository instance to use 485s :param str a: tag name of the first commit to pass to descendant_of() 485s :param str b: tag name of the second commit to pass to descendant_of() 485s :param bool expected: the expected result of descendant_of() 485s """ 485s Repo( 485s # Unique message parameters are used in each entry here in order to 485s # ensure that otherwise-identical commits do not end up being the same 485s # commit (with the same hash, etc). 485s commits=[ 485s Commit(name='root', message='1'), 485s Commit(name='child1', parents=[Placeholder('root')], message='2'), 485s Commit(name='child2', parents=[Placeholder('root')], message='3'), 485s Commit( 485s name='grandchild1', 485s parents=[Placeholder('child1')], 485s message='4' 485s ), 485s Commit(name='disjoint', message='5'), 485s ], 485s tags={ 485s 'root': Placeholder('root'), 485s 'child1': Placeholder('child1'), 485s 'child2': Placeholder('child2'), 485s 'grandchild1': Placeholder('grandchild1'), 485s 'disjoint': Placeholder('disjoint'), 485s } 485s > ).write(pygit2_repo) 485s 485s gitubuntu/git_repository_test.py:1099: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmp5f97onh9/.git/'), record = {} 485s 485s def write(self, repo, record=None): 485s replace_placeholders(self) 485s record = record or dict() 485s written_commits = [ 485s commit.write(repo=repo, record=record) 485s for commit 485s in self.commit_list 485s ] 485s for name, target in self.branches.items(): 485s repo.create_branch( 485s name, 485s repo.get(target.write(repo)).peel(pygit2.Commit), 485s ) 485s for name, target in self.tags.items(): 485s repo.create_tag( 485s name, 485s target.write(repo), 485s > pygit2.GIT_OBJ_COMMIT, 485s self.tagger.signature, 485s 'Tag message', 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s gitubuntu/repo_builder.py:389: AttributeError 485s ___________________ test_descendant_of[child1-child2-False] ____________________ 485s 485s pygit2_repo = pygit2.Repository('/tmp/tmp6t7awdhx/.git/'), a = 'child1' 485s b = 'child2', expected = False 485s 485s @pytest.mark.parametrize(['a', 'b', 'expected'], 485s [ 485s ('root', 'root', False), 485s ('child1', 'root', True), 485s ('root', 'child1', False), 485s ('grandchild1', 'root', True), 485s ('child1', 'child2', False), 485s ('root', 'disjoint', False), 485s ] 485s ) 485s def test_descendant_of(pygit2_repo, a, b, expected): 485s """ 485s General test for pygit2.Repository.descendant_of(). 485s 485s This test was formerly for a temporary alternative implementation of 485s pygit2.Repository.descendant_of() in our GitUbuntuRepository wrapper for 485s use until we updated our pinning to use a newer version of pygit2 that 485s included the pygit2.Repository.descendant_of() method. After the pinning 485s was removed and this implementation replacement took place, we kept the 485s test to ensure that actual behaviour did not change. 485s 485s This unit tests validate_upload_tag() for various parameterized cases. The 485s paramater sets assume the repository structure encoded in the Repo() call 485s below. 485s 485s :param pygit2.Repository pygit2_repo: fixture providing a temporary 485s pygit2.Repository instance to use 485s :param str a: tag name of the first commit to pass to descendant_of() 485s :param str b: tag name of the second commit to pass to descendant_of() 485s :param bool expected: the expected result of descendant_of() 485s """ 485s Repo( 485s # Unique message parameters are used in each entry here in order to 485s # ensure that otherwise-identical commits do not end up being the same 485s # commit (with the same hash, etc). 485s commits=[ 485s Commit(name='root', message='1'), 485s Commit(name='child1', parents=[Placeholder('root')], message='2'), 485s Commit(name='child2', parents=[Placeholder('root')], message='3'), 485s Commit( 485s name='grandchild1', 485s parents=[Placeholder('child1')], 485s message='4' 485s ), 485s Commit(name='disjoint', message='5'), 485s ], 485s tags={ 485s 'root': Placeholder('root'), 485s 'child1': Placeholder('child1'), 485s 'child2': Placeholder('child2'), 485s 'grandchild1': Placeholder('grandchild1'), 485s 'disjoint': Placeholder('disjoint'), 485s } 485s > ).write(pygit2_repo) 485s 485s gitubuntu/git_repository_test.py:1099: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmp6t7awdhx/.git/'), record = {} 485s 485s def write(self, repo, record=None): 485s replace_placeholders(self) 485s record = record or dict() 485s written_commits = [ 485s commit.write(repo=repo, record=record) 485s for commit 485s in self.commit_list 485s ] 485s for name, target in self.branches.items(): 485s repo.create_branch( 485s name, 485s repo.get(target.write(repo)).peel(pygit2.Commit), 485s ) 485s for name, target in self.tags.items(): 485s repo.create_tag( 485s name, 485s target.write(repo), 485s > pygit2.GIT_OBJ_COMMIT, 485s self.tagger.signature, 485s 'Tag message', 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s gitubuntu/repo_builder.py:389: AttributeError 485s ___________________ test_descendant_of[root-disjoint-False] ____________________ 485s 485s pygit2_repo = pygit2.Repository('/tmp/tmpssz25tmt/.git/'), a = 'root' 485s b = 'disjoint', expected = False 485s 485s @pytest.mark.parametrize(['a', 'b', 'expected'], 485s [ 485s ('root', 'root', False), 485s ('child1', 'root', True), 485s ('root', 'child1', False), 485s ('grandchild1', 'root', True), 485s ('child1', 'child2', False), 485s ('root', 'disjoint', False), 485s ] 485s ) 485s def test_descendant_of(pygit2_repo, a, b, expected): 485s """ 485s General test for pygit2.Repository.descendant_of(). 485s 485s This test was formerly for a temporary alternative implementation of 485s pygit2.Repository.descendant_of() in our GitUbuntuRepository wrapper for 485s use until we updated our pinning to use a newer version of pygit2 that 485s included the pygit2.Repository.descendant_of() method. After the pinning 485s was removed and this implementation replacement took place, we kept the 485s test to ensure that actual behaviour did not change. 485s 485s This unit tests validate_upload_tag() for various parameterized cases. The 485s paramater sets assume the repository structure encoded in the Repo() call 485s below. 485s 485s :param pygit2.Repository pygit2_repo: fixture providing a temporary 485s pygit2.Repository instance to use 485s :param str a: tag name of the first commit to pass to descendant_of() 485s :param str b: tag name of the second commit to pass to descendant_of() 485s :param bool expected: the expected result of descendant_of() 485s """ 485s Repo( 485s # Unique message parameters are used in each entry here in order to 485s # ensure that otherwise-identical commits do not end up being the same 485s # commit (with the same hash, etc). 485s commits=[ 485s Commit(name='root', message='1'), 485s Commit(name='child1', parents=[Placeholder('root')], message='2'), 485s Commit(name='child2', parents=[Placeholder('root')], message='3'), 485s Commit( 485s name='grandchild1', 485s parents=[Placeholder('child1')], 485s message='4' 485s ), 485s Commit(name='disjoint', message='5'), 485s ], 485s tags={ 485s 'root': Placeholder('root'), 485s 'child1': Placeholder('child1'), 485s 'child2': Placeholder('child2'), 485s 'grandchild1': Placeholder('grandchild1'), 485s 'disjoint': Placeholder('disjoint'), 485s } 485s > ).write(pygit2_repo) 485s 485s gitubuntu/git_repository_test.py:1099: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmpssz25tmt/.git/'), record = {} 485s 485s def write(self, repo, record=None): 485s replace_placeholders(self) 485s record = record or dict() 485s written_commits = [ 485s commit.write(repo=repo, record=record) 485s for commit 485s in self.commit_list 485s ] 485s for name, target in self.branches.items(): 485s repo.create_branch( 485s name, 485s repo.get(target.write(repo)).peel(pygit2.Commit), 485s ) 485s for name, target in self.tags.items(): 485s repo.create_tag( 485s name, 485s target.write(repo), 485s > pygit2.GIT_OBJ_COMMIT, 485s self.tagger.signature, 485s 'Tag message', 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s gitubuntu/repo_builder.py:389: AttributeError 485s _______________________________ test_create_tag ________________________________ 485s 485s repo = 485s 485s def test_create_tag(repo): 485s """create_tag() should create a tag 485s 485s :param GitUbuntuRepository repo: fixture providing a temporary 485s GitUbuntuRepository instance to use 485s """ 485s Repo( 485s commits=[Commit(name='root')], 485s tags={'root': Placeholder('root')}, 485s > ).write(repo.raw_repo) 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository_test.py:1127: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmpi_1y7q78/.git/'), record = {} 485s 485s def write(self, repo, record=None): 485s replace_placeholders(self) 485s record = record or dict() 485s written_commits = [ 485s commit.write(repo=repo, record=record) 485s for commit 485s in self.commit_list 485s ] 485s for name, target in self.branches.items(): 485s repo.create_branch( 485s name, 485s repo.get(target.write(repo)).peel(pygit2.Commit), 485s ) 485s for name, target in self.tags.items(): 485s repo.create_tag( 485s name, 485s target.write(repo), 485s > pygit2.GIT_OBJ_COMMIT, 485s self.tagger.signature, 485s 'Tag message', 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 485s __________________________ test_get_all_reimport_tags __________________________ 485s 485s repo = 485s 485s def test_get_all_reimport_tags(repo): 485s """get_all_reimport_tags() should return only matching reimport tags 485s 485s :param GitUbuntuRepository repo: fixture providing a temporary 485s GitUbuntuRepository instance to use 485s """ 485s Repo( 485s commits=[Commit(name='root')], 485s tags={ 485s 'importer/reimport/import/1/0': Placeholder('root'), 485s 'importer/reimport/import/1/1': Placeholder('root'), 485s 485s # This entry must not be identified as one of version 1's reimport 485s # tags, even though it shares the same base prefix. 485s 'importer/reimport/import/11/0': Placeholder('root'), 485s }, 485s > ).write(repo.raw_repo) 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository_test.py:1165: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmpcbyi2yzn/.git/'), record = {} 485s 485s def write(self, repo, record=None): 485s replace_placeholders(self) 485s record = record or dict() 485s written_commits = [ 485s commit.write(repo=repo, record=record) 485s for commit 485s in self.commit_list 485s ] 485s for name, target in self.branches.items(): 485s repo.create_branch( 485s name, 485s repo.get(target.write(repo)).peel(pygit2.Commit), 485s ) 485s for name, target in self.tags.items(): 485s repo.create_tag( 485s name, 485s target.write(repo), 485s > pygit2.GIT_OBJ_COMMIT, 485s self.tagger.signature, 485s 'Tag message', 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 485s ______________________________ test_get_head_info ______________________________ 485s 485s repo = 485s 485s def test_get_head_info(repo): 485s """get_head_info() extracts expected commit and version info from the head 485s commit 485s """ 485s Repo( 485s commits=[ 485s Commit(name='foo', tree=SourceTree(source=Source())), 485s ], 485s branches={ 485s 'importer/ubuntu/foo': Placeholder('foo'), 485s 'importer/debian/bar': Placeholder('foo'), 485s 'other/ubuntu/baz': Placeholder('foo'), 485s }, 485s ).write(repo.raw_repo) 485s foo_commit_id = ( 485s repo.raw_repo 485s .lookup_reference('refs/heads/importer/ubuntu/foo') 485s .peel(pygit2.Commit).id 485s ) 485s > assert repo.get_head_info('ubuntu', 'importer') == { 485s 'importer/ubuntu/foo': HeadInfoItem( 485s version='1-1', 485s commit_time=0, 485s commit_id=foo_commit_id, 485s ), 485s } 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository_test.py:1193: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:1952: in get_head_info 485s self.get_changelog_versions_from_treeish(str(head.peel().id)) 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:1888: in get_changelog_versions_from_treeish 485s changelog = self.get_changelog_from_treeish(treeish_string) 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 485s return Changelog.from_treeish( 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:569: in from_treeish 485s blob = follow_symlinks_to_blob( 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 485s return _follow_symlinks_to_blob( 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s repo = pygit2.Repository('/tmp/tmpg48h7a35/.git/') 485s top_tree_object = 485s search_path = 'debian/changelog' 485s _rel_tree = 485s _rel_path = '' 485s 485s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 485s _rel_tree=None, _rel_path='' 485s ): 485s '''Recursively follow a path down a tree, following symlinks, to find blob 485s 485s repo: pygit2.Repository object 485s top_tree: pygit2.Tree object of the top of the tree structure 485s search_path: '/'-separated path string of blob to find 485s _rel_tree: (internal) which tree to look further into 485s _rel_path: (internal) the path we are in so far 485s ''' 485s 485s NORMAL_BLOB_MODES = set([ 485s pygit2.GIT_FILEMODE_BLOB, 485s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 485s ]) 485s 485s _rel_tree = _rel_tree or top_tree_object 485s head, tail = posixpath.split(search_path) 485s 485s # A traditional functional split would put a single entry in head with tail 485s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 485s # to make it appear to have traditional semantics. 485s if not head: 485s head = tail 485s tail = None 485s 485s entry = _rel_tree[head] 485s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:68: AttributeError 485s ----------------------------- Captured stdout call ----------------------------- 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s ----------------------------- Captured stderr call ----------------------------- 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s _ test_import_unapplied_spi_tags[input_repo0-expected_output_refs0-validation_repo_delta0-validation_repo_expected_identical_refs0-True] _ 485s 485s get_import_commit_msg_mock = 485s get_import_tag_msg_mock = 485s repo = 485s input_repo = 485s 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'] 485s validation_repo_delta = {'update_branches': {'importer/ubuntu/trusty': }} 485s validation_repo_expected_identical_refs = ['refs/heads/importer/ubuntu/trusty-proposed', 'refs/heads/importer/ubuntu/trusty', 'refs/tags/importer/import/1-1'] 485s reuse = True 485s 485s @pytest.mark.parametrize( 485s [ 485s 'input_repo', 485s 'expected_output_refs', 485s 'validation_repo_delta', 485s 'validation_repo_expected_identical_refs', 485s 'reuse', 485s ], 485s [ 485s # 1) An existing import tag (or reimport tag) with the same Git tree 485s # - Reuse import tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[Commit.from_spec(name='import')], 485s branches={ 485s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 485s }, 485s tags={'importer/import/1-1': Placeholder('import')}, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s ], 485s # validation_repo_delta: 485s { 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('import'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty-proposed', 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s ], 485s # reuse: 485s True, 485s ), 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec( 485s name='import', 485s mutate='import tag contents', 485s ), 485s Commit.from_spec(name='reimport'), 485s ], 485s branches={ 485s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 485s }, 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 485s }, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s ], 485s # validation_repo_delta: 485s { 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('reimport'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty-proposed', 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s # reuse: 485s True, 485s ), 485s 485s # 2) An existing import tag with a different Git tree and an existing 485s # upload tag with the same Git tree 485s # - Reuse upload tag, create reimport tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec( 485s name='import', 485s mutate='The import tag contents', 485s ), 485s Commit.from_spec(name='upload'), 485s ], 485s branches={ 485s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 485s }, 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/upload/1-1': Placeholder('upload'), 485s }, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'update_tags': { 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('upload'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('upload'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty-proposed', 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/upload/1-1', 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s # reuse: 485s True, 485s ), 485s 485s # 3) An existing import tag with a different Git tree and an existing 485s # upload tag with a different Git tree 485s # - Create reimport tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec( 485s name='import', 485s mutate='The import tag contents', 485s ), 485s Commit.from_spec( 485s name='upload', 485s mutate='The upload tag contents', 485s ), 485s ], 485s branches={ 485s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 485s }, 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/upload/1-1': Placeholder('upload'), 485s }, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/changelog', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'add_commits': [Commit.from_spec( 485s name='reimport', 485s message='Test commit (new)', 485s )], 485s 'update_tags': { 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('reimport'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty-proposed', 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/upload/1-1', 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s # reuse: 485s False, 485s ), 485s 485s # 4) An existing import tag with a different Git tree and no upload tag 485s # - Create reimport tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec( 485s name='import', 485s mutate='The import tag contents', 485s ), 485s ], 485s branches={ 485s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 485s }, 485s tags={'importer/import/1-1': Placeholder('import')}, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/changelog', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'add_commits': [Commit.from_spec( 485s name='reimport', 485s message='Test commit (new)', 485s )], 485s 'update_tags': { 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('reimport'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty-proposed', 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s # reuse: 485s False, 485s ), 485s 485s # 5) No import tag and an existing upload tag with the same Git tree 485s # - Reuse upload tag, create import tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[Commit.from_spec(name='upload')], 485s tags={'importer/upload/1-1': Placeholder('upload')}, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'update_tags': { 485s 'importer/import/1-1': Placeholder('upload'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('upload'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/upload/1-1', 485s ], 485s # reuse: 485s True, 485s ), 485s 485s # 6) No import tag and an existing upload tag with a different Git tree 485s # - Create import tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec( 485s name='upload', 485s mutate='The upload tag contents', 485s ), 485s ], 485s tags={'importer/upload/1-1': Placeholder('upload')}, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/changelog', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'add_commits': [ 485s Commit.from_spec( 485s name='publish', 485s message='Test commit (new)', 485s ), 485s ], 485s 'update_tags': { 485s 'importer/import/1-1': Placeholder('publish'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('publish'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/upload/1-1', 485s ], 485s # reuse: 485s False, 485s ), 485s 485s # 7) No import tags or upload tags 485s # - Create import tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo(), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/changelog', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'add_commits': [ 485s Commit.from_spec( 485s name='publish', 485s message='Test commit (new)', 485s ), 485s ], 485s 'update_tags': { 485s 'importer/import/1-1': Placeholder('publish'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('publish'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1' 485s ], 485s # reuse: 485s False, 485s ), 485s ] 485s ) 485s @patch('gitubuntu.importer.get_import_tag_msg') 485s @patch('gitubuntu.importer.get_import_commit_msg') 485s def test_import_unapplied_spi_tags( 485s get_import_commit_msg_mock, 485s get_import_tag_msg_mock, 485s repo, 485s input_repo, 485s expected_output_refs, 485s validation_repo_delta, 485s validation_repo_expected_identical_refs, 485s reuse, 485s ): 485s """Test that unapplied tags are correctly created, adjusted and/or reused 485s 485s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 485s that determines the commit message to use for a given import 485s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 485s that determines the tag message to use for a given import 485s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 485s temporary output repository 485s :param repo_builder.Repo input_repo: input repository data 485s :param list(str) expected_output_refs: refs that must exist in the output 485s repository 485s :param dict validation_repo_delta: how to transform the input 485s repository into a "validation repository", expressed as a dict to 485s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 485s input repository. The validation repository is then used for the 485s purposes of comparison against the output repository. 485s :param list(str) validation_repo_expected_identical_refs: refs that must be 485s identical between the validation repository and the output repository 485s :param bool reuse: if set, the output ref importer/ubuntu/trusty must be 485s one supplied by the input repository (assumed to have a commit message 485s of "Test commit") and not one created by the importer in this run 485s (arranged by this test to have a different commit message) 485s 485s The input repository data is written into the output repository and then a 485s fake non-native source package publication of version 1-1 in the Trusty 485s release pocket is imported into it by calling import_unapplied_spi() 485s directly. expected_output_refs, validation_repo_expected_identical_refs and 485s reuse are then asserted. It is further asserted that no other refs exist in 485s the output repository except for those listed in expected_output_refs and 485s validation_repo_expected_identical_refs. 485s """ 485s # Match the repo_builder objects 485s get_import_tag_msg_mock.return_value = 'Test tag' 485s # Importantly, the following commit message must not be the same as the 485s # commit messages used by the test input repository commits, so that we can 485s # later detect the difference between commits that were already there and 485s # new commits created by the importer for the purposes of asserting the 485s # reuse parameter correctly. 485s get_import_commit_msg_mock.return_value = b'Test commit (new)' 485s 485s > input_repo.write(repo.raw_repo) 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_tag_test.py:463: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmpueo3soey/.git/'), record = {} 485s 485s def write(self, repo, record=None): 485s replace_placeholders(self) 485s record = record or dict() 485s written_commits = [ 485s commit.write(repo=repo, record=record) 485s for commit 485s in self.commit_list 485s ] 485s for name, target in self.branches.items(): 485s repo.create_branch( 485s name, 485s repo.get(target.write(repo)).peel(pygit2.Commit), 485s ) 485s for name, target in self.tags.items(): 485s repo.create_tag( 485s name, 485s target.write(repo), 485s > pygit2.GIT_OBJ_COMMIT, 485s self.tagger.signature, 485s 'Tag message', 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 485s ----------------------------- Captured stdout call ----------------------------- 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s ----------------------------- Captured stderr call ----------------------------- 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s _ test_import_unapplied_spi_tags[input_repo1-expected_output_refs1-validation_repo_delta1-validation_repo_expected_identical_refs1-True] _ 485s 485s get_import_commit_msg_mock = 485s get_import_tag_msg_mock = 485s repo = 485s input_repo = 485s 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'] 485s validation_repo_delta = {'update_branches': {'importer/ubuntu/trusty': }} 485s 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'] 485s reuse = True 485s 485s @pytest.mark.parametrize( 485s [ 485s 'input_repo', 485s 'expected_output_refs', 485s 'validation_repo_delta', 485s 'validation_repo_expected_identical_refs', 485s 'reuse', 485s ], 485s [ 485s # 1) An existing import tag (or reimport tag) with the same Git tree 485s # - Reuse import tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[Commit.from_spec(name='import')], 485s branches={ 485s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 485s }, 485s tags={'importer/import/1-1': Placeholder('import')}, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s ], 485s # validation_repo_delta: 485s { 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('import'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty-proposed', 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s ], 485s # reuse: 485s True, 485s ), 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec( 485s name='import', 485s mutate='import tag contents', 485s ), 485s Commit.from_spec(name='reimport'), 485s ], 485s branches={ 485s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 485s }, 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 485s }, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s ], 485s # validation_repo_delta: 485s { 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('reimport'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty-proposed', 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s # reuse: 485s True, 485s ), 485s 485s # 2) An existing import tag with a different Git tree and an existing 485s # upload tag with the same Git tree 485s # - Reuse upload tag, create reimport tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec( 485s name='import', 485s mutate='The import tag contents', 485s ), 485s Commit.from_spec(name='upload'), 485s ], 485s branches={ 485s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 485s }, 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/upload/1-1': Placeholder('upload'), 485s }, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'update_tags': { 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('upload'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('upload'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty-proposed', 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/upload/1-1', 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s # reuse: 485s True, 485s ), 485s 485s # 3) An existing import tag with a different Git tree and an existing 485s # upload tag with a different Git tree 485s # - Create reimport tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec( 485s name='import', 485s mutate='The import tag contents', 485s ), 485s Commit.from_spec( 485s name='upload', 485s mutate='The upload tag contents', 485s ), 485s ], 485s branches={ 485s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 485s }, 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/upload/1-1': Placeholder('upload'), 485s }, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/changelog', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'add_commits': [Commit.from_spec( 485s name='reimport', 485s message='Test commit (new)', 485s )], 485s 'update_tags': { 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('reimport'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty-proposed', 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/upload/1-1', 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s # reuse: 485s False, 485s ), 485s 485s # 4) An existing import tag with a different Git tree and no upload tag 485s # - Create reimport tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec( 485s name='import', 485s mutate='The import tag contents', 485s ), 485s ], 485s branches={ 485s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 485s }, 485s tags={'importer/import/1-1': Placeholder('import')}, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/changelog', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'add_commits': [Commit.from_spec( 485s name='reimport', 485s message='Test commit (new)', 485s )], 485s 'update_tags': { 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('reimport'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty-proposed', 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s # reuse: 485s False, 485s ), 485s 485s # 5) No import tag and an existing upload tag with the same Git tree 485s # - Reuse upload tag, create import tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[Commit.from_spec(name='upload')], 485s tags={'importer/upload/1-1': Placeholder('upload')}, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'update_tags': { 485s 'importer/import/1-1': Placeholder('upload'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('upload'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/upload/1-1', 485s ], 485s # reuse: 485s True, 485s ), 485s 485s # 6) No import tag and an existing upload tag with a different Git tree 485s # - Create import tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec( 485s name='upload', 485s mutate='The upload tag contents', 485s ), 485s ], 485s tags={'importer/upload/1-1': Placeholder('upload')}, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/changelog', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'add_commits': [ 485s Commit.from_spec( 485s name='publish', 485s message='Test commit (new)', 485s ), 485s ], 485s 'update_tags': { 485s 'importer/import/1-1': Placeholder('publish'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('publish'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/upload/1-1', 485s ], 485s # reuse: 485s False, 485s ), 485s 485s # 7) No import tags or upload tags 485s # - Create import tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo(), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/changelog', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'add_commits': [ 485s Commit.from_spec( 485s name='publish', 485s message='Test commit (new)', 485s ), 485s ], 485s 'update_tags': { 485s 'importer/import/1-1': Placeholder('publish'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('publish'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1' 485s ], 485s # reuse: 485s False, 485s ), 485s ] 485s ) 485s @patch('gitubuntu.importer.get_import_tag_msg') 485s @patch('gitubuntu.importer.get_import_commit_msg') 485s def test_import_unapplied_spi_tags( 485s get_import_commit_msg_mock, 485s get_import_tag_msg_mock, 485s repo, 485s input_repo, 485s expected_output_refs, 485s validation_repo_delta, 485s validation_repo_expected_identical_refs, 485s reuse, 485s ): 485s """Test that unapplied tags are correctly created, adjusted and/or reused 485s 485s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 485s that determines the commit message to use for a given import 485s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 485s that determines the tag message to use for a given import 485s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 485s temporary output repository 485s :param repo_builder.Repo input_repo: input repository data 485s :param list(str) expected_output_refs: refs that must exist in the output 485s repository 485s :param dict validation_repo_delta: how to transform the input 485s repository into a "validation repository", expressed as a dict to 485s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 485s input repository. The validation repository is then used for the 485s purposes of comparison against the output repository. 485s :param list(str) validation_repo_expected_identical_refs: refs that must be 485s identical between the validation repository and the output repository 485s :param bool reuse: if set, the output ref importer/ubuntu/trusty must be 485s one supplied by the input repository (assumed to have a commit message 485s of "Test commit") and not one created by the importer in this run 485s (arranged by this test to have a different commit message) 485s 485s The input repository data is written into the output repository and then a 485s fake non-native source package publication of version 1-1 in the Trusty 485s release pocket is imported into it by calling import_unapplied_spi() 485s directly. expected_output_refs, validation_repo_expected_identical_refs and 485s reuse are then asserted. It is further asserted that no other refs exist in 485s the output repository except for those listed in expected_output_refs and 485s validation_repo_expected_identical_refs. 485s """ 485s # Match the repo_builder objects 485s get_import_tag_msg_mock.return_value = 'Test tag' 485s # Importantly, the following commit message must not be the same as the 485s # commit messages used by the test input repository commits, so that we can 485s # later detect the difference between commits that were already there and 485s # new commits created by the importer for the purposes of asserting the 485s # reuse parameter correctly. 485s get_import_commit_msg_mock.return_value = b'Test commit (new)' 485s 485s > input_repo.write(repo.raw_repo) 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_tag_test.py:463: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmpmlmpk0_b/.git/'), record = {} 485s 485s def write(self, repo, record=None): 485s replace_placeholders(self) 485s record = record or dict() 485s written_commits = [ 485s commit.write(repo=repo, record=record) 485s for commit 485s in self.commit_list 485s ] 485s for name, target in self.branches.items(): 485s repo.create_branch( 485s name, 485s repo.get(target.write(repo)).peel(pygit2.Commit), 485s ) 485s for name, target in self.tags.items(): 485s repo.create_tag( 485s name, 485s target.write(repo), 485s > pygit2.GIT_OBJ_COMMIT, 485s self.tagger.signature, 485s 'Tag message', 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 485s ----------------------------- Captured stdout call ----------------------------- 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s ----------------------------- Captured stderr call ----------------------------- 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s _ test_import_unapplied_spi_tags[input_repo2-expected_output_refs2-validation_repo_delta2-validation_repo_expected_identical_refs2-True] _ 485s 485s get_import_commit_msg_mock = 485s get_import_tag_msg_mock = 485s repo = 485s input_repo = 485s 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'] 485s validation_repo_delta = {'update_branches': {'importer/ubuntu/trusty': }, 'update_tag...er object at 0xe8699b88>, 'importer/reimport/import/1-1/1': }} 485s 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'] 485s reuse = True 485s 485s @pytest.mark.parametrize( 485s [ 485s 'input_repo', 485s 'expected_output_refs', 485s 'validation_repo_delta', 485s 'validation_repo_expected_identical_refs', 485s 'reuse', 485s ], 485s [ 485s # 1) An existing import tag (or reimport tag) with the same Git tree 485s # - Reuse import tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[Commit.from_spec(name='import')], 485s branches={ 485s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 485s }, 485s tags={'importer/import/1-1': Placeholder('import')}, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s ], 485s # validation_repo_delta: 485s { 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('import'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty-proposed', 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s ], 485s # reuse: 485s True, 485s ), 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec( 485s name='import', 485s mutate='import tag contents', 485s ), 485s Commit.from_spec(name='reimport'), 485s ], 485s branches={ 485s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 485s }, 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 485s }, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s ], 485s # validation_repo_delta: 485s { 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('reimport'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty-proposed', 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s # reuse: 485s True, 485s ), 485s 485s # 2) An existing import tag with a different Git tree and an existing 485s # upload tag with the same Git tree 485s # - Reuse upload tag, create reimport tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec( 485s name='import', 485s mutate='The import tag contents', 485s ), 485s Commit.from_spec(name='upload'), 485s ], 485s branches={ 485s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 485s }, 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/upload/1-1': Placeholder('upload'), 485s }, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'update_tags': { 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('upload'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('upload'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty-proposed', 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/upload/1-1', 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s # reuse: 485s True, 485s ), 485s 485s # 3) An existing import tag with a different Git tree and an existing 485s # upload tag with a different Git tree 485s # - Create reimport tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec( 485s name='import', 485s mutate='The import tag contents', 485s ), 485s Commit.from_spec( 485s name='upload', 485s mutate='The upload tag contents', 485s ), 485s ], 485s branches={ 485s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 485s }, 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/upload/1-1': Placeholder('upload'), 485s }, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/changelog', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'add_commits': [Commit.from_spec( 485s name='reimport', 485s message='Test commit (new)', 485s )], 485s 'update_tags': { 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('reimport'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty-proposed', 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/upload/1-1', 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s # reuse: 485s False, 485s ), 485s 485s # 4) An existing import tag with a different Git tree and no upload tag 485s # - Create reimport tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec( 485s name='import', 485s mutate='The import tag contents', 485s ), 485s ], 485s branches={ 485s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 485s }, 485s tags={'importer/import/1-1': Placeholder('import')}, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/changelog', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'add_commits': [Commit.from_spec( 485s name='reimport', 485s message='Test commit (new)', 485s )], 485s 'update_tags': { 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('reimport'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty-proposed', 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s # reuse: 485s False, 485s ), 485s 485s # 5) No import tag and an existing upload tag with the same Git tree 485s # - Reuse upload tag, create import tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[Commit.from_spec(name='upload')], 485s tags={'importer/upload/1-1': Placeholder('upload')}, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'update_tags': { 485s 'importer/import/1-1': Placeholder('upload'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('upload'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/upload/1-1', 485s ], 485s # reuse: 485s True, 485s ), 485s 485s # 6) No import tag and an existing upload tag with a different Git tree 485s # - Create import tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec( 485s name='upload', 485s mutate='The upload tag contents', 485s ), 485s ], 485s tags={'importer/upload/1-1': Placeholder('upload')}, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/changelog', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'add_commits': [ 485s Commit.from_spec( 485s name='publish', 485s message='Test commit (new)', 485s ), 485s ], 485s 'update_tags': { 485s 'importer/import/1-1': Placeholder('publish'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('publish'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/upload/1-1', 485s ], 485s # reuse: 485s False, 485s ), 485s 485s # 7) No import tags or upload tags 485s # - Create import tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo(), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/changelog', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'add_commits': [ 485s Commit.from_spec( 485s name='publish', 485s message='Test commit (new)', 485s ), 485s ], 485s 'update_tags': { 485s 'importer/import/1-1': Placeholder('publish'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('publish'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1' 485s ], 485s # reuse: 485s False, 485s ), 485s ] 485s ) 485s @patch('gitubuntu.importer.get_import_tag_msg') 485s @patch('gitubuntu.importer.get_import_commit_msg') 485s def test_import_unapplied_spi_tags( 485s get_import_commit_msg_mock, 485s get_import_tag_msg_mock, 485s repo, 485s input_repo, 485s expected_output_refs, 485s validation_repo_delta, 485s validation_repo_expected_identical_refs, 485s reuse, 485s ): 485s """Test that unapplied tags are correctly created, adjusted and/or reused 485s 485s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 485s that determines the commit message to use for a given import 485s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 485s that determines the tag message to use for a given import 485s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 485s temporary output repository 485s :param repo_builder.Repo input_repo: input repository data 485s :param list(str) expected_output_refs: refs that must exist in the output 485s repository 485s :param dict validation_repo_delta: how to transform the input 485s repository into a "validation repository", expressed as a dict to 485s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 485s input repository. The validation repository is then used for the 485s purposes of comparison against the output repository. 485s :param list(str) validation_repo_expected_identical_refs: refs that must be 485s identical between the validation repository and the output repository 485s :param bool reuse: if set, the output ref importer/ubuntu/trusty must be 485s one supplied by the input repository (assumed to have a commit message 485s of "Test commit") and not one created by the importer in this run 485s (arranged by this test to have a different commit message) 485s 485s The input repository data is written into the output repository and then a 485s fake non-native source package publication of version 1-1 in the Trusty 485s release pocket is imported into it by calling import_unapplied_spi() 485s directly. expected_output_refs, validation_repo_expected_identical_refs and 485s reuse are then asserted. It is further asserted that no other refs exist in 485s the output repository except for those listed in expected_output_refs and 485s validation_repo_expected_identical_refs. 485s """ 485s # Match the repo_builder objects 485s get_import_tag_msg_mock.return_value = 'Test tag' 485s # Importantly, the following commit message must not be the same as the 485s # commit messages used by the test input repository commits, so that we can 485s # later detect the difference between commits that were already there and 485s # new commits created by the importer for the purposes of asserting the 485s # reuse parameter correctly. 485s get_import_commit_msg_mock.return_value = b'Test commit (new)' 485s 485s > input_repo.write(repo.raw_repo) 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_tag_test.py:463: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmpz4b_jfmk/.git/'), record = {} 485s 485s def write(self, repo, record=None): 485s replace_placeholders(self) 485s record = record or dict() 485s written_commits = [ 485s commit.write(repo=repo, record=record) 485s for commit 485s in self.commit_list 485s ] 485s for name, target in self.branches.items(): 485s repo.create_branch( 485s name, 485s repo.get(target.write(repo)).peel(pygit2.Commit), 485s ) 485s for name, target in self.tags.items(): 485s repo.create_tag( 485s name, 485s target.write(repo), 485s > pygit2.GIT_OBJ_COMMIT, 485s self.tagger.signature, 485s 'Tag message', 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 485s ----------------------------- Captured stdout call ----------------------------- 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s ----------------------------- Captured stderr call ----------------------------- 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s _ test_import_unapplied_spi_tags[input_repo3-expected_output_refs3-validation_repo_delta3-validation_repo_expected_identical_refs3-False] _ 485s 485s get_import_commit_msg_mock = 485s get_import_tag_msg_mock = 485s repo = 485s input_repo = 485s 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'] 485s validation_repo_delta = {'add_commits': [], 'update_branches': {'importer/ubuntu/trusty': ...er object at 0xe8699e88>, 'importer/reimport/import/1-1/1': }} 485s 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'] 485s reuse = False 485s 485s @pytest.mark.parametrize( 485s [ 485s 'input_repo', 485s 'expected_output_refs', 485s 'validation_repo_delta', 485s 'validation_repo_expected_identical_refs', 485s 'reuse', 485s ], 485s [ 485s # 1) An existing import tag (or reimport tag) with the same Git tree 485s # - Reuse import tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[Commit.from_spec(name='import')], 485s branches={ 485s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 485s }, 485s tags={'importer/import/1-1': Placeholder('import')}, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s ], 485s # validation_repo_delta: 485s { 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('import'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty-proposed', 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s ], 485s # reuse: 485s True, 485s ), 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec( 485s name='import', 485s mutate='import tag contents', 485s ), 485s Commit.from_spec(name='reimport'), 485s ], 485s branches={ 485s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 485s }, 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 485s }, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s ], 485s # validation_repo_delta: 485s { 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('reimport'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty-proposed', 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s # reuse: 485s True, 485s ), 485s 485s # 2) An existing import tag with a different Git tree and an existing 485s # upload tag with the same Git tree 485s # - Reuse upload tag, create reimport tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec( 485s name='import', 485s mutate='The import tag contents', 485s ), 485s Commit.from_spec(name='upload'), 485s ], 485s branches={ 485s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 485s }, 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/upload/1-1': Placeholder('upload'), 485s }, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'update_tags': { 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('upload'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('upload'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty-proposed', 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/upload/1-1', 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s # reuse: 485s True, 485s ), 485s 485s # 3) An existing import tag with a different Git tree and an existing 485s # upload tag with a different Git tree 485s # - Create reimport tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec( 485s name='import', 485s mutate='The import tag contents', 485s ), 485s Commit.from_spec( 485s name='upload', 485s mutate='The upload tag contents', 485s ), 485s ], 485s branches={ 485s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 485s }, 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/upload/1-1': Placeholder('upload'), 485s }, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/changelog', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'add_commits': [Commit.from_spec( 485s name='reimport', 485s message='Test commit (new)', 485s )], 485s 'update_tags': { 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('reimport'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty-proposed', 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/upload/1-1', 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s # reuse: 485s False, 485s ), 485s 485s # 4) An existing import tag with a different Git tree and no upload tag 485s # - Create reimport tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec( 485s name='import', 485s mutate='The import tag contents', 485s ), 485s ], 485s branches={ 485s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 485s }, 485s tags={'importer/import/1-1': Placeholder('import')}, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/changelog', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'add_commits': [Commit.from_spec( 485s name='reimport', 485s message='Test commit (new)', 485s )], 485s 'update_tags': { 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('reimport'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty-proposed', 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s # reuse: 485s False, 485s ), 485s 485s # 5) No import tag and an existing upload tag with the same Git tree 485s # - Reuse upload tag, create import tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[Commit.from_spec(name='upload')], 485s tags={'importer/upload/1-1': Placeholder('upload')}, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'update_tags': { 485s 'importer/import/1-1': Placeholder('upload'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('upload'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/upload/1-1', 485s ], 485s # reuse: 485s True, 485s ), 485s 485s # 6) No import tag and an existing upload tag with a different Git tree 485s # - Create import tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec( 485s name='upload', 485s mutate='The upload tag contents', 485s ), 485s ], 485s tags={'importer/upload/1-1': Placeholder('upload')}, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/changelog', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'add_commits': [ 485s Commit.from_spec( 485s name='publish', 485s message='Test commit (new)', 485s ), 485s ], 485s 'update_tags': { 485s 'importer/import/1-1': Placeholder('publish'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('publish'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/upload/1-1', 485s ], 485s # reuse: 485s False, 485s ), 485s 485s # 7) No import tags or upload tags 485s # - Create import tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo(), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/changelog', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'add_commits': [ 485s Commit.from_spec( 485s name='publish', 485s message='Test commit (new)', 485s ), 485s ], 485s 'update_tags': { 485s 'importer/import/1-1': Placeholder('publish'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('publish'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1' 485s ], 485s # reuse: 485s False, 485s ), 485s ] 485s ) 485s @patch('gitubuntu.importer.get_import_tag_msg') 485s @patch('gitubuntu.importer.get_import_commit_msg') 485s def test_import_unapplied_spi_tags( 485s get_import_commit_msg_mock, 485s get_import_tag_msg_mock, 485s repo, 485s input_repo, 485s expected_output_refs, 485s validation_repo_delta, 485s validation_repo_expected_identical_refs, 485s reuse, 485s ): 485s """Test that unapplied tags are correctly created, adjusted and/or reused 485s 485s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 485s that determines the commit message to use for a given import 485s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 485s that determines the tag message to use for a given import 485s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 485s temporary output repository 485s :param repo_builder.Repo input_repo: input repository data 485s :param list(str) expected_output_refs: refs that must exist in the output 485s repository 485s :param dict validation_repo_delta: how to transform the input 485s repository into a "validation repository", expressed as a dict to 485s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 485s input repository. The validation repository is then used for the 485s purposes of comparison against the output repository. 485s :param list(str) validation_repo_expected_identical_refs: refs that must be 485s identical between the validation repository and the output repository 485s :param bool reuse: if set, the output ref importer/ubuntu/trusty must be 485s one supplied by the input repository (assumed to have a commit message 485s of "Test commit") and not one created by the importer in this run 485s (arranged by this test to have a different commit message) 485s 485s The input repository data is written into the output repository and then a 485s fake non-native source package publication of version 1-1 in the Trusty 485s release pocket is imported into it by calling import_unapplied_spi() 485s directly. expected_output_refs, validation_repo_expected_identical_refs and 485s reuse are then asserted. It is further asserted that no other refs exist in 485s the output repository except for those listed in expected_output_refs and 485s validation_repo_expected_identical_refs. 485s """ 485s # Match the repo_builder objects 485s get_import_tag_msg_mock.return_value = 'Test tag' 485s # Importantly, the following commit message must not be the same as the 485s # commit messages used by the test input repository commits, so that we can 485s # later detect the difference between commits that were already there and 485s # new commits created by the importer for the purposes of asserting the 485s # reuse parameter correctly. 485s get_import_commit_msg_mock.return_value = b'Test commit (new)' 485s 485s > input_repo.write(repo.raw_repo) 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_tag_test.py:463: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmpj9h2fizm/.git/'), record = {} 485s 485s def write(self, repo, record=None): 485s replace_placeholders(self) 485s record = record or dict() 485s written_commits = [ 485s commit.write(repo=repo, record=record) 485s for commit 485s in self.commit_list 485s ] 485s for name, target in self.branches.items(): 485s repo.create_branch( 485s name, 485s repo.get(target.write(repo)).peel(pygit2.Commit), 485s ) 485s for name, target in self.tags.items(): 485s repo.create_tag( 485s name, 485s target.write(repo), 485s > pygit2.GIT_OBJ_COMMIT, 485s self.tagger.signature, 485s 'Tag message', 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 485s ----------------------------- Captured stdout call ----------------------------- 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s ----------------------------- Captured stderr call ----------------------------- 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s _ test_import_unapplied_spi_tags[input_repo4-expected_output_refs4-validation_repo_delta4-validation_repo_expected_identical_refs4-False] _ 485s 485s get_import_commit_msg_mock = 485s get_import_tag_msg_mock = 485s repo = 485s input_repo = 485s 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'] 485s validation_repo_delta = {'add_commits': [], 'update_branches': {'importer/ubuntu/trusty': ...er object at 0xe867e060>, 'importer/reimport/import/1-1/1': }} 485s 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'] 485s reuse = False 485s 485s @pytest.mark.parametrize( 485s [ 485s 'input_repo', 485s 'expected_output_refs', 485s 'validation_repo_delta', 485s 'validation_repo_expected_identical_refs', 485s 'reuse', 485s ], 485s [ 485s # 1) An existing import tag (or reimport tag) with the same Git tree 485s # - Reuse import tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[Commit.from_spec(name='import')], 485s branches={ 485s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 485s }, 485s tags={'importer/import/1-1': Placeholder('import')}, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s ], 485s # validation_repo_delta: 485s { 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('import'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty-proposed', 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s ], 485s # reuse: 485s True, 485s ), 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec( 485s name='import', 485s mutate='import tag contents', 485s ), 485s Commit.from_spec(name='reimport'), 485s ], 485s branches={ 485s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 485s }, 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 485s }, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s ], 485s # validation_repo_delta: 485s { 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('reimport'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty-proposed', 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s # reuse: 485s True, 485s ), 485s 485s # 2) An existing import tag with a different Git tree and an existing 485s # upload tag with the same Git tree 485s # - Reuse upload tag, create reimport tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec( 485s name='import', 485s mutate='The import tag contents', 485s ), 485s Commit.from_spec(name='upload'), 485s ], 485s branches={ 485s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 485s }, 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/upload/1-1': Placeholder('upload'), 485s }, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'update_tags': { 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('upload'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('upload'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty-proposed', 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/upload/1-1', 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s # reuse: 485s True, 485s ), 485s 485s # 3) An existing import tag with a different Git tree and an existing 485s # upload tag with a different Git tree 485s # - Create reimport tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec( 485s name='import', 485s mutate='The import tag contents', 485s ), 485s Commit.from_spec( 485s name='upload', 485s mutate='The upload tag contents', 485s ), 485s ], 485s branches={ 485s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 485s }, 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/upload/1-1': Placeholder('upload'), 485s }, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/changelog', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'add_commits': [Commit.from_spec( 485s name='reimport', 485s message='Test commit (new)', 485s )], 485s 'update_tags': { 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('reimport'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty-proposed', 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/upload/1-1', 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s # reuse: 485s False, 485s ), 485s 485s # 4) An existing import tag with a different Git tree and no upload tag 485s # - Create reimport tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec( 485s name='import', 485s mutate='The import tag contents', 485s ), 485s ], 485s branches={ 485s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 485s }, 485s tags={'importer/import/1-1': Placeholder('import')}, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/changelog', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'add_commits': [Commit.from_spec( 485s name='reimport', 485s message='Test commit (new)', 485s )], 485s 'update_tags': { 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('reimport'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty-proposed', 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s # reuse: 485s False, 485s ), 485s 485s # 5) No import tag and an existing upload tag with the same Git tree 485s # - Reuse upload tag, create import tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[Commit.from_spec(name='upload')], 485s tags={'importer/upload/1-1': Placeholder('upload')}, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'update_tags': { 485s 'importer/import/1-1': Placeholder('upload'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('upload'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/upload/1-1', 485s ], 485s # reuse: 485s True, 485s ), 485s 485s # 6) No import tag and an existing upload tag with a different Git tree 485s # - Create import tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec( 485s name='upload', 485s mutate='The upload tag contents', 485s ), 485s ], 485s tags={'importer/upload/1-1': Placeholder('upload')}, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/changelog', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'add_commits': [ 485s Commit.from_spec( 485s name='publish', 485s message='Test commit (new)', 485s ), 485s ], 485s 'update_tags': { 485s 'importer/import/1-1': Placeholder('publish'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('publish'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/upload/1-1', 485s ], 485s # reuse: 485s False, 485s ), 485s 485s # 7) No import tags or upload tags 485s # - Create import tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo(), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/changelog', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'add_commits': [ 485s Commit.from_spec( 485s name='publish', 485s message='Test commit (new)', 485s ), 485s ], 485s 'update_tags': { 485s 'importer/import/1-1': Placeholder('publish'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('publish'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1' 485s ], 485s # reuse: 485s False, 485s ), 485s ] 485s ) 485s @patch('gitubuntu.importer.get_import_tag_msg') 485s @patch('gitubuntu.importer.get_import_commit_msg') 485s def test_import_unapplied_spi_tags( 485s get_import_commit_msg_mock, 485s get_import_tag_msg_mock, 485s repo, 485s input_repo, 485s expected_output_refs, 485s validation_repo_delta, 485s validation_repo_expected_identical_refs, 485s reuse, 485s ): 485s """Test that unapplied tags are correctly created, adjusted and/or reused 485s 485s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 485s that determines the commit message to use for a given import 485s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 485s that determines the tag message to use for a given import 485s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 485s temporary output repository 485s :param repo_builder.Repo input_repo: input repository data 485s :param list(str) expected_output_refs: refs that must exist in the output 485s repository 485s :param dict validation_repo_delta: how to transform the input 485s repository into a "validation repository", expressed as a dict to 485s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 485s input repository. The validation repository is then used for the 485s purposes of comparison against the output repository. 485s :param list(str) validation_repo_expected_identical_refs: refs that must be 485s identical between the validation repository and the output repository 485s :param bool reuse: if set, the output ref importer/ubuntu/trusty must be 485s one supplied by the input repository (assumed to have a commit message 485s of "Test commit") and not one created by the importer in this run 485s (arranged by this test to have a different commit message) 485s 485s The input repository data is written into the output repository and then a 485s fake non-native source package publication of version 1-1 in the Trusty 485s release pocket is imported into it by calling import_unapplied_spi() 485s directly. expected_output_refs, validation_repo_expected_identical_refs and 485s reuse are then asserted. It is further asserted that no other refs exist in 485s the output repository except for those listed in expected_output_refs and 485s validation_repo_expected_identical_refs. 485s """ 485s # Match the repo_builder objects 485s get_import_tag_msg_mock.return_value = 'Test tag' 485s # Importantly, the following commit message must not be the same as the 485s # commit messages used by the test input repository commits, so that we can 485s # later detect the difference between commits that were already there and 485s # new commits created by the importer for the purposes of asserting the 485s # reuse parameter correctly. 485s get_import_commit_msg_mock.return_value = b'Test commit (new)' 485s 485s > input_repo.write(repo.raw_repo) 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_tag_test.py:463: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmpcip_6lie/.git/'), record = {} 485s 485s def write(self, repo, record=None): 485s replace_placeholders(self) 485s record = record or dict() 485s written_commits = [ 485s commit.write(repo=repo, record=record) 485s for commit 485s in self.commit_list 485s ] 485s for name, target in self.branches.items(): 485s repo.create_branch( 485s name, 485s repo.get(target.write(repo)).peel(pygit2.Commit), 485s ) 485s for name, target in self.tags.items(): 485s repo.create_tag( 485s name, 485s target.write(repo), 485s > pygit2.GIT_OBJ_COMMIT, 485s self.tagger.signature, 485s 'Tag message', 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 485s ----------------------------- Captured stdout call ----------------------------- 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s ----------------------------- Captured stderr call ----------------------------- 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s _ test_import_unapplied_spi_tags[input_repo5-expected_output_refs5-validation_repo_delta5-validation_repo_expected_identical_refs5-True] _ 485s 485s get_import_commit_msg_mock = 485s get_import_tag_msg_mock = 485s repo = 485s input_repo = 485s 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'] 485s validation_repo_delta = {'update_branches': {'importer/ubuntu/trusty': }, 'update_tags': {'importer/import/1-1': }} 485s validation_repo_expected_identical_refs = ['refs/heads/importer/ubuntu/trusty', 'refs/tags/importer/import/1-1', 'refs/tags/importer/upload/1-1'] 485s reuse = True 485s 485s @pytest.mark.parametrize( 485s [ 485s 'input_repo', 485s 'expected_output_refs', 485s 'validation_repo_delta', 485s 'validation_repo_expected_identical_refs', 485s 'reuse', 485s ], 485s [ 485s # 1) An existing import tag (or reimport tag) with the same Git tree 485s # - Reuse import tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[Commit.from_spec(name='import')], 485s branches={ 485s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 485s }, 485s tags={'importer/import/1-1': Placeholder('import')}, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s ], 485s # validation_repo_delta: 485s { 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('import'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty-proposed', 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s ], 485s # reuse: 485s True, 485s ), 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec( 485s name='import', 485s mutate='import tag contents', 485s ), 485s Commit.from_spec(name='reimport'), 485s ], 485s branches={ 485s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 485s }, 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 485s }, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s ], 485s # validation_repo_delta: 485s { 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('reimport'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty-proposed', 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s # reuse: 485s True, 485s ), 485s 485s # 2) An existing import tag with a different Git tree and an existing 485s # upload tag with the same Git tree 485s # - Reuse upload tag, create reimport tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec( 485s name='import', 485s mutate='The import tag contents', 485s ), 485s Commit.from_spec(name='upload'), 485s ], 485s branches={ 485s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 485s }, 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/upload/1-1': Placeholder('upload'), 485s }, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'update_tags': { 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('upload'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('upload'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty-proposed', 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/upload/1-1', 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s # reuse: 485s True, 485s ), 485s 485s # 3) An existing import tag with a different Git tree and an existing 485s # upload tag with a different Git tree 485s # - Create reimport tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec( 485s name='import', 485s mutate='The import tag contents', 485s ), 485s Commit.from_spec( 485s name='upload', 485s mutate='The upload tag contents', 485s ), 485s ], 485s branches={ 485s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 485s }, 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/upload/1-1': Placeholder('upload'), 485s }, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/changelog', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'add_commits': [Commit.from_spec( 485s name='reimport', 485s message='Test commit (new)', 485s )], 485s 'update_tags': { 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('reimport'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty-proposed', 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/upload/1-1', 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s # reuse: 485s False, 485s ), 485s 485s # 4) An existing import tag with a different Git tree and no upload tag 485s # - Create reimport tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec( 485s name='import', 485s mutate='The import tag contents', 485s ), 485s ], 485s branches={ 485s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 485s }, 485s tags={'importer/import/1-1': Placeholder('import')}, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/changelog', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'add_commits': [Commit.from_spec( 485s name='reimport', 485s message='Test commit (new)', 485s )], 485s 'update_tags': { 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('reimport'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty-proposed', 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s # reuse: 485s False, 485s ), 485s 485s # 5) No import tag and an existing upload tag with the same Git tree 485s # - Reuse upload tag, create import tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[Commit.from_spec(name='upload')], 485s tags={'importer/upload/1-1': Placeholder('upload')}, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'update_tags': { 485s 'importer/import/1-1': Placeholder('upload'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('upload'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/upload/1-1', 485s ], 485s # reuse: 485s True, 485s ), 485s 485s # 6) No import tag and an existing upload tag with a different Git tree 485s # - Create import tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec( 485s name='upload', 485s mutate='The upload tag contents', 485s ), 485s ], 485s tags={'importer/upload/1-1': Placeholder('upload')}, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/changelog', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'add_commits': [ 485s Commit.from_spec( 485s name='publish', 485s message='Test commit (new)', 485s ), 485s ], 485s 'update_tags': { 485s 'importer/import/1-1': Placeholder('publish'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('publish'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/upload/1-1', 485s ], 485s # reuse: 485s False, 485s ), 485s 485s # 7) No import tags or upload tags 485s # - Create import tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo(), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/changelog', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'add_commits': [ 485s Commit.from_spec( 485s name='publish', 485s message='Test commit (new)', 485s ), 485s ], 485s 'update_tags': { 485s 'importer/import/1-1': Placeholder('publish'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('publish'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1' 485s ], 485s # reuse: 485s False, 485s ), 485s ] 485s ) 485s @patch('gitubuntu.importer.get_import_tag_msg') 485s @patch('gitubuntu.importer.get_import_commit_msg') 485s def test_import_unapplied_spi_tags( 485s get_import_commit_msg_mock, 485s get_import_tag_msg_mock, 485s repo, 485s input_repo, 485s expected_output_refs, 485s validation_repo_delta, 485s validation_repo_expected_identical_refs, 485s reuse, 485s ): 485s """Test that unapplied tags are correctly created, adjusted and/or reused 485s 485s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 485s that determines the commit message to use for a given import 485s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 485s that determines the tag message to use for a given import 485s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 485s temporary output repository 485s :param repo_builder.Repo input_repo: input repository data 485s :param list(str) expected_output_refs: refs that must exist in the output 485s repository 485s :param dict validation_repo_delta: how to transform the input 485s repository into a "validation repository", expressed as a dict to 485s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 485s input repository. The validation repository is then used for the 485s purposes of comparison against the output repository. 485s :param list(str) validation_repo_expected_identical_refs: refs that must be 485s identical between the validation repository and the output repository 485s :param bool reuse: if set, the output ref importer/ubuntu/trusty must be 485s one supplied by the input repository (assumed to have a commit message 485s of "Test commit") and not one created by the importer in this run 485s (arranged by this test to have a different commit message) 485s 485s The input repository data is written into the output repository and then a 485s fake non-native source package publication of version 1-1 in the Trusty 485s release pocket is imported into it by calling import_unapplied_spi() 485s directly. expected_output_refs, validation_repo_expected_identical_refs and 485s reuse are then asserted. It is further asserted that no other refs exist in 485s the output repository except for those listed in expected_output_refs and 485s validation_repo_expected_identical_refs. 485s """ 485s # Match the repo_builder objects 485s get_import_tag_msg_mock.return_value = 'Test tag' 485s # Importantly, the following commit message must not be the same as the 485s # commit messages used by the test input repository commits, so that we can 485s # later detect the difference between commits that were already there and 485s # new commits created by the importer for the purposes of asserting the 485s # reuse parameter correctly. 485s get_import_commit_msg_mock.return_value = b'Test commit (new)' 485s 485s > input_repo.write(repo.raw_repo) 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_tag_test.py:463: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmpkmsp8sc2/.git/'), record = {} 485s 485s def write(self, repo, record=None): 485s replace_placeholders(self) 485s record = record or dict() 485s written_commits = [ 485s commit.write(repo=repo, record=record) 485s for commit 485s in self.commit_list 485s ] 485s for name, target in self.branches.items(): 485s repo.create_branch( 485s name, 485s repo.get(target.write(repo)).peel(pygit2.Commit), 485s ) 485s for name, target in self.tags.items(): 485s repo.create_tag( 485s name, 485s target.write(repo), 485s > pygit2.GIT_OBJ_COMMIT, 485s self.tagger.signature, 485s 'Tag message', 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 485s ----------------------------- Captured stdout call ----------------------------- 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s ----------------------------- Captured stderr call ----------------------------- 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s _ test_import_unapplied_spi_tags[input_repo6-expected_output_refs6-validation_repo_delta6-validation_repo_expected_identical_refs6-False] _ 485s 485s get_import_commit_msg_mock = 485s get_import_tag_msg_mock = 485s repo = 485s input_repo = 485s 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'] 485s validation_repo_delta = {'add_commits': [], 'update_branches': {'importer/ubuntu/trusty': ...ect at 0xe867e468>}, 'update_tags': {'importer/import/1-1': }} 485s validation_repo_expected_identical_refs = ['refs/heads/importer/ubuntu/trusty', 'refs/tags/importer/import/1-1', 'refs/tags/importer/upload/1-1'] 485s reuse = False 485s 485s @pytest.mark.parametrize( 485s [ 485s 'input_repo', 485s 'expected_output_refs', 485s 'validation_repo_delta', 485s 'validation_repo_expected_identical_refs', 485s 'reuse', 485s ], 485s [ 485s # 1) An existing import tag (or reimport tag) with the same Git tree 485s # - Reuse import tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[Commit.from_spec(name='import')], 485s branches={ 485s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 485s }, 485s tags={'importer/import/1-1': Placeholder('import')}, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s ], 485s # validation_repo_delta: 485s { 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('import'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty-proposed', 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s ], 485s # reuse: 485s True, 485s ), 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec( 485s name='import', 485s mutate='import tag contents', 485s ), 485s Commit.from_spec(name='reimport'), 485s ], 485s branches={ 485s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 485s }, 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 485s }, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s ], 485s # validation_repo_delta: 485s { 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('reimport'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty-proposed', 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s # reuse: 485s True, 485s ), 485s 485s # 2) An existing import tag with a different Git tree and an existing 485s # upload tag with the same Git tree 485s # - Reuse upload tag, create reimport tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec( 485s name='import', 485s mutate='The import tag contents', 485s ), 485s Commit.from_spec(name='upload'), 485s ], 485s branches={ 485s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 485s }, 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/upload/1-1': Placeholder('upload'), 485s }, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'update_tags': { 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('upload'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('upload'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty-proposed', 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/upload/1-1', 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s # reuse: 485s True, 485s ), 485s 485s # 3) An existing import tag with a different Git tree and an existing 485s # upload tag with a different Git tree 485s # - Create reimport tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec( 485s name='import', 485s mutate='The import tag contents', 485s ), 485s Commit.from_spec( 485s name='upload', 485s mutate='The upload tag contents', 485s ), 485s ], 485s branches={ 485s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 485s }, 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/upload/1-1': Placeholder('upload'), 485s }, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/changelog', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'add_commits': [Commit.from_spec( 485s name='reimport', 485s message='Test commit (new)', 485s )], 485s 'update_tags': { 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('reimport'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty-proposed', 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/upload/1-1', 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s # reuse: 485s False, 485s ), 485s 485s # 4) An existing import tag with a different Git tree and no upload tag 485s # - Create reimport tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec( 485s name='import', 485s mutate='The import tag contents', 485s ), 485s ], 485s branches={ 485s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 485s }, 485s tags={'importer/import/1-1': Placeholder('import')}, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/changelog', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'add_commits': [Commit.from_spec( 485s name='reimport', 485s message='Test commit (new)', 485s )], 485s 'update_tags': { 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('reimport'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty-proposed', 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s # reuse: 485s False, 485s ), 485s 485s # 5) No import tag and an existing upload tag with the same Git tree 485s # - Reuse upload tag, create import tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[Commit.from_spec(name='upload')], 485s tags={'importer/upload/1-1': Placeholder('upload')}, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'update_tags': { 485s 'importer/import/1-1': Placeholder('upload'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('upload'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/upload/1-1', 485s ], 485s # reuse: 485s True, 485s ), 485s 485s # 6) No import tag and an existing upload tag with a different Git tree 485s # - Create import tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec( 485s name='upload', 485s mutate='The upload tag contents', 485s ), 485s ], 485s tags={'importer/upload/1-1': Placeholder('upload')}, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/changelog', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'add_commits': [ 485s Commit.from_spec( 485s name='publish', 485s message='Test commit (new)', 485s ), 485s ], 485s 'update_tags': { 485s 'importer/import/1-1': Placeholder('publish'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('publish'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/upload/1-1', 485s ], 485s # reuse: 485s False, 485s ), 485s 485s # 7) No import tags or upload tags 485s # - Create import tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo(), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/changelog', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'add_commits': [ 485s Commit.from_spec( 485s name='publish', 485s message='Test commit (new)', 485s ), 485s ], 485s 'update_tags': { 485s 'importer/import/1-1': Placeholder('publish'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('publish'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1' 485s ], 485s # reuse: 485s False, 485s ), 485s ] 485s ) 485s @patch('gitubuntu.importer.get_import_tag_msg') 485s @patch('gitubuntu.importer.get_import_commit_msg') 485s def test_import_unapplied_spi_tags( 485s get_import_commit_msg_mock, 485s get_import_tag_msg_mock, 485s repo, 485s input_repo, 485s expected_output_refs, 485s validation_repo_delta, 485s validation_repo_expected_identical_refs, 485s reuse, 485s ): 485s """Test that unapplied tags are correctly created, adjusted and/or reused 485s 485s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 485s that determines the commit message to use for a given import 485s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 485s that determines the tag message to use for a given import 485s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 485s temporary output repository 485s :param repo_builder.Repo input_repo: input repository data 485s :param list(str) expected_output_refs: refs that must exist in the output 485s repository 485s :param dict validation_repo_delta: how to transform the input 485s repository into a "validation repository", expressed as a dict to 485s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 485s input repository. The validation repository is then used for the 485s purposes of comparison against the output repository. 485s :param list(str) validation_repo_expected_identical_refs: refs that must be 485s identical between the validation repository and the output repository 485s :param bool reuse: if set, the output ref importer/ubuntu/trusty must be 485s one supplied by the input repository (assumed to have a commit message 485s of "Test commit") and not one created by the importer in this run 485s (arranged by this test to have a different commit message) 485s 485s The input repository data is written into the output repository and then a 485s fake non-native source package publication of version 1-1 in the Trusty 485s release pocket is imported into it by calling import_unapplied_spi() 485s directly. expected_output_refs, validation_repo_expected_identical_refs and 485s reuse are then asserted. It is further asserted that no other refs exist in 485s the output repository except for those listed in expected_output_refs and 485s validation_repo_expected_identical_refs. 485s """ 485s # Match the repo_builder objects 485s get_import_tag_msg_mock.return_value = 'Test tag' 485s # Importantly, the following commit message must not be the same as the 485s # commit messages used by the test input repository commits, so that we can 485s # later detect the difference between commits that were already there and 485s # new commits created by the importer for the purposes of asserting the 485s # reuse parameter correctly. 485s get_import_commit_msg_mock.return_value = b'Test commit (new)' 485s 485s > input_repo.write(repo.raw_repo) 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_tag_test.py:463: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmpw1tmxn6u/.git/'), record = {} 485s 485s def write(self, repo, record=None): 485s replace_placeholders(self) 485s record = record or dict() 485s written_commits = [ 485s commit.write(repo=repo, record=record) 485s for commit 485s in self.commit_list 485s ] 485s for name, target in self.branches.items(): 485s repo.create_branch( 485s name, 485s repo.get(target.write(repo)).peel(pygit2.Commit), 485s ) 485s for name, target in self.tags.items(): 485s repo.create_tag( 485s name, 485s target.write(repo), 485s > pygit2.GIT_OBJ_COMMIT, 485s self.tagger.signature, 485s 'Tag message', 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 485s ----------------------------- Captured stdout call ----------------------------- 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s ----------------------------- Captured stderr call ----------------------------- 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s _ test_import_unapplied_spi_tags[input_repo7-expected_output_refs7-validation_repo_delta7-validation_repo_expected_identical_refs7-False] _ 485s 485s get_import_commit_msg_mock = 485s get_import_tag_msg_mock = 485s repo = 485s input_repo = 485s 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'] 485s validation_repo_delta = {'add_commits': [], 'update_branches': {'importer/ubuntu/trusty': ...ect at 0xe867e5a0>}, 'update_tags': {'importer/import/1-1': }} 485s validation_repo_expected_identical_refs = ['refs/heads/importer/ubuntu/trusty', 'refs/tags/importer/import/1-1'] 485s reuse = False 485s 485s @pytest.mark.parametrize( 485s [ 485s 'input_repo', 485s 'expected_output_refs', 485s 'validation_repo_delta', 485s 'validation_repo_expected_identical_refs', 485s 'reuse', 485s ], 485s [ 485s # 1) An existing import tag (or reimport tag) with the same Git tree 485s # - Reuse import tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[Commit.from_spec(name='import')], 485s branches={ 485s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 485s }, 485s tags={'importer/import/1-1': Placeholder('import')}, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s ], 485s # validation_repo_delta: 485s { 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('import'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty-proposed', 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s ], 485s # reuse: 485s True, 485s ), 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec( 485s name='import', 485s mutate='import tag contents', 485s ), 485s Commit.from_spec(name='reimport'), 485s ], 485s branches={ 485s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 485s }, 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 485s }, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s ], 485s # validation_repo_delta: 485s { 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('reimport'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty-proposed', 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s # reuse: 485s True, 485s ), 485s 485s # 2) An existing import tag with a different Git tree and an existing 485s # upload tag with the same Git tree 485s # - Reuse upload tag, create reimport tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec( 485s name='import', 485s mutate='The import tag contents', 485s ), 485s Commit.from_spec(name='upload'), 485s ], 485s branches={ 485s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 485s }, 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/upload/1-1': Placeholder('upload'), 485s }, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'update_tags': { 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('upload'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('upload'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty-proposed', 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/upload/1-1', 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s # reuse: 485s True, 485s ), 485s 485s # 3) An existing import tag with a different Git tree and an existing 485s # upload tag with a different Git tree 485s # - Create reimport tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec( 485s name='import', 485s mutate='The import tag contents', 485s ), 485s Commit.from_spec( 485s name='upload', 485s mutate='The upload tag contents', 485s ), 485s ], 485s branches={ 485s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 485s }, 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/upload/1-1': Placeholder('upload'), 485s }, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/changelog', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'add_commits': [Commit.from_spec( 485s name='reimport', 485s message='Test commit (new)', 485s )], 485s 'update_tags': { 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('reimport'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty-proposed', 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/upload/1-1', 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s # reuse: 485s False, 485s ), 485s 485s # 4) An existing import tag with a different Git tree and no upload tag 485s # - Create reimport tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec( 485s name='import', 485s mutate='The import tag contents', 485s ), 485s ], 485s branches={ 485s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 485s }, 485s tags={'importer/import/1-1': Placeholder('import')}, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/changelog', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'add_commits': [Commit.from_spec( 485s name='reimport', 485s message='Test commit (new)', 485s )], 485s 'update_tags': { 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('reimport'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty-proposed', 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s # reuse: 485s False, 485s ), 485s 485s # 5) No import tag and an existing upload tag with the same Git tree 485s # - Reuse upload tag, create import tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[Commit.from_spec(name='upload')], 485s tags={'importer/upload/1-1': Placeholder('upload')}, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'update_tags': { 485s 'importer/import/1-1': Placeholder('upload'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('upload'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/upload/1-1', 485s ], 485s # reuse: 485s True, 485s ), 485s 485s # 6) No import tag and an existing upload tag with a different Git tree 485s # - Create import tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec( 485s name='upload', 485s mutate='The upload tag contents', 485s ), 485s ], 485s tags={'importer/upload/1-1': Placeholder('upload')}, 485s ), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/changelog', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'add_commits': [ 485s Commit.from_spec( 485s name='publish', 485s message='Test commit (new)', 485s ), 485s ], 485s 'update_tags': { 485s 'importer/import/1-1': Placeholder('publish'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('publish'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/upload/1-1', 485s ], 485s # reuse: 485s False, 485s ), 485s 485s # 7) No import tags or upload tags 485s # - Create import tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo(), 485s # expected_output_refs: 485s [ 485s 'refs/heads/do-not-push', 485s 'refs/tags/importer/upstream/ubuntu/1.gz', 485s 'refs/heads/importer/importer/ubuntu/dsc', 485s 'refs/heads/importer/importer/ubuntu/pristine-tar', 485s 'refs/notes/importer/changelog', 485s 'refs/notes/importer/importer', 485s ], 485s # validation_repo_delta: 485s { 485s 'add_commits': [ 485s Commit.from_spec( 485s name='publish', 485s message='Test commit (new)', 485s ), 485s ], 485s 'update_tags': { 485s 'importer/import/1-1': Placeholder('publish'), 485s }, 485s 'update_branches': { 485s 'importer/ubuntu/trusty': Placeholder('publish'), 485s }, 485s }, 485s # validation_repo_expected_identical_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1' 485s ], 485s # reuse: 485s False, 485s ), 485s ] 485s ) 485s @patch('gitubuntu.importer.get_import_tag_msg') 485s @patch('gitubuntu.importer.get_import_commit_msg') 485s def test_import_unapplied_spi_tags( 485s get_import_commit_msg_mock, 485s get_import_tag_msg_mock, 485s repo, 485s input_repo, 485s expected_output_refs, 485s validation_repo_delta, 485s validation_repo_expected_identical_refs, 485s reuse, 485s ): 485s """Test that unapplied tags are correctly created, adjusted and/or reused 485s 485s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 485s that determines the commit message to use for a given import 485s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 485s that determines the tag message to use for a given import 485s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 485s temporary output repository 485s :param repo_builder.Repo input_repo: input repository data 485s :param list(str) expected_output_refs: refs that must exist in the output 485s repository 485s :param dict validation_repo_delta: how to transform the input 485s repository into a "validation repository", expressed as a dict to 485s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 485s input repository. The validation repository is then used for the 485s purposes of comparison against the output repository. 485s :param list(str) validation_repo_expected_identical_refs: refs that must be 485s identical between the validation repository and the output repository 485s :param bool reuse: if set, the output ref importer/ubuntu/trusty must be 485s one supplied by the input repository (assumed to have a commit message 485s of "Test commit") and not one created by the importer in this run 485s (arranged by this test to have a different commit message) 485s 485s The input repository data is written into the output repository and then a 485s fake non-native source package publication of version 1-1 in the Trusty 485s release pocket is imported into it by calling import_unapplied_spi() 485s directly. expected_output_refs, validation_repo_expected_identical_refs and 485s reuse are then asserted. It is further asserted that no other refs exist in 485s the output repository except for those listed in expected_output_refs and 485s validation_repo_expected_identical_refs. 485s """ 485s # Match the repo_builder objects 485s get_import_tag_msg_mock.return_value = 'Test tag' 485s # Importantly, the following commit message must not be the same as the 485s # commit messages used by the test input repository commits, so that we can 485s # later detect the difference between commits that were already there and 485s # new commits created by the importer for the purposes of asserting the 485s # reuse parameter correctly. 485s get_import_commit_msg_mock.return_value = b'Test commit (new)' 485s 485s input_repo.write(repo.raw_repo) 485s 485s publish_spec = source_builder.SourceSpec( 485s version='1-1', 485s native=False, 485s ) 485s 485s with source_builder.Source(publish_spec) as dsc_path: 485s > target.import_unapplied_spi( 485s repo=repo, 485s spi=MockSPI(dsc_path, publish_spec.version), 485s namespace='importer', 485s skip_orig=False, 485s parent_overrides={}, 485s ) 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_tag_test.py:471: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer.py:2308: in import_unapplied_spi 485s import_unapplied_dsc( 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer.py:2230: in import_unapplied_dsc 485s commit, tag = find_or_create_unapplied_commit( 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer.py:2052: in find_or_create_unapplied_commit 485s changelog_parents = get_unapplied_import_parents( 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer.py:1503: in get_unapplied_import_parents 485s import_tree_versions = repo.get_all_changelog_versions_from_treeish( 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:2230: in get_all_changelog_versions_from_treeish 485s changelog = self.get_changelog_from_treeish(treeish) 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 485s return Changelog.from_treeish( 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:569: in from_treeish 485s blob = follow_symlinks_to_blob( 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 485s return _follow_symlinks_to_blob( 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s repo = pygit2.Repository('/tmp/tmpzgbi96m9/.git/') 485s top_tree_object = 485s search_path = 'debian/changelog' 485s _rel_tree = 485s _rel_path = '' 485s 485s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 485s _rel_tree=None, _rel_path='' 485s ): 485s '''Recursively follow a path down a tree, following symlinks, to find blob 485s 485s repo: pygit2.Repository object 485s top_tree: pygit2.Tree object of the top of the tree structure 485s search_path: '/'-separated path string of blob to find 485s _rel_tree: (internal) which tree to look further into 485s _rel_path: (internal) the path we are in so far 485s ''' 485s 485s NORMAL_BLOB_MODES = set([ 485s pygit2.GIT_FILEMODE_BLOB, 485s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 485s ]) 485s 485s _rel_tree = _rel_tree or top_tree_object 485s head, tail = posixpath.split(search_path) 485s 485s # A traditional functional split would put a single entry in head with tail 485s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 485s # to make it appear to have traditional semantics. 485s if not head: 485s head = tail 485s tail = None 485s 485s entry = _rel_tree[head] 485s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:68: AttributeError 485s ----------------------------- Captured stdout call ----------------------------- 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s ----------------------------- Captured stderr call ----------------------------- 485s dpkg-source: warning: missing information for output field Standards-Version 485s _ test_import_applied_spi_tags[input_repo0-validation_repo_delta0-validation_repo_expected_treewise_refs0-True] _ 485s 485s get_import_commit_msg_mock = 485s get_import_tag_msg_mock = 485s repo = 485s input_repo = 485s validation_repo_delta = {} 485s 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'] 485s reuse = True 485s 485s @pytest.mark.parametrize( 485s [ 485s 'input_repo', 485s 'validation_repo_delta', 485s 'validation_repo_expected_treewise_refs', 485s 'reuse', 485s ], 485s [ 485s # 1) An existing applied tag (or reimport tag) with the same Git tree 485s # - Reuse applied tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec(name='unapplied', has_patches=True), 485s Commit.from_spec(name='applied', patches_applied=True), 485s ], 485s branches={ 485s 'importer/ubuntu/trusty': Placeholder('unapplied'), 485s 'importer/applied/ubuntu/trusty': Placeholder('applied'), 485s }, 485s tags={ 485s 'importer/import/1-1': Placeholder('unapplied'), 485s 'importer/applied/1-1': Placeholder('applied'), 485s }, 485s ), 485s # validation_repo_delta: 485s { 485s # no output repository delta 485s }, 485s # validation_repo_expected_treewise_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/heads/importer/applied/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/applied/1-1', 485s ], 485s # reuse: 485s True, 485s ), 485s 485s # 2) An existing applied tag with a different Git tree 485s # - Create reimport tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec( 485s name='unapplied', 485s has_patches=True, 485s mutate='import tag contents', 485s ), 485s Commit.from_spec( 485s name='unapplied_reimport', 485s has_patches=True, 485s ), 485s Commit.from_spec( 485s name='applied', 485s patches_applied=True, 485s mutate='import tag contents', 485s ) 485s ], 485s branches={'importer/ubuntu/trusty': Placeholder('unapplied')}, 485s tags={ 485s 'importer/import/1-1': 485s Placeholder('unapplied'), 485s 'importer/reimport/import/1-1/0': 485s Placeholder('unapplied'), 485s 'importer/reimport/import/1-1/1': 485s Placeholder('unapplied_reimport'), 485s 'importer/applied/1-1': 485s Placeholder('applied'), 485s }, 485s ), 485s # validation_repo_delta: 485s { 485s 'add_commits': [ 485s Commit.from_spec( 485s name='applied_reimport', 485s patches_applied=True, 485s parents=[Placeholder('unapplied_reimport')], 485s ), 485s ], 485s 'update_tags': { 485s 'importer/reimport/applied/1-1/0': 485s Placeholder('applied'), 485s 'importer/reimport/applied/1-1/1': 485s Placeholder('applied_reimport'), 485s }, 485s 'update_branches': { 485s 'importer/applied/ubuntu/trusty': 485s Placeholder('applied_reimport'), 485s }, 485s }, 485s # validation_repo_expected_treewise_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/heads/importer/applied/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s 'refs/tags/importer/applied/1-1', 485s 'refs/tags/importer/reimport/applied/1-1/0', 485s 'refs/tags/importer/reimport/applied/1-1/1', 485s ], 485s # reuse: 485s False, 485s 485s marks=pytest.mark.xfail(reason='LP: #1755247'), 485s ), 485s 485s # 3) No applied tags 485s # - Create applied tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[Commit.from_spec(name='unapplied', has_patches=True)], 485s branches={'importer/ubuntu/trusty': Placeholder('unapplied')}, 485s tags={'importer/import/1-1': Placeholder('unapplied')}, 485s ), 485s # validation_repo_delta: 485s { 485s 'add_commits': [ 485s Commit.from_spec( 485s name='applied', 485s patches_applied=True, 485s parents=[Placeholder('unapplied')], 485s ), 485s ], 485s 'update_tags': { 485s 'importer/applied/1-1': Placeholder('applied') 485s }, 485s 'update_branches': { 485s 'importer/applied/ubuntu/trusty': Placeholder('applied'), 485s }, 485s }, 485s # validation_repo_expected_treewise_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/heads/importer/applied/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/applied/1-1' 485s ], 485s # reuse: 485s False, 485s ), 485s ] 485s ) 485s @patch('gitubuntu.importer.get_import_tag_msg') 485s @patch('gitubuntu.importer.get_import_commit_msg') 485s def test_import_applied_spi_tags( 485s get_import_commit_msg_mock, 485s get_import_tag_msg_mock, 485s repo, 485s input_repo, 485s validation_repo_delta, 485s validation_repo_expected_treewise_refs, 485s reuse, 485s ): 485s """Test that applied tags are correctly created, adjusted and/or reused 485s 485s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 485s that determines the commit message to use for a given import 485s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 485s that determines the tag message to use for a given import 485s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 485s temporary output repository 485s :param repo_builder.Repo input_repo: input repository data 485s :param dict validation_repo_delta: how to transform the input repository 485s into a "validation repository", expressed as a dict to 485s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 485s input repository. The validation repository is then used for the 485s purposes of comparison against the output repository. 485s :param list(str) validation_repo_expected_treewise_refs: refs whose trees 485s must be identical between the validation repository and the output 485s repository 485s :param bool reuse: if set, the output ref importer/ubuntu/trusty must be 485s one supplied by the input repository (assumed to have a commit message 485s of "Test commit") and not one created by the importer in this run 485s (arranged by this test to have a different commit message) 485s 485s The input repository data is written into the output repository and then a 485s fake non-native source package publication of version 1-1 in the Trusty 485s release pocket is imported into it by calling import_applied_spi() 485s directly. reuse and validation_repo_expected_treewise_refs are then 485s asserted. 485s 485s This is similar to test_unapplied_spi_tags except that it calls 485s import_applied_spi() instead of import_unapplied_spi() and only treewise 485s ref comparisons are made. 485s """ 485s # Match the repo_builder objects 485s get_import_tag_msg_mock.return_value = 'Test tag' 485s # Importantly, the following commit message must not be the same as the 485s # commit messages used by the test input repository commits, so that we can 485s # later detect the difference between commits that were already there and 485s # new commits created by the importer for the purposes of asserting the 485s # reuse parameter correctly. 485s get_import_commit_msg_mock.return_value = b'Test commit (new)' 485s 485s > input_repo.write(repo.raw_repo) 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_tag_test.py:711: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmpx_mlissi/.git/'), record = {} 485s 485s def write(self, repo, record=None): 485s replace_placeholders(self) 485s record = record or dict() 485s written_commits = [ 485s commit.write(repo=repo, record=record) 485s for commit 485s in self.commit_list 485s ] 485s for name, target in self.branches.items(): 485s repo.create_branch( 485s name, 485s repo.get(target.write(repo)).peel(pygit2.Commit), 485s ) 485s for name, target in self.tags.items(): 485s repo.create_tag( 485s name, 485s target.write(repo), 485s > pygit2.GIT_OBJ_COMMIT, 485s self.tagger.signature, 485s 'Tag message', 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 485s ----------------------------- Captured stdout call ----------------------------- 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: using patch list from debian/patches/series 485s dpkg-source: info: applying a 485s dpkg-source: info: applying b 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: using patch list from debian/patches/series 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: using patch list from debian/patches/series 485s dpkg-source: info: applying a 485s dpkg-source: info: applying b 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: using patch list from debian/patches/series 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: using patch list from debian/patches/series 485s dpkg-source: info: applying a 485s dpkg-source: info: applying b 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: using patch list from debian/patches/series 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: using patch list from debian/patches/series 485s dpkg-source: info: applying a 485s dpkg-source: info: applying b 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: using patch list from debian/patches/series 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: using patch list from debian/patches/series 485s dpkg-source: info: applying a 485s dpkg-source: info: applying b 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: using patch list from debian/patches/series 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s ----------------------------- Captured stderr call ----------------------------- 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s _ test_import_applied_spi_tags[input_repo2-validation_repo_delta2-validation_repo_expected_treewise_refs2-False] _ 485s 485s get_import_commit_msg_mock = 485s get_import_tag_msg_mock = 485s repo = 485s input_repo = 485s validation_repo_delta = {'add_commits': [], 'update_branches': {'importer/applied/ubuntu/t...ct at 0xe867ef30>}, 'update_tags': {'importer/applied/1-1': }} 485s 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'] 485s reuse = False 485s 485s @pytest.mark.parametrize( 485s [ 485s 'input_repo', 485s 'validation_repo_delta', 485s 'validation_repo_expected_treewise_refs', 485s 'reuse', 485s ], 485s [ 485s # 1) An existing applied tag (or reimport tag) with the same Git tree 485s # - Reuse applied tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec(name='unapplied', has_patches=True), 485s Commit.from_spec(name='applied', patches_applied=True), 485s ], 485s branches={ 485s 'importer/ubuntu/trusty': Placeholder('unapplied'), 485s 'importer/applied/ubuntu/trusty': Placeholder('applied'), 485s }, 485s tags={ 485s 'importer/import/1-1': Placeholder('unapplied'), 485s 'importer/applied/1-1': Placeholder('applied'), 485s }, 485s ), 485s # validation_repo_delta: 485s { 485s # no output repository delta 485s }, 485s # validation_repo_expected_treewise_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/heads/importer/applied/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/applied/1-1', 485s ], 485s # reuse: 485s True, 485s ), 485s 485s # 2) An existing applied tag with a different Git tree 485s # - Create reimport tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[ 485s Commit.from_spec( 485s name='unapplied', 485s has_patches=True, 485s mutate='import tag contents', 485s ), 485s Commit.from_spec( 485s name='unapplied_reimport', 485s has_patches=True, 485s ), 485s Commit.from_spec( 485s name='applied', 485s patches_applied=True, 485s mutate='import tag contents', 485s ) 485s ], 485s branches={'importer/ubuntu/trusty': Placeholder('unapplied')}, 485s tags={ 485s 'importer/import/1-1': 485s Placeholder('unapplied'), 485s 'importer/reimport/import/1-1/0': 485s Placeholder('unapplied'), 485s 'importer/reimport/import/1-1/1': 485s Placeholder('unapplied_reimport'), 485s 'importer/applied/1-1': 485s Placeholder('applied'), 485s }, 485s ), 485s # validation_repo_delta: 485s { 485s 'add_commits': [ 485s Commit.from_spec( 485s name='applied_reimport', 485s patches_applied=True, 485s parents=[Placeholder('unapplied_reimport')], 485s ), 485s ], 485s 'update_tags': { 485s 'importer/reimport/applied/1-1/0': 485s Placeholder('applied'), 485s 'importer/reimport/applied/1-1/1': 485s Placeholder('applied_reimport'), 485s }, 485s 'update_branches': { 485s 'importer/applied/ubuntu/trusty': 485s Placeholder('applied_reimport'), 485s }, 485s }, 485s # validation_repo_expected_treewise_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/heads/importer/applied/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s 'refs/tags/importer/applied/1-1', 485s 'refs/tags/importer/reimport/applied/1-1/0', 485s 'refs/tags/importer/reimport/applied/1-1/1', 485s ], 485s # reuse: 485s False, 485s 485s marks=pytest.mark.xfail(reason='LP: #1755247'), 485s ), 485s 485s # 3) No applied tags 485s # - Create applied tag 485s pytest.param( 485s # input_repo: 485s repo_builder.Repo( 485s commits=[Commit.from_spec(name='unapplied', has_patches=True)], 485s branches={'importer/ubuntu/trusty': Placeholder('unapplied')}, 485s tags={'importer/import/1-1': Placeholder('unapplied')}, 485s ), 485s # validation_repo_delta: 485s { 485s 'add_commits': [ 485s Commit.from_spec( 485s name='applied', 485s patches_applied=True, 485s parents=[Placeholder('unapplied')], 485s ), 485s ], 485s 'update_tags': { 485s 'importer/applied/1-1': Placeholder('applied') 485s }, 485s 'update_branches': { 485s 'importer/applied/ubuntu/trusty': Placeholder('applied'), 485s }, 485s }, 485s # validation_repo_expected_treewise_refs: 485s [ 485s 'refs/heads/importer/ubuntu/trusty', 485s 'refs/heads/importer/applied/ubuntu/trusty', 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/applied/1-1' 485s ], 485s # reuse: 485s False, 485s ), 485s ] 485s ) 485s @patch('gitubuntu.importer.get_import_tag_msg') 485s @patch('gitubuntu.importer.get_import_commit_msg') 485s def test_import_applied_spi_tags( 485s get_import_commit_msg_mock, 485s get_import_tag_msg_mock, 485s repo, 485s input_repo, 485s validation_repo_delta, 485s validation_repo_expected_treewise_refs, 485s reuse, 485s ): 485s """Test that applied tags are correctly created, adjusted and/or reused 485s 485s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 485s that determines the commit message to use for a given import 485s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 485s that determines the tag message to use for a given import 485s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 485s temporary output repository 485s :param repo_builder.Repo input_repo: input repository data 485s :param dict validation_repo_delta: how to transform the input repository 485s into a "validation repository", expressed as a dict to 485s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 485s input repository. The validation repository is then used for the 485s purposes of comparison against the output repository. 485s :param list(str) validation_repo_expected_treewise_refs: refs whose trees 485s must be identical between the validation repository and the output 485s repository 485s :param bool reuse: if set, the output ref importer/ubuntu/trusty must be 485s one supplied by the input repository (assumed to have a commit message 485s of "Test commit") and not one created by the importer in this run 485s (arranged by this test to have a different commit message) 485s 485s The input repository data is written into the output repository and then a 485s fake non-native source package publication of version 1-1 in the Trusty 485s release pocket is imported into it by calling import_applied_spi() 485s directly. reuse and validation_repo_expected_treewise_refs are then 485s asserted. 485s 485s This is similar to test_unapplied_spi_tags except that it calls 485s import_applied_spi() instead of import_unapplied_spi() and only treewise 485s ref comparisons are made. 485s """ 485s # Match the repo_builder objects 485s get_import_tag_msg_mock.return_value = 'Test tag' 485s # Importantly, the following commit message must not be the same as the 485s # commit messages used by the test input repository commits, so that we can 485s # later detect the difference between commits that were already there and 485s # new commits created by the importer for the purposes of asserting the 485s # reuse parameter correctly. 485s get_import_commit_msg_mock.return_value = b'Test commit (new)' 485s 485s > input_repo.write(repo.raw_repo) 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_tag_test.py:711: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmpis7k3vsr/.git/'), record = {} 485s 485s def write(self, repo, record=None): 485s replace_placeholders(self) 485s record = record or dict() 485s written_commits = [ 485s commit.write(repo=repo, record=record) 485s for commit 485s in self.commit_list 485s ] 485s for name, target in self.branches.items(): 485s repo.create_branch( 485s name, 485s repo.get(target.write(repo)).peel(pygit2.Commit), 485s ) 485s for name, target in self.tags.items(): 485s repo.create_tag( 485s name, 485s target.write(repo), 485s > pygit2.GIT_OBJ_COMMIT, 485s self.tagger.signature, 485s 'Tag message', 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 485s ----------------------------- Captured stdout call ----------------------------- 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: using patch list from debian/patches/series 485s dpkg-source: info: applying a 485s dpkg-source: info: applying b 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: using patch list from debian/patches/series 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: using patch list from debian/patches/series 485s dpkg-source: info: applying a 485s dpkg-source: info: applying b 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: using patch list from debian/patches/series 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: using patch list from debian/patches/series 485s dpkg-source: info: applying a 485s dpkg-source: info: applying b 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: using patch list from debian/patches/series 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s ----------------------------- Captured stderr call ----------------------------- 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s __ test_get_existing_import_tags[input_repo1-PatchState.UNAPPLIED-expected1] ___ 485s 485s repo = 485s patch_state = 485s input_repo = 485s expected = ['refs/tags/importer/import/1-1'] 485s 485s @pytest.mark.parametrize( 485s 'input_repo, patch_state, expected', [ 485s ( 485s repo_builder.Repo(), 485s PatchState.UNAPPLIED, 485s [], 485s ), 485s ( 485s repo_builder.Repo( 485s tags={'importer/import/1-1': repo_builder.Commit()}, 485s ), 485s PatchState.UNAPPLIED, 485s ['refs/tags/importer/import/1-1'], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit(name='import'), 485s repo_builder.Commit(name='reimport1'), 485s ], 485s tags={ 485s 'importer/import/1-1': repo_builder.Commit(), 485s 'importer/reimport/import/1-1/0': repo_builder.Commit(), 485s 'importer/reimport/import/1-1/1': repo_builder.Commit(), 485s }, 485s ), 485s PatchState.UNAPPLIED, 485s [ 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s ), 485s ( 485s repo_builder.Repo(), 485s PatchState.APPLIED, 485s [], 485s ), 485s ( 485s repo_builder.Repo( 485s tags={'importer/applied/1-1': repo_builder.Commit()}, 485s ), 485s PatchState.APPLIED, 485s ['refs/tags/importer/applied/1-1'], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit(name='applied'), 485s repo_builder.Commit(name='reimport1'), 485s ], 485s tags={ 485s 'importer/applied/1-1': repo_builder.Commit(), 485s 'importer/reimport/applied/1-1/0': repo_builder.Commit(), 485s 'importer/reimport/applied/1-1/1': repo_builder.Commit(), 485s }, 485s ), 485s PatchState.APPLIED, 485s [ 485s 'refs/tags/importer/reimport/applied/1-1/0', 485s 'refs/tags/importer/reimport/applied/1-1/1', 485s ], 485s ), 485s ], 485s ) 485s def test_get_existing_import_tags(repo, patch_state, input_repo, expected): 485s """Test that get_existing_import_tags is generally correct 485s 485s This is the general parameterised test for the common case uses of 485s target.get_existing_import_tags. 485s 485s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 485s temporary output repository 485s :param PatchState patch_state: passed through to get_existing_import_tags 485s :param repo_builder.Repo input_repo: input repository data 485s :param list(str) expected: the names of the references that are expected to 485s be returned, in order. 485s """ 485s > input_repo.write(repo.raw_repo) 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:214: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmpo2zbfxc4/.git/'), record = {} 485s 485s def write(self, repo, record=None): 485s replace_placeholders(self) 485s record = record or dict() 485s written_commits = [ 485s commit.write(repo=repo, record=record) 485s for commit 485s in self.commit_list 485s ] 485s for name, target in self.branches.items(): 485s repo.create_branch( 485s name, 485s repo.get(target.write(repo)).peel(pygit2.Commit), 485s ) 485s for name, target in self.tags.items(): 485s repo.create_tag( 485s name, 485s target.write(repo), 485s > pygit2.GIT_OBJ_COMMIT, 485s self.tagger.signature, 485s 'Tag message', 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 485s __ test_get_existing_import_tags[input_repo2-PatchState.UNAPPLIED-expected2] ___ 485s 485s repo = 485s patch_state = 485s input_repo = 485s expected = ['refs/tags/importer/reimport/import/1-1/0', 'refs/tags/importer/reimport/import/1-1/1'] 485s 485s @pytest.mark.parametrize( 485s 'input_repo, patch_state, expected', [ 485s ( 485s repo_builder.Repo(), 485s PatchState.UNAPPLIED, 485s [], 485s ), 485s ( 485s repo_builder.Repo( 485s tags={'importer/import/1-1': repo_builder.Commit()}, 485s ), 485s PatchState.UNAPPLIED, 485s ['refs/tags/importer/import/1-1'], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit(name='import'), 485s repo_builder.Commit(name='reimport1'), 485s ], 485s tags={ 485s 'importer/import/1-1': repo_builder.Commit(), 485s 'importer/reimport/import/1-1/0': repo_builder.Commit(), 485s 'importer/reimport/import/1-1/1': repo_builder.Commit(), 485s }, 485s ), 485s PatchState.UNAPPLIED, 485s [ 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s ), 485s ( 485s repo_builder.Repo(), 485s PatchState.APPLIED, 485s [], 485s ), 485s ( 485s repo_builder.Repo( 485s tags={'importer/applied/1-1': repo_builder.Commit()}, 485s ), 485s PatchState.APPLIED, 485s ['refs/tags/importer/applied/1-1'], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit(name='applied'), 485s repo_builder.Commit(name='reimport1'), 485s ], 485s tags={ 485s 'importer/applied/1-1': repo_builder.Commit(), 485s 'importer/reimport/applied/1-1/0': repo_builder.Commit(), 485s 'importer/reimport/applied/1-1/1': repo_builder.Commit(), 485s }, 485s ), 485s PatchState.APPLIED, 485s [ 485s 'refs/tags/importer/reimport/applied/1-1/0', 485s 'refs/tags/importer/reimport/applied/1-1/1', 485s ], 485s ), 485s ], 485s ) 485s def test_get_existing_import_tags(repo, patch_state, input_repo, expected): 485s """Test that get_existing_import_tags is generally correct 485s 485s This is the general parameterised test for the common case uses of 485s target.get_existing_import_tags. 485s 485s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 485s temporary output repository 485s :param PatchState patch_state: passed through to get_existing_import_tags 485s :param repo_builder.Repo input_repo: input repository data 485s :param list(str) expected: the names of the references that are expected to 485s be returned, in order. 485s """ 485s > input_repo.write(repo.raw_repo) 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:214: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmpdr2xy7jc/.git/'), record = {} 485s 485s def write(self, repo, record=None): 485s replace_placeholders(self) 485s record = record or dict() 485s written_commits = [ 485s commit.write(repo=repo, record=record) 485s for commit 485s in self.commit_list 485s ] 485s for name, target in self.branches.items(): 485s repo.create_branch( 485s name, 485s repo.get(target.write(repo)).peel(pygit2.Commit), 485s ) 485s for name, target in self.tags.items(): 485s repo.create_tag( 485s name, 485s target.write(repo), 485s > pygit2.GIT_OBJ_COMMIT, 485s self.tagger.signature, 485s 'Tag message', 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 485s ___ test_get_existing_import_tags[input_repo4-PatchState.APPLIED-expected4] ____ 485s 485s repo = 485s patch_state = 485s input_repo = 485s expected = ['refs/tags/importer/applied/1-1'] 485s 485s @pytest.mark.parametrize( 485s 'input_repo, patch_state, expected', [ 485s ( 485s repo_builder.Repo(), 485s PatchState.UNAPPLIED, 485s [], 485s ), 485s ( 485s repo_builder.Repo( 485s tags={'importer/import/1-1': repo_builder.Commit()}, 485s ), 485s PatchState.UNAPPLIED, 485s ['refs/tags/importer/import/1-1'], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit(name='import'), 485s repo_builder.Commit(name='reimport1'), 485s ], 485s tags={ 485s 'importer/import/1-1': repo_builder.Commit(), 485s 'importer/reimport/import/1-1/0': repo_builder.Commit(), 485s 'importer/reimport/import/1-1/1': repo_builder.Commit(), 485s }, 485s ), 485s PatchState.UNAPPLIED, 485s [ 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s ), 485s ( 485s repo_builder.Repo(), 485s PatchState.APPLIED, 485s [], 485s ), 485s ( 485s repo_builder.Repo( 485s tags={'importer/applied/1-1': repo_builder.Commit()}, 485s ), 485s PatchState.APPLIED, 485s ['refs/tags/importer/applied/1-1'], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit(name='applied'), 485s repo_builder.Commit(name='reimport1'), 485s ], 485s tags={ 485s 'importer/applied/1-1': repo_builder.Commit(), 485s 'importer/reimport/applied/1-1/0': repo_builder.Commit(), 485s 'importer/reimport/applied/1-1/1': repo_builder.Commit(), 485s }, 485s ), 485s PatchState.APPLIED, 485s [ 485s 'refs/tags/importer/reimport/applied/1-1/0', 485s 'refs/tags/importer/reimport/applied/1-1/1', 485s ], 485s ), 485s ], 485s ) 485s def test_get_existing_import_tags(repo, patch_state, input_repo, expected): 485s """Test that get_existing_import_tags is generally correct 485s 485s This is the general parameterised test for the common case uses of 485s target.get_existing_import_tags. 485s 485s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 485s temporary output repository 485s :param PatchState patch_state: passed through to get_existing_import_tags 485s :param repo_builder.Repo input_repo: input repository data 485s :param list(str) expected: the names of the references that are expected to 485s be returned, in order. 485s """ 485s > input_repo.write(repo.raw_repo) 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:214: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmpfqq9xpyt/.git/'), record = {} 485s 485s def write(self, repo, record=None): 485s replace_placeholders(self) 485s record = record or dict() 485s written_commits = [ 485s commit.write(repo=repo, record=record) 485s for commit 485s in self.commit_list 485s ] 485s for name, target in self.branches.items(): 485s repo.create_branch( 485s name, 485s repo.get(target.write(repo)).peel(pygit2.Commit), 485s ) 485s for name, target in self.tags.items(): 485s repo.create_tag( 485s name, 485s target.write(repo), 485s > pygit2.GIT_OBJ_COMMIT, 485s self.tagger.signature, 485s 'Tag message', 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 485s ___ test_get_existing_import_tags[input_repo5-PatchState.APPLIED-expected5] ____ 485s 485s repo = 485s patch_state = 485s input_repo = 485s expected = ['refs/tags/importer/reimport/applied/1-1/0', 'refs/tags/importer/reimport/applied/1-1/1'] 485s 485s @pytest.mark.parametrize( 485s 'input_repo, patch_state, expected', [ 485s ( 485s repo_builder.Repo(), 485s PatchState.UNAPPLIED, 485s [], 485s ), 485s ( 485s repo_builder.Repo( 485s tags={'importer/import/1-1': repo_builder.Commit()}, 485s ), 485s PatchState.UNAPPLIED, 485s ['refs/tags/importer/import/1-1'], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit(name='import'), 485s repo_builder.Commit(name='reimport1'), 485s ], 485s tags={ 485s 'importer/import/1-1': repo_builder.Commit(), 485s 'importer/reimport/import/1-1/0': repo_builder.Commit(), 485s 'importer/reimport/import/1-1/1': repo_builder.Commit(), 485s }, 485s ), 485s PatchState.UNAPPLIED, 485s [ 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s ), 485s ( 485s repo_builder.Repo(), 485s PatchState.APPLIED, 485s [], 485s ), 485s ( 485s repo_builder.Repo( 485s tags={'importer/applied/1-1': repo_builder.Commit()}, 485s ), 485s PatchState.APPLIED, 485s ['refs/tags/importer/applied/1-1'], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit(name='applied'), 485s repo_builder.Commit(name='reimport1'), 485s ], 485s tags={ 485s 'importer/applied/1-1': repo_builder.Commit(), 485s 'importer/reimport/applied/1-1/0': repo_builder.Commit(), 485s 'importer/reimport/applied/1-1/1': repo_builder.Commit(), 485s }, 485s ), 485s PatchState.APPLIED, 485s [ 485s 'refs/tags/importer/reimport/applied/1-1/0', 485s 'refs/tags/importer/reimport/applied/1-1/1', 485s ], 485s ), 485s ], 485s ) 485s def test_get_existing_import_tags(repo, patch_state, input_repo, expected): 485s """Test that get_existing_import_tags is generally correct 485s 485s This is the general parameterised test for the common case uses of 485s target.get_existing_import_tags. 485s 485s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 485s temporary output repository 485s :param PatchState patch_state: passed through to get_existing_import_tags 485s :param repo_builder.Repo input_repo: input repository data 485s :param list(str) expected: the names of the references that are expected to 485s be returned, in order. 485s """ 485s > input_repo.write(repo.raw_repo) 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:214: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmphi61dg_b/.git/'), record = {} 485s 485s def write(self, repo, record=None): 485s replace_placeholders(self) 485s record = record or dict() 485s written_commits = [ 485s commit.write(repo=repo, record=record) 485s for commit 485s in self.commit_list 485s ] 485s for name, target in self.branches.items(): 485s repo.create_branch( 485s name, 485s repo.get(target.write(repo)).peel(pygit2.Commit), 485s ) 485s for name, target in self.tags.items(): 485s repo.create_tag( 485s name, 485s target.write(repo), 485s > pygit2.GIT_OBJ_COMMIT, 485s self.tagger.signature, 485s 'Tag message', 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 485s ____________________ test_get_existing_import_tags_ordering ____________________ 485s 485s repo = 485s 485s def test_get_existing_import_tags_ordering(repo): 485s """Test that get_existing_import_tags returns results in the correct order 485s 485s To maintain hash stability, the spec defines that multiple changelog 485s parents must appear in the order that they were published. For this to 485s work, get_existing_import_tags must return the tags in the correct order 485s even if the underlying git repository tags appear in an arbitrary order. 485s 485s :param GitUbuntuRepository repo: fixture of a temporary repository to use 485s """ 485s 485s # Construct a synthetic git repository containing tags 485s repo_builder.Repo( 485s tags={ 485s 'importer/import/1-1': repo_builder.Commit(), 485s 'importer/reimport/import/1-1/0': repo_builder.Commit(), 485s 'importer/reimport/import/1-1/1': repo_builder.Commit(), 485s } 485s > ).write(repo.raw_repo) 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:240: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmp32vvhyvb/.git/'), record = {} 485s 485s def write(self, repo, record=None): 485s replace_placeholders(self) 485s record = record or dict() 485s written_commits = [ 485s commit.write(repo=repo, record=record) 485s for commit 485s in self.commit_list 485s ] 485s for name, target in self.branches.items(): 485s repo.create_branch( 485s name, 485s repo.get(target.write(repo)).peel(pygit2.Commit), 485s ) 485s for name, target in self.tags.items(): 485s repo.create_tag( 485s name, 485s target.write(repo), 485s > pygit2.GIT_OBJ_COMMIT, 485s self.tagger.signature, 485s 'Tag message', 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 485s _ test_create_import_tag[input_repo0-validation_repo_delta0-validation_repo_expected_identical_refs0] _ 485s 485s repo = 485s input_repo = 485s validation_repo_delta = {'add_commits': [], 'update_tags': {'importer/import/1-1': }} 485s validation_repo_expected_identical_refs = ['refs/tags/importer/import/1-1'] 485s 485s @pytest.mark.parametrize( 485s [ 485s 'input_repo', 485s 'validation_repo_delta', 485s 'validation_repo_expected_identical_refs', 485s ], 485s [ 485s ( 485s repo_builder.Repo(), 485s { 485s 'add_commits': [ 485s repo_builder.Commit(name='import'), 485s ], 485s 'update_tags': { 485s 'importer/import/1-1': Placeholder('import'), 485s }, 485s }, 485s [ 485s 'refs/tags/importer/import/1-1', 485s ], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[repo_builder.Commit(name='import')], 485s tags={'importer/import/1-1': Placeholder('import')}, 485s ), 485s { 485s 'add_commits': [ 485s repo_builder.Commit(name='reimport'), 485s ], 485s 'update_tags': { 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 485s }, 485s }, 485s [ 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit(name='import'), 485s repo_builder.Commit(name='reimport1'), 485s ], 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('reimport1'), 485s }, 485s ), 485s { 485s 'add_commits': [ 485s repo_builder.Commit(name='reimport2'), 485s ], 485s 'update_tags': { 485s 'importer/reimport/import/1-1/2': Placeholder('reimport2'), 485s }, 485s }, 485s [ 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s 'refs/tags/importer/reimport/import/1-1/2', 485s ], 485s ), 485s ], 485s ) 485s def test_create_import_tag( 485s repo, 485s input_repo, 485s validation_repo_delta, 485s validation_repo_expected_identical_refs, 485s ): 485s """ 485s Unit test that create_import_tag creates the correct import tag 485s 485s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 485s temporary output repository 485s :param repo_builder.Repo input_repo: input repository data 485s :param dict validation_repo_delta: how to transform the input repository 485s into a "validation repository", expressed as a dict to 485s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 485s input repository. The validation repository is then used for the 485s purposes of comparison against the output repository. 485s :param list(str) validation_repo_expected_identical_refs: refs that must be 485s identical between the validation repository and the output repository 485s """ 485s publish_commit = repo.raw_repo.get( 485s repo_builder.Commit().write(repo.raw_repo) 485s ).peel(pygit2.Commit) 485s input_repo.write(repo.raw_repo) 485s 485s > target.create_import_tag(repo, publish_commit, '1-1', 'importer') 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:370: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer.py:1379: in create_import_tag 485s repo.create_tag( 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s commit_hash = '240dd844a69653244edb52c57c42d709512d64cd' 485s tag_name = 'importer/import/1-1', tag_msg = 'git-ubuntu import' 485s tagger = pygit2.Signature('git-ubuntu importer', 'ubuntu-devel-discuss@lists.ubuntu.com', 0, 0, None) 485s 485s def create_tag(self, 485s commit_hash, 485s tag_name, 485s tag_msg, 485s tagger=None, 485s ): 485s """Create a tag in the repository 485s 485s :param str commit_hash: the commit hash the tag will point to. 485s :param str tag_name: the name of the tag to be created. 485s :param str tag_msg: the text of the tag annotation. 485s :param pygit2.Signature tagger: if supplied, use this signature in the 485s created tag's "tagger" metadata. If not supplied, an arbitrary name 485s and email address is used with the current time. 485s :returns: None 485s """ 485s if not tagger: 485s tagger_time, tagger_offset = datetime_to_signature_spec( 485s datetime.datetime.now(), 485s ) 485s tagger = pygit2.Signature( 485s gitubuntu.spec.SYNTHESIZED_COMMITTER_NAME, 485s gitubuntu.spec.SYNTHESIZED_COMMITTER_EMAIL, 485s tagger_time, 485s tagger_offset, 485s ) 485s 485s logging.debug("Creating tag %s pointing to %s", tag_name, commit_hash) 485s self.raw_repo.create_tag( 485s tag_name, 485s pygit2.Oid(hex=commit_hash), 485s > pygit2.GIT_OBJ_COMMIT, 485s tagger, 485s tag_msg, 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:2114: AttributeError 485s _ test_create_import_tag[input_repo1-validation_repo_delta1-validation_repo_expected_identical_refs1] _ 485s 485s repo = 485s input_repo = 485s validation_repo_delta = {'add_commits': [], 'update_tags': {'importer/reimport/import/1-1/...er object at 0xe85ed510>, 'importer/reimport/import/1-1/1': }} 485s 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'] 485s 485s @pytest.mark.parametrize( 485s [ 485s 'input_repo', 485s 'validation_repo_delta', 485s 'validation_repo_expected_identical_refs', 485s ], 485s [ 485s ( 485s repo_builder.Repo(), 485s { 485s 'add_commits': [ 485s repo_builder.Commit(name='import'), 485s ], 485s 'update_tags': { 485s 'importer/import/1-1': Placeholder('import'), 485s }, 485s }, 485s [ 485s 'refs/tags/importer/import/1-1', 485s ], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[repo_builder.Commit(name='import')], 485s tags={'importer/import/1-1': Placeholder('import')}, 485s ), 485s { 485s 'add_commits': [ 485s repo_builder.Commit(name='reimport'), 485s ], 485s 'update_tags': { 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 485s }, 485s }, 485s [ 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit(name='import'), 485s repo_builder.Commit(name='reimport1'), 485s ], 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('reimport1'), 485s }, 485s ), 485s { 485s 'add_commits': [ 485s repo_builder.Commit(name='reimport2'), 485s ], 485s 'update_tags': { 485s 'importer/reimport/import/1-1/2': Placeholder('reimport2'), 485s }, 485s }, 485s [ 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s 'refs/tags/importer/reimport/import/1-1/2', 485s ], 485s ), 485s ], 485s ) 485s def test_create_import_tag( 485s repo, 485s input_repo, 485s validation_repo_delta, 485s validation_repo_expected_identical_refs, 485s ): 485s """ 485s Unit test that create_import_tag creates the correct import tag 485s 485s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 485s temporary output repository 485s :param repo_builder.Repo input_repo: input repository data 485s :param dict validation_repo_delta: how to transform the input repository 485s into a "validation repository", expressed as a dict to 485s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 485s input repository. The validation repository is then used for the 485s purposes of comparison against the output repository. 485s :param list(str) validation_repo_expected_identical_refs: refs that must be 485s identical between the validation repository and the output repository 485s """ 485s publish_commit = repo.raw_repo.get( 485s repo_builder.Commit().write(repo.raw_repo) 485s ).peel(pygit2.Commit) 485s > input_repo.write(repo.raw_repo) 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:368: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmp9p05_e4_/.git/'), record = {} 485s 485s def write(self, repo, record=None): 485s replace_placeholders(self) 485s record = record or dict() 485s written_commits = [ 485s commit.write(repo=repo, record=record) 485s for commit 485s in self.commit_list 485s ] 485s for name, target in self.branches.items(): 485s repo.create_branch( 485s name, 485s repo.get(target.write(repo)).peel(pygit2.Commit), 485s ) 485s for name, target in self.tags.items(): 485s repo.create_tag( 485s name, 485s target.write(repo), 485s > pygit2.GIT_OBJ_COMMIT, 485s self.tagger.signature, 485s 'Tag message', 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 485s _ test_create_import_tag[input_repo2-validation_repo_delta2-validation_repo_expected_identical_refs2] _ 485s 485s repo = 485s input_repo = 485s validation_repo_delta = {'add_commits': [], 'update_tags': {'importer/reimport/import/1-1/2': }} 485s 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'] 485s 485s @pytest.mark.parametrize( 485s [ 485s 'input_repo', 485s 'validation_repo_delta', 485s 'validation_repo_expected_identical_refs', 485s ], 485s [ 485s ( 485s repo_builder.Repo(), 485s { 485s 'add_commits': [ 485s repo_builder.Commit(name='import'), 485s ], 485s 'update_tags': { 485s 'importer/import/1-1': Placeholder('import'), 485s }, 485s }, 485s [ 485s 'refs/tags/importer/import/1-1', 485s ], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[repo_builder.Commit(name='import')], 485s tags={'importer/import/1-1': Placeholder('import')}, 485s ), 485s { 485s 'add_commits': [ 485s repo_builder.Commit(name='reimport'), 485s ], 485s 'update_tags': { 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 485s }, 485s }, 485s [ 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit(name='import'), 485s repo_builder.Commit(name='reimport1'), 485s ], 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('reimport1'), 485s }, 485s ), 485s { 485s 'add_commits': [ 485s repo_builder.Commit(name='reimport2'), 485s ], 485s 'update_tags': { 485s 'importer/reimport/import/1-1/2': Placeholder('reimport2'), 485s }, 485s }, 485s [ 485s 'refs/tags/importer/import/1-1', 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s 'refs/tags/importer/reimport/import/1-1/2', 485s ], 485s ), 485s ], 485s ) 485s def test_create_import_tag( 485s repo, 485s input_repo, 485s validation_repo_delta, 485s validation_repo_expected_identical_refs, 485s ): 485s """ 485s Unit test that create_import_tag creates the correct import tag 485s 485s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 485s temporary output repository 485s :param repo_builder.Repo input_repo: input repository data 485s :param dict validation_repo_delta: how to transform the input repository 485s into a "validation repository", expressed as a dict to 485s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 485s input repository. The validation repository is then used for the 485s purposes of comparison against the output repository. 485s :param list(str) validation_repo_expected_identical_refs: refs that must be 485s identical between the validation repository and the output repository 485s """ 485s publish_commit = repo.raw_repo.get( 485s repo_builder.Commit().write(repo.raw_repo) 485s ).peel(pygit2.Commit) 485s > input_repo.write(repo.raw_repo) 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:368: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmp4hiwwsqr/.git/'), record = {} 485s 485s def write(self, repo, record=None): 485s replace_placeholders(self) 485s record = record or dict() 485s written_commits = [ 485s commit.write(repo=repo, record=record) 485s for commit 485s in self.commit_list 485s ] 485s for name, target in self.branches.items(): 485s repo.create_branch( 485s name, 485s repo.get(target.write(repo)).peel(pygit2.Commit), 485s ) 485s for name, target in self.tags.items(): 485s repo.create_tag( 485s name, 485s target.write(repo), 485s > pygit2.GIT_OBJ_COMMIT, 485s self.tagger.signature, 485s 'Tag message', 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 485s ____________ test_create_import_tag_hash_stability_on_first_import _____________ 485s 485s repo = 485s 485s def test_create_import_tag_hash_stability_on_first_import(repo): 485s """Created import tags should be hash stable on first import 485s 485s :param GitUbuntuRepository repo: fixture providing a temporary 485s GitUbuntuRepository instance to use 485s """ 485s publish_commit = repo.raw_repo.get( 485s repo_builder.Commit( 485s author=pygit2.Signature( 485s 'Hash stability test author', 485s 'newauthor@example.com', 485s 1, 485s 2, 485s ), 485s committer=pygit2.Signature( 485s 'Hash stability test committer', 485s 'newcommitter@example.com', 485s 3, 485s 4, 485s ), 485s ).write(repo.raw_repo) 485s ).peel(pygit2.Commit) 485s > target.create_import_tag(repo, publish_commit, '1-1', 'importer') 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:402: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer.py:1379: in create_import_tag 485s repo.create_tag( 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s commit_hash = '65729a1dca101328820bf4f49fbca4e9571a772a' 485s tag_name = 'importer/import/1-1', tag_msg = 'git-ubuntu import' 485s tagger = pygit2.Signature('git-ubuntu importer', 'ubuntu-devel-discuss@lists.ubuntu.com', 3, 4, None) 485s 485s def create_tag(self, 485s commit_hash, 485s tag_name, 485s tag_msg, 485s tagger=None, 485s ): 485s """Create a tag in the repository 485s 485s :param str commit_hash: the commit hash the tag will point to. 485s :param str tag_name: the name of the tag to be created. 485s :param str tag_msg: the text of the tag annotation. 485s :param pygit2.Signature tagger: if supplied, use this signature in the 485s created tag's "tagger" metadata. If not supplied, an arbitrary name 485s and email address is used with the current time. 485s :returns: None 485s """ 485s if not tagger: 485s tagger_time, tagger_offset = datetime_to_signature_spec( 485s datetime.datetime.now(), 485s ) 485s tagger = pygit2.Signature( 485s gitubuntu.spec.SYNTHESIZED_COMMITTER_NAME, 485s gitubuntu.spec.SYNTHESIZED_COMMITTER_EMAIL, 485s tagger_time, 485s tagger_offset, 485s ) 485s 485s logging.debug("Creating tag %s pointing to %s", tag_name, commit_hash) 485s self.raw_repo.create_tag( 485s tag_name, 485s pygit2.Oid(hex=commit_hash), 485s > pygit2.GIT_OBJ_COMMIT, 485s tagger, 485s tag_msg, 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:2114: AttributeError 485s ______________ test_create_import_tag_hash_stability_on_reimport _______________ 485s 485s repo = 485s 485s def test_create_import_tag_hash_stability_on_reimport(repo): 485s """Created import tags should be hash stable on reimport 485s 485s This includes both the /0 duplicate reimport tag of the original import tag 485s as well as the /1 reimport tag being created. 485s 485s :param GitUbuntuRepository repo: fixture providing a temporary 485s GitUbuntuRepository instance to use 485s """ 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit( 485s name='root', 485s author=pygit2.Signature( 485s 'Hash stability test author', 485s 'author@example.com', 485s 1, 485s 2, 485s ), 485s committer=pygit2.Signature( 485s 'Hash stability test committer', 485s 'committer@example.com', 485s 3, 485s 4, 485s ), 485s ), 485s ], 485s tags={ 485s 'importer/import/1-1': Placeholder('root'), 485s }, 485s tagger=pygit2.Signature( 485s 'Hash stability test name', 485s 'stability@example.com', 485s 5, 485s 6, 485s ), 485s > ).write(repo.raw_repo) 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:449: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmpxpavfn6e/.git/'), record = {} 485s 485s def write(self, repo, record=None): 485s replace_placeholders(self) 485s record = record or dict() 485s written_commits = [ 485s commit.write(repo=repo, record=record) 485s for commit 485s in self.commit_list 485s ] 485s for name, target in self.branches.items(): 485s repo.create_branch( 485s name, 485s repo.get(target.write(repo)).peel(pygit2.Commit), 485s ) 485s for name, target in self.tags.items(): 485s repo.create_tag( 485s name, 485s target.write(repo), 485s > pygit2.GIT_OBJ_COMMIT, 485s self.tagger.signature, 485s 'Tag message', 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 485s _ test_create_applied_tag[input_repo0-validation_repo_delta0-validation_repo_expected_identical_refs0] _ 485s 485s repo = 485s input_repo = 485s validation_repo_delta = {'add_commits': [], 'update_tags': {'importer/applied/1-1': }} 485s validation_repo_expected_identical_refs = ['refs/tags/importer/applied/1-1'] 485s 485s @pytest.mark.parametrize( 485s [ 485s 'input_repo', 485s 'validation_repo_delta', 485s 'validation_repo_expected_identical_refs', 485s ], 485s [ 485s ( 485s repo_builder.Repo(), 485s { 485s 'add_commits': [repo_builder.Commit(name='import')], 485s 'update_tags': {'importer/applied/1-1': Placeholder('import')}, 485s }, 485s [ 485s 'refs/tags/importer/applied/1-1', 485s ], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[repo_builder.Commit(name='import')], 485s tags={'importer/applied/1-1': Placeholder('import')}, 485s ), 485s { 485s 'add_commits': [repo_builder.Commit(name='reimport')], 485s 'update_tags': { 485s 'importer/reimport/applied/1-1/0': Placeholder('import'), 485s 'importer/reimport/applied/1-1/1': Placeholder('reimport'), 485s }, 485s }, 485s [ 485s 'refs/tags/importer/applied/1-1', 485s 'refs/tags/importer/reimport/applied/1-1/0', 485s 'refs/tags/importer/reimport/applied/1-1/1', 485s ], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit(name='import'), 485s repo_builder.Commit(name='reimport1'), 485s ], 485s tags={ 485s 'importer/applied/1-1': Placeholder('import'), 485s 'importer/reimport/applied/1-1/0': Placeholder('import'), 485s 'importer/reimport/applied/1-1/1': Placeholder('reimport1'), 485s }, 485s ), 485s { 485s 'add_commits': [ 485s repo_builder.Commit(name='reimport2') 485s ], 485s 'update_tags': { 485s 'importer/reimport/applied/1-1/2': Placeholder('reimport2'), 485s }, 485s }, 485s [ 485s 'refs/tags/importer/applied/1-1', 485s 'refs/tags/importer/reimport/applied/1-1/0', 485s 'refs/tags/importer/reimport/applied/1-1/1', 485s 'refs/tags/importer/reimport/applied/1-1/2', 485s ], 485s ), 485s ], 485s ) 485s def test_create_applied_tag( 485s repo, 485s input_repo, 485s validation_repo_delta, 485s validation_repo_expected_identical_refs, 485s ): 485s """ 485s Unit test that create_applied_tag creates the correct import tag 485s 485s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 485s temporary output repository 485s :param repo_builder.Repo input_repo: input repository data 485s :param dict validation_repo_delta: how to transform the input repository 485s into a "validation repository", expressed as a dict to 485s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 485s input repository. The validation repository is then used for the 485s purposes of comparison against the output repository. 485s :param list(str) validation_repo_expected_identical_refs: refs that must be 485s identical between the validation repository and the output repository 485s """ 485s publish_commit_str = str( 485s repo.raw_repo.get( 485s repo_builder.Commit().write(repo.raw_repo) 485s ).peel(pygit2.Commit).id 485s ) 485s 485s input_repo.write(repo.raw_repo) 485s 485s > target.create_applied_tag(repo, publish_commit_str, '1-1', 'importer') 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:577: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer.py:1309: in create_applied_tag 485s repo.create_tag( 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s commit_hash = '240dd844a69653244edb52c57c42d709512d64cd' 485s tag_name = 'importer/applied/1-1', tag_msg = 'git-ubuntu import' 485s tagger = pygit2.Signature('git-ubuntu importer', 'ubuntu-devel-discuss@lists.ubuntu.com', 1733218937, 0, None) 485s 485s def create_tag(self, 485s commit_hash, 485s tag_name, 485s tag_msg, 485s tagger=None, 485s ): 485s """Create a tag in the repository 485s 485s :param str commit_hash: the commit hash the tag will point to. 485s :param str tag_name: the name of the tag to be created. 485s :param str tag_msg: the text of the tag annotation. 485s :param pygit2.Signature tagger: if supplied, use this signature in the 485s created tag's "tagger" metadata. If not supplied, an arbitrary name 485s and email address is used with the current time. 485s :returns: None 485s """ 485s if not tagger: 485s tagger_time, tagger_offset = datetime_to_signature_spec( 485s datetime.datetime.now(), 485s ) 485s tagger = pygit2.Signature( 485s gitubuntu.spec.SYNTHESIZED_COMMITTER_NAME, 485s gitubuntu.spec.SYNTHESIZED_COMMITTER_EMAIL, 485s tagger_time, 485s tagger_offset, 485s ) 485s 485s logging.debug("Creating tag %s pointing to %s", tag_name, commit_hash) 485s self.raw_repo.create_tag( 485s tag_name, 485s pygit2.Oid(hex=commit_hash), 485s > pygit2.GIT_OBJ_COMMIT, 485s tagger, 485s tag_msg, 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:2114: AttributeError 485s _ test_create_applied_tag[input_repo1-validation_repo_delta1-validation_repo_expected_identical_refs1] _ 485s 485s repo = 485s input_repo = 485s validation_repo_delta = {'add_commits': [], 'update_tags': {'importer/reimport/applied/1-1...r object at 0xe826be10>, 'importer/reimport/applied/1-1/1': }} 485s 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'] 485s 485s @pytest.mark.parametrize( 485s [ 485s 'input_repo', 485s 'validation_repo_delta', 485s 'validation_repo_expected_identical_refs', 485s ], 485s [ 485s ( 485s repo_builder.Repo(), 485s { 485s 'add_commits': [repo_builder.Commit(name='import')], 485s 'update_tags': {'importer/applied/1-1': Placeholder('import')}, 485s }, 485s [ 485s 'refs/tags/importer/applied/1-1', 485s ], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[repo_builder.Commit(name='import')], 485s tags={'importer/applied/1-1': Placeholder('import')}, 485s ), 485s { 485s 'add_commits': [repo_builder.Commit(name='reimport')], 485s 'update_tags': { 485s 'importer/reimport/applied/1-1/0': Placeholder('import'), 485s 'importer/reimport/applied/1-1/1': Placeholder('reimport'), 485s }, 485s }, 485s [ 485s 'refs/tags/importer/applied/1-1', 485s 'refs/tags/importer/reimport/applied/1-1/0', 485s 'refs/tags/importer/reimport/applied/1-1/1', 485s ], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit(name='import'), 485s repo_builder.Commit(name='reimport1'), 485s ], 485s tags={ 485s 'importer/applied/1-1': Placeholder('import'), 485s 'importer/reimport/applied/1-1/0': Placeholder('import'), 485s 'importer/reimport/applied/1-1/1': Placeholder('reimport1'), 485s }, 485s ), 485s { 485s 'add_commits': [ 485s repo_builder.Commit(name='reimport2') 485s ], 485s 'update_tags': { 485s 'importer/reimport/applied/1-1/2': Placeholder('reimport2'), 485s }, 485s }, 485s [ 485s 'refs/tags/importer/applied/1-1', 485s 'refs/tags/importer/reimport/applied/1-1/0', 485s 'refs/tags/importer/reimport/applied/1-1/1', 485s 'refs/tags/importer/reimport/applied/1-1/2', 485s ], 485s ), 485s ], 485s ) 485s def test_create_applied_tag( 485s repo, 485s input_repo, 485s validation_repo_delta, 485s validation_repo_expected_identical_refs, 485s ): 485s """ 485s Unit test that create_applied_tag creates the correct import tag 485s 485s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 485s temporary output repository 485s :param repo_builder.Repo input_repo: input repository data 485s :param dict validation_repo_delta: how to transform the input repository 485s into a "validation repository", expressed as a dict to 485s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 485s input repository. The validation repository is then used for the 485s purposes of comparison against the output repository. 485s :param list(str) validation_repo_expected_identical_refs: refs that must be 485s identical between the validation repository and the output repository 485s """ 485s publish_commit_str = str( 485s repo.raw_repo.get( 485s repo_builder.Commit().write(repo.raw_repo) 485s ).peel(pygit2.Commit).id 485s ) 485s 485s > input_repo.write(repo.raw_repo) 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:575: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmprydit3i9/.git/'), record = {} 485s 485s def write(self, repo, record=None): 485s replace_placeholders(self) 485s record = record or dict() 485s written_commits = [ 485s commit.write(repo=repo, record=record) 485s for commit 485s in self.commit_list 485s ] 485s for name, target in self.branches.items(): 485s repo.create_branch( 485s name, 485s repo.get(target.write(repo)).peel(pygit2.Commit), 485s ) 485s for name, target in self.tags.items(): 485s repo.create_tag( 485s name, 485s target.write(repo), 485s > pygit2.GIT_OBJ_COMMIT, 485s self.tagger.signature, 485s 'Tag message', 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 485s _ test_create_applied_tag[input_repo2-validation_repo_delta2-validation_repo_expected_identical_refs2] _ 485s 485s repo = 485s input_repo = 485s validation_repo_delta = {'add_commits': [], 'update_tags': {'importer/reimport/applied/1-1/2': }} 485s 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'] 485s 485s @pytest.mark.parametrize( 485s [ 485s 'input_repo', 485s 'validation_repo_delta', 485s 'validation_repo_expected_identical_refs', 485s ], 485s [ 485s ( 485s repo_builder.Repo(), 485s { 485s 'add_commits': [repo_builder.Commit(name='import')], 485s 'update_tags': {'importer/applied/1-1': Placeholder('import')}, 485s }, 485s [ 485s 'refs/tags/importer/applied/1-1', 485s ], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[repo_builder.Commit(name='import')], 485s tags={'importer/applied/1-1': Placeholder('import')}, 485s ), 485s { 485s 'add_commits': [repo_builder.Commit(name='reimport')], 485s 'update_tags': { 485s 'importer/reimport/applied/1-1/0': Placeholder('import'), 485s 'importer/reimport/applied/1-1/1': Placeholder('reimport'), 485s }, 485s }, 485s [ 485s 'refs/tags/importer/applied/1-1', 485s 'refs/tags/importer/reimport/applied/1-1/0', 485s 'refs/tags/importer/reimport/applied/1-1/1', 485s ], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit(name='import'), 485s repo_builder.Commit(name='reimport1'), 485s ], 485s tags={ 485s 'importer/applied/1-1': Placeholder('import'), 485s 'importer/reimport/applied/1-1/0': Placeholder('import'), 485s 'importer/reimport/applied/1-1/1': Placeholder('reimport1'), 485s }, 485s ), 485s { 485s 'add_commits': [ 485s repo_builder.Commit(name='reimport2') 485s ], 485s 'update_tags': { 485s 'importer/reimport/applied/1-1/2': Placeholder('reimport2'), 485s }, 485s }, 485s [ 485s 'refs/tags/importer/applied/1-1', 485s 'refs/tags/importer/reimport/applied/1-1/0', 485s 'refs/tags/importer/reimport/applied/1-1/1', 485s 'refs/tags/importer/reimport/applied/1-1/2', 485s ], 485s ), 485s ], 485s ) 485s def test_create_applied_tag( 485s repo, 485s input_repo, 485s validation_repo_delta, 485s validation_repo_expected_identical_refs, 485s ): 485s """ 485s Unit test that create_applied_tag creates the correct import tag 485s 485s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 485s temporary output repository 485s :param repo_builder.Repo input_repo: input repository data 485s :param dict validation_repo_delta: how to transform the input repository 485s into a "validation repository", expressed as a dict to 485s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 485s input repository. The validation repository is then used for the 485s purposes of comparison against the output repository. 485s :param list(str) validation_repo_expected_identical_refs: refs that must be 485s identical between the validation repository and the output repository 485s """ 485s publish_commit_str = str( 485s repo.raw_repo.get( 485s repo_builder.Commit().write(repo.raw_repo) 485s ).peel(pygit2.Commit).id 485s ) 485s 485s > input_repo.write(repo.raw_repo) 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:575: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmpfw0bnhzb/.git/'), record = {} 485s 485s def write(self, repo, record=None): 485s replace_placeholders(self) 485s record = record or dict() 485s written_commits = [ 485s commit.write(repo=repo, record=record) 485s for commit 485s in self.commit_list 485s ] 485s for name, target in self.branches.items(): 485s repo.create_branch( 485s name, 485s repo.get(target.write(repo)).peel(pygit2.Commit), 485s ) 485s for name, target in self.tags.items(): 485s repo.create_tag( 485s name, 485s target.write(repo), 485s > pygit2.GIT_OBJ_COMMIT, 485s self.tagger.signature, 485s 'Tag message', 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 485s _ test_get_changelog_parent_commits[input_repo1-parent_overrides1-changelog_versions1-PatchState.UNAPPLIED-expected_refs1] _ 485s 485s repo = 485s input_repo = 485s parent_overrides = {}, changelog_versions = ['1-2', '1-1'] 485s patch_state = 485s expected_refs = ['refs/tags/importer/import/1-1'] 485s 485s @pytest.mark.parametrize( 485s [ 485s 'input_repo', 485s 'parent_overrides', 485s 'changelog_versions', 485s 'patch_state', 485s 'expected_refs', 485s ], 485s [ 485s ( 485s repo_builder.Repo(), 485s {}, 485s ['1-2', '1-1',], 485s PatchState.UNAPPLIED, 485s [], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[repo_builder.Commit.from_spec(name='import')], 485s tags={'importer/import/1-1': Placeholder('import')}, 485s ), 485s {}, 485s ['1-2', '1-1'], 485s PatchState.UNAPPLIED, 485s ['refs/tags/importer/import/1-1'], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit.from_spec(name='import'), 485s repo_builder.Commit.from_spec(name='reimport', mutate=1), 485s ], 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 485s }, 485s ), 485s {}, 485s ['1-2', '1-1'], 485s PatchState.UNAPPLIED, 485s [ 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[repo_builder.Commit.from_spec(name='import')], 485s tags={'importer/import/1-1': Placeholder('import')}, 485s ), 485s {}, 485s ['1-3', '1-2', '1-1'], 485s PatchState.UNAPPLIED, 485s ['refs/tags/importer/import/1-1'], 485s ), 485s ( 485s repo_builder.Repo(), 485s {}, 485s ['1-2', '1-1',], 485s PatchState.APPLIED, 485s [], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[repo_builder.Commit.from_spec(name='applied')], 485s tags={'importer/applied/1-1': Placeholder('applied')}, 485s ), 485s {}, 485s ['1-2', '1-1'], 485s PatchState.APPLIED, 485s ['refs/tags/importer/applied/1-1'], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit.from_spec(name='import'), 485s repo_builder.Commit.from_spec(name='reimport', mutate=1), 485s ], 485s tags={ 485s 'importer/applied/1-1': Placeholder('import'), 485s 'importer/reimport/applied/1-1/0': Placeholder('import'), 485s 'importer/reimport/applied/1-1/1': Placeholder('reimport'), 485s }, 485s ), 485s {}, 485s ['1-2', '1-1'], 485s PatchState.APPLIED, 485s [ 485s 'refs/tags/importer/reimport/applied/1-1/0', 485s 'refs/tags/importer/reimport/applied/1-1/1', 485s ], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[repo_builder.Commit.from_spec(name='applied')], 485s tags={'importer/applied/1-1': Placeholder('applied')}, 485s ), 485s {}, 485s ['1-3', '1-2', '1-1'], 485s PatchState.APPLIED, 485s ['refs/tags/importer/applied/1-1'], 485s ), 485s ], 485s ) 485s def test_get_changelog_parent_commits( 485s repo, 485s input_repo, 485s parent_overrides, 485s changelog_versions, 485s patch_state, 485s expected_refs, 485s ): 485s """Test that get_changelog_parent_commits is generally correct 485s 485s This is the general parameterised test for the common case uses of 485s target.get_changelog_parent_commits. 485s 485s :param GitUbuntuRepository repo: fixture providing a temporary 485s GitUbuntuRepository instance to use 485s :param repo_builder.Repo input_repo: the input repository data to use that 485s will be populated into @repo before @repo is passed through to 485s get_changelog_parent_commits 485s :param dict parent_overrides: passed through to 485s get_changelog_parent_commits. 485s :param PatchState patch_state: passed through to 485s get_changelog_parent_commits 485s :param list(str) expected_refs: the expected return value of 485s get_changelog_parent_commits expressed using a list of reference names. 485s Since get_changelog_parent_commits returns a list of commit hash 485s strings, the reference names will need to be dereferenced before 485s comparison; this way the test parameters don't need to be opaque hash 485s strings. 485s """ 485s > input_repo.write(repo.raw_repo) 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:721: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmp2879xq78/.git/'), record = {} 485s 485s def write(self, repo, record=None): 485s replace_placeholders(self) 485s record = record or dict() 485s written_commits = [ 485s commit.write(repo=repo, record=record) 485s for commit 485s in self.commit_list 485s ] 485s for name, target in self.branches.items(): 485s repo.create_branch( 485s name, 485s repo.get(target.write(repo)).peel(pygit2.Commit), 485s ) 485s for name, target in self.tags.items(): 485s repo.create_tag( 485s name, 485s target.write(repo), 485s > pygit2.GIT_OBJ_COMMIT, 485s self.tagger.signature, 485s 'Tag message', 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 485s ----------------------------- Captured stdout call ----------------------------- 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s ----------------------------- Captured stderr call ----------------------------- 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s _ test_get_changelog_parent_commits[input_repo2-parent_overrides2-changelog_versions2-PatchState.UNAPPLIED-expected_refs2] _ 485s 485s repo = 485s input_repo = 485s parent_overrides = {}, changelog_versions = ['1-2', '1-1'] 485s patch_state = 485s expected_refs = ['refs/tags/importer/reimport/import/1-1/0', 'refs/tags/importer/reimport/import/1-1/1'] 485s 485s @pytest.mark.parametrize( 485s [ 485s 'input_repo', 485s 'parent_overrides', 485s 'changelog_versions', 485s 'patch_state', 485s 'expected_refs', 485s ], 485s [ 485s ( 485s repo_builder.Repo(), 485s {}, 485s ['1-2', '1-1',], 485s PatchState.UNAPPLIED, 485s [], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[repo_builder.Commit.from_spec(name='import')], 485s tags={'importer/import/1-1': Placeholder('import')}, 485s ), 485s {}, 485s ['1-2', '1-1'], 485s PatchState.UNAPPLIED, 485s ['refs/tags/importer/import/1-1'], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit.from_spec(name='import'), 485s repo_builder.Commit.from_spec(name='reimport', mutate=1), 485s ], 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 485s }, 485s ), 485s {}, 485s ['1-2', '1-1'], 485s PatchState.UNAPPLIED, 485s [ 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[repo_builder.Commit.from_spec(name='import')], 485s tags={'importer/import/1-1': Placeholder('import')}, 485s ), 485s {}, 485s ['1-3', '1-2', '1-1'], 485s PatchState.UNAPPLIED, 485s ['refs/tags/importer/import/1-1'], 485s ), 485s ( 485s repo_builder.Repo(), 485s {}, 485s ['1-2', '1-1',], 485s PatchState.APPLIED, 485s [], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[repo_builder.Commit.from_spec(name='applied')], 485s tags={'importer/applied/1-1': Placeholder('applied')}, 485s ), 485s {}, 485s ['1-2', '1-1'], 485s PatchState.APPLIED, 485s ['refs/tags/importer/applied/1-1'], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit.from_spec(name='import'), 485s repo_builder.Commit.from_spec(name='reimport', mutate=1), 485s ], 485s tags={ 485s 'importer/applied/1-1': Placeholder('import'), 485s 'importer/reimport/applied/1-1/0': Placeholder('import'), 485s 'importer/reimport/applied/1-1/1': Placeholder('reimport'), 485s }, 485s ), 485s {}, 485s ['1-2', '1-1'], 485s PatchState.APPLIED, 485s [ 485s 'refs/tags/importer/reimport/applied/1-1/0', 485s 'refs/tags/importer/reimport/applied/1-1/1', 485s ], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[repo_builder.Commit.from_spec(name='applied')], 485s tags={'importer/applied/1-1': Placeholder('applied')}, 485s ), 485s {}, 485s ['1-3', '1-2', '1-1'], 485s PatchState.APPLIED, 485s ['refs/tags/importer/applied/1-1'], 485s ), 485s ], 485s ) 485s def test_get_changelog_parent_commits( 485s repo, 485s input_repo, 485s parent_overrides, 485s changelog_versions, 485s patch_state, 485s expected_refs, 485s ): 485s """Test that get_changelog_parent_commits is generally correct 485s 485s This is the general parameterised test for the common case uses of 485s target.get_changelog_parent_commits. 485s 485s :param GitUbuntuRepository repo: fixture providing a temporary 485s GitUbuntuRepository instance to use 485s :param repo_builder.Repo input_repo: the input repository data to use that 485s will be populated into @repo before @repo is passed through to 485s get_changelog_parent_commits 485s :param dict parent_overrides: passed through to 485s get_changelog_parent_commits. 485s :param PatchState patch_state: passed through to 485s get_changelog_parent_commits 485s :param list(str) expected_refs: the expected return value of 485s get_changelog_parent_commits expressed using a list of reference names. 485s Since get_changelog_parent_commits returns a list of commit hash 485s strings, the reference names will need to be dereferenced before 485s comparison; this way the test parameters don't need to be opaque hash 485s strings. 485s """ 485s > input_repo.write(repo.raw_repo) 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:721: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmpo_olg84t/.git/'), record = {} 485s 485s def write(self, repo, record=None): 485s replace_placeholders(self) 485s record = record or dict() 485s written_commits = [ 485s commit.write(repo=repo, record=record) 485s for commit 485s in self.commit_list 485s ] 485s for name, target in self.branches.items(): 485s repo.create_branch( 485s name, 485s repo.get(target.write(repo)).peel(pygit2.Commit), 485s ) 485s for name, target in self.tags.items(): 485s repo.create_tag( 485s name, 485s target.write(repo), 485s > pygit2.GIT_OBJ_COMMIT, 485s self.tagger.signature, 485s 'Tag message', 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 485s ----------------------------- Captured stdout call ----------------------------- 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s ----------------------------- Captured stderr call ----------------------------- 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s _ test_get_changelog_parent_commits[input_repo3-parent_overrides3-changelog_versions3-PatchState.UNAPPLIED-expected_refs3] _ 485s 485s repo = 485s input_repo = 485s parent_overrides = {}, changelog_versions = ['1-3', '1-2', '1-1'] 485s patch_state = 485s expected_refs = ['refs/tags/importer/import/1-1'] 485s 485s @pytest.mark.parametrize( 485s [ 485s 'input_repo', 485s 'parent_overrides', 485s 'changelog_versions', 485s 'patch_state', 485s 'expected_refs', 485s ], 485s [ 485s ( 485s repo_builder.Repo(), 485s {}, 485s ['1-2', '1-1',], 485s PatchState.UNAPPLIED, 485s [], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[repo_builder.Commit.from_spec(name='import')], 485s tags={'importer/import/1-1': Placeholder('import')}, 485s ), 485s {}, 485s ['1-2', '1-1'], 485s PatchState.UNAPPLIED, 485s ['refs/tags/importer/import/1-1'], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit.from_spec(name='import'), 485s repo_builder.Commit.from_spec(name='reimport', mutate=1), 485s ], 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 485s }, 485s ), 485s {}, 485s ['1-2', '1-1'], 485s PatchState.UNAPPLIED, 485s [ 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[repo_builder.Commit.from_spec(name='import')], 485s tags={'importer/import/1-1': Placeholder('import')}, 485s ), 485s {}, 485s ['1-3', '1-2', '1-1'], 485s PatchState.UNAPPLIED, 485s ['refs/tags/importer/import/1-1'], 485s ), 485s ( 485s repo_builder.Repo(), 485s {}, 485s ['1-2', '1-1',], 485s PatchState.APPLIED, 485s [], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[repo_builder.Commit.from_spec(name='applied')], 485s tags={'importer/applied/1-1': Placeholder('applied')}, 485s ), 485s {}, 485s ['1-2', '1-1'], 485s PatchState.APPLIED, 485s ['refs/tags/importer/applied/1-1'], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit.from_spec(name='import'), 485s repo_builder.Commit.from_spec(name='reimport', mutate=1), 485s ], 485s tags={ 485s 'importer/applied/1-1': Placeholder('import'), 485s 'importer/reimport/applied/1-1/0': Placeholder('import'), 485s 'importer/reimport/applied/1-1/1': Placeholder('reimport'), 485s }, 485s ), 485s {}, 485s ['1-2', '1-1'], 485s PatchState.APPLIED, 485s [ 485s 'refs/tags/importer/reimport/applied/1-1/0', 485s 'refs/tags/importer/reimport/applied/1-1/1', 485s ], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[repo_builder.Commit.from_spec(name='applied')], 485s tags={'importer/applied/1-1': Placeholder('applied')}, 485s ), 485s {}, 485s ['1-3', '1-2', '1-1'], 485s PatchState.APPLIED, 485s ['refs/tags/importer/applied/1-1'], 485s ), 485s ], 485s ) 485s def test_get_changelog_parent_commits( 485s repo, 485s input_repo, 485s parent_overrides, 485s changelog_versions, 485s patch_state, 485s expected_refs, 485s ): 485s """Test that get_changelog_parent_commits is generally correct 485s 485s This is the general parameterised test for the common case uses of 485s target.get_changelog_parent_commits. 485s 485s :param GitUbuntuRepository repo: fixture providing a temporary 485s GitUbuntuRepository instance to use 485s :param repo_builder.Repo input_repo: the input repository data to use that 485s will be populated into @repo before @repo is passed through to 485s get_changelog_parent_commits 485s :param dict parent_overrides: passed through to 485s get_changelog_parent_commits. 485s :param PatchState patch_state: passed through to 485s get_changelog_parent_commits 485s :param list(str) expected_refs: the expected return value of 485s get_changelog_parent_commits expressed using a list of reference names. 485s Since get_changelog_parent_commits returns a list of commit hash 485s strings, the reference names will need to be dereferenced before 485s comparison; this way the test parameters don't need to be opaque hash 485s strings. 485s """ 485s > input_repo.write(repo.raw_repo) 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:721: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmpfi_pss8c/.git/'), record = {} 485s 485s def write(self, repo, record=None): 485s replace_placeholders(self) 485s record = record or dict() 485s written_commits = [ 485s commit.write(repo=repo, record=record) 485s for commit 485s in self.commit_list 485s ] 485s for name, target in self.branches.items(): 485s repo.create_branch( 485s name, 485s repo.get(target.write(repo)).peel(pygit2.Commit), 485s ) 485s for name, target in self.tags.items(): 485s repo.create_tag( 485s name, 485s target.write(repo), 485s > pygit2.GIT_OBJ_COMMIT, 485s self.tagger.signature, 485s 'Tag message', 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 485s ----------------------------- Captured stdout call ----------------------------- 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s ----------------------------- Captured stderr call ----------------------------- 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s _ test_get_changelog_parent_commits[input_repo5-parent_overrides5-changelog_versions5-PatchState.APPLIED-expected_refs5] _ 485s 485s repo = 485s input_repo = 485s parent_overrides = {}, changelog_versions = ['1-2', '1-1'] 485s patch_state = 485s expected_refs = ['refs/tags/importer/applied/1-1'] 485s 485s @pytest.mark.parametrize( 485s [ 485s 'input_repo', 485s 'parent_overrides', 485s 'changelog_versions', 485s 'patch_state', 485s 'expected_refs', 485s ], 485s [ 485s ( 485s repo_builder.Repo(), 485s {}, 485s ['1-2', '1-1',], 485s PatchState.UNAPPLIED, 485s [], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[repo_builder.Commit.from_spec(name='import')], 485s tags={'importer/import/1-1': Placeholder('import')}, 485s ), 485s {}, 485s ['1-2', '1-1'], 485s PatchState.UNAPPLIED, 485s ['refs/tags/importer/import/1-1'], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit.from_spec(name='import'), 485s repo_builder.Commit.from_spec(name='reimport', mutate=1), 485s ], 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 485s }, 485s ), 485s {}, 485s ['1-2', '1-1'], 485s PatchState.UNAPPLIED, 485s [ 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[repo_builder.Commit.from_spec(name='import')], 485s tags={'importer/import/1-1': Placeholder('import')}, 485s ), 485s {}, 485s ['1-3', '1-2', '1-1'], 485s PatchState.UNAPPLIED, 485s ['refs/tags/importer/import/1-1'], 485s ), 485s ( 485s repo_builder.Repo(), 485s {}, 485s ['1-2', '1-1',], 485s PatchState.APPLIED, 485s [], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[repo_builder.Commit.from_spec(name='applied')], 485s tags={'importer/applied/1-1': Placeholder('applied')}, 485s ), 485s {}, 485s ['1-2', '1-1'], 485s PatchState.APPLIED, 485s ['refs/tags/importer/applied/1-1'], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit.from_spec(name='import'), 485s repo_builder.Commit.from_spec(name='reimport', mutate=1), 485s ], 485s tags={ 485s 'importer/applied/1-1': Placeholder('import'), 485s 'importer/reimport/applied/1-1/0': Placeholder('import'), 485s 'importer/reimport/applied/1-1/1': Placeholder('reimport'), 485s }, 485s ), 485s {}, 485s ['1-2', '1-1'], 485s PatchState.APPLIED, 485s [ 485s 'refs/tags/importer/reimport/applied/1-1/0', 485s 'refs/tags/importer/reimport/applied/1-1/1', 485s ], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[repo_builder.Commit.from_spec(name='applied')], 485s tags={'importer/applied/1-1': Placeholder('applied')}, 485s ), 485s {}, 485s ['1-3', '1-2', '1-1'], 485s PatchState.APPLIED, 485s ['refs/tags/importer/applied/1-1'], 485s ), 485s ], 485s ) 485s def test_get_changelog_parent_commits( 485s repo, 485s input_repo, 485s parent_overrides, 485s changelog_versions, 485s patch_state, 485s expected_refs, 485s ): 485s """Test that get_changelog_parent_commits is generally correct 485s 485s This is the general parameterised test for the common case uses of 485s target.get_changelog_parent_commits. 485s 485s :param GitUbuntuRepository repo: fixture providing a temporary 485s GitUbuntuRepository instance to use 485s :param repo_builder.Repo input_repo: the input repository data to use that 485s will be populated into @repo before @repo is passed through to 485s get_changelog_parent_commits 485s :param dict parent_overrides: passed through to 485s get_changelog_parent_commits. 485s :param PatchState patch_state: passed through to 485s get_changelog_parent_commits 485s :param list(str) expected_refs: the expected return value of 485s get_changelog_parent_commits expressed using a list of reference names. 485s Since get_changelog_parent_commits returns a list of commit hash 485s strings, the reference names will need to be dereferenced before 485s comparison; this way the test parameters don't need to be opaque hash 485s strings. 485s """ 485s > input_repo.write(repo.raw_repo) 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:721: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmpk7x3m4hz/.git/'), record = {} 485s 485s def write(self, repo, record=None): 485s replace_placeholders(self) 485s record = record or dict() 485s written_commits = [ 485s commit.write(repo=repo, record=record) 485s for commit 485s in self.commit_list 485s ] 485s for name, target in self.branches.items(): 485s repo.create_branch( 485s name, 485s repo.get(target.write(repo)).peel(pygit2.Commit), 485s ) 485s for name, target in self.tags.items(): 485s repo.create_tag( 485s name, 485s target.write(repo), 485s > pygit2.GIT_OBJ_COMMIT, 485s self.tagger.signature, 485s 'Tag message', 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 485s ----------------------------- Captured stdout call ----------------------------- 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s ----------------------------- Captured stderr call ----------------------------- 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s _ test_get_changelog_parent_commits[input_repo6-parent_overrides6-changelog_versions6-PatchState.APPLIED-expected_refs6] _ 485s 485s repo = 485s input_repo = 485s parent_overrides = {}, changelog_versions = ['1-2', '1-1'] 485s patch_state = 485s expected_refs = ['refs/tags/importer/reimport/applied/1-1/0', 'refs/tags/importer/reimport/applied/1-1/1'] 485s 485s @pytest.mark.parametrize( 485s [ 485s 'input_repo', 485s 'parent_overrides', 485s 'changelog_versions', 485s 'patch_state', 485s 'expected_refs', 485s ], 485s [ 485s ( 485s repo_builder.Repo(), 485s {}, 485s ['1-2', '1-1',], 485s PatchState.UNAPPLIED, 485s [], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[repo_builder.Commit.from_spec(name='import')], 485s tags={'importer/import/1-1': Placeholder('import')}, 485s ), 485s {}, 485s ['1-2', '1-1'], 485s PatchState.UNAPPLIED, 485s ['refs/tags/importer/import/1-1'], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit.from_spec(name='import'), 485s repo_builder.Commit.from_spec(name='reimport', mutate=1), 485s ], 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 485s }, 485s ), 485s {}, 485s ['1-2', '1-1'], 485s PatchState.UNAPPLIED, 485s [ 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[repo_builder.Commit.from_spec(name='import')], 485s tags={'importer/import/1-1': Placeholder('import')}, 485s ), 485s {}, 485s ['1-3', '1-2', '1-1'], 485s PatchState.UNAPPLIED, 485s ['refs/tags/importer/import/1-1'], 485s ), 485s ( 485s repo_builder.Repo(), 485s {}, 485s ['1-2', '1-1',], 485s PatchState.APPLIED, 485s [], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[repo_builder.Commit.from_spec(name='applied')], 485s tags={'importer/applied/1-1': Placeholder('applied')}, 485s ), 485s {}, 485s ['1-2', '1-1'], 485s PatchState.APPLIED, 485s ['refs/tags/importer/applied/1-1'], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit.from_spec(name='import'), 485s repo_builder.Commit.from_spec(name='reimport', mutate=1), 485s ], 485s tags={ 485s 'importer/applied/1-1': Placeholder('import'), 485s 'importer/reimport/applied/1-1/0': Placeholder('import'), 485s 'importer/reimport/applied/1-1/1': Placeholder('reimport'), 485s }, 485s ), 485s {}, 485s ['1-2', '1-1'], 485s PatchState.APPLIED, 485s [ 485s 'refs/tags/importer/reimport/applied/1-1/0', 485s 'refs/tags/importer/reimport/applied/1-1/1', 485s ], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[repo_builder.Commit.from_spec(name='applied')], 485s tags={'importer/applied/1-1': Placeholder('applied')}, 485s ), 485s {}, 485s ['1-3', '1-2', '1-1'], 485s PatchState.APPLIED, 485s ['refs/tags/importer/applied/1-1'], 485s ), 485s ], 485s ) 485s def test_get_changelog_parent_commits( 485s repo, 485s input_repo, 485s parent_overrides, 485s changelog_versions, 485s patch_state, 485s expected_refs, 485s ): 485s """Test that get_changelog_parent_commits is generally correct 485s 485s This is the general parameterised test for the common case uses of 485s target.get_changelog_parent_commits. 485s 485s :param GitUbuntuRepository repo: fixture providing a temporary 485s GitUbuntuRepository instance to use 485s :param repo_builder.Repo input_repo: the input repository data to use that 485s will be populated into @repo before @repo is passed through to 485s get_changelog_parent_commits 485s :param dict parent_overrides: passed through to 485s get_changelog_parent_commits. 485s :param PatchState patch_state: passed through to 485s get_changelog_parent_commits 485s :param list(str) expected_refs: the expected return value of 485s get_changelog_parent_commits expressed using a list of reference names. 485s Since get_changelog_parent_commits returns a list of commit hash 485s strings, the reference names will need to be dereferenced before 485s comparison; this way the test parameters don't need to be opaque hash 485s strings. 485s """ 485s > input_repo.write(repo.raw_repo) 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:721: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmpoyvq_fas/.git/'), record = {} 485s 485s def write(self, repo, record=None): 485s replace_placeholders(self) 485s record = record or dict() 485s written_commits = [ 485s commit.write(repo=repo, record=record) 485s for commit 485s in self.commit_list 485s ] 485s for name, target in self.branches.items(): 485s repo.create_branch( 485s name, 485s repo.get(target.write(repo)).peel(pygit2.Commit), 485s ) 485s for name, target in self.tags.items(): 485s repo.create_tag( 485s name, 485s target.write(repo), 485s > pygit2.GIT_OBJ_COMMIT, 485s self.tagger.signature, 485s 'Tag message', 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 485s ----------------------------- Captured stdout call ----------------------------- 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s ----------------------------- Captured stderr call ----------------------------- 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s _ test_get_changelog_parent_commits[input_repo7-parent_overrides7-changelog_versions7-PatchState.APPLIED-expected_refs7] _ 485s 485s repo = 485s input_repo = 485s parent_overrides = {}, changelog_versions = ['1-3', '1-2', '1-1'] 485s patch_state = 485s expected_refs = ['refs/tags/importer/applied/1-1'] 485s 485s @pytest.mark.parametrize( 485s [ 485s 'input_repo', 485s 'parent_overrides', 485s 'changelog_versions', 485s 'patch_state', 485s 'expected_refs', 485s ], 485s [ 485s ( 485s repo_builder.Repo(), 485s {}, 485s ['1-2', '1-1',], 485s PatchState.UNAPPLIED, 485s [], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[repo_builder.Commit.from_spec(name='import')], 485s tags={'importer/import/1-1': Placeholder('import')}, 485s ), 485s {}, 485s ['1-2', '1-1'], 485s PatchState.UNAPPLIED, 485s ['refs/tags/importer/import/1-1'], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit.from_spec(name='import'), 485s repo_builder.Commit.from_spec(name='reimport', mutate=1), 485s ], 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/reimport/import/1-1/0': Placeholder('import'), 485s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 485s }, 485s ), 485s {}, 485s ['1-2', '1-1'], 485s PatchState.UNAPPLIED, 485s [ 485s 'refs/tags/importer/reimport/import/1-1/0', 485s 'refs/tags/importer/reimport/import/1-1/1', 485s ], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[repo_builder.Commit.from_spec(name='import')], 485s tags={'importer/import/1-1': Placeholder('import')}, 485s ), 485s {}, 485s ['1-3', '1-2', '1-1'], 485s PatchState.UNAPPLIED, 485s ['refs/tags/importer/import/1-1'], 485s ), 485s ( 485s repo_builder.Repo(), 485s {}, 485s ['1-2', '1-1',], 485s PatchState.APPLIED, 485s [], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[repo_builder.Commit.from_spec(name='applied')], 485s tags={'importer/applied/1-1': Placeholder('applied')}, 485s ), 485s {}, 485s ['1-2', '1-1'], 485s PatchState.APPLIED, 485s ['refs/tags/importer/applied/1-1'], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit.from_spec(name='import'), 485s repo_builder.Commit.from_spec(name='reimport', mutate=1), 485s ], 485s tags={ 485s 'importer/applied/1-1': Placeholder('import'), 485s 'importer/reimport/applied/1-1/0': Placeholder('import'), 485s 'importer/reimport/applied/1-1/1': Placeholder('reimport'), 485s }, 485s ), 485s {}, 485s ['1-2', '1-1'], 485s PatchState.APPLIED, 485s [ 485s 'refs/tags/importer/reimport/applied/1-1/0', 485s 'refs/tags/importer/reimport/applied/1-1/1', 485s ], 485s ), 485s ( 485s repo_builder.Repo( 485s commits=[repo_builder.Commit.from_spec(name='applied')], 485s tags={'importer/applied/1-1': Placeholder('applied')}, 485s ), 485s {}, 485s ['1-3', '1-2', '1-1'], 485s PatchState.APPLIED, 485s ['refs/tags/importer/applied/1-1'], 485s ), 485s ], 485s ) 485s def test_get_changelog_parent_commits( 485s repo, 485s input_repo, 485s parent_overrides, 485s changelog_versions, 485s patch_state, 485s expected_refs, 485s ): 485s """Test that get_changelog_parent_commits is generally correct 485s 485s This is the general parameterised test for the common case uses of 485s target.get_changelog_parent_commits. 485s 485s :param GitUbuntuRepository repo: fixture providing a temporary 485s GitUbuntuRepository instance to use 485s :param repo_builder.Repo input_repo: the input repository data to use that 485s will be populated into @repo before @repo is passed through to 485s get_changelog_parent_commits 485s :param dict parent_overrides: passed through to 485s get_changelog_parent_commits. 485s :param PatchState patch_state: passed through to 485s get_changelog_parent_commits 485s :param list(str) expected_refs: the expected return value of 485s get_changelog_parent_commits expressed using a list of reference names. 485s Since get_changelog_parent_commits returns a list of commit hash 485s strings, the reference names will need to be dereferenced before 485s comparison; this way the test parameters don't need to be opaque hash 485s strings. 485s """ 485s > input_repo.write(repo.raw_repo) 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:721: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmppkxc5gf2/.git/'), record = {} 485s 485s def write(self, repo, record=None): 485s replace_placeholders(self) 485s record = record or dict() 485s written_commits = [ 485s commit.write(repo=repo, record=record) 485s for commit 485s in self.commit_list 485s ] 485s for name, target in self.branches.items(): 485s repo.create_branch( 485s name, 485s repo.get(target.write(repo)).peel(pygit2.Commit), 485s ) 485s for name, target in self.tags.items(): 485s repo.create_tag( 485s name, 485s target.write(repo), 485s > pygit2.GIT_OBJ_COMMIT, 485s self.tagger.signature, 485s 'Tag message', 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 485s ----------------------------- Captured stdout call ----------------------------- 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s ----------------------------- Captured stderr call ----------------------------- 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s _________ test_validate_rich_history[input_repo0-published_spec0-True] _________ 485s 485s repo = 485s input_repo = 485s published_spec = {'changelog_versions': ['1-2', '1-1']}, expected_result = True 485s 485s @pytest.mark.parametrize( 485s [ 485s 'input_repo', 485s 'published_spec', 485s 'expected_result', 485s ], 485s [ 485s ( 485s # Common case: upload tag has a changelog parent as an ancestor 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit.from_spec(name='import'), 485s repo_builder.Commit.from_spec( 485s name='upload', 485s changelog_versions=['1-2', '1-1'], 485s parents=[Placeholder('import')], 485s ), 485s ], 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/upload/1-2': Placeholder('upload'), 485s }, 485s ), 485s {'changelog_versions': ['1-2', '1-1']}, 485s True, 485s ), 485s ( 485s # Upload tag is the first one, with no parents present 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit.from_spec( 485s name='upload', 485s version='1-2', 485s ), 485s ], 485s tags={ 485s 'importer/upload/1-2': Placeholder('upload'), 485s }, 485s ), 485s {'changelog_versions': ['1-2']}, 485s True, 485s ), 485s ( 485s # Upload tag mismatches published tree but is otherwise correct 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit.from_spec(name='import'), 485s repo_builder.Commit.from_spec( 485s name='upload', 485s changelog_versions=['1-2', '1-1'], 485s parents=[Placeholder('import')], 485s mutate=True, 485s ), 485s ], 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/upload/1-2': Placeholder('upload'), 485s }, 485s ), 485s {'changelog_versions': ['1-2', '1-1']}, 485s target.RichHistoryTreeMismatch, 485s ), 485s ( 485s # Upload tag doesn't have a changelog parent as an ancestor but is 485s # otherwise correct 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit.from_spec(name='import'), 485s repo_builder.Commit.from_spec( 485s name='upload', 485s changelog_versions=['1-2', '1-1'], 485s ), 485s ], 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/upload/1-2': Placeholder('upload'), 485s }, 485s ), 485s {'changelog_versions': ['1-2', '1-1']}, 485s target.RichHistoryHasNoChangelogParentAncestor, 485s ), 485s ], 485s ) 485s def test_validate_rich_history( 485s repo, 485s input_repo, 485s published_spec, 485s expected_result, 485s ): 485s """ 485s General test for validate_rich_history(). 485s 485s This unit tests validate_rich_history() for various parameterized cases. 485s Given an input repository and the specification of a Launchpad publication 485s of a source package, we check that validate_rich_history() correctly 485s accepts or rejects the rich history corresponding to the upload tag named 485s 'importer/upload/1-2'. It is assumed that the package being imported is 485s always of version '1-2' for all parameter sets. 485s 485s Since the target function requires rich history, the case of there not 485s being rich history does not need to be tested here, as it wouldn't be 485s called in this case. 485s 485s validate_rich_history() is generic for all sourced rich history, not just 485s rich history sourced from an upload tag. But since it is independent of how 485s the rich history commit arrived, it is easiest to use upload tags to test 485s it; this results in coverage for all sources. 485s 485s :param GitUbuntuRepository repo: fixture providing a temporary 485s GitUbuntuRepository instance to use 485s :param repo_builder.Repo input_repo: input repository data 485s :param dict published_spec: the package simulated being imported from the 485s archive, specified as a dict to pass as **kwargs to 485s repo_builder.Commit.from_spec() 485s :param bool expected_result: the expected return value of, or exception 485s raised by, the call to validate_rich_history() 485s """ 485s > input_repo.write(repo.raw_repo) 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:910: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmp5ucbn_3q/.git/'), record = {} 485s 485s def write(self, repo, record=None): 485s replace_placeholders(self) 485s record = record or dict() 485s written_commits = [ 485s commit.write(repo=repo, record=record) 485s for commit 485s in self.commit_list 485s ] 485s for name, target in self.branches.items(): 485s repo.create_branch( 485s name, 485s repo.get(target.write(repo)).peel(pygit2.Commit), 485s ) 485s for name, target in self.tags.items(): 485s repo.create_tag( 485s name, 485s target.write(repo), 485s > pygit2.GIT_OBJ_COMMIT, 485s self.tagger.signature, 485s 'Tag message', 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 485s ----------------------------- Captured stdout call ----------------------------- 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-2.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-2.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s ----------------------------- Captured stderr call ----------------------------- 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s _________ test_validate_rich_history[input_repo1-published_spec1-True] _________ 485s 485s repo = 485s input_repo = 485s published_spec = {'changelog_versions': ['1-2']}, expected_result = True 485s 485s @pytest.mark.parametrize( 485s [ 485s 'input_repo', 485s 'published_spec', 485s 'expected_result', 485s ], 485s [ 485s ( 485s # Common case: upload tag has a changelog parent as an ancestor 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit.from_spec(name='import'), 485s repo_builder.Commit.from_spec( 485s name='upload', 485s changelog_versions=['1-2', '1-1'], 485s parents=[Placeholder('import')], 485s ), 485s ], 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/upload/1-2': Placeholder('upload'), 485s }, 485s ), 485s {'changelog_versions': ['1-2', '1-1']}, 485s True, 485s ), 485s ( 485s # Upload tag is the first one, with no parents present 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit.from_spec( 485s name='upload', 485s version='1-2', 485s ), 485s ], 485s tags={ 485s 'importer/upload/1-2': Placeholder('upload'), 485s }, 485s ), 485s {'changelog_versions': ['1-2']}, 485s True, 485s ), 485s ( 485s # Upload tag mismatches published tree but is otherwise correct 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit.from_spec(name='import'), 485s repo_builder.Commit.from_spec( 485s name='upload', 485s changelog_versions=['1-2', '1-1'], 485s parents=[Placeholder('import')], 485s mutate=True, 485s ), 485s ], 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/upload/1-2': Placeholder('upload'), 485s }, 485s ), 485s {'changelog_versions': ['1-2', '1-1']}, 485s target.RichHistoryTreeMismatch, 485s ), 485s ( 485s # Upload tag doesn't have a changelog parent as an ancestor but is 485s # otherwise correct 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit.from_spec(name='import'), 485s repo_builder.Commit.from_spec( 485s name='upload', 485s changelog_versions=['1-2', '1-1'], 485s ), 485s ], 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/upload/1-2': Placeholder('upload'), 485s }, 485s ), 485s {'changelog_versions': ['1-2', '1-1']}, 485s target.RichHistoryHasNoChangelogParentAncestor, 485s ), 485s ], 485s ) 485s def test_validate_rich_history( 485s repo, 485s input_repo, 485s published_spec, 485s expected_result, 485s ): 485s """ 485s General test for validate_rich_history(). 485s 485s This unit tests validate_rich_history() for various parameterized cases. 485s Given an input repository and the specification of a Launchpad publication 485s of a source package, we check that validate_rich_history() correctly 485s accepts or rejects the rich history corresponding to the upload tag named 485s 'importer/upload/1-2'. It is assumed that the package being imported is 485s always of version '1-2' for all parameter sets. 485s 485s Since the target function requires rich history, the case of there not 485s being rich history does not need to be tested here, as it wouldn't be 485s called in this case. 485s 485s validate_rich_history() is generic for all sourced rich history, not just 485s rich history sourced from an upload tag. But since it is independent of how 485s the rich history commit arrived, it is easiest to use upload tags to test 485s it; this results in coverage for all sources. 485s 485s :param GitUbuntuRepository repo: fixture providing a temporary 485s GitUbuntuRepository instance to use 485s :param repo_builder.Repo input_repo: input repository data 485s :param dict published_spec: the package simulated being imported from the 485s archive, specified as a dict to pass as **kwargs to 485s repo_builder.Commit.from_spec() 485s :param bool expected_result: the expected return value of, or exception 485s raised by, the call to validate_rich_history() 485s """ 485s > input_repo.write(repo.raw_repo) 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:910: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmpmhm8qegl/.git/'), record = {} 485s 485s def write(self, repo, record=None): 485s replace_placeholders(self) 485s record = record or dict() 485s written_commits = [ 485s commit.write(repo=repo, record=record) 485s for commit 485s in self.commit_list 485s ] 485s for name, target in self.branches.items(): 485s repo.create_branch( 485s name, 485s repo.get(target.write(repo)).peel(pygit2.Commit), 485s ) 485s for name, target in self.tags.items(): 485s repo.create_tag( 485s name, 485s target.write(repo), 485s > pygit2.GIT_OBJ_COMMIT, 485s self.tagger.signature, 485s 'Tag message', 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 485s ----------------------------- Captured stdout call ----------------------------- 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-2.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-2.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-2.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-2.dsc 485s ----------------------------- Captured stderr call ----------------------------- 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s _ test_validate_rich_history[input_repo2-published_spec2-RichHistoryTreeMismatch] _ 485s 485s repo = 485s input_repo = 485s published_spec = {'changelog_versions': ['1-2', '1-1']} 485s expected_result = 485s 485s @pytest.mark.parametrize( 485s [ 485s 'input_repo', 485s 'published_spec', 485s 'expected_result', 485s ], 485s [ 485s ( 485s # Common case: upload tag has a changelog parent as an ancestor 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit.from_spec(name='import'), 485s repo_builder.Commit.from_spec( 485s name='upload', 485s changelog_versions=['1-2', '1-1'], 485s parents=[Placeholder('import')], 485s ), 485s ], 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/upload/1-2': Placeholder('upload'), 485s }, 485s ), 485s {'changelog_versions': ['1-2', '1-1']}, 485s True, 485s ), 485s ( 485s # Upload tag is the first one, with no parents present 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit.from_spec( 485s name='upload', 485s version='1-2', 485s ), 485s ], 485s tags={ 485s 'importer/upload/1-2': Placeholder('upload'), 485s }, 485s ), 485s {'changelog_versions': ['1-2']}, 485s True, 485s ), 485s ( 485s # Upload tag mismatches published tree but is otherwise correct 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit.from_spec(name='import'), 485s repo_builder.Commit.from_spec( 485s name='upload', 485s changelog_versions=['1-2', '1-1'], 485s parents=[Placeholder('import')], 485s mutate=True, 485s ), 485s ], 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/upload/1-2': Placeholder('upload'), 485s }, 485s ), 485s {'changelog_versions': ['1-2', '1-1']}, 485s target.RichHistoryTreeMismatch, 485s ), 485s ( 485s # Upload tag doesn't have a changelog parent as an ancestor but is 485s # otherwise correct 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit.from_spec(name='import'), 485s repo_builder.Commit.from_spec( 485s name='upload', 485s changelog_versions=['1-2', '1-1'], 485s ), 485s ], 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/upload/1-2': Placeholder('upload'), 485s }, 485s ), 485s {'changelog_versions': ['1-2', '1-1']}, 485s target.RichHistoryHasNoChangelogParentAncestor, 485s ), 485s ], 485s ) 485s def test_validate_rich_history( 485s repo, 485s input_repo, 485s published_spec, 485s expected_result, 485s ): 485s """ 485s General test for validate_rich_history(). 485s 485s This unit tests validate_rich_history() for various parameterized cases. 485s Given an input repository and the specification of a Launchpad publication 485s of a source package, we check that validate_rich_history() correctly 485s accepts or rejects the rich history corresponding to the upload tag named 485s 'importer/upload/1-2'. It is assumed that the package being imported is 485s always of version '1-2' for all parameter sets. 485s 485s Since the target function requires rich history, the case of there not 485s being rich history does not need to be tested here, as it wouldn't be 485s called in this case. 485s 485s validate_rich_history() is generic for all sourced rich history, not just 485s rich history sourced from an upload tag. But since it is independent of how 485s the rich history commit arrived, it is easiest to use upload tags to test 485s it; this results in coverage for all sources. 485s 485s :param GitUbuntuRepository repo: fixture providing a temporary 485s GitUbuntuRepository instance to use 485s :param repo_builder.Repo input_repo: input repository data 485s :param dict published_spec: the package simulated being imported from the 485s archive, specified as a dict to pass as **kwargs to 485s repo_builder.Commit.from_spec() 485s :param bool expected_result: the expected return value of, or exception 485s raised by, the call to validate_rich_history() 485s """ 485s > input_repo.write(repo.raw_repo) 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:910: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmp_vwh0l95/.git/'), record = {} 485s 485s def write(self, repo, record=None): 485s replace_placeholders(self) 485s record = record or dict() 485s written_commits = [ 485s commit.write(repo=repo, record=record) 485s for commit 485s in self.commit_list 485s ] 485s for name, target in self.branches.items(): 485s repo.create_branch( 485s name, 485s repo.get(target.write(repo)).peel(pygit2.Commit), 485s ) 485s for name, target in self.tags.items(): 485s repo.create_tag( 485s name, 485s target.write(repo), 485s > pygit2.GIT_OBJ_COMMIT, 485s self.tagger.signature, 485s 'Tag message', 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 485s ----------------------------- Captured stdout call ----------------------------- 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-2.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-2.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s ----------------------------- Captured stderr call ----------------------------- 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s _ test_validate_rich_history[input_repo3-published_spec3-RichHistoryHasNoChangelogParentAncestor] _ 485s 485s repo = 485s input_repo = 485s published_spec = {'changelog_versions': ['1-2', '1-1']} 485s expected_result = 485s 485s @pytest.mark.parametrize( 485s [ 485s 'input_repo', 485s 'published_spec', 485s 'expected_result', 485s ], 485s [ 485s ( 485s # Common case: upload tag has a changelog parent as an ancestor 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit.from_spec(name='import'), 485s repo_builder.Commit.from_spec( 485s name='upload', 485s changelog_versions=['1-2', '1-1'], 485s parents=[Placeholder('import')], 485s ), 485s ], 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/upload/1-2': Placeholder('upload'), 485s }, 485s ), 485s {'changelog_versions': ['1-2', '1-1']}, 485s True, 485s ), 485s ( 485s # Upload tag is the first one, with no parents present 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit.from_spec( 485s name='upload', 485s version='1-2', 485s ), 485s ], 485s tags={ 485s 'importer/upload/1-2': Placeholder('upload'), 485s }, 485s ), 485s {'changelog_versions': ['1-2']}, 485s True, 485s ), 485s ( 485s # Upload tag mismatches published tree but is otherwise correct 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit.from_spec(name='import'), 485s repo_builder.Commit.from_spec( 485s name='upload', 485s changelog_versions=['1-2', '1-1'], 485s parents=[Placeholder('import')], 485s mutate=True, 485s ), 485s ], 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/upload/1-2': Placeholder('upload'), 485s }, 485s ), 485s {'changelog_versions': ['1-2', '1-1']}, 485s target.RichHistoryTreeMismatch, 485s ), 485s ( 485s # Upload tag doesn't have a changelog parent as an ancestor but is 485s # otherwise correct 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit.from_spec(name='import'), 485s repo_builder.Commit.from_spec( 485s name='upload', 485s changelog_versions=['1-2', '1-1'], 485s ), 485s ], 485s tags={ 485s 'importer/import/1-1': Placeholder('import'), 485s 'importer/upload/1-2': Placeholder('upload'), 485s }, 485s ), 485s {'changelog_versions': ['1-2', '1-1']}, 485s target.RichHistoryHasNoChangelogParentAncestor, 485s ), 485s ], 485s ) 485s def test_validate_rich_history( 485s repo, 485s input_repo, 485s published_spec, 485s expected_result, 485s ): 485s """ 485s General test for validate_rich_history(). 485s 485s This unit tests validate_rich_history() for various parameterized cases. 485s Given an input repository and the specification of a Launchpad publication 485s of a source package, we check that validate_rich_history() correctly 485s accepts or rejects the rich history corresponding to the upload tag named 485s 'importer/upload/1-2'. It is assumed that the package being imported is 485s always of version '1-2' for all parameter sets. 485s 485s Since the target function requires rich history, the case of there not 485s being rich history does not need to be tested here, as it wouldn't be 485s called in this case. 485s 485s validate_rich_history() is generic for all sourced rich history, not just 485s rich history sourced from an upload tag. But since it is independent of how 485s the rich history commit arrived, it is easiest to use upload tags to test 485s it; this results in coverage for all sources. 485s 485s :param GitUbuntuRepository repo: fixture providing a temporary 485s GitUbuntuRepository instance to use 485s :param repo_builder.Repo input_repo: input repository data 485s :param dict published_spec: the package simulated being imported from the 485s archive, specified as a dict to pass as **kwargs to 485s repo_builder.Commit.from_spec() 485s :param bool expected_result: the expected return value of, or exception 485s raised by, the call to validate_rich_history() 485s """ 485s > input_repo.write(repo.raw_repo) 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:910: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmp6_ruthy5/.git/'), record = {} 485s 485s def write(self, repo, record=None): 485s replace_placeholders(self) 485s record = record or dict() 485s written_commits = [ 485s commit.write(repo=repo, record=record) 485s for commit 485s in self.commit_list 485s ] 485s for name, target in self.branches.items(): 485s repo.create_branch( 485s name, 485s repo.get(target.write(repo)).peel(pygit2.Commit), 485s ) 485s for name, target in self.tags.items(): 485s repo.create_tag( 485s name, 485s target.write(repo), 485s > pygit2.GIT_OBJ_COMMIT, 485s self.tagger.signature, 485s 'Tag message', 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 485s ----------------------------- Captured stdout call ----------------------------- 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-2.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-2.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s ----------------------------- Captured stderr call ----------------------------- 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s ______________________ test_add_changelog_note_to_commit _______________________ 485s 485s repo = 485s 485s def test_add_changelog_note_to_commit(repo): 485s """add_changelog_note_to_commit should add the expected note""" 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit.from_spec(name='1-1'), 485s repo_builder.Commit.from_spec( 485s name='1-2', 485s changelog_versions=['1-1', '1-2'], 485s parents=[Placeholder('1-1')], 485s ), 485s ], 485s tags={'1-1': Placeholder('1-1'), '1-2': Placeholder('1-2')}, 485s > ).write(repo.raw_repo) 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:953: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmps9weza4j/.git/'), record = {} 485s 485s def write(self, repo, record=None): 485s replace_placeholders(self) 485s record = record or dict() 485s written_commits = [ 485s commit.write(repo=repo, record=record) 485s for commit 485s in self.commit_list 485s ] 485s for name, target in self.branches.items(): 485s repo.create_branch( 485s name, 485s repo.get(target.write(repo)).peel(pygit2.Commit), 485s ) 485s for name, target in self.tags.items(): 485s repo.create_tag( 485s name, 485s target.write(repo), 485s > pygit2.GIT_OBJ_COMMIT, 485s self.tagger.signature, 485s 'Tag message', 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 485s ----------------------------- Captured stdout call ----------------------------- 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s dpkg-source: info: using source format '3.0 (quilt)' 485s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 485s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 485s ----------------------------- Captured stderr call ----------------------------- 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s dpkg-source: warning: missing information for output field Standards-Version 485s ____________________ test_add_changelog_note_to_commit_utf8 ____________________ 485s 485s repo = 485s 485s def test_add_changelog_note_to_commit_utf8(repo): 485s """A changelog file with non-UTF8 should have such characters substituted 485s 485s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 485s temporary output repository 485s """ 485s test_utf8_error_changelog_path = os.path.join( 485s pkg_resources.resource_filename('gitubuntu', 'changelog_tests'), 485s 'test_utf8_error', 485s ) 485s with open(test_utf8_error_changelog_path, 'rb') as f: 485s utf8_changelog_blob = f.read() 485s 485s # We only need an example child commit with a debian/changelog file since 485s # this is the only file accessed by add_changelog_note_to_commit(). 485s # Further, the parent need only exist and can be empty. 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit(name='parent'), 485s repo_builder.Commit( 485s tree=repo_builder.Tree({'debian': repo_builder.Tree( 485s {'changelog': repo_builder.Blob(utf8_changelog_blob)} 485s )}), 485s name='child', 485s ) 485s ], 485s tags={'parent': Placeholder('parent'), 'child': Placeholder('child')}, 485s > ).write(repo.raw_repo) 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:1002: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmps83fxnk7/.git/'), record = {} 485s 485s def write(self, repo, record=None): 485s replace_placeholders(self) 485s record = record or dict() 485s written_commits = [ 485s commit.write(repo=repo, record=record) 485s for commit 485s in self.commit_list 485s ] 485s for name, target in self.branches.items(): 485s repo.create_branch( 485s name, 485s repo.get(target.write(repo)).peel(pygit2.Commit), 485s ) 485s for name, target in self.tags.items(): 485s repo.create_tag( 485s name, 485s target.write(repo), 485s > pygit2.GIT_OBJ_COMMIT, 485s self.tagger.signature, 485s 'Tag message', 485s ) 485s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 485s _________________ test_double_changelog_note_add_does_not_fail _________________ 485s 485s repo = 485s 485s def test_double_changelog_note_add_does_not_fail(repo): 485s """add_changelog_note_to_commit shouldn't fail if a note already exists""" 485s repo_builder.Repo( 485s commits=[ 485s repo_builder.Commit.from_spec(name='1-1'), 485s repo_builder.Commit.from_spec( 485s name='1-2', 485s changelog_versions=['1-1', '1-2'], 485s parents=[Placeholder('1-1')], 485s ), 485s ], 485s tags={'1-1': Placeholder('1-1'), '1-2': Placeholder('1-2')}, 485s > ).write(repo.raw_repo) 485s 485s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:1035: 485s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 485s 485s self = 485s repo = pygit2.Repository('/tmp/tmp96xuqyy_/.git/'), record = {} 485s 486s def write(self, repo, record=None): 486s replace_placeholders(self) 486s record = record or dict() 486s written_commits = [ 486s commit.write(repo=repo, record=record) 486s for commit 486s in self.commit_list 486s ] 486s for name, target in self.branches.items(): 486s repo.create_branch( 486s name, 486s repo.get(target.write(repo)).peel(pygit2.Commit), 486s ) 486s for name, target in self.tags.items(): 486s repo.create_tag( 486s name, 486s target.write(repo), 486s > pygit2.GIT_OBJ_COMMIT, 486s self.tagger.signature, 486s 'Tag message', 486s ) 486s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 486s ----------------------------- Captured stdout call ----------------------------- 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s ----------------------------- Captured stderr call ----------------------------- 486s dpkg-source: warning: missing information for output field Standards-Version 486s dpkg-source: warning: missing information for output field Standards-Version 486s dpkg-source: warning: missing information for output field Standards-Version 486s dpkg-source: warning: missing information for output field Standards-Version 486s ___________________________ test_create_import_note ____________________________ 486s 486s repo = 486s 486s def test_create_import_note(repo): 486s """create_import_note() should create a note in the correct ref""" 486s repo_builder.Repo( 486s commits=[repo_builder.Commit(name='root')], 486s tags={'root': repo_builder.Placeholder('root')}, 486s > ).write(repo.raw_repo) 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:1066: 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s 486s self = 486s repo = pygit2.Repository('/tmp/tmpn67d3k9n/.git/'), record = {} 486s 486s def write(self, repo, record=None): 486s replace_placeholders(self) 486s record = record or dict() 486s written_commits = [ 486s commit.write(repo=repo, record=record) 486s for commit 486s in self.commit_list 486s ] 486s for name, target in self.branches.items(): 486s repo.create_branch( 486s name, 486s repo.get(target.write(repo)).peel(pygit2.Commit), 486s ) 486s for name, target in self.tags.items(): 486s repo.create_tag( 486s name, 486s target.write(repo), 486s > pygit2.GIT_OBJ_COMMIT, 486s self.tagger.signature, 486s 'Tag message', 486s ) 486s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 486s ______________________ test_create_import_note_timestamp _______________________ 486s 486s repo = 486s 486s def test_create_import_note_timestamp(repo): 486s """create_import_note() should include the timestamp in the note""" 486s repo_builder.Repo( 486s commits=[repo_builder.Commit(name='root')], 486s tags={'root': repo_builder.Placeholder('root')}, 486s > ).write(repo.raw_repo) 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:1082: 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s 486s self = 486s repo = pygit2.Repository('/tmp/tmp1yvlwa9c/.git/'), record = {} 486s 486s def write(self, repo, record=None): 486s replace_placeholders(self) 486s record = record or dict() 486s written_commits = [ 486s commit.write(repo=repo, record=record) 486s for commit 486s in self.commit_list 486s ] 486s for name, target in self.branches.items(): 486s repo.create_branch( 486s name, 486s repo.get(target.write(repo)).peel(pygit2.Commit), 486s ) 486s for name, target in self.tags.items(): 486s repo.create_tag( 486s name, 486s target.write(repo), 486s > pygit2.GIT_OBJ_COMMIT, 486s self.tagger.signature, 486s 'Tag message', 486s ) 486s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 486s _______________________ test_import_creates_import_note ________________________ 486s 486s repo = 486s 486s def test_import_creates_import_note(repo): 486s """When an import runs, the note should appear in the correct ref""" 486s with source_builder.Source() as dsc_pathname: 486s > target.import_unapplied_dsc( 486s repo=repo, 486s version='1-1', 486s namespace='importer', 486s dist='ubuntu', 486s dsc_pathname=dsc_pathname, 486s head_name='ubuntu/focal', 486s skip_orig=True, 486s parent_overrides={}, 486s ) 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:1102: 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer.py:2230: in import_unapplied_dsc 486s commit, tag = find_or_create_unapplied_commit( 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer.py:2052: in find_or_create_unapplied_commit 486s changelog_parents = get_unapplied_import_parents( 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer.py:1503: in get_unapplied_import_parents 486s import_tree_versions = repo.get_all_changelog_versions_from_treeish( 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:2230: in get_all_changelog_versions_from_treeish 486s changelog = self.get_changelog_from_treeish(treeish) 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 486s return Changelog.from_treeish( 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:569: in from_treeish 486s blob = follow_symlinks_to_blob( 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 486s return _follow_symlinks_to_blob( 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s 486s repo = pygit2.Repository('/tmp/tmp2dztccy7/.git/') 486s top_tree_object = 486s search_path = 'debian/changelog' 486s _rel_tree = 486s _rel_path = '' 486s 486s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 486s _rel_tree=None, _rel_path='' 486s ): 486s '''Recursively follow a path down a tree, following symlinks, to find blob 486s 486s repo: pygit2.Repository object 486s top_tree: pygit2.Tree object of the top of the tree structure 486s search_path: '/'-separated path string of blob to find 486s _rel_tree: (internal) which tree to look further into 486s _rel_path: (internal) the path we are in so far 486s ''' 486s 486s NORMAL_BLOB_MODES = set([ 486s pygit2.GIT_FILEMODE_BLOB, 486s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 486s ]) 486s 486s _rel_tree = _rel_tree or top_tree_object 486s head, tail = posixpath.split(search_path) 486s 486s # A traditional functional split would put a single entry in head with tail 486s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 486s # to make it appear to have traditional semantics. 486s if not head: 486s head = tail 486s tail = None 486s 486s entry = _rel_tree[head] 486s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 486s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:68: AttributeError 486s ----------------------------- Captured stdout call ----------------------------- 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s ----------------------------- Captured stderr call ----------------------------- 486s dpkg-source: warning: missing information for output field Standards-Version 486s ___________________ test_import_unapplied_spi_quilt_patches ____________________ 486s 486s get_import_commit_msg_mock = 486s get_import_tag_msg_mock = 486s repo = 486s 486s @patch('gitubuntu.importer.get_import_tag_msg') 486s @patch('gitubuntu.importer.get_import_commit_msg') 486s def test_import_unapplied_spi_quilt_patches( 486s get_import_commit_msg_mock, 486s get_import_tag_msg_mock, 486s repo, 486s ): 486s """Test that a package with quilt patches is imported with correct 486s unapplied refs 486s 486s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 486s that determines the commit message to use for a given import 486s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 486s that determines the tag message to use for a given import 486s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 486s temporary output repository 486s """ 486s # Match the repo_builder objects 486s get_import_tag_msg_mock.return_value = 'Test tag' 486s get_import_commit_msg_mock.return_value = b'Test commit' 486s 486s publish_spec = source_builder.SourceSpec(has_patches=True) 486s 486s input_repo = repo_builder.Repo() 486s input_repo.write(repo.raw_repo) 486s expected_result = repo_builder.Repo( 486s commits=[ 486s repo_builder.Commit( 486s tree=repo_builder.SourceTree( 486s source_builder.Source(publish_spec) 486s ), 486s name='publish' 486s ), 486s ], 486s tags={'importer/import/1-1': Placeholder('publish')}, 486s branches={'importer/ubuntu/trusty': Placeholder('publish')}, 486s ) 486s 486s with source_builder.Source(publish_spec) as dsc_path: 486s # import_unapplied_spi currently assumes it is called from the 486s # repository directory (pristine-tar and other commands rely on 486s # this) 486s > target.import_unapplied_spi( 486s repo=repo, 486s spi=MockSPI(dsc_path, publish_spec.version), 486s namespace='importer', 486s skip_orig=False, 486s parent_overrides={}, 486s ) 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:1222: 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer.py:2308: in import_unapplied_spi 486s import_unapplied_dsc( 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer.py:2230: in import_unapplied_dsc 486s commit, tag = find_or_create_unapplied_commit( 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer.py:2052: in find_or_create_unapplied_commit 486s changelog_parents = get_unapplied_import_parents( 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer.py:1503: in get_unapplied_import_parents 486s import_tree_versions = repo.get_all_changelog_versions_from_treeish( 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:2230: in get_all_changelog_versions_from_treeish 486s changelog = self.get_changelog_from_treeish(treeish) 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 486s return Changelog.from_treeish( 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:569: in from_treeish 486s blob = follow_symlinks_to_blob( 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 486s return _follow_symlinks_to_blob( 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s 486s repo = pygit2.Repository('/tmp/tmpkm6toy5h/.git/') 486s top_tree_object = 486s search_path = 'debian/changelog' 486s _rel_tree = 486s _rel_path = '' 486s 486s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 486s _rel_tree=None, _rel_path='' 486s ): 486s '''Recursively follow a path down a tree, following symlinks, to find blob 486s 486s repo: pygit2.Repository object 486s top_tree: pygit2.Tree object of the top of the tree structure 486s search_path: '/'-separated path string of blob to find 486s _rel_tree: (internal) which tree to look further into 486s _rel_path: (internal) the path we are in so far 486s ''' 486s 486s NORMAL_BLOB_MODES = set([ 486s pygit2.GIT_FILEMODE_BLOB, 486s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 486s ]) 486s 486s _rel_tree = _rel_tree or top_tree_object 486s head, tail = posixpath.split(search_path) 486s 486s # A traditional functional split would put a single entry in head with tail 486s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 486s # to make it appear to have traditional semantics. 486s if not head: 486s head = tail 486s tail = None 486s 486s entry = _rel_tree[head] 486s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 486s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:68: AttributeError 486s ----------------------------- Captured stdout call ----------------------------- 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: using patch list from debian/patches/series 486s dpkg-source: info: applying a 486s dpkg-source: info: applying b 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: using patch list from debian/patches/series 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s ----------------------------- Captured stderr call ----------------------------- 486s dpkg-source: warning: missing information for output field Standards-Version 486s _ test_import_unapplied_spi_parenting[input_repo0-changelog_versions0-validation_repo_delta0-validation_repo_expected_identical_refs0] _ 486s 486s get_import_commit_msg_mock = 486s get_import_tag_msg_mock = 486s repo = 486s input_repo = 486s changelog_versions = ['1-1'] 486s validation_repo_delta = {'add_commits': [], 'update_tags': {'importer/import/1-1': }} 486s validation_repo_expected_identical_refs = ['refs/tags/importer/import/1-1'] 486s 486s @pytest.mark.parametrize( 486s [ 486s 'input_repo', 486s 'changelog_versions', 486s 'validation_repo_delta', 486s 'validation_repo_expected_identical_refs', 486s ], 486s [ 486s pytest.param( 486s repo_builder.Repo(), 486s ['1-1'], 486s { 486s 'add_commits': [ 486s repo_builder.Commit.from_spec(name='publish'), 486s ], 486s 'update_tags': {'importer/import/1-1': Placeholder('publish')}, 486s }, 486s [ 486s 'refs/tags/importer/import/1-1', 486s ] 486s ), 486s pytest.param( 486s repo_builder.Repo( 486s commits=[repo_builder.Commit.from_spec(name='import')], 486s tags={'importer/import/1-1': Placeholder('import')}, 486s ), 486s ['1-2', '1-1'], 486s { 486s 'add_commits': [ 486s repo_builder.Commit.from_spec( 486s name='publish', 486s parents=[Placeholder('import')], 486s changelog_versions=['1-2', '1-1'], 486s ), 486s ], 486s 'update_tags': {'importer/import/1-2': Placeholder('publish')}, 486s }, 486s [ 486s 'refs/tags/importer/import/1-1', 486s 'refs/tags/importer/import/1-2', 486s ], 486s ), 486s pytest.param( 486s repo_builder.Repo( 486s commits=[repo_builder.Commit.from_spec(name='import')], 486s tags={'importer/import/1-1': Placeholder('import')}, 486s ), 486s ['1-3', '1-2', '1-1'], 486s { 486s 'add_commits': [ 486s repo_builder.Commit.from_spec( 486s parents=[Placeholder('import')], 486s name='publish', 486s changelog_versions=['1-3', '1-2', '1-1'], 486s ), 486s ], 486s 'update_tags': {'importer/import/1-3': Placeholder('publish')}, 486s }, 486s [ 486s 'refs/tags/importer/import/1-1', 486s 'refs/tags/importer/import/1-3', 486s ], 486s ), 486s ( 486s repo_builder.Repo( 486s commits=[ 486s repo_builder.Commit.from_spec(name='import'), 486s repo_builder.Commit.from_spec( 486s name='reimport', 486s mutate='Reimport tag contents', 486s ), 486s ], 486s tags={ 486s 'importer/import/1-1': Placeholder('import'), 486s 'importer/reimport/import/1-1/0': Placeholder('import'), 486s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 486s }, 486s ), 486s ['1-2', '1-1'], 486s { 486s 'add_commits': [ 486s repo_builder.Commit.from_spec( 486s parents=[ 486s Placeholder('import'), 486s Placeholder('reimport'), 486s ], 486s name='publish', 486s changelog_versions=['1-2', '1-1'], 486s ), 486s ], 486s 'update_tags': {'importer/import/1-2': Placeholder('publish')}, 486s }, 486s [ 486s 'refs/tags/importer/import/1-1', 486s 'refs/tags/importer/reimport/import/1-1/0', 486s 'refs/tags/importer/reimport/import/1-1/1', 486s 'refs/tags/importer/import/1-2', 486s ], 486s ), 486s ] 486s ) 486s @patch('gitubuntu.importer.get_import_tag_msg') 486s @patch('gitubuntu.importer.get_import_commit_msg') 486s def test_import_unapplied_spi_parenting( 486s get_import_commit_msg_mock, 486s get_import_tag_msg_mock, 486s repo, 486s input_repo, 486s changelog_versions, 486s validation_repo_delta, 486s validation_repo_expected_identical_refs, 486s ): 486s """Test that unapplied import commits have the correct parents 486s 486s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 486s that determines the commit message to use for a given import 486s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 486s that determines the tag message to use for a given import 486s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 486s temporary output repository 486s :param repo_builder.Repo input_repo: input repository data 486s :param list(str) changelog_versions: the versions in the changelog of a 486s fake package to test import 486s :param dict validation_repo_delta: how to transform the input 486s repository into a "validation repository", expressed as a dict to 486s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 486s input repository. The validation repository is then used for the 486s purposes of comparison against the output repository. 486s :param list(str) validation_repo_expected_identical_refs: refs that must be 486s identical between the validation repository and the output repository 486s 486s Verify that if an import of a package is made into input_repo where the 486s package being imported has the given changelog_versions, then the output 486s repository has commits with the parents we expect. This is tested by 486s comparing specific output references against the validation repository. 486s """ 486s 486s # Match the repo_builder objects 486s get_import_tag_msg_mock.return_value = 'Test tag' 486s get_import_commit_msg_mock.return_value = b'Test commit' 486s 486s input_repo.write(repo.raw_repo) 486s 486s publish_spec = source_builder.SourceSpec( 486s changelog_versions=changelog_versions, 486s ) 486s 486s with source_builder.Source(publish_spec) as dsc_path: 486s # import_unapplied_spi currently assumes it is called from the 486s # repository directory (pristine-tar and other commands rely on 486s # this) 486s > target.import_unapplied_spi( 486s repo=repo, 486s spi=MockSPI(dsc_path, publish_spec.version), 486s namespace='importer', 486s skip_orig=False, 486s parent_overrides={}, 486s ) 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:1391: 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer.py:2308: in import_unapplied_spi 486s import_unapplied_dsc( 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer.py:2230: in import_unapplied_dsc 486s commit, tag = find_or_create_unapplied_commit( 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer.py:2052: in find_or_create_unapplied_commit 486s changelog_parents = get_unapplied_import_parents( 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer.py:1503: in get_unapplied_import_parents 486s import_tree_versions = repo.get_all_changelog_versions_from_treeish( 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:2230: in get_all_changelog_versions_from_treeish 486s changelog = self.get_changelog_from_treeish(treeish) 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 486s return Changelog.from_treeish( 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:569: in from_treeish 486s blob = follow_symlinks_to_blob( 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 486s return _follow_symlinks_to_blob( 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s 486s repo = pygit2.Repository('/tmp/tmpmgrht33f/.git/') 486s top_tree_object = 486s search_path = 'debian/changelog' 486s _rel_tree = 486s _rel_path = '' 486s 486s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 486s _rel_tree=None, _rel_path='' 486s ): 486s '''Recursively follow a path down a tree, following symlinks, to find blob 486s 486s repo: pygit2.Repository object 486s top_tree: pygit2.Tree object of the top of the tree structure 486s search_path: '/'-separated path string of blob to find 486s _rel_tree: (internal) which tree to look further into 486s _rel_path: (internal) the path we are in so far 486s ''' 486s 486s NORMAL_BLOB_MODES = set([ 486s pygit2.GIT_FILEMODE_BLOB, 486s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 486s ]) 486s 486s _rel_tree = _rel_tree or top_tree_object 486s head, tail = posixpath.split(search_path) 486s 486s # A traditional functional split would put a single entry in head with tail 486s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 486s # to make it appear to have traditional semantics. 486s if not head: 486s head = tail 486s tail = None 486s 486s entry = _rel_tree[head] 486s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 486s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:68: AttributeError 486s ----------------------------- Captured stdout call ----------------------------- 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s ----------------------------- Captured stderr call ----------------------------- 486s dpkg-source: warning: missing information for output field Standards-Version 486s _ test_import_unapplied_spi_parenting[input_repo1-changelog_versions1-validation_repo_delta1-validation_repo_expected_identical_refs1] _ 486s 486s get_import_commit_msg_mock = 486s get_import_tag_msg_mock = 486s repo = 486s input_repo = 486s changelog_versions = ['1-2', '1-1'] 486s validation_repo_delta = {'add_commits': [], 'update_tags': {'importer/import/1-2': }} 486s validation_repo_expected_identical_refs = ['refs/tags/importer/import/1-1', 'refs/tags/importer/import/1-2'] 486s 486s @pytest.mark.parametrize( 486s [ 486s 'input_repo', 486s 'changelog_versions', 486s 'validation_repo_delta', 486s 'validation_repo_expected_identical_refs', 486s ], 486s [ 486s pytest.param( 486s repo_builder.Repo(), 486s ['1-1'], 486s { 486s 'add_commits': [ 486s repo_builder.Commit.from_spec(name='publish'), 486s ], 486s 'update_tags': {'importer/import/1-1': Placeholder('publish')}, 486s }, 486s [ 486s 'refs/tags/importer/import/1-1', 486s ] 486s ), 486s pytest.param( 486s repo_builder.Repo( 486s commits=[repo_builder.Commit.from_spec(name='import')], 486s tags={'importer/import/1-1': Placeholder('import')}, 486s ), 486s ['1-2', '1-1'], 486s { 486s 'add_commits': [ 486s repo_builder.Commit.from_spec( 486s name='publish', 486s parents=[Placeholder('import')], 486s changelog_versions=['1-2', '1-1'], 486s ), 486s ], 486s 'update_tags': {'importer/import/1-2': Placeholder('publish')}, 486s }, 486s [ 486s 'refs/tags/importer/import/1-1', 486s 'refs/tags/importer/import/1-2', 486s ], 486s ), 486s pytest.param( 486s repo_builder.Repo( 486s commits=[repo_builder.Commit.from_spec(name='import')], 486s tags={'importer/import/1-1': Placeholder('import')}, 486s ), 486s ['1-3', '1-2', '1-1'], 486s { 486s 'add_commits': [ 486s repo_builder.Commit.from_spec( 486s parents=[Placeholder('import')], 486s name='publish', 486s changelog_versions=['1-3', '1-2', '1-1'], 486s ), 486s ], 486s 'update_tags': {'importer/import/1-3': Placeholder('publish')}, 486s }, 486s [ 486s 'refs/tags/importer/import/1-1', 486s 'refs/tags/importer/import/1-3', 486s ], 486s ), 486s ( 486s repo_builder.Repo( 486s commits=[ 486s repo_builder.Commit.from_spec(name='import'), 486s repo_builder.Commit.from_spec( 486s name='reimport', 486s mutate='Reimport tag contents', 486s ), 486s ], 486s tags={ 486s 'importer/import/1-1': Placeholder('import'), 486s 'importer/reimport/import/1-1/0': Placeholder('import'), 486s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 486s }, 486s ), 486s ['1-2', '1-1'], 486s { 486s 'add_commits': [ 486s repo_builder.Commit.from_spec( 486s parents=[ 486s Placeholder('import'), 486s Placeholder('reimport'), 486s ], 486s name='publish', 486s changelog_versions=['1-2', '1-1'], 486s ), 486s ], 486s 'update_tags': {'importer/import/1-2': Placeholder('publish')}, 486s }, 486s [ 486s 'refs/tags/importer/import/1-1', 486s 'refs/tags/importer/reimport/import/1-1/0', 486s 'refs/tags/importer/reimport/import/1-1/1', 486s 'refs/tags/importer/import/1-2', 486s ], 486s ), 486s ] 486s ) 486s @patch('gitubuntu.importer.get_import_tag_msg') 486s @patch('gitubuntu.importer.get_import_commit_msg') 486s def test_import_unapplied_spi_parenting( 486s get_import_commit_msg_mock, 486s get_import_tag_msg_mock, 486s repo, 486s input_repo, 486s changelog_versions, 486s validation_repo_delta, 486s validation_repo_expected_identical_refs, 486s ): 486s """Test that unapplied import commits have the correct parents 486s 486s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 486s that determines the commit message to use for a given import 486s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 486s that determines the tag message to use for a given import 486s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 486s temporary output repository 486s :param repo_builder.Repo input_repo: input repository data 486s :param list(str) changelog_versions: the versions in the changelog of a 486s fake package to test import 486s :param dict validation_repo_delta: how to transform the input 486s repository into a "validation repository", expressed as a dict to 486s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 486s input repository. The validation repository is then used for the 486s purposes of comparison against the output repository. 486s :param list(str) validation_repo_expected_identical_refs: refs that must be 486s identical between the validation repository and the output repository 486s 486s Verify that if an import of a package is made into input_repo where the 486s package being imported has the given changelog_versions, then the output 486s repository has commits with the parents we expect. This is tested by 486s comparing specific output references against the validation repository. 486s """ 486s 486s # Match the repo_builder objects 486s get_import_tag_msg_mock.return_value = 'Test tag' 486s get_import_commit_msg_mock.return_value = b'Test commit' 486s 486s > input_repo.write(repo.raw_repo) 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:1381: 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s 486s self = 486s repo = pygit2.Repository('/tmp/tmpiht03au_/.git/'), record = {} 486s 486s def write(self, repo, record=None): 486s replace_placeholders(self) 486s record = record or dict() 486s written_commits = [ 486s commit.write(repo=repo, record=record) 486s for commit 486s in self.commit_list 486s ] 486s for name, target in self.branches.items(): 486s repo.create_branch( 486s name, 486s repo.get(target.write(repo)).peel(pygit2.Commit), 486s ) 486s for name, target in self.tags.items(): 486s repo.create_tag( 486s name, 486s target.write(repo), 486s > pygit2.GIT_OBJ_COMMIT, 486s self.tagger.signature, 486s 'Tag message', 486s ) 486s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 486s ----------------------------- Captured stdout call ----------------------------- 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s ----------------------------- Captured stderr call ----------------------------- 486s dpkg-source: warning: missing information for output field Standards-Version 486s dpkg-source: warning: missing information for output field Standards-Version 486s _ test_import_unapplied_spi_parenting[input_repo2-changelog_versions2-validation_repo_delta2-validation_repo_expected_identical_refs2] _ 486s 486s get_import_commit_msg_mock = 486s get_import_tag_msg_mock = 486s repo = 486s input_repo = 486s changelog_versions = ['1-3', '1-2', '1-1'] 486s validation_repo_delta = {'add_commits': [], 'update_tags': {'importer/import/1-3': }} 486s validation_repo_expected_identical_refs = ['refs/tags/importer/import/1-1', 'refs/tags/importer/import/1-3'] 486s 486s @pytest.mark.parametrize( 486s [ 486s 'input_repo', 486s 'changelog_versions', 486s 'validation_repo_delta', 486s 'validation_repo_expected_identical_refs', 486s ], 486s [ 486s pytest.param( 486s repo_builder.Repo(), 486s ['1-1'], 486s { 486s 'add_commits': [ 486s repo_builder.Commit.from_spec(name='publish'), 486s ], 486s 'update_tags': {'importer/import/1-1': Placeholder('publish')}, 486s }, 486s [ 486s 'refs/tags/importer/import/1-1', 486s ] 486s ), 486s pytest.param( 486s repo_builder.Repo( 486s commits=[repo_builder.Commit.from_spec(name='import')], 486s tags={'importer/import/1-1': Placeholder('import')}, 486s ), 486s ['1-2', '1-1'], 486s { 486s 'add_commits': [ 486s repo_builder.Commit.from_spec( 486s name='publish', 486s parents=[Placeholder('import')], 486s changelog_versions=['1-2', '1-1'], 486s ), 486s ], 486s 'update_tags': {'importer/import/1-2': Placeholder('publish')}, 486s }, 486s [ 486s 'refs/tags/importer/import/1-1', 486s 'refs/tags/importer/import/1-2', 486s ], 486s ), 486s pytest.param( 486s repo_builder.Repo( 486s commits=[repo_builder.Commit.from_spec(name='import')], 486s tags={'importer/import/1-1': Placeholder('import')}, 486s ), 486s ['1-3', '1-2', '1-1'], 486s { 486s 'add_commits': [ 486s repo_builder.Commit.from_spec( 486s parents=[Placeholder('import')], 486s name='publish', 486s changelog_versions=['1-3', '1-2', '1-1'], 486s ), 486s ], 486s 'update_tags': {'importer/import/1-3': Placeholder('publish')}, 486s }, 486s [ 486s 'refs/tags/importer/import/1-1', 486s 'refs/tags/importer/import/1-3', 486s ], 486s ), 486s ( 486s repo_builder.Repo( 486s commits=[ 486s repo_builder.Commit.from_spec(name='import'), 486s repo_builder.Commit.from_spec( 486s name='reimport', 486s mutate='Reimport tag contents', 486s ), 486s ], 486s tags={ 486s 'importer/import/1-1': Placeholder('import'), 486s 'importer/reimport/import/1-1/0': Placeholder('import'), 486s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 486s }, 486s ), 486s ['1-2', '1-1'], 486s { 486s 'add_commits': [ 486s repo_builder.Commit.from_spec( 486s parents=[ 486s Placeholder('import'), 486s Placeholder('reimport'), 486s ], 486s name='publish', 486s changelog_versions=['1-2', '1-1'], 486s ), 486s ], 486s 'update_tags': {'importer/import/1-2': Placeholder('publish')}, 486s }, 486s [ 486s 'refs/tags/importer/import/1-1', 486s 'refs/tags/importer/reimport/import/1-1/0', 486s 'refs/tags/importer/reimport/import/1-1/1', 486s 'refs/tags/importer/import/1-2', 486s ], 486s ), 486s ] 486s ) 486s @patch('gitubuntu.importer.get_import_tag_msg') 486s @patch('gitubuntu.importer.get_import_commit_msg') 486s def test_import_unapplied_spi_parenting( 486s get_import_commit_msg_mock, 486s get_import_tag_msg_mock, 486s repo, 486s input_repo, 486s changelog_versions, 486s validation_repo_delta, 486s validation_repo_expected_identical_refs, 486s ): 486s """Test that unapplied import commits have the correct parents 486s 486s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 486s that determines the commit message to use for a given import 486s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 486s that determines the tag message to use for a given import 486s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 486s temporary output repository 486s :param repo_builder.Repo input_repo: input repository data 486s :param list(str) changelog_versions: the versions in the changelog of a 486s fake package to test import 486s :param dict validation_repo_delta: how to transform the input 486s repository into a "validation repository", expressed as a dict to 486s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 486s input repository. The validation repository is then used for the 486s purposes of comparison against the output repository. 486s :param list(str) validation_repo_expected_identical_refs: refs that must be 486s identical between the validation repository and the output repository 486s 486s Verify that if an import of a package is made into input_repo where the 486s package being imported has the given changelog_versions, then the output 486s repository has commits with the parents we expect. This is tested by 486s comparing specific output references against the validation repository. 486s """ 486s 486s # Match the repo_builder objects 486s get_import_tag_msg_mock.return_value = 'Test tag' 486s get_import_commit_msg_mock.return_value = b'Test commit' 486s 486s > input_repo.write(repo.raw_repo) 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:1381: 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s 486s self = 486s repo = pygit2.Repository('/tmp/tmpn4d40s6_/.git/'), record = {} 486s 486s def write(self, repo, record=None): 486s replace_placeholders(self) 486s record = record or dict() 486s written_commits = [ 486s commit.write(repo=repo, record=record) 486s for commit 486s in self.commit_list 486s ] 486s for name, target in self.branches.items(): 486s repo.create_branch( 486s name, 486s repo.get(target.write(repo)).peel(pygit2.Commit), 486s ) 486s for name, target in self.tags.items(): 486s repo.create_tag( 486s name, 486s target.write(repo), 486s > pygit2.GIT_OBJ_COMMIT, 486s self.tagger.signature, 486s 'Tag message', 486s ) 486s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 486s ----------------------------- Captured stdout call ----------------------------- 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s ----------------------------- Captured stderr call ----------------------------- 486s dpkg-source: warning: missing information for output field Standards-Version 486s dpkg-source: warning: missing information for output field Standards-Version 486s _ test_import_unapplied_spi_parenting[input_repo3-changelog_versions3-validation_repo_delta3-validation_repo_expected_identical_refs3] _ 486s 486s get_import_commit_msg_mock = 486s get_import_tag_msg_mock = 486s repo = 486s input_repo = 486s changelog_versions = ['1-2', '1-1'] 486s validation_repo_delta = {'add_commits': [], 'update_tags': {'importer/import/1-2': }} 486s 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'] 486s 486s @pytest.mark.parametrize( 486s [ 486s 'input_repo', 486s 'changelog_versions', 486s 'validation_repo_delta', 486s 'validation_repo_expected_identical_refs', 486s ], 486s [ 486s pytest.param( 486s repo_builder.Repo(), 486s ['1-1'], 486s { 486s 'add_commits': [ 486s repo_builder.Commit.from_spec(name='publish'), 486s ], 486s 'update_tags': {'importer/import/1-1': Placeholder('publish')}, 486s }, 486s [ 486s 'refs/tags/importer/import/1-1', 486s ] 486s ), 486s pytest.param( 486s repo_builder.Repo( 486s commits=[repo_builder.Commit.from_spec(name='import')], 486s tags={'importer/import/1-1': Placeholder('import')}, 486s ), 486s ['1-2', '1-1'], 486s { 486s 'add_commits': [ 486s repo_builder.Commit.from_spec( 486s name='publish', 486s parents=[Placeholder('import')], 486s changelog_versions=['1-2', '1-1'], 486s ), 486s ], 486s 'update_tags': {'importer/import/1-2': Placeholder('publish')}, 486s }, 486s [ 486s 'refs/tags/importer/import/1-1', 486s 'refs/tags/importer/import/1-2', 486s ], 486s ), 486s pytest.param( 486s repo_builder.Repo( 486s commits=[repo_builder.Commit.from_spec(name='import')], 486s tags={'importer/import/1-1': Placeholder('import')}, 486s ), 486s ['1-3', '1-2', '1-1'], 486s { 486s 'add_commits': [ 486s repo_builder.Commit.from_spec( 486s parents=[Placeholder('import')], 486s name='publish', 486s changelog_versions=['1-3', '1-2', '1-1'], 486s ), 486s ], 486s 'update_tags': {'importer/import/1-3': Placeholder('publish')}, 486s }, 486s [ 486s 'refs/tags/importer/import/1-1', 486s 'refs/tags/importer/import/1-3', 486s ], 486s ), 486s ( 486s repo_builder.Repo( 486s commits=[ 486s repo_builder.Commit.from_spec(name='import'), 486s repo_builder.Commit.from_spec( 486s name='reimport', 486s mutate='Reimport tag contents', 486s ), 486s ], 486s tags={ 486s 'importer/import/1-1': Placeholder('import'), 486s 'importer/reimport/import/1-1/0': Placeholder('import'), 486s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 486s }, 486s ), 486s ['1-2', '1-1'], 486s { 486s 'add_commits': [ 486s repo_builder.Commit.from_spec( 486s parents=[ 486s Placeholder('import'), 486s Placeholder('reimport'), 486s ], 486s name='publish', 486s changelog_versions=['1-2', '1-1'], 486s ), 486s ], 486s 'update_tags': {'importer/import/1-2': Placeholder('publish')}, 486s }, 486s [ 486s 'refs/tags/importer/import/1-1', 486s 'refs/tags/importer/reimport/import/1-1/0', 486s 'refs/tags/importer/reimport/import/1-1/1', 486s 'refs/tags/importer/import/1-2', 486s ], 486s ), 486s ] 486s ) 486s @patch('gitubuntu.importer.get_import_tag_msg') 486s @patch('gitubuntu.importer.get_import_commit_msg') 486s def test_import_unapplied_spi_parenting( 486s get_import_commit_msg_mock, 486s get_import_tag_msg_mock, 486s repo, 486s input_repo, 486s changelog_versions, 486s validation_repo_delta, 486s validation_repo_expected_identical_refs, 486s ): 486s """Test that unapplied import commits have the correct parents 486s 486s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 486s that determines the commit message to use for a given import 486s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 486s that determines the tag message to use for a given import 486s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 486s temporary output repository 486s :param repo_builder.Repo input_repo: input repository data 486s :param list(str) changelog_versions: the versions in the changelog of a 486s fake package to test import 486s :param dict validation_repo_delta: how to transform the input 486s repository into a "validation repository", expressed as a dict to 486s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 486s input repository. The validation repository is then used for the 486s purposes of comparison against the output repository. 486s :param list(str) validation_repo_expected_identical_refs: refs that must be 486s identical between the validation repository and the output repository 486s 486s Verify that if an import of a package is made into input_repo where the 486s package being imported has the given changelog_versions, then the output 486s repository has commits with the parents we expect. This is tested by 486s comparing specific output references against the validation repository. 486s """ 486s 486s # Match the repo_builder objects 486s get_import_tag_msg_mock.return_value = 'Test tag' 486s get_import_commit_msg_mock.return_value = b'Test commit' 486s 486s > input_repo.write(repo.raw_repo) 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:1381: 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s 486s self = 486s repo = pygit2.Repository('/tmp/tmpe7tedfio/.git/'), record = {} 486s 486s def write(self, repo, record=None): 486s replace_placeholders(self) 486s record = record or dict() 486s written_commits = [ 486s commit.write(repo=repo, record=record) 486s for commit 486s in self.commit_list 486s ] 486s for name, target in self.branches.items(): 486s repo.create_branch( 486s name, 486s repo.get(target.write(repo)).peel(pygit2.Commit), 486s ) 486s for name, target in self.tags.items(): 486s repo.create_tag( 486s name, 486s target.write(repo), 486s > pygit2.GIT_OBJ_COMMIT, 486s self.tagger.signature, 486s 'Tag message', 486s ) 486s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 486s ----------------------------- Captured stdout call ----------------------------- 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s ----------------------------- Captured stderr call ----------------------------- 486s dpkg-source: warning: missing information for output field Standards-Version 486s dpkg-source: warning: missing information for output field Standards-Version 486s dpkg-source: warning: missing information for output field Standards-Version 486s __________________ test_import_unapplied_spi_parent_override ___________________ 486s 486s get_import_commit_msg_mock = 486s get_import_tag_msg_mock = 486s repo = 486s 486s @patch('gitubuntu.importer.get_import_tag_msg') 486s @patch('gitubuntu.importer.get_import_commit_msg') 486s def test_import_unapplied_spi_parent_override( 486s get_import_commit_msg_mock, 486s get_import_tag_msg_mock, 486s repo, 486s ): 486s """Test import_unapplied_spi() parent_override functionality 486s 486s Test that if parent_overrides is used in the import_unapplied_spi call then 486s the resulting commit correctly uses the overridden parents specified. 486s 486s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 486s that determines the commit message to use for a given import 486s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 486s that determines the tag message to use for a given import 486s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 486s temporary output repository 486s :param repo_builder.Repo input_repo: input repository data 486s """ 486s # Match the repo_builder objects 486s get_import_tag_msg_mock.return_value = 'Test tag' 486s get_import_commit_msg_mock.return_value = b'Test commit' 486s 486s input_repo = repo_builder.Repo( 486s commits=[ 486s repo_builder.Commit.from_spec(name='import1-1', version='1-1'), 486s repo_builder.Commit.from_spec(name='import1-2', version='1-2'), 486s ], 486s tags={ 486s 'importer/import/1-1': Placeholder('import1-1'), 486s 'importer/import/1-2': Placeholder('import1-2'), 486s }, 486s ) 486s > input_repo.write(repo.raw_repo) 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:1444: 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s 486s self = 486s repo = pygit2.Repository('/tmp/tmp4y_1gp3q/.git/'), record = {} 486s 486s def write(self, repo, record=None): 486s replace_placeholders(self) 486s record = record or dict() 486s written_commits = [ 486s commit.write(repo=repo, record=record) 486s for commit 486s in self.commit_list 486s ] 486s for name, target in self.branches.items(): 486s repo.create_branch( 486s name, 486s repo.get(target.write(repo)).peel(pygit2.Commit), 486s ) 486s for name, target in self.tags.items(): 486s repo.create_tag( 486s name, 486s target.write(repo), 486s > pygit2.GIT_OBJ_COMMIT, 486s self.tagger.signature, 486s 'Tag message', 486s ) 486s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 486s ----------------------------- Captured stdout call ----------------------------- 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-2.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-2.dsc 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s ----------------------------- Captured stderr call ----------------------------- 486s dpkg-source: warning: missing information for output field Standards-Version 486s dpkg-source: warning: missing information for output field Standards-Version 486s dpkg-source: warning: missing information for output field Standards-Version 486s ______________ test_import_unapplied_spi_parent_override_failure _______________ 486s 486s repo = 486s 486s def test_import_unapplied_spi_parent_override_failure(repo): 486s """ 486s Test override_parents ParentOverrideError raise 486s 486s When a parent override is specified but the specified version doesn't have 486s an import tag, an exception should be raised. 486s 486s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 486s temporary output repository 486s """ 486s repo_builder.Repo( 486s commits=[repo_builder.Commit.from_spec(name='import1-1')], 486s tags={'importer/import/1-1': Placeholder('import1-1')}, 486s > ).write(repo.raw_repo) 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:1499: 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s 486s self = 486s repo = pygit2.Repository('/tmp/tmpr05wr_fd/.git/'), record = {} 486s 486s def write(self, repo, record=None): 486s replace_placeholders(self) 486s record = record or dict() 486s written_commits = [ 486s commit.write(repo=repo, record=record) 486s for commit 486s in self.commit_list 486s ] 486s for name, target in self.branches.items(): 486s repo.create_branch( 486s name, 486s repo.get(target.write(repo)).peel(pygit2.Commit), 486s ) 486s for name, target in self.tags.items(): 486s repo.create_tag( 486s name, 486s target.write(repo), 486s > pygit2.GIT_OBJ_COMMIT, 486s self.tagger.signature, 486s 'Tag message', 486s ) 486s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 486s ----------------------------- Captured stdout call ----------------------------- 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s ----------------------------- Captured stderr call ----------------------------- 486s dpkg-source: warning: missing information for output field Standards-Version 486s dpkg-source: warning: missing information for output field Standards-Version 486s _ test_import_applied_spi_parenting[input_repo0-expected_ancestor_commits0-expected_parent_commits0] _ 486s 486s get_import_commit_msg_mock = 486s get_import_tag_msg_mock = 486s repo = 486s input_repo = 486s expected_ancestor_commits = ['refs/tags/importer/import/1-2'] 486s expected_parent_commits = ['refs/tags/importer/applied/1-1'] 486s 486s @pytest.mark.parametrize( 486s 'input_repo, expected_ancestor_commits, expected_parent_commits', [ 486s # In general, these tests do not set applied commit parents in the 486s # input repository since we have no mechanism to do that correctly, but 486s # this doesn't matter for the purposes of these tests. 486s 486s # if only one import tag exists, then it is the parent 486s pytest.param( 486s repo_builder.Repo( 486s commits=[ 486s repo_builder.Commit.from_spec( 486s name='unapplied1', 486s has_patches=True, 486s ), 486s repo_builder.Commit.from_spec( 486s parents=[Placeholder('unapplied1')], 486s name='unapplied2', 486s changelog_versions=['1-2', '1-1'], 486s has_patches=True, 486s ), 486s repo_builder.Commit.from_spec( 486s name='applied1', 486s patches_applied=True, 486s ), 486s ], 486s # no branches: technically not possible but branches are not 486s # relevant to the test 486s branches={}, 486s tags={ 486s 'importer/import/1-1': Placeholder('unapplied1'), 486s 'importer/import/1-2': Placeholder('unapplied2'), 486s 'importer/applied/1-1': Placeholder('applied1'), 486s }, 486s ), 486s ['refs/tags/importer/import/1-2'], 486s ['refs/tags/importer/applied/1-1'], 486s ), 486s 486s # if multiple import tags exist, then do they all end up as parents? 486s pytest.param( 486s repo_builder.Repo( 486s commits=[ 486s repo_builder.Commit.from_spec( 486s name='unapplied1', 486s has_patches=True, 486s ), 486s repo_builder.Commit.from_spec( 486s parents=[Placeholder('unapplied1')], 486s name='unapplied2', 486s changelog_versions=['1-2', '1-1'], 486s has_patches=True, 486s ), 486s repo_builder.Commit.from_spec( 486s parents=[Placeholder('unapplied1')], 486s name='unapplied2reimport', 486s changelog_versions=['1-2', '1-1'], 486s has_patches=True, 486s mutate='reimport tag', 486s ), 486s repo_builder.Commit.from_spec( 486s name='applied1', 486s patches_applied=True, 486s ), 486s ], 486s # no branches: technically not possible but branches are not 486s # relevant to the test 486s branches={}, 486s tags={ 486s 'importer/import/1-1': 486s Placeholder('unapplied1'), 486s 'importer/import/1-2': 486s Placeholder('unapplied2'), 486s 'importer/reimport/import/1-2/0': 486s Placeholder('unapplied2'), 486s 'importer/reimport/import/1-2/1': 486s Placeholder('unapplied2reimport'), 486s 'importer/applied/1-1': 486s Placeholder('applied1'), 486s }, 486s ), 486s [ 486s 'refs/tags/importer/reimport/import/1-2/0', 486s 'refs/tags/importer/reimport/import/1-2/1', 486s ], 486s [ 486s 'refs/tags/importer/applied/1-1', 486s ], 486s marks=pytest.mark.xfail(reason='LP: #1755247'), 486s ), 486s 486s # do we correctly create a reimport tag because a different import 486s # already exists? 486s pytest.param( 486s repo_builder.Repo( 486s commits=[ 486s repo_builder.Commit.from_spec( 486s name='unapplied1', 486s has_patches=True, 486s ), 486s repo_builder.Commit.from_spec( 486s name='unapplied1_reimport', 486s has_patches=True, 486s mutate='reimport contents', 486s ), 486s repo_builder.Commit.from_spec( 486s parents=[Placeholder('unapplied1')], 486s name='unapplied2', 486s changelog_versions=['1-2', '1-1'], 486s has_patches=True, 486s ), 486s repo_builder.Commit.from_spec( 486s name='applied1', 486s patches_applied=True, 486s ), 486s repo_builder.Commit.from_spec( 486s name='applied1_reimport', 486s patches_applied=True, 486s mutate='reimport contents', 486s ), 486s ], 486s # no branches: technically not possible but branches are not 486s # relevant to the test 486s branches={}, 486s tags={ 486s 'importer/import/1-1': 486s Placeholder('unapplied1'), 486s 'importer/reimport/import/1-1/0': 486s Placeholder('unapplied1'), 486s 'importer/reimport/import/1-1/1': 486s Placeholder('unapplied1_reimport'), 486s 'importer/import/1-2': 486s Placeholder('unapplied2'), 486s 'importer/applied/1-1': 486s Placeholder('applied1'), 486s 'importer/reimport/applied/1-1/0': 486s Placeholder('applied1'), 486s 'importer/reimport/applied/1-1/1': 486s Placeholder('applied1_reimport'), 486s }, 486s ), 486s [ 486s 'refs/tags/importer/reimport/import/1-2/0', 486s 'refs/tags/importer/reimport/import/1-2/1', 486s ], 486s [ 486s 'refs/tags/importer/reimport/applied/1-1/0', 486s 'refs/tags/importer/reimport/applied/1-1/1', 486s ], 486s marks=pytest.mark.xfail(reason='LP: #1755247'), 486s ), 486s ], 486s ) 486s @patch('gitubuntu.importer.get_import_tag_msg') 486s @patch('gitubuntu.importer.get_import_commit_msg') 486s def test_import_applied_spi_parenting( 486s get_import_commit_msg_mock, 486s get_import_tag_msg_mock, 486s repo, 486s input_repo, 486s expected_ancestor_commits, 486s expected_parent_commits, 486s ): 486s """Test that applied import commits have the right parents 486s 486s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 486s that determines the commit message to use for a given import 486s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 486s that determines the tag message to use for a given import 486s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 486s temporary output repository 486s :param repo_builder.Repo input_repo: input repository data 486s :param list(str) expected_ancestor_commits: list of commit-ish strings that 486s must be ancestors of the 'applied/1-2' tag following the applied import 486s :param list(str) expected_parent_commits: list of commit-ish strings that 486s must be parents of the 'applied/1-2' tag following the applied import. 486s 486s A fake package with version '1-2' that has a changelog parent of '1-1' is 486s imported on top of the provided input_repo. The test fails if any 486s of the expected_ancestor_commits or expected_parent_commits are not 486s present. 486s 486s This test is ugly because we do not yet have a programmatic way 486s to get the interstitial commits of the patch applications. 486s """ 486s # Match the repo_builder objects 486s get_import_tag_msg_mock.return_value = 'Test tag' 486s get_import_commit_msg_mock.return_value = b'Test commit' 486s 486s > input_repo.write(repo.raw_repo) 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:1698: 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s 486s self = 486s repo = pygit2.Repository('/tmp/tmpiqutci0_/.git/'), record = {} 486s 486s def write(self, repo, record=None): 486s replace_placeholders(self) 486s record = record or dict() 486s written_commits = [ 486s commit.write(repo=repo, record=record) 486s for commit 486s in self.commit_list 486s ] 486s for name, target in self.branches.items(): 486s repo.create_branch( 486s name, 486s repo.get(target.write(repo)).peel(pygit2.Commit), 486s ) 486s for name, target in self.tags.items(): 486s repo.create_tag( 486s name, 486s target.write(repo), 486s > pygit2.GIT_OBJ_COMMIT, 486s self.tagger.signature, 486s 'Tag message', 486s ) 486s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 486s ----------------------------- Captured stdout call ----------------------------- 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: using patch list from debian/patches/series 486s dpkg-source: info: applying a 486s dpkg-source: info: applying b 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: using patch list from debian/patches/series 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: using patch list from debian/patches/series 486s dpkg-source: info: applying a 486s dpkg-source: info: applying b 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: using patch list from debian/patches/series 486s dpkg-source: info: building source-builder-package in source-builder-package_1-2.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-2.dsc 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: using patch list from debian/patches/series 486s dpkg-source: info: applying a 486s dpkg-source: info: applying b 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: using patch list from debian/patches/series 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: using patch list from debian/patches/series 486s dpkg-source: info: applying a 486s dpkg-source: info: applying b 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: using patch list from debian/patches/series 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: using patch list from debian/patches/series 486s dpkg-source: info: applying a 486s dpkg-source: info: applying b 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: using patch list from debian/patches/series 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s ----------------------------- Captured stderr call ----------------------------- 486s dpkg-source: warning: missing information for output field Standards-Version 486s dpkg-source: warning: missing information for output field Standards-Version 486s dpkg-source: warning: missing information for output field Standards-Version 486s dpkg-source: warning: missing information for output field Standards-Version 486s dpkg-source: warning: missing information for output field Standards-Version 486s _ test_authorship_date[False-Fri, 2 Feb 1971 12:34:56 +0100-expected_result0] __ 486s 486s repo = 486s override = False, input_string = 'Fri, 2 Feb 1971 12:34:56 +0100' 486s expected_result = (1971, 2, 2, 11, 34, 56, ...) 486s 486s @pytest.mark.parametrize(['override', 'input_string', 'expected_result'], [ 486s # Standard date that should parse and be used 486s (False, 'Fri, 2 Feb 1971 12:34:56 +0100', (1971, 2, 2, 11, 34, 56, 60)), 486s # Deliberately illegal date that cannot be parsed 486s (True, 'Failday, 30 Feb 1971 99:99:99 +9999', (1972, 3, 3, 12, 45, 57, 0)), 486s ]) 486s def test_authorship_date(repo, override, input_string, expected_result): 486s """Synthesized commit should use changelog or override when provided 486s 486s A synthesized commit should use the date of the changelog entry in the 486s usual case, or commit_date when an override is requested. 486s 486s :param GitUbuntuRepository repo: fixture providing a temporary 486s GitUbuntuRepository instance to use 486s :param bool override: whether a changelog date override should be requested 486s from import_unapplied_dsc() 486s :param str input_string: the timestamp part of the changelog entry to use 486s :param tuple expected_result: the expected author date of the synthesized 486s commit, specified as six parameters to datetime.datetime() followed by 486s the expected tz offset in minutes. 486s """ 486s spec = source_builder.SourceSpec(changelog_date=input_string) 486s with source_builder.Source(spec) as dsc_pathname: 486s > target.import_unapplied_dsc( 486s repo=repo, 486s version='1-1', 486s namespace='importer', 486s dist='ubuntu', 486s dsc_pathname=dsc_pathname, 486s head_name='ubuntu/focal', 486s skip_orig=True, 486s parent_overrides={}, 486s commit_date=datetime.datetime( 486s 1972, 486s 3, 486s 3, 486s 12, 486s 45, 486s 57, 486s tzinfo=datetime.timezone.utc, 486s ), 486s changelog_date_overrides=( 486s frozenset({'1-1'}) if override else frozenset() 486s ), 486s ) 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:1815: 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer.py:2230: in import_unapplied_dsc 486s commit, tag = find_or_create_unapplied_commit( 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer.py:2052: in find_or_create_unapplied_commit 486s changelog_parents = get_unapplied_import_parents( 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer.py:1503: in get_unapplied_import_parents 486s import_tree_versions = repo.get_all_changelog_versions_from_treeish( 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:2230: in get_all_changelog_versions_from_treeish 486s changelog = self.get_changelog_from_treeish(treeish) 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 486s return Changelog.from_treeish( 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:569: in from_treeish 486s blob = follow_symlinks_to_blob( 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 486s return _follow_symlinks_to_blob( 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s 486s repo = pygit2.Repository('/tmp/tmpzjhufwdz/.git/') 486s top_tree_object = 486s search_path = 'debian/changelog' 486s _rel_tree = 486s _rel_path = '' 486s 486s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 486s _rel_tree=None, _rel_path='' 486s ): 486s '''Recursively follow a path down a tree, following symlinks, to find blob 486s 486s repo: pygit2.Repository object 486s top_tree: pygit2.Tree object of the top of the tree structure 486s search_path: '/'-separated path string of blob to find 486s _rel_tree: (internal) which tree to look further into 486s _rel_path: (internal) the path we are in so far 486s ''' 486s 486s NORMAL_BLOB_MODES = set([ 486s pygit2.GIT_FILEMODE_BLOB, 486s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 486s ]) 486s 486s _rel_tree = _rel_tree or top_tree_object 486s head, tail = posixpath.split(search_path) 486s 486s # A traditional functional split would put a single entry in head with tail 486s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 486s # to make it appear to have traditional semantics. 486s if not head: 486s head = tail 486s tail = None 486s 486s entry = _rel_tree[head] 486s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 486s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:68: AttributeError 486s ----------------------------- Captured stdout call ----------------------------- 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s ----------------------------- Captured stderr call ----------------------------- 486s dpkg-source: warning: missing information for output field Standards-Version 486s _ test_authorship_date[True-Failday, 30 Feb 1971 99:99:99 +9999-expected_result1] _ 486s 486s repo = 486s override = True, input_string = 'Failday, 30 Feb 1971 99:99:99 +9999' 486s expected_result = (1972, 3, 3, 12, 45, 57, ...) 486s 486s @pytest.mark.parametrize(['override', 'input_string', 'expected_result'], [ 486s # Standard date that should parse and be used 486s (False, 'Fri, 2 Feb 1971 12:34:56 +0100', (1971, 2, 2, 11, 34, 56, 60)), 486s # Deliberately illegal date that cannot be parsed 486s (True, 'Failday, 30 Feb 1971 99:99:99 +9999', (1972, 3, 3, 12, 45, 57, 0)), 486s ]) 486s def test_authorship_date(repo, override, input_string, expected_result): 486s """Synthesized commit should use changelog or override when provided 486s 486s A synthesized commit should use the date of the changelog entry in the 486s usual case, or commit_date when an override is requested. 486s 486s :param GitUbuntuRepository repo: fixture providing a temporary 486s GitUbuntuRepository instance to use 486s :param bool override: whether a changelog date override should be requested 486s from import_unapplied_dsc() 486s :param str input_string: the timestamp part of the changelog entry to use 486s :param tuple expected_result: the expected author date of the synthesized 486s commit, specified as six parameters to datetime.datetime() followed by 486s the expected tz offset in minutes. 486s """ 486s spec = source_builder.SourceSpec(changelog_date=input_string) 486s with source_builder.Source(spec) as dsc_pathname: 486s > target.import_unapplied_dsc( 486s repo=repo, 486s version='1-1', 486s namespace='importer', 486s dist='ubuntu', 486s dsc_pathname=dsc_pathname, 486s head_name='ubuntu/focal', 486s skip_orig=True, 486s parent_overrides={}, 486s commit_date=datetime.datetime( 486s 1972, 486s 3, 486s 3, 486s 12, 486s 45, 486s 57, 486s tzinfo=datetime.timezone.utc, 486s ), 486s changelog_date_overrides=( 486s frozenset({'1-1'}) if override else frozenset() 486s ), 486s ) 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:1815: 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer.py:2230: in import_unapplied_dsc 486s commit, tag = find_or_create_unapplied_commit( 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer.py:2052: in find_or_create_unapplied_commit 486s changelog_parents = get_unapplied_import_parents( 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer.py:1503: in get_unapplied_import_parents 486s import_tree_versions = repo.get_all_changelog_versions_from_treeish( 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:2230: in get_all_changelog_versions_from_treeish 486s changelog = self.get_changelog_from_treeish(treeish) 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 486s return Changelog.from_treeish( 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:569: in from_treeish 486s blob = follow_symlinks_to_blob( 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 486s return _follow_symlinks_to_blob( 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s 486s repo = pygit2.Repository('/tmp/tmpt2jr03_s/.git/') 486s top_tree_object = 486s search_path = 'debian/changelog' 486s _rel_tree = 486s _rel_path = '' 486s 486s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 486s _rel_tree=None, _rel_path='' 486s ): 486s '''Recursively follow a path down a tree, following symlinks, to find blob 486s 486s repo: pygit2.Repository object 486s top_tree: pygit2.Tree object of the top of the tree structure 486s search_path: '/'-separated path string of blob to find 486s _rel_tree: (internal) which tree to look further into 486s _rel_path: (internal) the path we are in so far 486s ''' 486s 486s NORMAL_BLOB_MODES = set([ 486s pygit2.GIT_FILEMODE_BLOB, 486s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 486s ]) 486s 486s _rel_tree = _rel_tree or top_tree_object 486s head, tail = posixpath.split(search_path) 486s 486s # A traditional functional split would put a single entry in head with tail 486s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 486s # to make it appear to have traditional semantics. 486s if not head: 486s head = tail 486s tail = None 486s 486s entry = _rel_tree[head] 486s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 486s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:68: AttributeError 486s ----------------------------- Captured stdout call ----------------------------- 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s ----------------------------- Captured stderr call ----------------------------- 486s dpkg-source: warning: srcpkg/debian/changelog(l4): ignoring invalid week day 'Failday' 486s LINE: -- git ubuntu Failday, 30 Feb 1971 99:99:99 +9999 486s dpkg-source: warning: srcpkg/debian/changelog(l4): cannot parse non-conformant date '30 Feb 1971 99:99:99 +9999' 486s LINE: -- git ubuntu Failday, 30 Feb 1971 99:99:99 +9999 486s dpkg-source: warning: missing information for output field Standards-Version 486s __________________ test_fetch_rich_history_from_changes_file ___________________ 486s 486s repo = 486s pygit2_repo = pygit2.Repository('/tmp/tmprtdt3m5u/.git/') 486s 486s @patch('gitubuntu.importer.LAUNCHPAD_GIT_HOSTING_URL_PREFIX', 'file://') 486s @patch('gitubuntu.importer.VCS_GIT_URL_VALIDATION', re.compile(r'.*')) 486s def test_fetch_rich_history_from_changes_file(repo, pygit2_repo): 486s """Rich history specified in a changes file is found and validated""" 486s > rich_commit, parent_commit, import_tree = populate_rich_history( 486s import_repo=repo.raw_repo, 486s uploader_repo=pygit2_repo, 486s ) 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:2111: 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:2080: in populate_rich_history 486s ).write(import_repo) 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s 486s self = 486s repo = pygit2.Repository('/tmp/tmpp85yr9_a/.git/'), record = {} 486s 486s def write(self, repo, record=None): 486s replace_placeholders(self) 486s record = record or dict() 486s written_commits = [ 486s commit.write(repo=repo, record=record) 486s for commit 486s in self.commit_list 486s ] 486s for name, target in self.branches.items(): 486s repo.create_branch( 486s name, 486s repo.get(target.write(repo)).peel(pygit2.Commit), 486s ) 486s for name, target in self.tags.items(): 486s repo.create_tag( 486s name, 486s target.write(repo), 486s > pygit2.GIT_OBJ_COMMIT, 486s self.tagger.signature, 486s 'Tag message', 486s ) 486s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 486s ----------------------------- Captured stdout call ----------------------------- 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s ----------------------------- Captured stderr call ----------------------------- 486s dpkg-source: warning: missing information for output field Standards-Version 486s dpkg-source: warning: missing information for output field Standards-Version 486s dpkg-source: warning: missing information for output field Standards-Version 486s ________ test_fetch_rich_history_from_changes_file_fetch_failure_retry _________ 486s 486s repo = 486s pygit2_repo = pygit2.Repository('/tmp/tmp5h6vzmha/.git/') 486s 486s @patch('gitubuntu.importer.LAUNCHPAD_GIT_HOSTING_URL_PREFIX', 'file://') 486s @patch('gitubuntu.importer.VCS_GIT_URL_VALIDATION', re.compile(r'.*')) 486s def test_fetch_rich_history_from_changes_file_fetch_failure_retry( 486s repo, 486s pygit2_repo, 486s ): 486s """If rich history cannot be fetched once, it is retried""" 486s > rich_commit, parent_commit, import_tree = populate_rich_history( 486s import_repo=repo.raw_repo, 486s uploader_repo=pygit2_repo, 486s ) 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:2204: 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:2080: in populate_rich_history 486s ).write(import_repo) 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s 486s self = 486s repo = pygit2.Repository('/tmp/tmplsqbyqmn/.git/'), record = {} 486s 486s def write(self, repo, record=None): 486s replace_placeholders(self) 486s record = record or dict() 486s written_commits = [ 486s commit.write(repo=repo, record=record) 486s for commit 486s in self.commit_list 486s ] 486s for name, target in self.branches.items(): 486s repo.create_branch( 486s name, 486s repo.get(target.write(repo)).peel(pygit2.Commit), 486s ) 486s for name, target in self.tags.items(): 486s repo.create_tag( 486s name, 486s target.write(repo), 486s > pygit2.GIT_OBJ_COMMIT, 486s self.tagger.signature, 486s 'Tag message', 486s ) 486s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 486s ----------------------------- Captured stdout call ----------------------------- 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s ----------------------------- Captured stderr call ----------------------------- 486s dpkg-source: warning: missing information for output field Standards-Version 486s dpkg-source: warning: missing information for output field Standards-Version 486s dpkg-source: warning: missing information for output field Standards-Version 486s ____________ test_fetch_rich_history_from_changes_file_missing_ref _____________ 486s 486s repo = 486s pygit2_repo = pygit2.Repository('/tmp/tmp_f3qyps3/.git/') 486s 486s @patch('gitubuntu.importer.LAUNCHPAD_GIT_HOSTING_URL_PREFIX', 'file://') 486s @patch('gitubuntu.importer.VCS_GIT_URL_VALIDATION', re.compile(r'.*')) 486s def test_fetch_rich_history_from_changes_file_missing_ref( 486s repo, 486s pygit2_repo, 486s ): 486s """If rich history is specified but the ref cannot be found, a hard 486s exception is raised 486s """ 486s > rich_commit, _, _ = populate_rich_history( 486s import_repo=repo.raw_repo, 486s uploader_repo=pygit2_repo, 486s ) 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:2243: 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:2080: in populate_rich_history 486s ).write(import_repo) 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s 486s self = 486s repo = pygit2.Repository('/tmp/tmp9r3ibxah/.git/'), record = {} 486s 486s def write(self, repo, record=None): 486s replace_placeholders(self) 486s record = record or dict() 486s written_commits = [ 486s commit.write(repo=repo, record=record) 486s for commit 486s in self.commit_list 486s ] 486s for name, target in self.branches.items(): 486s repo.create_branch( 486s name, 486s repo.get(target.write(repo)).peel(pygit2.Commit), 486s ) 486s for name, target in self.tags.items(): 486s repo.create_tag( 486s name, 486s target.write(repo), 486s > pygit2.GIT_OBJ_COMMIT, 486s self.tagger.signature, 486s 'Tag message', 486s ) 486s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 486s ----------------------------- Captured stdout call ----------------------------- 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s ----------------------------- Captured stderr call ----------------------------- 486s dpkg-source: warning: missing information for output field Standards-Version 486s dpkg-source: warning: missing information for output field Standards-Version 486s dpkg-source: warning: missing information for output field Standards-Version 486s ___________ test_fetch_rich_history_from_changes_file_missing_commit ___________ 486s 486s repo = 486s pygit2_repo = pygit2.Repository('/tmp/tmp5o4tvh4m/.git/') 486s 486s @patch('gitubuntu.importer.LAUNCHPAD_GIT_HOSTING_URL_PREFIX', 'file://') 486s @patch('gitubuntu.importer.VCS_GIT_URL_VALIDATION', re.compile(r'.*')) 486s def test_fetch_rich_history_from_changes_file_missing_commit( 486s repo, 486s pygit2_repo, 486s ): 486s """If rich history is specified but the commit cannot be found, an 486s exception is raised 486s """ 486s > rich_commit, _, _ = populate_rich_history( 486s import_repo=repo.raw_repo, 486s uploader_repo=pygit2_repo, 486s ) 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:2271: 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:2080: in populate_rich_history 486s ).write(import_repo) 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s 486s self = 486s repo = pygit2.Repository('/tmp/tmp__vckkrt/.git/'), record = {} 486s 486s def write(self, repo, record=None): 486s replace_placeholders(self) 486s record = record or dict() 486s written_commits = [ 486s commit.write(repo=repo, record=record) 486s for commit 486s in self.commit_list 486s ] 486s for name, target in self.branches.items(): 486s repo.create_branch( 486s name, 486s repo.get(target.write(repo)).peel(pygit2.Commit), 486s ) 486s for name, target in self.tags.items(): 486s repo.create_tag( 486s name, 486s target.write(repo), 486s > pygit2.GIT_OBJ_COMMIT, 486s self.tagger.signature, 486s 'Tag message', 486s ) 486s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 486s ----------------------------- Captured stdout call ----------------------------- 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s ----------------------------- Captured stderr call ----------------------------- 486s dpkg-source: warning: missing information for output field Standards-Version 486s dpkg-source: warning: missing information for output field Standards-Version 486s dpkg-source: warning: missing information for output field Standards-Version 486s ____________ test_fetch_rich_history_from_changes_file_not_a_commit ____________ 486s 486s repo = 486s pygit2_repo = pygit2.Repository('/tmp/tmpo2_yc0i4/.git/') 486s 486s @patch('gitubuntu.importer.LAUNCHPAD_GIT_HOSTING_URL_PREFIX', 'file://') 486s @patch('gitubuntu.importer.VCS_GIT_URL_VALIDATION', re.compile(r'.*')) 486s def test_fetch_rich_history_from_changes_file_not_a_commit(repo, pygit2_repo): 486s """If rich history is specified but the commit hash resolves to something 486s other than a commit, an exception is raised 486s """ 486s > rich_commit, _, _ = populate_rich_history( 486s import_repo=repo.raw_repo, 486s uploader_repo=pygit2_repo, 486s ) 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:2297: 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/importer_test.py:2080: in populate_rich_history 486s ).write(import_repo) 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s 486s self = 486s repo = pygit2.Repository('/tmp/tmp0yc2cd7u/.git/'), record = {} 486s 486s def write(self, repo, record=None): 486s replace_placeholders(self) 486s record = record or dict() 486s written_commits = [ 486s commit.write(repo=repo, record=record) 486s for commit 486s in self.commit_list 486s ] 486s for name, target in self.branches.items(): 486s repo.create_branch( 486s name, 486s repo.get(target.write(repo)).peel(pygit2.Commit), 486s ) 486s for name, target in self.tags.items(): 486s repo.create_tag( 486s name, 486s target.write(repo), 486s > pygit2.GIT_OBJ_COMMIT, 486s self.tagger.signature, 486s 'Tag message', 486s ) 486s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 486s ----------------------------- Captured stdout call ----------------------------- 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s ----------------------------- Captured stderr call ----------------------------- 486s dpkg-source: warning: missing information for output field Standards-Version 486s dpkg-source: warning: missing information for output field Standards-Version 486s dpkg-source: warning: missing information for output field Standards-Version 486s __________________________ test_reconstruct_changelog __________________________ 486s 486s pygit2_repo = pygit2.Repository('/tmp/tmpytrt86_f/.git/') 486s monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0xe82519a8> 486s 486s @pytest.mark.skipif( 486s ENTRY_POINT_TYPE is None, 486s reason="Entry point testing not available", 486s ) 486s def test_reconstruct_changelog(pygit2_repo, monkeypatch): 486s '''The reconstruct-changelog endpoint should add the expected commit''' 486s monkeypatch.setenv('DEBFULLNAME', 'Test User') 486s monkeypatch.setenv('DEBEMAIL', 'test@example.com') 486s Repo( 486s commits=[ 486s Commit(tree=SourceTree(Source()), name='root'), 486s Commit( 486s tree=SourceTree(Source(spec=SourceSpec(mutate=1))), 486s message=' * Test changelog entry', 486s name='child', 486s parents=[Placeholder('root')], 486s ), 486s ], 486s tags={'root': Placeholder('root'), 'child': Placeholder('child')}, 486s > ).write(pygit2_repo) 486s 486s gitubuntu/integration_test.py:219: 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s 486s self = 486s repo = pygit2.Repository('/tmp/tmpytrt86_f/.git/'), record = {} 486s 486s def write(self, repo, record=None): 486s replace_placeholders(self) 486s record = record or dict() 486s written_commits = [ 486s commit.write(repo=repo, record=record) 486s for commit 486s in self.commit_list 486s ] 486s for name, target in self.branches.items(): 486s repo.create_branch( 486s name, 486s repo.get(target.write(repo)).peel(pygit2.Commit), 486s ) 486s for name, target in self.tags.items(): 486s repo.create_tag( 486s name, 486s target.write(repo), 486s > pygit2.GIT_OBJ_COMMIT, 486s self.tagger.signature, 486s 'Tag message', 486s ) 486s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 486s 486s gitubuntu/repo_builder.py:389: AttributeError 486s ----------------------------- Captured stdout call ----------------------------- 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s ----------------------------- Captured stderr call ----------------------------- 486s dpkg-source: warning: missing information for output field Standards-Version 486s dpkg-source: warning: missing information for output field Standards-Version 486s dpkg-source: warning: missing information for output field Standards-Version 486s dpkg-source: warning: missing information for output field Standards-Version 486s ___________________ TestObjectCreation.testRepoBranchesTags ____________________ 486s 486s self = 486s 486s def testRepoBranchesTags(self): 486s graph = Repo( 486s commits=[ 486s Commit( 486s Tree({}), 486s parents=[Placeholder('parent')], 486s name='child', 486s ), 486s Commit(Tree({}), name='parent'), 486s ], 486s branches={ 486s 'branch1': Placeholder('parent'), 486s 'branch2': Commit(Tree({'foo': Blob(b'qux')})), 486s }, 486s tags={ 486s 'tag1': Placeholder('child'), 486s 'tag2': Commit(Tree({'foo': Blob(b'quz')})), 486s }, 486s ) 486s > child_ref = graph.write(self.repo) 486s 486s gitubuntu/repo_builder_test.py:154: 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s 486s self = 486s repo = pygit2.Repository('/tmp/tmp8u1zd39v/.git/'), record = {} 486s 486s def write(self, repo, record=None): 486s replace_placeholders(self) 486s record = record or dict() 486s written_commits = [ 486s commit.write(repo=repo, record=record) 486s for commit 486s in self.commit_list 486s ] 486s for name, target in self.branches.items(): 486s repo.create_branch( 486s name, 486s repo.get(target.write(repo)).peel(pygit2.Commit), 486s ) 486s for name, target in self.tags.items(): 486s repo.create_tag( 486s name, 486s target.write(repo), 486s > pygit2.GIT_OBJ_COMMIT, 486s self.tagger.signature, 486s 'Tag message', 486s ) 486s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 486s 486s gitubuntu/repo_builder.py:389: AttributeError 486s ______________________ TestObjectCreation.testRepoTagger _______________________ 486s 486s self = 486s 486s def testRepoTagger(self): 486s """The tagger parameter should make it through to the tag""" 486s input_repo = Repo( 486s commits=[Commit(name='root')], 486s tags={'root': Placeholder('root')}, 486s tagger=pygit2.Signature( 486s 'Test Tagger', 486s 'test@example.com', 486s 1, 486s 2, 486s ), 486s ) 486s > input_repo.write(self.repo) 486s 486s gitubuntu/repo_builder_test.py:178: 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s 486s self = 486s repo = pygit2.Repository('/tmp/tmpn0wqz95g/.git/'), record = {} 486s 486s def write(self, repo, record=None): 486s replace_placeholders(self) 486s record = record or dict() 486s written_commits = [ 486s commit.write(repo=repo, record=record) 486s for commit 486s in self.commit_list 486s ] 486s for name, target in self.branches.items(): 486s repo.create_branch( 486s name, 486s repo.get(target.write(repo)).peel(pygit2.Commit), 486s ) 486s for name, target in self.tags.items(): 486s repo.create_tag( 486s name, 486s target.write(repo), 486s > pygit2.GIT_OBJ_COMMIT, 486s self.tagger.signature, 486s 'Tag message', 486s ) 486s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 486s 486s gitubuntu/repo_builder.py:389: AttributeError 486s _______________________________ test_source_tree _______________________________ 486s 486s pygit2_repo = pygit2.Repository('/tmp/tmpba2pvlqb/.git/') 486s 486s def test_source_tree(pygit2_repo): 486s commit_str = Commit(SourceTree(Source())).write(pygit2_repo) 486s commit = pygit2_repo.get(commit_str) 486s > assert gitubuntu.git_repository.follow_symlinks_to_blob( 486s repo=pygit2_repo, 486s treeish_object=commit, 486s path='debian/changelog', 486s ) 486s 486s gitubuntu/repo_builder_test.py:190: 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 486s return _follow_symlinks_to_blob( 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s 486s repo = pygit2.Repository('/tmp/tmpba2pvlqb/.git/') 486s top_tree_object = 486s search_path = 'debian/changelog' 486s _rel_tree = 486s _rel_path = '' 486s 486s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 486s _rel_tree=None, _rel_path='' 486s ): 486s '''Recursively follow a path down a tree, following symlinks, to find blob 486s 486s repo: pygit2.Repository object 486s top_tree: pygit2.Tree object of the top of the tree structure 486s search_path: '/'-separated path string of blob to find 486s _rel_tree: (internal) which tree to look further into 486s _rel_path: (internal) the path we are in so far 486s ''' 486s 486s NORMAL_BLOB_MODES = set([ 486s pygit2.GIT_FILEMODE_BLOB, 486s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 486s ]) 486s 486s _rel_tree = _rel_tree or top_tree_object 486s head, tail = posixpath.split(search_path) 486s 486s # A traditional functional split would put a single entry in head with tail 486s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 486s # to make it appear to have traditional semantics. 486s if not head: 486s head = tail 486s tail = None 486s 486s entry = _rel_tree[head] 486s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 486s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 486s 486s gitubuntu/git_repository.py:68: AttributeError 486s ----------------------------- Captured stdout call ----------------------------- 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s ----------------------------- Captured stderr call ----------------------------- 486s dpkg-source: warning: missing information for output field Standards-Version 486s ______________________________ test_preservation _______________________________ 486s 486s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_preservation0') 486s repo = 486s 486s def test_preservation(tmpdir, repo): 486s """An export followed by an import should preserve rich history 486s 486s Given a minimal repository that should be able to have upload tags be 486s exported, when we import the export result into a similar repository with a 486s subtly different upload tag in which the rich history should still apply, 486s the result should be a correctly reconstructed upload tag. 486s 486s :param py.path tmpdir: the pytest standard tmpdir fixture. 486s :param repo: our standard repo fixture. 486s """ 486s Repo( 486s commits=[ 486s Commit( 486s name='1', 486s tree=Tree({ 486s 'a': Blob(b'a'), 486s }), 486s ), 486s Commit( 486s name='2', 486s parents=[Placeholder('1')], 486s tree=Tree({ 486s 'a': Blob(b'ab'), 486s }), 486s ), 486s Commit( 486s name='3', 486s parents=[Placeholder('2')], 486s tree=Tree({ 486s 'a': Blob(b'abc'), 486s }), 486s ), 486s ], 486s tags={ 486s 'importer/import/1': Placeholder('1'), 486s 'importer/upload/2': Placeholder('3'), 486s } 486s > ).write(repo.raw_repo) 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/rich_history_test.py:51: 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s 486s self = 486s repo = pygit2.Repository('/tmp/tmpysbhpxsn/.git/'), record = {} 486s 486s def write(self, repo, record=None): 486s replace_placeholders(self) 486s record = record or dict() 486s written_commits = [ 486s commit.write(repo=repo, record=record) 486s for commit 486s in self.commit_list 486s ] 486s for name, target in self.branches.items(): 486s repo.create_branch( 486s name, 486s repo.get(target.write(repo)).peel(pygit2.Commit), 486s ) 486s for name, target in self.tags.items(): 486s repo.create_tag( 486s name, 486s target.write(repo), 486s > pygit2.GIT_OBJ_COMMIT, 486s self.tagger.signature, 486s 'Tag message', 486s ) 486s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 486s ______________________ test_preservation_multiple_parents ______________________ 486s 486s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_preservation_multiple_par0') 486s repo = 486s 486s def test_preservation_multiple_parents(tmpdir, repo): 486s """An export of rich history should omit multiple parent cases 486s 486s If an upload tag leads to multiple parents before we reach an import tag, 486s it should be excluded from the export as this type of upload tag is not 486s supported for rich history preservation. This test also serves to verify 486s code paths that handle the MultipleParentError exception in the export 486s code. 486s 486s :param py.path tmpdir: the pytest standard tmpdir fixture. 486s :param repo: our standard repo fixture. 486s """ 486s Repo( 486s commits=[ 486s Commit(name='1', message='a'), 486s Commit(name='2', message='b'), 486s Commit(name='child', parents=[Placeholder('1'), Placeholder('2')]), 486s ], 486s tags={ 486s 'importer/import/1': Placeholder('1'), 486s 'importer/upload/2': Placeholder('child'), 486s } 486s > ).write(repo.raw_repo) 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/rich_history_test.py:102: 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s 486s self = 486s repo = pygit2.Repository('/tmp/tmpzmvil8c3/.git/'), record = {} 486s 486s def write(self, repo, record=None): 486s replace_placeholders(self) 486s record = record or dict() 486s written_commits = [ 486s commit.write(repo=repo, record=record) 486s for commit 486s in self.commit_list 486s ] 486s for name, target in self.branches.items(): 486s repo.create_branch( 486s name, 486s repo.get(target.write(repo)).peel(pygit2.Commit), 486s ) 486s for name, target in self.tags.items(): 486s repo.create_tag( 486s name, 486s target.write(repo), 486s > pygit2.GIT_OBJ_COMMIT, 486s self.tagger.signature, 486s 'Tag message', 486s ) 486s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 486s _________________________ test_preservation_no_parents _________________________ 486s 486s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_preservation_no_parents0') 486s repo = 486s 486s def test_preservation_no_parents(tmpdir, repo): 486s """An export of rich history should omit no parent cases 486s 486s If an upload tag leads to no parents before we reach an import tag, 486s it should be excluded from the export as this type of upload tag is not 486s supported for rich history preservation. This test also serves to verify 486s code paths that handle the NoParentError exception in the export 486s code. 486s 486s :param py.path tmpdir: the pytest standard tmpdir fixture. 486s :param repo: our standard repo fixture. 486s """ 486s Repo( 486s commits=[ 486s Commit(name='1', message='a'), 486s Commit(name='2', message='b'), 486s ], 486s tags={ 486s 'importer/import/1': Placeholder('1'), 486s 'importer/upload/2': Placeholder('2'), 486s } 486s > ).write(repo.raw_repo) 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/rich_history_test.py:129: 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s 486s self = 486s repo = pygit2.Repository('/tmp/tmp2kdkcx__/.git/'), record = {} 486s 486s def write(self, repo, record=None): 486s replace_placeholders(self) 486s record = record or dict() 486s written_commits = [ 486s commit.write(repo=repo, record=record) 486s for commit 486s in self.commit_list 486s ] 486s for name, target in self.branches.items(): 486s repo.create_branch( 486s name, 486s repo.get(target.write(repo)).peel(pygit2.Commit), 486s ) 486s for name, target in self.tags.items(): 486s repo.create_tag( 486s name, 486s target.write(repo), 486s > pygit2.GIT_OBJ_COMMIT, 486s self.tagger.signature, 486s 'Tag message', 486s ) 486s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 486s _____________ test_input_edge_cases[before_export0-before_import0] _____________ 486s 486s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_input_edge_cases_before_e0') 486s repo = 486s before_export = {'commits': [, , 'importer/upload/2': }} 486s before_import = {'commits': [], 'tags': {'importer/import/1': }} 486s 486s @pytest.mark.parametrize(['before_export', 'before_import'], [ 486s ( 486s # Commit messages with patch-like contents should not fail 486s 486s # If a commit message in rich history contains text in a patch-like 486s # format (such as a diff of some file), it should not prevent correct 486s # round-tripping. "git format-patch" followed by "git am" fails this 486s # test, for example. 486s { 486s 'commits': [ 486s Commit(name='1', message='a', tree=Tree({'a': Blob(b'a')})), 486s Commit( 486s name='2', 486s message='''First line 486s 486s Inline patch that isn't part of the real patch starts here 486s 486s --- a/foo 486s +++ b/foo 486s @@ -1 +1,2 @@ 486s foo 486s +bar 486s ''', 486s tree=Tree({'a': Blob(b'ab')}), 486s parents=[Placeholder('1')], 486s ), 486s ], 486s 'tags': { 486s 'importer/import/1': Placeholder('1'), 486s 'importer/upload/2': Placeholder('2'), 486s } 486s }, 486s { 486s 'commits': [ 486s Commit(name='b1', message='c', tree=Tree({'a': Blob(b'a')})), 486s ], 486s 'tags': {'importer/import/1': Placeholder('b1')}, 486s }, 486s ), 486s ( 486s # Commits that have no changes should round trip 486s { 486s 'commits': [ 486s Commit( 486s name='1', 486s message='a', 486s ), 486s Commit( 486s name='2', 486s message='b', 486s parents=[Placeholder('1')], 486s ), 486s ], 486s 'tags': { 486s 'importer/import/1': Placeholder('1'), 486s 'importer/upload/2': Placeholder('2'), 486s }, 486s }, 486s { 486s 'commits': [Commit(name='b1', message='c')], 486s 'tags': {'importer/import/1': Placeholder('b1')}, 486s }, 486s ), 486s ( 486s # Commits that have no commit message should round trip 486s { 486s 'commits': [ 486s Commit( 486s name='1', 486s message='a', 486s ), 486s Commit( 486s name='2', 486s message='', 486s tree=Tree({'a': Blob(b'a')}), 486s parents=[Placeholder('1')], 486s ), 486s ], 486s 'tags': { 486s 'importer/import/1': Placeholder('1'), 486s 'importer/upload/2': Placeholder('2'), 486s } 486s }, 486s { 486s 'commits': [Commit(name='b1', message='c')], 486s 'tags': {'importer/import/1': Placeholder('b1')}, 486s }, 486s ), 486s ]) 486s def test_input_edge_cases(tmpdir, repo, before_export, before_import): 486s """ 486s Edge cases in input rich history should reimport without failure 486s 486s Check that rich history preservation completes without an exception in 486s various cases. Details of each case are described in comments in the test 486s parameters above. 486s 486s Since these tests generally cover the mutated case (where rich history has 486s to be ported forward because parent commits have mutated), we must remove 486s and recreate the 'importer/import/1' tag so that it is different before 486s attempting reimport. This is done by deleting all ('importer/*') tags and 486s then using the before_import parameter to recreate it again. 486s 486s :param py.path tmpdir: the pytest standard tmpdir fixture. 486s :param GitUbuntuRepository repo: our standard repo fixture. 486s :param dict before_export: the parameters to supply to Repo() to construct 486s the repository that will be exported. 486s :param dict before_import: the parametsrs to supply to Repo() to add to the 486s repository before attempting reimport. 486s """ 486s > Repo(**before_export).write(repo.raw_repo) 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/rich_history_test.py:260: 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s 486s self = 486s repo = pygit2.Repository('/tmp/tmp56h2r4d4/.git/'), record = {} 486s 486s def write(self, repo, record=None): 486s replace_placeholders(self) 486s record = record or dict() 486s written_commits = [ 486s commit.write(repo=repo, record=record) 486s for commit 486s in self.commit_list 486s ] 486s for name, target in self.branches.items(): 486s repo.create_branch( 486s name, 486s repo.get(target.write(repo)).peel(pygit2.Commit), 486s ) 486s for name, target in self.tags.items(): 486s repo.create_tag( 486s name, 486s target.write(repo), 486s > pygit2.GIT_OBJ_COMMIT, 486s self.tagger.signature, 486s 'Tag message', 486s ) 486s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 486s _____________ test_input_edge_cases[before_export1-before_import1] _____________ 486s 486s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_input_edge_cases_before_e1') 486s repo = 486s before_export = {'commits': [, , 'importer/upload/2': }} 486s before_import = {'commits': [], 'tags': {'importer/import/1': }} 486s 486s @pytest.mark.parametrize(['before_export', 'before_import'], [ 486s ( 486s # Commit messages with patch-like contents should not fail 486s 486s # If a commit message in rich history contains text in a patch-like 486s # format (such as a diff of some file), it should not prevent correct 486s # round-tripping. "git format-patch" followed by "git am" fails this 486s # test, for example. 486s { 486s 'commits': [ 486s Commit(name='1', message='a', tree=Tree({'a': Blob(b'a')})), 486s Commit( 486s name='2', 486s message='''First line 486s 486s Inline patch that isn't part of the real patch starts here 486s 486s --- a/foo 486s +++ b/foo 486s @@ -1 +1,2 @@ 486s foo 486s +bar 486s ''', 486s tree=Tree({'a': Blob(b'ab')}), 486s parents=[Placeholder('1')], 486s ), 486s ], 486s 'tags': { 486s 'importer/import/1': Placeholder('1'), 486s 'importer/upload/2': Placeholder('2'), 486s } 486s }, 486s { 486s 'commits': [ 486s Commit(name='b1', message='c', tree=Tree({'a': Blob(b'a')})), 486s ], 486s 'tags': {'importer/import/1': Placeholder('b1')}, 486s }, 486s ), 486s ( 486s # Commits that have no changes should round trip 486s { 486s 'commits': [ 486s Commit( 486s name='1', 486s message='a', 486s ), 486s Commit( 486s name='2', 486s message='b', 486s parents=[Placeholder('1')], 486s ), 486s ], 486s 'tags': { 486s 'importer/import/1': Placeholder('1'), 486s 'importer/upload/2': Placeholder('2'), 486s }, 486s }, 486s { 486s 'commits': [Commit(name='b1', message='c')], 486s 'tags': {'importer/import/1': Placeholder('b1')}, 486s }, 486s ), 486s ( 486s # Commits that have no commit message should round trip 486s { 486s 'commits': [ 486s Commit( 486s name='1', 486s message='a', 486s ), 486s Commit( 486s name='2', 486s message='', 486s tree=Tree({'a': Blob(b'a')}), 486s parents=[Placeholder('1')], 486s ), 486s ], 486s 'tags': { 486s 'importer/import/1': Placeholder('1'), 486s 'importer/upload/2': Placeholder('2'), 486s } 486s }, 486s { 486s 'commits': [Commit(name='b1', message='c')], 486s 'tags': {'importer/import/1': Placeholder('b1')}, 486s }, 486s ), 486s ]) 486s def test_input_edge_cases(tmpdir, repo, before_export, before_import): 486s """ 486s Edge cases in input rich history should reimport without failure 486s 486s Check that rich history preservation completes without an exception in 486s various cases. Details of each case are described in comments in the test 486s parameters above. 486s 486s Since these tests generally cover the mutated case (where rich history has 486s to be ported forward because parent commits have mutated), we must remove 486s and recreate the 'importer/import/1' tag so that it is different before 486s attempting reimport. This is done by deleting all ('importer/*') tags and 486s then using the before_import parameter to recreate it again. 486s 486s :param py.path tmpdir: the pytest standard tmpdir fixture. 486s :param GitUbuntuRepository repo: our standard repo fixture. 486s :param dict before_export: the parameters to supply to Repo() to construct 486s the repository that will be exported. 486s :param dict before_import: the parametsrs to supply to Repo() to add to the 486s repository before attempting reimport. 486s """ 486s > Repo(**before_export).write(repo.raw_repo) 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/rich_history_test.py:260: 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s 486s self = 486s repo = pygit2.Repository('/tmp/tmp5rwolce3/.git/'), record = {} 486s 486s def write(self, repo, record=None): 486s replace_placeholders(self) 486s record = record or dict() 486s written_commits = [ 486s commit.write(repo=repo, record=record) 486s for commit 486s in self.commit_list 486s ] 486s for name, target in self.branches.items(): 486s repo.create_branch( 486s name, 486s repo.get(target.write(repo)).peel(pygit2.Commit), 486s ) 486s for name, target in self.tags.items(): 486s repo.create_tag( 486s name, 486s target.write(repo), 486s > pygit2.GIT_OBJ_COMMIT, 486s self.tagger.signature, 486s 'Tag message', 486s ) 486s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 486s _____________ test_input_edge_cases[before_export2-before_import2] _____________ 486s 486s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_input_edge_cases_before_e2') 486s repo = 486s before_export = {'commits': [, , 'importer/upload/2': }} 486s before_import = {'commits': [], 'tags': {'importer/import/1': }} 486s 486s @pytest.mark.parametrize(['before_export', 'before_import'], [ 486s ( 486s # Commit messages with patch-like contents should not fail 486s 486s # If a commit message in rich history contains text in a patch-like 486s # format (such as a diff of some file), it should not prevent correct 486s # round-tripping. "git format-patch" followed by "git am" fails this 486s # test, for example. 486s { 486s 'commits': [ 486s Commit(name='1', message='a', tree=Tree({'a': Blob(b'a')})), 486s Commit( 486s name='2', 486s message='''First line 486s 486s Inline patch that isn't part of the real patch starts here 486s 486s --- a/foo 486s +++ b/foo 486s @@ -1 +1,2 @@ 486s foo 486s +bar 486s ''', 486s tree=Tree({'a': Blob(b'ab')}), 486s parents=[Placeholder('1')], 486s ), 486s ], 486s 'tags': { 486s 'importer/import/1': Placeholder('1'), 486s 'importer/upload/2': Placeholder('2'), 486s } 486s }, 486s { 486s 'commits': [ 486s Commit(name='b1', message='c', tree=Tree({'a': Blob(b'a')})), 486s ], 486s 'tags': {'importer/import/1': Placeholder('b1')}, 486s }, 486s ), 486s ( 486s # Commits that have no changes should round trip 486s { 486s 'commits': [ 486s Commit( 486s name='1', 486s message='a', 486s ), 486s Commit( 486s name='2', 486s message='b', 486s parents=[Placeholder('1')], 486s ), 486s ], 486s 'tags': { 486s 'importer/import/1': Placeholder('1'), 486s 'importer/upload/2': Placeholder('2'), 486s }, 486s }, 486s { 486s 'commits': [Commit(name='b1', message='c')], 486s 'tags': {'importer/import/1': Placeholder('b1')}, 486s }, 486s ), 486s ( 486s # Commits that have no commit message should round trip 486s { 486s 'commits': [ 486s Commit( 486s name='1', 486s message='a', 486s ), 486s Commit( 486s name='2', 486s message='', 486s tree=Tree({'a': Blob(b'a')}), 486s parents=[Placeholder('1')], 486s ), 486s ], 486s 'tags': { 486s 'importer/import/1': Placeholder('1'), 486s 'importer/upload/2': Placeholder('2'), 486s } 486s }, 486s { 486s 'commits': [Commit(name='b1', message='c')], 486s 'tags': {'importer/import/1': Placeholder('b1')}, 486s }, 486s ), 486s ]) 486s def test_input_edge_cases(tmpdir, repo, before_export, before_import): 486s """ 486s Edge cases in input rich history should reimport without failure 486s 486s Check that rich history preservation completes without an exception in 486s various cases. Details of each case are described in comments in the test 486s parameters above. 486s 486s Since these tests generally cover the mutated case (where rich history has 486s to be ported forward because parent commits have mutated), we must remove 486s and recreate the 'importer/import/1' tag so that it is different before 486s attempting reimport. This is done by deleting all ('importer/*') tags and 486s then using the before_import parameter to recreate it again. 486s 486s :param py.path tmpdir: the pytest standard tmpdir fixture. 486s :param GitUbuntuRepository repo: our standard repo fixture. 486s :param dict before_export: the parameters to supply to Repo() to construct 486s the repository that will be exported. 486s :param dict before_import: the parametsrs to supply to Repo() to add to the 486s repository before attempting reimport. 486s """ 486s > Repo(**before_export).write(repo.raw_repo) 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/rich_history_test.py:260: 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s 486s self = 486s repo = pygit2.Repository('/tmp/tmpf7e1ka13/.git/'), record = {} 486s 486s def write(self, repo, record=None): 486s replace_placeholders(self) 486s record = record or dict() 486s written_commits = [ 486s commit.write(repo=repo, record=record) 486s for commit 486s in self.commit_list 486s ] 486s for name, target in self.branches.items(): 486s repo.create_branch( 486s name, 486s repo.get(target.write(repo)).peel(pygit2.Commit), 486s ) 486s for name, target in self.tags.items(): 486s repo.create_tag( 486s name, 486s target.write(repo), 486s > pygit2.GIT_OBJ_COMMIT, 486s self.tagger.signature, 486s 'Tag message', 486s ) 486s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 486s _______________________ test_preservation_fast_forwards ________________________ 486s 486s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_preservation_fast_forward0') 486s repo = 486s 486s def test_preservation_fast_forwards(tmpdir, repo): 486s """Rich history that can be fast forwarded should not mutate 486s 486s :param py.path tmpdir: the pytest standard tmpdir fixture. 486s :param GitUbuntuRepository repo: our standard repo fixture. 486s """ 486s Repo( 486s commits=[ 486s Commit( 486s name='1', 486s message='a', 486s ), 486s Commit( 486s name='2', 486s message='', 486s tree=Tree({'a': Blob(b'a')}), 486s parents=[Placeholder('1')], 486s ), 486s ], 486s tags={ 486s 'importer/import/1': Placeholder('1'), 486s 'importer/upload/2': Placeholder('2'), 486s } 486s > ).write(repo.raw_repo) 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/rich_history_test.py:294: 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s 486s self = 486s repo = pygit2.Repository('/tmp/tmpl5r17ebk/.git/'), record = {} 486s 486s def write(self, repo, record=None): 486s replace_placeholders(self) 486s record = record or dict() 486s written_commits = [ 486s commit.write(repo=repo, record=record) 486s for commit 486s in self.commit_list 486s ] 486s for name, target in self.branches.items(): 486s repo.create_branch( 486s name, 486s repo.get(target.write(repo)).peel(pygit2.Commit), 486s ) 486s for name, target in self.tags.items(): 486s repo.create_tag( 486s name, 486s target.write(repo), 486s > pygit2.GIT_OBJ_COMMIT, 486s self.tagger.signature, 486s 'Tag message', 486s ) 486s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/repo_builder.py:389: AttributeError 486s _______________________ test_source_create_with_version ________________________ 486s 486s repo = 486s 486s def test_source_create_with_version(repo): 486s > version = get_spec_changelog_version(repo, version='3', native=True) 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/source_builder_test.py:57: 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/source_builder_test.py:47: in get_spec_changelog_version 486s changelog = repo.get_changelog_from_treeish(tree_hash) 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 486s return Changelog.from_treeish( 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:569: in from_treeish 486s blob = follow_symlinks_to_blob( 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 486s return _follow_symlinks_to_blob( 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s 486s repo = pygit2.Repository('/tmp/tmptwjb71cc/.git/') 486s top_tree_object = 486s search_path = 'debian/changelog' 486s _rel_tree = 486s _rel_path = '' 486s 486s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 486s _rel_tree=None, _rel_path='' 486s ): 486s '''Recursively follow a path down a tree, following symlinks, to find blob 486s 486s repo: pygit2.Repository object 486s top_tree: pygit2.Tree object of the top of the tree structure 486s search_path: '/'-separated path string of blob to find 486s _rel_tree: (internal) which tree to look further into 486s _rel_path: (internal) the path we are in so far 486s ''' 486s 486s NORMAL_BLOB_MODES = set([ 486s pygit2.GIT_FILEMODE_BLOB, 486s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 486s ]) 486s 486s _rel_tree = _rel_tree or top_tree_object 486s head, tail = posixpath.split(search_path) 486s 486s # A traditional functional split would put a single entry in head with tail 486s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 486s # to make it appear to have traditional semantics. 486s if not head: 486s head = tail 486s tail = None 486s 486s entry = _rel_tree[head] 486s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 486s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:68: AttributeError 486s ----------------------------- Captured stdout call ----------------------------- 486s dpkg-source: info: using source format '3.0 (native)' 486s dpkg-source: info: building source-builder-package in source-builder-package_3.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_3.dsc 486s ----------------------------- Captured stderr call ----------------------------- 486s dpkg-source: warning: missing information for output field Standards-Version 486s _______________________ test_source_create_with_versions _______________________ 486s 486s repo = 486s 486s def test_source_create_with_versions(repo): 486s source_spec = target.SourceSpec(changelog_versions=['3', '4'], native=True) 486s with target.Source(source_spec) as f: 486s tree_hash = importer.dsc_to_tree_hash(repo.raw_repo, f) 486s > changelog = repo.get_changelog_from_treeish(tree_hash) 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/source_builder_test.py:65: 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 486s return Changelog.from_treeish( 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:569: in from_treeish 486s blob = follow_symlinks_to_blob( 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 486s return _follow_symlinks_to_blob( 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s 486s repo = pygit2.Repository('/tmp/tmp1pwk9xc8/.git/') 486s top_tree_object = 486s search_path = 'debian/changelog' 486s _rel_tree = 486s _rel_path = '' 486s 486s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 486s _rel_tree=None, _rel_path='' 486s ): 486s '''Recursively follow a path down a tree, following symlinks, to find blob 486s 486s repo: pygit2.Repository object 486s top_tree: pygit2.Tree object of the top of the tree structure 486s search_path: '/'-separated path string of blob to find 486s _rel_tree: (internal) which tree to look further into 486s _rel_path: (internal) the path we are in so far 486s ''' 486s 486s NORMAL_BLOB_MODES = set([ 486s pygit2.GIT_FILEMODE_BLOB, 486s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 486s ]) 486s 486s _rel_tree = _rel_tree or top_tree_object 486s head, tail = posixpath.split(search_path) 486s 486s # A traditional functional split would put a single entry in head with tail 486s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 486s # to make it appear to have traditional semantics. 486s if not head: 486s head = tail 486s tail = None 486s 486s entry = _rel_tree[head] 486s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 486s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:68: AttributeError 486s ----------------------------- Captured stdout call ----------------------------- 486s dpkg-source: info: using source format '3.0 (native)' 486s dpkg-source: info: building source-builder-package in source-builder-package_3.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_3.dsc 486s ----------------------------- Captured stderr call ----------------------------- 486s dpkg-source: warning: missing information for output field Standards-Version 486s ____________ test_source_native_source_format[True-3.0 (native)\n] _____________ 486s 486s repo = 486s native = True, expected = b'3.0 (native)\n' 486s 486s @pytest.mark.parametrize('native,expected', [ 486s (True, b"3.0 (native)\n"), 486s (False, b"3.0 (quilt)\n"), 486s ]) 486s def test_source_native_source_format(repo, native, expected): 486s with target.Source(target.SourceSpec(native=native)) as dsc_path: 486s > blob = git_repository.follow_symlinks_to_blob( 486s repo.raw_repo, 486s dsc_path_to_tree(repo, dsc_path), 486s 'debian/source/format', 486s ) 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/source_builder_test.py:133: 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 486s return _follow_symlinks_to_blob( 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s 486s repo = pygit2.Repository('/tmp/tmplkmt3j_r/.git/') 486s top_tree_object = 486s search_path = 'debian/source/format' 486s _rel_tree = 486s _rel_path = '' 486s 486s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 486s _rel_tree=None, _rel_path='' 486s ): 486s '''Recursively follow a path down a tree, following symlinks, to find blob 486s 486s repo: pygit2.Repository object 486s top_tree: pygit2.Tree object of the top of the tree structure 486s search_path: '/'-separated path string of blob to find 486s _rel_tree: (internal) which tree to look further into 486s _rel_path: (internal) the path we are in so far 486s ''' 486s 486s NORMAL_BLOB_MODES = set([ 486s pygit2.GIT_FILEMODE_BLOB, 486s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 486s ]) 486s 486s _rel_tree = _rel_tree or top_tree_object 486s head, tail = posixpath.split(search_path) 486s 486s # A traditional functional split would put a single entry in head with tail 486s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 486s # to make it appear to have traditional semantics. 486s if not head: 486s head = tail 486s tail = None 486s 486s entry = _rel_tree[head] 486s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 486s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:68: AttributeError 486s ----------------------------- Captured stdout call ----------------------------- 486s dpkg-source: info: using source format '3.0 (native)' 486s dpkg-source: info: building source-builder-package in source-builder-package_1.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1.dsc 486s ----------------------------- Captured stderr call ----------------------------- 486s dpkg-source: warning: missing information for output field Standards-Version 486s ____________ test_source_native_source_format[False-3.0 (quilt)\n] _____________ 486s 486s repo = 486s native = False, expected = b'3.0 (quilt)\n' 486s 486s @pytest.mark.parametrize('native,expected', [ 486s (True, b"3.0 (native)\n"), 486s (False, b"3.0 (quilt)\n"), 486s ]) 486s def test_source_native_source_format(repo, native, expected): 486s with target.Source(target.SourceSpec(native=native)) as dsc_path: 486s > blob = git_repository.follow_symlinks_to_blob( 486s repo.raw_repo, 486s dsc_path_to_tree(repo, dsc_path), 486s 'debian/source/format', 486s ) 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/source_builder_test.py:133: 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 486s return _follow_symlinks_to_blob( 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s 486s repo = pygit2.Repository('/tmp/tmptkk95gpq/.git/') 486s top_tree_object = 486s search_path = 'debian/source/format' 486s _rel_tree = 486s _rel_path = '' 486s 486s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 486s _rel_tree=None, _rel_path='' 486s ): 486s '''Recursively follow a path down a tree, following symlinks, to find blob 486s 486s repo: pygit2.Repository object 486s top_tree: pygit2.Tree object of the top of the tree structure 486s search_path: '/'-separated path string of blob to find 486s _rel_tree: (internal) which tree to look further into 486s _rel_path: (internal) the path we are in so far 486s ''' 486s 486s NORMAL_BLOB_MODES = set([ 486s pygit2.GIT_FILEMODE_BLOB, 486s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 486s ]) 486s 486s _rel_tree = _rel_tree or top_tree_object 486s head, tail = posixpath.split(search_path) 486s 486s # A traditional functional split would put a single entry in head with tail 486s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 486s # to make it appear to have traditional semantics. 486s if not head: 486s head = tail 486s tail = None 486s 486s entry = _rel_tree[head] 486s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 486s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:68: AttributeError 486s ----------------------------- Captured stdout call ----------------------------- 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s ----------------------------- Captured stderr call ----------------------------- 486s dpkg-source: warning: missing information for output field Standards-Version 486s _________________________ test_source_quilt_no_patches _________________________ 486s 486s repo = 486s 486s def test_source_quilt_no_patches(repo): 486s with target.Source(target.SourceSpec()) as dsc_path: 486s top = dsc_path_to_tree(repo, dsc_path) 486s debian_entry = top['debian'] 486s > assert debian_entry.type in [pygit2.GIT_OBJ_TREE, 'tree'] 486s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/source_builder_test.py:144: AttributeError 486s ----------------------------- Captured stdout call ----------------------------- 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s ----------------------------- Captured stderr call ----------------------------- 486s dpkg-source: warning: missing information for output field Standards-Version 486s ________________________ test_source_quilt_with_patches ________________________ 486s 486s repo = 486s 486s def test_source_quilt_with_patches(repo): 486s spec = target.SourceSpec(has_patches=True) 486s with target.Source(spec) as dsc_path: 486s top = dsc_path_to_tree(repo, dsc_path) 486s expected_files = ['series', 'a', 'b'] 486s for basename in expected_files: 486s > assert git_repository.follow_symlinks_to_blob( 486s repo.raw_repo, 486s top, 486s 'debian/patches/%s' % basename, 486s ) 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/source_builder_test.py:156: 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 486s return _follow_symlinks_to_blob( 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s 486s repo = pygit2.Repository('/tmp/tmpxcbir28i/.git/') 486s top_tree_object = 486s search_path = 'debian/patches/series' 486s _rel_tree = 486s _rel_path = '' 486s 486s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 486s _rel_tree=None, _rel_path='' 486s ): 486s '''Recursively follow a path down a tree, following symlinks, to find blob 486s 486s repo: pygit2.Repository object 486s top_tree: pygit2.Tree object of the top of the tree structure 486s search_path: '/'-separated path string of blob to find 486s _rel_tree: (internal) which tree to look further into 486s _rel_path: (internal) the path we are in so far 486s ''' 486s 486s NORMAL_BLOB_MODES = set([ 486s pygit2.GIT_FILEMODE_BLOB, 486s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 486s ]) 486s 486s _rel_tree = _rel_tree or top_tree_object 486s head, tail = posixpath.split(search_path) 486s 486s # A traditional functional split would put a single entry in head with tail 486s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 486s # to make it appear to have traditional semantics. 486s if not head: 486s head = tail 486s tail = None 486s 486s entry = _rel_tree[head] 486s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 486s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:68: AttributeError 486s ----------------------------- Captured stdout call ----------------------------- 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: using patch list from debian/patches/series 486s dpkg-source: info: applying a 486s dpkg-source: info: applying b 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: using patch list from debian/patches/series 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s ----------------------------- Captured stderr call ----------------------------- 486s dpkg-source: warning: missing information for output field Standards-Version 486s ____________________ test_source_quilt_with_patches_applied ____________________ 486s 486s repo = 486s 486s def test_source_quilt_with_patches_applied(repo): 486s spec = target.SourceSpec(has_patches=True) 486s with target.Source(spec) as dsc_path: 486s top = dsc_path_to_tree(repo, dsc_path, patches_applied=True) 486s expected_files = [ 486s 'debian/patches/series', 486s 'debian/patches/a', 486s 'debian/patches/b', 486s 'a', 486s 'b', 486s ] 486s for filename in expected_files: 486s > assert git_repository.follow_symlinks_to_blob( 486s repo.raw_repo, 486s top, 486s filename, 486s ) 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/source_builder_test.py:183: 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 486s return _follow_symlinks_to_blob( 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s 486s repo = pygit2.Repository('/tmp/tmp0rhwvlh7/.git/') 486s top_tree_object = 486s search_path = 'debian/patches/series' 486s _rel_tree = 486s _rel_path = '' 486s 486s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 486s _rel_tree=None, _rel_path='' 486s ): 486s '''Recursively follow a path down a tree, following symlinks, to find blob 486s 486s repo: pygit2.Repository object 486s top_tree: pygit2.Tree object of the top of the tree structure 486s search_path: '/'-separated path string of blob to find 486s _rel_tree: (internal) which tree to look further into 486s _rel_path: (internal) the path we are in so far 486s ''' 486s 486s NORMAL_BLOB_MODES = set([ 486s pygit2.GIT_FILEMODE_BLOB, 486s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 486s ]) 486s 486s _rel_tree = _rel_tree or top_tree_object 486s head, tail = posixpath.split(search_path) 486s 486s # A traditional functional split would put a single entry in head with tail 486s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 486s # to make it appear to have traditional semantics. 486s if not head: 486s head = tail 486s tail = None 486s 486s entry = _rel_tree[head] 486s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 486s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:68: AttributeError 486s ----------------------------- Captured stdout call ----------------------------- 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: using patch list from debian/patches/series 486s dpkg-source: info: applying a 486s dpkg-source: info: applying b 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: using patch list from debian/patches/series 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s ----------------------------- Captured stderr call ----------------------------- 486s dpkg-source: warning: missing information for output field Standards-Version 486s ______________________ test_source_version_native_default ______________________ 486s 486s repo = 486s 486s def test_source_version_native_default(repo): 486s """The default version string for a native package should not have a 486s '-' in it. 486s """ 486s > version = get_spec_changelog_version(repo, native=True) 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/source_builder_test.py:194: 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/source_builder_test.py:47: in get_spec_changelog_version 486s changelog = repo.get_changelog_from_treeish(tree_hash) 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 486s return Changelog.from_treeish( 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:569: in from_treeish 486s blob = follow_symlinks_to_blob( 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 486s return _follow_symlinks_to_blob( 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s 486s repo = pygit2.Repository('/tmp/tmpau4m0pgf/.git/') 486s top_tree_object = 486s search_path = 'debian/changelog' 486s _rel_tree = 486s _rel_path = '' 486s 486s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 486s _rel_tree=None, _rel_path='' 486s ): 486s '''Recursively follow a path down a tree, following symlinks, to find blob 486s 486s repo: pygit2.Repository object 486s top_tree: pygit2.Tree object of the top of the tree structure 486s search_path: '/'-separated path string of blob to find 486s _rel_tree: (internal) which tree to look further into 486s _rel_path: (internal) the path we are in so far 486s ''' 486s 486s NORMAL_BLOB_MODES = set([ 486s pygit2.GIT_FILEMODE_BLOB, 486s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 486s ]) 486s 486s _rel_tree = _rel_tree or top_tree_object 486s head, tail = posixpath.split(search_path) 486s 486s # A traditional functional split would put a single entry in head with tail 486s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 486s # to make it appear to have traditional semantics. 486s if not head: 486s head = tail 486s tail = None 486s 486s entry = _rel_tree[head] 486s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 486s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:68: AttributeError 486s ----------------------------- Captured stdout call ----------------------------- 486s dpkg-source: info: using source format '3.0 (native)' 486s dpkg-source: info: building source-builder-package in source-builder-package_1.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1.dsc 486s ----------------------------- Captured stderr call ----------------------------- 486s dpkg-source: warning: missing information for output field Standards-Version 486s ____________________ test_source_version_non_native_default ____________________ 486s 486s repo = 486s 486s def test_source_version_non_native_default(repo): 486s """The default version string for a non-native package should have a 486s '-' in it. 486s """ 486s > version = get_spec_changelog_version(repo, native=False) 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/source_builder_test.py:202: 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/source_builder_test.py:47: in get_spec_changelog_version 486s changelog = repo.get_changelog_from_treeish(tree_hash) 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 486s return Changelog.from_treeish( 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:569: in from_treeish 486s blob = follow_symlinks_to_blob( 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 486s return _follow_symlinks_to_blob( 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s 486s repo = pygit2.Repository('/tmp/tmpg4qu96cj/.git/') 486s top_tree_object = 486s search_path = 'debian/changelog' 486s _rel_tree = 486s _rel_path = '' 486s 486s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 486s _rel_tree=None, _rel_path='' 486s ): 486s '''Recursively follow a path down a tree, following symlinks, to find blob 486s 486s repo: pygit2.Repository object 486s top_tree: pygit2.Tree object of the top of the tree structure 486s search_path: '/'-separated path string of blob to find 486s _rel_tree: (internal) which tree to look further into 486s _rel_path: (internal) the path we are in so far 486s ''' 486s 486s NORMAL_BLOB_MODES = set([ 486s pygit2.GIT_FILEMODE_BLOB, 486s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 486s ]) 486s 486s _rel_tree = _rel_tree or top_tree_object 486s head, tail = posixpath.split(search_path) 486s 486s # A traditional functional split would put a single entry in head with tail 486s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 486s # to make it appear to have traditional semantics. 486s if not head: 486s head = tail 486s tail = None 486s 486s entry = _rel_tree[head] 486s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 486s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:68: AttributeError 486s ----------------------------- Captured stdout call ----------------------------- 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 486s ----------------------------- Captured stderr call ----------------------------- 486s dpkg-source: warning: missing information for output field Standards-Version 486s _____________________ test_source_version_native_specific ______________________ 486s 486s repo = 486s 486s def test_source_version_native_specific(repo): 486s """We should be able to create a native package with a 486s native-looking version string. 486s """ 486s > version = get_spec_changelog_version(repo, native=True, version='1.0') 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/source_builder_test.py:210: 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/source_builder_test.py:47: in get_spec_changelog_version 486s changelog = repo.get_changelog_from_treeish(tree_hash) 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 486s return Changelog.from_treeish( 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:569: in from_treeish 486s blob = follow_symlinks_to_blob( 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 486s return _follow_symlinks_to_blob( 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s 486s repo = pygit2.Repository('/tmp/tmp986ntzuv/.git/') 486s top_tree_object = 486s search_path = 'debian/changelog' 486s _rel_tree = 486s _rel_path = '' 486s 486s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 486s _rel_tree=None, _rel_path='' 486s ): 486s '''Recursively follow a path down a tree, following symlinks, to find blob 486s 486s repo: pygit2.Repository object 486s top_tree: pygit2.Tree object of the top of the tree structure 486s search_path: '/'-separated path string of blob to find 486s _rel_tree: (internal) which tree to look further into 486s _rel_path: (internal) the path we are in so far 486s ''' 486s 486s NORMAL_BLOB_MODES = set([ 486s pygit2.GIT_FILEMODE_BLOB, 486s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 486s ]) 486s 486s _rel_tree = _rel_tree or top_tree_object 486s head, tail = posixpath.split(search_path) 486s 486s # A traditional functional split would put a single entry in head with tail 486s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 486s # to make it appear to have traditional semantics. 486s if not head: 486s head = tail 486s tail = None 486s 486s entry = _rel_tree[head] 486s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 486s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:68: AttributeError 486s ----------------------------- Captured stdout call ----------------------------- 486s dpkg-source: info: using source format '3.0 (native)' 486s dpkg-source: info: building source-builder-package in source-builder-package_1.0.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1.0.dsc 486s ----------------------------- Captured stderr call ----------------------------- 486s dpkg-source: warning: missing information for output field Standards-Version 486s ___________________ test_source_version_non_native_specific ____________________ 486s 486s repo = 486s 486s def test_source_version_non_native_specific(repo): 486s """We should be able to create a non-native package with a 486s non-native-looking version string. 486s """ 486s > version = get_spec_changelog_version(repo, native=False, version='1.0-1') 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/source_builder_test.py:218: 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/source_builder_test.py:47: in get_spec_changelog_version 486s changelog = repo.get_changelog_from_treeish(tree_hash) 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 486s return Changelog.from_treeish( 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:569: in from_treeish 486s blob = follow_symlinks_to_blob( 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 486s return _follow_symlinks_to_blob( 486s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 486s 486s repo = pygit2.Repository('/tmp/tmpzn6uer6j/.git/') 486s top_tree_object = 486s search_path = 'debian/changelog' 486s _rel_tree = 486s _rel_path = '' 486s 486s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 486s _rel_tree=None, _rel_path='' 486s ): 486s '''Recursively follow a path down a tree, following symlinks, to find blob 486s 486s repo: pygit2.Repository object 486s top_tree: pygit2.Tree object of the top of the tree structure 486s search_path: '/'-separated path string of blob to find 486s _rel_tree: (internal) which tree to look further into 486s _rel_path: (internal) the path we are in so far 486s ''' 486s 486s NORMAL_BLOB_MODES = set([ 486s pygit2.GIT_FILEMODE_BLOB, 486s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 486s ]) 486s 486s _rel_tree = _rel_tree or top_tree_object 486s head, tail = posixpath.split(search_path) 486s 486s # A traditional functional split would put a single entry in head with tail 486s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 486s # to make it appear to have traditional semantics. 486s if not head: 486s head = tail 486s tail = None 486s 486s entry = _rel_tree[head] 486s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 486s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 486s 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/git_repository.py:68: AttributeError 486s ----------------------------- Captured stdout call ----------------------------- 486s dpkg-source: info: using source format '3.0 (quilt)' 486s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.0.orig.tar.gz 486s dpkg-source: info: building source-builder-package in source-builder-package_1.0-1.debian.tar.xz 486s dpkg-source: info: building source-builder-package in source-builder-package_1.0-1.dsc 486s ----------------------------- Captured stderr call ----------------------------- 486s dpkg-source: warning: missing information for output field Standards-Version 486s =============================== warnings summary =============================== 486s gitubuntu/__main__.py:7 486s /tmp/autopkgtest.fX8nmF/build.mOL/src/gitubuntu/__main__.py:7: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html 486s import pkg_resources 486s 486s ../../../../usr/lib/python3/dist-packages/pkg_resources/__init__.py:3154 486s /usr/lib/python3/dist-packages/pkg_resources/__init__.py:3154: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('logilab')`. 486s 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 486s declare_namespace(pkg) 486s 486s -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html 486s 486s ---------- coverage: platform linux, python 3.12.7-final-0 ----------- 486s Name Stmts Miss Cover 486s --------------------------------------------------------------- 486s gitubuntu/__init__.py 0 0 100% 486s gitubuntu/__main__.py 103 94 9% 486s gitubuntu/build.py 185 131 29% 486s gitubuntu/cache.py 1 0 100% 486s gitubuntu/clone.py 70 54 23% 486s gitubuntu/dsc.py 65 16 75% 486s gitubuntu/exportorig.py 48 37 23% 486s gitubuntu/git_repository.py 1103 521 53% 486s gitubuntu/git_repository_test.py 316 40 87% 486s gitubuntu/importer.py 707 446 37% 486s gitubuntu/importer_service.py 215 22 90% 486s gitubuntu/importer_service_broker.py 60 49 18% 486s gitubuntu/importer_service_ipc.py 12 2 83% 486s gitubuntu/importer_service_poller.py 37 25 32% 486s gitubuntu/importer_service_test.py 147 0 100% 486s gitubuntu/importer_service_worker.py 87 64 26% 486s gitubuntu/importer_service_worker_test.py 18 0 100% 486s gitubuntu/importer_tag_test.py 47 20 57% 486s gitubuntu/importer_test.py 388 133 66% 486s gitubuntu/integration_test.py 67 26 61% 486s gitubuntu/logging.py 8 4 50% 486s gitubuntu/merge.py 219 192 12% 486s gitubuntu/patch_state.py 2 0 100% 486s gitubuntu/prepare_upload.py 86 3 97% 486s gitubuntu/prepare_upload_test.py 152 0 100% 486s gitubuntu/queue.py 174 148 15% 486s gitubuntu/remote.py 100 85 15% 486s gitubuntu/repo_builder.py 162 0 100% 486s gitubuntu/repo_builder_test.py 159 12 92% 486s gitubuntu/repo_comparator.py 32 25 22% 486s gitubuntu/rich_history.py 67 45 33% 486s gitubuntu/rich_history_test.py 53 31 42% 486s gitubuntu/run.py 72 12 83% 486s gitubuntu/scriptutils.py 11 0 100% 486s gitubuntu/source_builder.py 119 0 100% 486s gitubuntu/source_builder_test.py 105 18 83% 486s gitubuntu/source_information.py 339 133 61% 486s gitubuntu/source_information_test.py 78 3 96% 486s gitubuntu/spec.py 3 0 100% 486s gitubuntu/submit.py 103 86 17% 486s gitubuntu/tag.py 78 69 12% 486s gitubuntu/test_fixtures.py 29 5 83% 486s gitubuntu/test_util.py 5 0 100% 486s gitubuntu/version.py 1 0 100% 486s gitubuntu/versioning.py 124 16 87% 486s --------------------------------------------------------------- 486s TOTAL 5957 2567 57% 486s 486s =========================== short test summary info ============================ 486s FAILED gitubuntu/git_repository_test.py::test_follow_symlinks_to_blob[0] 486s FAILED gitubuntu/git_repository_test.py::test_follow_symlinks_to_blob[1] 486s FAILED gitubuntu/git_repository_test.py::test_follow_symlinks_to_blob[2] 486s FAILED gitubuntu/git_repository_test.py::test_follow_symlinks_to_blob[3] 486s FAILED gitubuntu/git_repository_test.py::test_follow_symlinks_to_blob[4] 486s FAILED gitubuntu/git_repository_test.py::test_follow_symlinks_to_blob_not_found[tree1] 486s FAILED gitubuntu/git_repository_test.py::test_follow_symlinks_to_blob_not_found[tree2] 486s FAILED gitubuntu/git_repository_test.py::test_follow_symlinks_to_blob_not_found[tree3] 486s FAILED gitubuntu/git_repository_test.py::test_git_escape_dir_to_tree - Attrib... 486s FAILED gitubuntu/git_repository_test.py::test_determine_quilt_series_path[tree_data1-debian/patches/series] 486s FAILED gitubuntu/git_repository_test.py::test_determine_quilt_series_path[tree_data2-debian/patches/series] 486s FAILED gitubuntu/git_repository_test.py::test_determine_quilt_series_path[tree_data3-debian/patches/debian.series] 486s FAILED gitubuntu/git_repository_test.py::test_determine_quilt_series_path[tree_data4-debian/patches/debian.series] 486s FAILED gitubuntu/git_repository_test.py::test_quilt_env - AttributeError: mod... 486s FAILED gitubuntu/git_repository_test.py::test_repo_quilt_env - AttributeError... 486s FAILED gitubuntu/git_repository_test.py::test_repo_quilt_env_from_treeish_str 486s 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] 486s 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] 486s 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] 486s FAILED gitubuntu/git_repository_test.py::test_commit_tree - AttributeError: m... 486s FAILED gitubuntu/git_repository_test.py::test_descendant_of[root-root-False] 486s FAILED gitubuntu/git_repository_test.py::test_descendant_of[child1-root-True] 486s FAILED gitubuntu/git_repository_test.py::test_descendant_of[root-child1-False] 486s FAILED gitubuntu/git_repository_test.py::test_descendant_of[grandchild1-root-True] 486s FAILED gitubuntu/git_repository_test.py::test_descendant_of[child1-child2-False] 486s FAILED gitubuntu/git_repository_test.py::test_descendant_of[root-disjoint-False] 486s FAILED gitubuntu/git_repository_test.py::test_create_tag - AttributeError: mo... 486s FAILED gitubuntu/git_repository_test.py::test_get_all_reimport_tags - Attribu... 486s FAILED gitubuntu/git_repository_test.py::test_get_head_info - AttributeError:... 486s 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] 486s 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] 486s 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] 486s 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] 486s 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] 486s 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] 486s 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] 486s 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] 486s FAILED gitubuntu/importer_tag_test.py::test_import_applied_spi_tags[input_repo0-validation_repo_delta0-validation_repo_expected_treewise_refs0-True] 486s FAILED gitubuntu/importer_tag_test.py::test_import_applied_spi_tags[input_repo2-validation_repo_delta2-validation_repo_expected_treewise_refs2-False] 486s FAILED gitubuntu/importer_test.py::test_get_existing_import_tags[input_repo1-PatchState.UNAPPLIED-expected1] 486s FAILED gitubuntu/importer_test.py::test_get_existing_import_tags[input_repo2-PatchState.UNAPPLIED-expected2] 486s FAILED gitubuntu/importer_test.py::test_get_existing_import_tags[input_repo4-PatchState.APPLIED-expected4] 486s FAILED gitubuntu/importer_test.py::test_get_existing_import_tags[input_repo5-PatchState.APPLIED-expected5] 486s FAILED gitubuntu/importer_test.py::test_get_existing_import_tags_ordering - A... 486s FAILED gitubuntu/importer_test.py::test_create_import_tag[input_repo0-validation_repo_delta0-validation_repo_expected_identical_refs0] 486s FAILED gitubuntu/importer_test.py::test_create_import_tag[input_repo1-validation_repo_delta1-validation_repo_expected_identical_refs1] 486s FAILED gitubuntu/importer_test.py::test_create_import_tag[input_repo2-validation_repo_delta2-validation_repo_expected_identical_refs2] 486s FAILED gitubuntu/importer_test.py::test_create_import_tag_hash_stability_on_first_import 486s FAILED gitubuntu/importer_test.py::test_create_import_tag_hash_stability_on_reimport 486s FAILED gitubuntu/importer_test.py::test_create_applied_tag[input_repo0-validation_repo_delta0-validation_repo_expected_identical_refs0] 486s FAILED gitubuntu/importer_test.py::test_create_applied_tag[input_repo1-validation_repo_delta1-validation_repo_expected_identical_refs1] 486s FAILED gitubuntu/importer_test.py::test_create_applied_tag[input_repo2-validation_repo_delta2-validation_repo_expected_identical_refs2] 486s FAILED gitubuntu/importer_test.py::test_get_changelog_parent_commits[input_repo1-parent_overrides1-changelog_versions1-PatchState.UNAPPLIED-expected_refs1] 486s FAILED gitubuntu/importer_test.py::test_get_changelog_parent_commits[input_repo2-parent_overrides2-changelog_versions2-PatchState.UNAPPLIED-expected_refs2] 486s FAILED gitubuntu/importer_test.py::test_get_changelog_parent_commits[input_repo3-parent_overrides3-changelog_versions3-PatchState.UNAPPLIED-expected_refs3] 486s FAILED gitubuntu/importer_test.py::test_get_changelog_parent_commits[input_repo5-parent_overrides5-changelog_versions5-PatchState.APPLIED-expected_refs5] 486s FAILED gitubuntu/importer_test.py::test_get_changelog_parent_commits[input_repo6-parent_overrides6-changelog_versions6-PatchState.APPLIED-expected_refs6] 486s FAILED gitubuntu/importer_test.py::test_get_changelog_parent_commits[input_repo7-parent_overrides7-changelog_versions7-PatchState.APPLIED-expected_refs7] 486s FAILED gitubuntu/importer_test.py::test_validate_rich_history[input_repo0-published_spec0-True] 486s FAILED gitubuntu/importer_test.py::test_validate_rich_history[input_repo1-published_spec1-True] 486s FAILED gitubuntu/importer_test.py::test_validate_rich_history[input_repo2-published_spec2-RichHistoryTreeMismatch] 486s FAILED gitubuntu/importer_test.py::test_validate_rich_history[input_repo3-published_spec3-RichHistoryHasNoChangelogParentAncestor] 486s FAILED gitubuntu/importer_test.py::test_add_changelog_note_to_commit - Attrib... 486s FAILED gitubuntu/importer_test.py::test_add_changelog_note_to_commit_utf8 - A... 486s FAILED gitubuntu/importer_test.py::test_double_changelog_note_add_does_not_fail 486s FAILED gitubuntu/importer_test.py::test_create_import_note - AttributeError: ... 486s FAILED gitubuntu/importer_test.py::test_create_import_note_timestamp - Attrib... 486s FAILED gitubuntu/importer_test.py::test_import_creates_import_note - Attribut... 486s FAILED gitubuntu/importer_test.py::test_import_unapplied_spi_quilt_patches - ... 486s FAILED gitubuntu/importer_test.py::test_import_unapplied_spi_parenting[input_repo0-changelog_versions0-validation_repo_delta0-validation_repo_expected_identical_refs0] 486s FAILED gitubuntu/importer_test.py::test_import_unapplied_spi_parenting[input_repo1-changelog_versions1-validation_repo_delta1-validation_repo_expected_identical_refs1] 486s FAILED gitubuntu/importer_test.py::test_import_unapplied_spi_parenting[input_repo2-changelog_versions2-validation_repo_delta2-validation_repo_expected_identical_refs2] 486s FAILED gitubuntu/importer_test.py::test_import_unapplied_spi_parenting[input_repo3-changelog_versions3-validation_repo_delta3-validation_repo_expected_identical_refs3] 486s FAILED gitubuntu/importer_test.py::test_import_unapplied_spi_parent_override 486s FAILED gitubuntu/importer_test.py::test_import_unapplied_spi_parent_override_failure 486s FAILED gitubuntu/importer_test.py::test_import_applied_spi_parenting[input_repo0-expected_ancestor_commits0-expected_parent_commits0] 486s FAILED gitubuntu/importer_test.py::test_authorship_date[False-Fri, 2 Feb 1971 12:34:56 +0100-expected_result0] 486s FAILED gitubuntu/importer_test.py::test_authorship_date[True-Failday, 30 Feb 1971 99:99:99 +9999-expected_result1] 486s FAILED gitubuntu/importer_test.py::test_fetch_rich_history_from_changes_file 486s FAILED gitubuntu/importer_test.py::test_fetch_rich_history_from_changes_file_fetch_failure_retry 486s FAILED gitubuntu/importer_test.py::test_fetch_rich_history_from_changes_file_missing_ref 486s FAILED gitubuntu/importer_test.py::test_fetch_rich_history_from_changes_file_missing_commit 486s FAILED gitubuntu/importer_test.py::test_fetch_rich_history_from_changes_file_not_a_commit 486s FAILED gitubuntu/integration_test.py::test_reconstruct_changelog - AttributeE... 486s FAILED gitubuntu/repo_builder_test.py::TestObjectCreation::testRepoBranchesTags 486s FAILED gitubuntu/repo_builder_test.py::TestObjectCreation::testRepoTagger - A... 486s FAILED gitubuntu/repo_builder_test.py::test_source_tree - AttributeError: mod... 486s FAILED gitubuntu/rich_history_test.py::test_preservation - AttributeError: mo... 486s FAILED gitubuntu/rich_history_test.py::test_preservation_multiple_parents - A... 486s FAILED gitubuntu/rich_history_test.py::test_preservation_no_parents - Attribu... 486s FAILED gitubuntu/rich_history_test.py::test_input_edge_cases[before_export0-before_import0] 486s FAILED gitubuntu/rich_history_test.py::test_input_edge_cases[before_export1-before_import1] 486s FAILED gitubuntu/rich_history_test.py::test_input_edge_cases[before_export2-before_import2] 486s FAILED gitubuntu/rich_history_test.py::test_preservation_fast_forwards - Attr... 486s FAILED gitubuntu/source_builder_test.py::test_source_create_with_version - At... 486s FAILED gitubuntu/source_builder_test.py::test_source_create_with_versions - A... 486s FAILED gitubuntu/source_builder_test.py::test_source_native_source_format[True-3.0 (native)\n] 486s FAILED gitubuntu/source_builder_test.py::test_source_native_source_format[False-3.0 (quilt)\n] 486s FAILED gitubuntu/source_builder_test.py::test_source_quilt_no_patches - Attri... 486s FAILED gitubuntu/source_builder_test.py::test_source_quilt_with_patches - Att... 486s FAILED gitubuntu/source_builder_test.py::test_source_quilt_with_patches_applied 486s FAILED gitubuntu/source_builder_test.py::test_source_version_native_default 486s FAILED gitubuntu/source_builder_test.py::test_source_version_non_native_default 486s FAILED gitubuntu/source_builder_test.py::test_source_version_native_specific 486s FAILED gitubuntu/source_builder_test.py::test_source_version_non_native_specific 486s = 105 failed, 348 passed, 3 skipped, 3 xfailed, 2 warnings in 85.77s (0:01:25) = 486s pytest failed; self test will fail 486s autopkgtest [09:43:02]: test self-test: -----------------------] 495s self-test FAIL non-zero exit status 1 495s autopkgtest [09:43:11]: test self-test: - - - - - - - - - - results - - - - - - - - - - 506s autopkgtest [09:43:22]: @@@@@@@@@@@@@@@@@@@@ summary 506s self-test FAIL non-zero exit status 1