0s autopkgtest [09:53:33]: starting date and time: 2024-12-03 09:53:33+0000 0s autopkgtest [09:53:33]: git checkout: be626eda Fix armhf LXD image generation for plucky 0s autopkgtest [09:53:33]: host juju-7f2275-prod-proposed-migration-environment-15; command line: /home/ubuntu/autopkgtest/runner/autopkgtest --output-dir /tmp/autopkgtest-work.n3kr5xhd/out --timeout-copy=6000 -a i386 --setup-commands /home/ubuntu/autopkgtest-cloud/worker-config-production/setup-canonical.sh --apt-pocket=proposed=src:python-pygit2 --apt-upgrade git-ubuntu --timeout-short=300 --timeout-copy=20000 --timeout-build=20000 --env=ADT_TEST_TRIGGERS=python-pygit2/1.16.0-2 -- ssh -s /home/ubuntu/autopkgtest/ssh-setup/nova -- --flavor builder-cpu2-ram4-disk20 --security-groups autopkgtest-juju-7f2275-prod-proposed-migration-environment-15@bos03-6.secgroup --name adt-plucky-i386-git-ubuntu-20241203-093455-juju-7f2275-prod-proposed-migration-environment-15-76e888a3-3f53-4add-bffc-9a13f8a06bd1 --image adt/ubuntu-plucky-amd64-server --keyname testbed-juju-7f2275-prod-proposed-migration-environment-15 --net-id=net_prod-proposed-migration-amd64 -e TERM=linux -e ''"'"'http_proxy=http://squid.internal:3128'"'"'' -e ''"'"'https_proxy=http://squid.internal:3128'"'"'' -e ''"'"'no_proxy=127.0.0.1,127.0.1.1,login.ubuntu.com,localhost,localdomain,novalocal,internal,archive.ubuntu.com,ports.ubuntu.com,security.ubuntu.com,ddebs.ubuntu.com,changelogs.ubuntu.com,keyserver.ubuntu.com,launchpadlibrarian.net,launchpadcontent.net,launchpad.net,10.24.0.0/24,keystone.ps5.canonical.com,objectstorage.prodstack5.canonical.com'"'"'' --mirror=http://ftpmaster.internal/ubuntu/ 47s autopkgtest [09:54:20]: testbed dpkg architecture: amd64 47s autopkgtest [09:54:20]: testbed apt version: 2.9.14ubuntu1 47s autopkgtest [09:54:20]: @@@@@@@@@@@@@@@@@@@@ test bed setup 47s autopkgtest [09:54:20]: testbed release detected to be: None 48s autopkgtest [09:54:21]: updating testbed package index (apt update) 48s Get:1 http://ftpmaster.internal/ubuntu plucky-proposed InRelease [73.9 kB] 49s Hit:2 http://ftpmaster.internal/ubuntu plucky InRelease 49s Hit:3 http://ftpmaster.internal/ubuntu plucky-updates InRelease 49s Hit:4 http://ftpmaster.internal/ubuntu plucky-security InRelease 49s Get:5 http://ftpmaster.internal/ubuntu plucky-proposed/main Sources [65.3 kB] 49s Get:6 http://ftpmaster.internal/ubuntu plucky-proposed/restricted Sources [9708 B] 49s Get:7 http://ftpmaster.internal/ubuntu plucky-proposed/universe Sources [781 kB] 49s Get:8 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse Sources [15.1 kB] 49s Get:9 http://ftpmaster.internal/ubuntu plucky-proposed/main amd64 Packages [153 kB] 49s Get:10 http://ftpmaster.internal/ubuntu plucky-proposed/main i386 Packages [104 kB] 49s Get:11 http://ftpmaster.internal/ubuntu plucky-proposed/restricted i386 Packages [2572 B] 49s Get:12 http://ftpmaster.internal/ubuntu plucky-proposed/restricted amd64 Packages [40.6 kB] 49s Get:13 http://ftpmaster.internal/ubuntu plucky-proposed/universe i386 Packages [256 kB] 49s Get:14 http://ftpmaster.internal/ubuntu plucky-proposed/universe amd64 Packages [687 kB] 49s Get:15 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse i386 Packages [6364 B] 49s Get:16 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse amd64 Packages [21.9 kB] 49s Fetched 2217 kB in 1s (2491 kB/s) 50s Reading package lists... 50s Reading package lists... 51s Building dependency tree... 51s Reading state information... 51s Calculating upgrade... 51s The following packages will be upgraded: 51s gcc-14-base libatomic1 libgcc-s1 libstdc++6 51s 4 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 51s Need to get 928 kB of archives. 51s After this operation, 1024 B of additional disk space will be used. 51s Get:1 http://ftpmaster.internal/ubuntu plucky/main amd64 libatomic1 amd64 14.2.0-9ubuntu1 [10.3 kB] 51s Get:2 http://ftpmaster.internal/ubuntu plucky/main amd64 gcc-14-base amd64 14.2.0-9ubuntu1 [52.0 kB] 51s Get:3 http://ftpmaster.internal/ubuntu plucky/main amd64 libstdc++6 amd64 14.2.0-9ubuntu1 [788 kB] 52s Get:4 http://ftpmaster.internal/ubuntu plucky/main amd64 libgcc-s1 amd64 14.2.0-9ubuntu1 [78.4 kB] 52s Fetched 928 kB in 1s (1718 kB/s) 52s (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 ... 75952 files and directories currently installed.) 52s Preparing to unpack .../libatomic1_14.2.0-9ubuntu1_amd64.deb ... 52s Unpacking libatomic1:amd64 (14.2.0-9ubuntu1) over (14.2.0-8ubuntu1) ... 52s Preparing to unpack .../gcc-14-base_14.2.0-9ubuntu1_amd64.deb ... 52s Unpacking gcc-14-base:amd64 (14.2.0-9ubuntu1) over (14.2.0-8ubuntu1) ... 52s Setting up gcc-14-base:amd64 (14.2.0-9ubuntu1) ... 52s (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 ... 75952 files and directories currently installed.) 52s Preparing to unpack .../libstdc++6_14.2.0-9ubuntu1_amd64.deb ... 52s Unpacking libstdc++6:amd64 (14.2.0-9ubuntu1) over (14.2.0-8ubuntu1) ... 52s Setting up libstdc++6:amd64 (14.2.0-9ubuntu1) ... 52s (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 ... 75952 files and directories currently installed.) 52s Preparing to unpack .../libgcc-s1_14.2.0-9ubuntu1_amd64.deb ... 52s Unpacking libgcc-s1:amd64 (14.2.0-9ubuntu1) over (14.2.0-8ubuntu1) ... 52s Setting up libgcc-s1:amd64 (14.2.0-9ubuntu1) ... 52s Setting up libatomic1:amd64 (14.2.0-9ubuntu1) ... 52s Processing triggers for libc-bin (2.40-1ubuntu3) ... 52s Reading package lists... 53s Building dependency tree... 53s Reading state information... 53s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 53s autopkgtest [09:54:26]: upgrading testbed (apt dist-upgrade and autopurge) 53s Reading package lists... 53s Building dependency tree... 53s Reading state information... 54s Calculating upgrade...Starting pkgProblemResolver with broken count: 0 54s Starting 2 pkgProblemResolver with broken count: 0 54s Done 54s Entering ResolveByKeep 54s 54s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 55s Reading package lists... 55s Building dependency tree... 55s Reading state information... 55s Starting pkgProblemResolver with broken count: 0 55s Starting 2 pkgProblemResolver with broken count: 0 55s Done 55s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 58s autopkgtest [09:54:31]: testbed running kernel: Linux 6.11.0-8-generic #8-Ubuntu SMP PREEMPT_DYNAMIC Mon Sep 16 13:41:20 UTC 2024 58s autopkgtest [09:54:31]: @@@@@@@@@@@@@@@@@@@@ apt-source git-ubuntu 59s Get:1 http://ftpmaster.internal/ubuntu plucky/universe git-ubuntu 1.1-1 (dsc) [2280 B] 59s Get:2 http://ftpmaster.internal/ubuntu plucky/universe git-ubuntu 1.1-1 (tar) [179 kB] 59s Get:3 http://ftpmaster.internal/ubuntu plucky/universe git-ubuntu 1.1-1 (diff) [5776 B] 60s gpgv: Signature made Wed Jul 3 16:18:24 2024 UTC 60s gpgv: using RSA key A62D2CFBD50B9B5BF360D54B159EB5C4EFC8774C 60s gpgv: Can't check signature: No public key 60s dpkg-source: warning: cannot verify inline signature for ./git-ubuntu_1.1-1.dsc: no acceptable signature found 60s autopkgtest [09:54:33]: testing package git-ubuntu version 1.1-1 60s autopkgtest [09:54:33]: build not needed 60s autopkgtest [09:54:33]: test self-test: preparing testbed 60s Reading package lists... 61s Building dependency tree... 61s Reading state information... 61s Starting pkgProblemResolver with broken count: 0 61s Starting 2 pkgProblemResolver with broken count: 0 61s Done 61s The following NEW packages will be installed: 61s dctrl-tools debian-archive-keyring devscripts diffstat dput gettext git 61s git-buildpackage git-man git-ubuntu libb-hooks-op-check-perl 61s libclass-method-modifiers-perl libclass-xsaccessor-perl libclone-perl 61s libdevel-callchecker-perl libdynaloader-functions-perl libencode-locale-perl 61s liberror-perl libfile-dirlist-perl libfile-homedir-perl libfile-listing-perl 61s libfile-touch-perl libfile-which-perl libgit2-1.8 libgomp1 61s libhtml-parser-perl libhtml-tagset-perl libhtml-tree-perl 61s libhttp-cookies-perl libhttp-date-perl libhttp-message-perl 61s libhttp-negotiate-perl libhttp-parser2.9 libimport-into-perl libio-html-perl 61s libio-pty-perl libio-socket-ssl-perl libipc-run-perl libjs-jquery 61s libjs-jquery-hotkeys libjs-jquery-isonscreen libjs-jquery-metadata 61s libjs-jquery-tablesorter libjs-jquery-throttle-debounce libjs-sphinxdoc 61s libjs-underscore liblwp-mediatypes-perl liblwp-protocol-https-perl 61s libmodule-runtime-perl libmoo-perl libnet-http-perl libnet-ssleay-perl 61s libnorm1t64 libparams-classify-perl libpgm-5.3-0t64 libpython3.13-minimal 61s libpython3.13-stdlib librole-tiny-perl libsodium23 libsub-quote-perl 61s libsys-cpuaffinity-perl libtimedate-perl libtry-tiny-perl liburi-perl 61s libwww-perl libwww-robotrules-perl libxdelta2t64 libzmq5 patchutils pbzip2 61s perl-openssl-defaults pixz pristine-tar pylint python3-argcomplete 61s python3-astroid python3-cachetools python3-coverage python3-dateutil 61s python3-debian python3-debianbts python3-dill python3-distro-info 61s python3-gpg python3-importlib-metadata python3-iniconfig python3-isort 61s python3-jaraco.classes python3-jeepney python3-keyring python3-keyrings.alt 61s python3-launchpadlib-desktop python3-logilab-common python3-mccabe 61s python3-mypy-extensions python3-packaging python3-platformdirs 61s python3-pluggy python3-py python3-pycryptodome python3-pygit2 python3-pytest 61s python3-pytest-cov python3-secretstorage python3-tenacity python3-tomlkit 61s python3-ubuntutools python3-xdg python3-zmq python3.13 python3.13-minimal 61s quilt ubuntu-dev-tools wdiff xdelta xdelta3 61s 0 upgraded, 116 newly installed, 0 to remove and 0 not upgraded. 61s Need to get 24.1 MB of archives. 61s After this operation, 100 MB of additional disk space will be used. 61s Get:1 http://ftpmaster.internal/ubuntu plucky/main amd64 libpython3.13-minimal amd64 3.13.0-2 [879 kB] 62s Get:2 http://ftpmaster.internal/ubuntu plucky/main amd64 python3.13-minimal amd64 3.13.0-2 [2188 kB] 62s Get:3 http://ftpmaster.internal/ubuntu plucky/main amd64 libjs-jquery all 3.6.1+dfsg+~3.5.14-1 [328 kB] 62s Get:4 http://ftpmaster.internal/ubuntu plucky/universe amd64 libjs-jquery-hotkeys all 0~20130707+git2d51e3a9+dfsg-2.1 [11.5 kB] 62s Get:5 http://ftpmaster.internal/ubuntu plucky/main amd64 python3-distro-info all 1.12 [7754 B] 62s Get:6 http://ftpmaster.internal/ubuntu plucky/main amd64 dctrl-tools amd64 2.24-3build3 [106 kB] 62s Get:7 http://ftpmaster.internal/ubuntu plucky/universe amd64 debian-archive-keyring all 2023.4ubuntu1 [168 kB] 62s Get:8 http://ftpmaster.internal/ubuntu plucky/main amd64 libfile-dirlist-perl all 0.05-3 [7286 B] 62s Get:9 http://ftpmaster.internal/ubuntu plucky/main amd64 libfile-which-perl all 1.27-2 [12.5 kB] 62s Get:10 http://ftpmaster.internal/ubuntu plucky/main amd64 libfile-homedir-perl all 1.006-2 [37.0 kB] 62s Get:11 http://ftpmaster.internal/ubuntu plucky/main amd64 libfile-touch-perl all 0.12-2 [7498 B] 62s Get:12 http://ftpmaster.internal/ubuntu plucky/main amd64 libio-pty-perl amd64 1:1.20-1build3 [31.4 kB] 62s Get:13 http://ftpmaster.internal/ubuntu plucky/main amd64 libipc-run-perl all 20231003.0-2 [91.5 kB] 62s Get:14 http://ftpmaster.internal/ubuntu plucky/main amd64 libclass-method-modifiers-perl all 2.15-1 [16.1 kB] 62s Get:15 http://ftpmaster.internal/ubuntu plucky/main amd64 libclass-xsaccessor-perl amd64 1.19-4build5 [33.0 kB] 62s Get:16 http://ftpmaster.internal/ubuntu plucky/main amd64 libb-hooks-op-check-perl amd64 0.22-3build2 [9624 B] 62s Get:17 http://ftpmaster.internal/ubuntu plucky/main amd64 libdynaloader-functions-perl all 0.004-1 [11.4 kB] 62s Get:18 http://ftpmaster.internal/ubuntu plucky/main amd64 libdevel-callchecker-perl amd64 0.009-1build1 [14.2 kB] 62s Get:19 http://ftpmaster.internal/ubuntu plucky/main amd64 libparams-classify-perl amd64 0.015-2build6 [20.1 kB] 62s Get:20 http://ftpmaster.internal/ubuntu plucky/main amd64 libmodule-runtime-perl all 0.016-2 [16.4 kB] 62s Get:21 http://ftpmaster.internal/ubuntu plucky/main amd64 libimport-into-perl all 1.002005-2 [10.7 kB] 62s Get:22 http://ftpmaster.internal/ubuntu plucky/main amd64 librole-tiny-perl all 2.002004-1 [16.3 kB] 62s Get:23 http://ftpmaster.internal/ubuntu plucky/main amd64 libsub-quote-perl all 2.006008-1ubuntu1 [20.7 kB] 62s Get:24 http://ftpmaster.internal/ubuntu plucky/main amd64 libmoo-perl all 2.005005-1 [47.4 kB] 62s Get:25 http://ftpmaster.internal/ubuntu plucky/main amd64 libencode-locale-perl all 1.05-3 [11.6 kB] 62s Get:26 http://ftpmaster.internal/ubuntu plucky/main amd64 libtimedate-perl all 2.3300-2 [34.0 kB] 62s Get:27 http://ftpmaster.internal/ubuntu plucky/main amd64 libhttp-date-perl all 6.06-1 [10.2 kB] 62s Get:28 http://ftpmaster.internal/ubuntu plucky/main amd64 libfile-listing-perl all 6.16-1 [11.3 kB] 62s Get:29 http://ftpmaster.internal/ubuntu plucky/main amd64 libhtml-tagset-perl all 3.24-1 [14.1 kB] 62s Get:30 http://ftpmaster.internal/ubuntu plucky/main amd64 liburi-perl all 5.30-1 [94.4 kB] 62s Get:31 http://ftpmaster.internal/ubuntu plucky/main amd64 libhtml-parser-perl amd64 3.83-1build1 [86.2 kB] 62s Get:32 http://ftpmaster.internal/ubuntu plucky/main amd64 libhtml-tree-perl all 5.07-3 [200 kB] 62s Get:33 http://ftpmaster.internal/ubuntu plucky/main amd64 libclone-perl amd64 0.47-1 [10.7 kB] 62s Get:34 http://ftpmaster.internal/ubuntu plucky/main amd64 libio-html-perl all 1.004-3 [15.9 kB] 62s Get:35 http://ftpmaster.internal/ubuntu plucky/main amd64 liblwp-mediatypes-perl all 6.04-2 [20.1 kB] 62s Get:36 http://ftpmaster.internal/ubuntu plucky/main amd64 libhttp-message-perl all 7.00-2ubuntu1 [75.9 kB] 62s Get:37 http://ftpmaster.internal/ubuntu plucky/main amd64 libhttp-cookies-perl all 6.11-1 [18.2 kB] 62s Get:38 http://ftpmaster.internal/ubuntu plucky/main amd64 libhttp-negotiate-perl all 6.01-2 [12.4 kB] 62s Get:39 http://ftpmaster.internal/ubuntu plucky/main amd64 perl-openssl-defaults amd64 7build3 [6626 B] 62s Get:40 http://ftpmaster.internal/ubuntu plucky/main amd64 libnet-ssleay-perl amd64 1.94-2 [317 kB] 62s Get:41 http://ftpmaster.internal/ubuntu plucky/main amd64 libio-socket-ssl-perl all 2.089-1 [200 kB] 62s Get:42 http://ftpmaster.internal/ubuntu plucky/main amd64 libnet-http-perl all 6.23-1 [22.3 kB] 62s Get:43 http://ftpmaster.internal/ubuntu plucky/main amd64 liblwp-protocol-https-perl all 6.14-1 [9040 B] 62s Get:44 http://ftpmaster.internal/ubuntu plucky/main amd64 libtry-tiny-perl all 0.32-1 [21.2 kB] 62s Get:45 http://ftpmaster.internal/ubuntu plucky/main amd64 libwww-robotrules-perl all 6.02-1 [12.6 kB] 62s Get:46 http://ftpmaster.internal/ubuntu plucky/main amd64 libwww-perl all 6.77-1 [138 kB] 62s Get:47 http://ftpmaster.internal/ubuntu plucky/main amd64 patchutils amd64 0.4.2-1build3 [77.0 kB] 62s Get:48 http://ftpmaster.internal/ubuntu plucky/main amd64 wdiff amd64 1.2.2-6build1 [29.1 kB] 63s Get:49 http://ftpmaster.internal/ubuntu plucky/main amd64 devscripts all 2.24.5 [1081 kB] 63s Get:50 http://ftpmaster.internal/ubuntu plucky/main amd64 diffstat amd64 1.67-1 [33.1 kB] 63s Get:51 http://ftpmaster.internal/ubuntu plucky/main amd64 python3-debian all 0.1.49ubuntu3 [116 kB] 63s Get:52 http://ftpmaster.internal/ubuntu plucky/main amd64 python3-gpg amd64 1.24.0-2ubuntu1 [275 kB] 63s Get:53 http://ftpmaster.internal/ubuntu plucky/main amd64 python3-xdg all 0.28-2 [38.3 kB] 63s Get:54 http://ftpmaster.internal/ubuntu plucky/main amd64 dput all 1.2.4ubuntu1 [49.1 kB] 63s Get:55 http://ftpmaster.internal/ubuntu plucky/main amd64 libgomp1 amd64 14.2.0-9ubuntu1 [148 kB] 63s Get:56 http://ftpmaster.internal/ubuntu plucky/main amd64 gettext amd64 0.22.5-2 [948 kB] 63s Get:57 http://ftpmaster.internal/ubuntu plucky/main amd64 liberror-perl all 0.17029-2 [25.6 kB] 63s Get:58 http://ftpmaster.internal/ubuntu plucky/main amd64 git-man all 1:2.45.2-1.2ubuntu1 [1122 kB] 63s Get:59 http://ftpmaster.internal/ubuntu plucky/main amd64 git amd64 1:2.45.2-1.2ubuntu1 [4634 kB] 63s Get:60 http://ftpmaster.internal/ubuntu plucky/main amd64 python3-dateutil all 2.9.0-3 [80.2 kB] 63s Get:61 http://ftpmaster.internal/ubuntu plucky/main amd64 python3-importlib-metadata all 8.5.0-1 [20.7 kB] 63s Get:62 http://ftpmaster.internal/ubuntu plucky/universe amd64 git-buildpackage all 0.9.35 [677 kB] 63s Get:63 http://ftpmaster.internal/ubuntu plucky/universe amd64 libsys-cpuaffinity-perl amd64 1.13~03-2build4 [31.9 kB] 63s Get:64 http://ftpmaster.internal/ubuntu plucky/universe amd64 pbzip2 amd64 1.1.13-1build1 [40.0 kB] 63s Get:65 http://ftpmaster.internal/ubuntu plucky/universe amd64 pixz amd64 1.0.7-3 [21.8 kB] 63s Get:66 http://ftpmaster.internal/ubuntu plucky/universe amd64 libxdelta2t64 amd64 1.1.3-10.7 [50.9 kB] 63s Get:67 http://ftpmaster.internal/ubuntu plucky/universe amd64 xdelta amd64 1.1.3-10.7 [25.2 kB] 63s Get:68 http://ftpmaster.internal/ubuntu plucky/universe amd64 xdelta3 amd64 3.0.11-dfsg-1.2 [73.9 kB] 63s Get:69 http://ftpmaster.internal/ubuntu plucky/universe amd64 pristine-tar amd64 1.50+nmu2build1 [117 kB] 63s Get:70 http://ftpmaster.internal/ubuntu plucky/universe amd64 quilt all 0.68-1 [439 kB] 63s Get:71 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-debianbts all 4.1.1 [12.8 kB] 63s Get:72 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-jeepney all 0.8.0-4 [33.1 kB] 63s Get:73 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-secretstorage all 3.3.3-3 [13.7 kB] 63s Get:74 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-jaraco.classes all 3.4.0-1 [7664 B] 63s Get:75 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-keyring all 25.4.1-1 [40.5 kB] 63s Get:76 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-launchpadlib-desktop all 2.0.0-1 [1778 B] 63s Get:77 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-ubuntutools all 0.203 [67.4 kB] 63s Get:78 http://ftpmaster.internal/ubuntu plucky/universe amd64 ubuntu-dev-tools all 0.203 [93.2 kB] 63s Get:79 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-astroid all 3.3.5-1 [174 kB] 63s Get:80 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-isort all 5.13.2-2 [59.3 kB] 63s Get:81 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-mypy-extensions all 1.0.0-1 [6148 B] 63s Get:82 http://ftpmaster.internal/ubuntu plucky/main amd64 libjs-underscore all 1.13.4~dfsg+~1.11.4-3 [118 kB] 63s Get:83 http://ftpmaster.internal/ubuntu plucky/main amd64 libjs-sphinxdoc all 7.4.7-4 [158 kB] 63s Get:84 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-logilab-common all 2.0.0-1 [281 kB] 63s Get:85 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-dill all 0.3.9-1 [84.5 kB] 63s Get:86 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-mccabe all 0.7.0-1 [8678 B] 63s Get:87 http://ftpmaster.internal/ubuntu plucky/main amd64 python3-platformdirs all 4.3.6-1 [16.8 kB] 63s Get:88 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-tomlkit all 0.13.2-1 [37.6 kB] 63s Get:89 http://ftpmaster.internal/ubuntu plucky/universe amd64 pylint all 3.3.1-2 [345 kB] 63s Get:90 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-argcomplete all 3.5.1-1ubuntu1 [35.6 kB] 63s Get:91 http://ftpmaster.internal/ubuntu plucky/main amd64 python3-cachetools all 5.3.3-1 [10.3 kB] 63s Get:92 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-pycryptodome amd64 3.20.0+dfsg-3build1 [1113 kB] 63s Get:93 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-keyrings.alt all 5.0.2-1 [16.6 kB] 63s Get:94 http://ftpmaster.internal/ubuntu plucky/main amd64 libhttp-parser2.9 amd64 2.9.4-6build1 [22.3 kB] 63s Get:95 http://ftpmaster.internal/ubuntu plucky-proposed/main amd64 libgit2-1.8 amd64 1.8.4+ds-1ubuntu1 [654 kB] 63s Get:96 http://ftpmaster.internal/ubuntu plucky-proposed/universe amd64 python3-pygit2 amd64 1.16.0-2 [183 kB] 63s Get:97 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-iniconfig all 1.1.1-2 [6024 B] 63s Get:98 http://ftpmaster.internal/ubuntu plucky/main amd64 python3-packaging all 24.2-1 [51.5 kB] 63s Get:99 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-pluggy all 1.5.0-1 [21.0 kB] 63s Get:100 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-pytest all 8.3.3-1 [251 kB] 63s Get:101 http://ftpmaster.internal/ubuntu plucky/main amd64 libpython3.13-stdlib amd64 3.13.0-2 [2107 kB] 63s Get:102 http://ftpmaster.internal/ubuntu plucky/main amd64 python3.13 amd64 3.13.0-2 [719 kB] 64s Get:103 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-coverage amd64 7.4.4+dfsg1-0ubuntu3 [150 kB] 64s Get:104 http://ftpmaster.internal/ubuntu plucky/universe amd64 libjs-jquery-isonscreen all 1.2.0-1.1 [3244 B] 64s Get:105 http://ftpmaster.internal/ubuntu plucky/universe amd64 libjs-jquery-metadata all 12-4 [6582 B] 64s Get:106 http://ftpmaster.internal/ubuntu plucky/universe amd64 libjs-jquery-tablesorter all 1:2.31.3+dfsg1-4 [192 kB] 64s Get:107 http://ftpmaster.internal/ubuntu plucky/universe amd64 libjs-jquery-throttle-debounce all 1.1+dfsg.1-2 [12.5 kB] 64s Get:108 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-pytest-cov all 5.0.0-1 [21.3 kB] 64s Get:109 http://ftpmaster.internal/ubuntu plucky/main amd64 python3-tenacity all 8.5.0-0ubuntu1 [17.0 kB] 64s Get:110 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-py all 1.11.0-2 [72.7 kB] 64s Get:111 http://ftpmaster.internal/ubuntu plucky/universe amd64 libnorm1t64 amd64 1.5.9+dfsg-3.1build1 [154 kB] 64s Get:112 http://ftpmaster.internal/ubuntu plucky/universe amd64 libpgm-5.3-0t64 amd64 5.3.128~dfsg-2.1build1 [167 kB] 64s Get:113 http://ftpmaster.internal/ubuntu plucky/main amd64 libsodium23 amd64 1.0.18-1build3 [161 kB] 64s Get:114 http://ftpmaster.internal/ubuntu plucky/universe amd64 libzmq5 amd64 4.3.5-1build2 [260 kB] 64s Get:115 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-zmq amd64 24.0.1-5build2 [406 kB] 64s Get:116 http://ftpmaster.internal/ubuntu plucky/universe amd64 git-ubuntu all 1.1-1 [152 kB] 64s Fetched 24.1 MB in 3s (9028 kB/s) 64s Selecting previously unselected package libpython3.13-minimal:amd64. 64s (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 ... 75952 files and directories currently installed.) 64s Preparing to unpack .../000-libpython3.13-minimal_3.13.0-2_amd64.deb ... 64s Unpacking libpython3.13-minimal:amd64 (3.13.0-2) ... 64s Selecting previously unselected package python3.13-minimal. 64s Preparing to unpack .../001-python3.13-minimal_3.13.0-2_amd64.deb ... 64s Unpacking python3.13-minimal (3.13.0-2) ... 65s Selecting previously unselected package libjs-jquery. 65s Preparing to unpack .../002-libjs-jquery_3.6.1+dfsg+~3.5.14-1_all.deb ... 65s Unpacking libjs-jquery (3.6.1+dfsg+~3.5.14-1) ... 65s Selecting previously unselected package libjs-jquery-hotkeys. 65s Preparing to unpack .../003-libjs-jquery-hotkeys_0~20130707+git2d51e3a9+dfsg-2.1_all.deb ... 65s Unpacking libjs-jquery-hotkeys (0~20130707+git2d51e3a9+dfsg-2.1) ... 65s Selecting previously unselected package python3-distro-info. 65s Preparing to unpack .../004-python3-distro-info_1.12_all.deb ... 65s Unpacking python3-distro-info (1.12) ... 65s Selecting previously unselected package dctrl-tools. 65s Preparing to unpack .../005-dctrl-tools_2.24-3build3_amd64.deb ... 65s Unpacking dctrl-tools (2.24-3build3) ... 65s Selecting previously unselected package debian-archive-keyring. 65s Preparing to unpack .../006-debian-archive-keyring_2023.4ubuntu1_all.deb ... 65s Unpacking debian-archive-keyring (2023.4ubuntu1) ... 65s Selecting previously unselected package libfile-dirlist-perl. 65s Preparing to unpack .../007-libfile-dirlist-perl_0.05-3_all.deb ... 65s Unpacking libfile-dirlist-perl (0.05-3) ... 65s Selecting previously unselected package libfile-which-perl. 65s Preparing to unpack .../008-libfile-which-perl_1.27-2_all.deb ... 65s Unpacking libfile-which-perl (1.27-2) ... 65s Selecting previously unselected package libfile-homedir-perl. 65s Preparing to unpack .../009-libfile-homedir-perl_1.006-2_all.deb ... 65s Unpacking libfile-homedir-perl (1.006-2) ... 65s Selecting previously unselected package libfile-touch-perl. 65s Preparing to unpack .../010-libfile-touch-perl_0.12-2_all.deb ... 65s Unpacking libfile-touch-perl (0.12-2) ... 65s Selecting previously unselected package libio-pty-perl. 65s Preparing to unpack .../011-libio-pty-perl_1%3a1.20-1build3_amd64.deb ... 65s Unpacking libio-pty-perl (1:1.20-1build3) ... 65s Selecting previously unselected package libipc-run-perl. 65s Preparing to unpack .../012-libipc-run-perl_20231003.0-2_all.deb ... 65s Unpacking libipc-run-perl (20231003.0-2) ... 65s Selecting previously unselected package libclass-method-modifiers-perl. 65s Preparing to unpack .../013-libclass-method-modifiers-perl_2.15-1_all.deb ... 65s Unpacking libclass-method-modifiers-perl (2.15-1) ... 65s Selecting previously unselected package libclass-xsaccessor-perl. 65s Preparing to unpack .../014-libclass-xsaccessor-perl_1.19-4build5_amd64.deb ... 65s Unpacking libclass-xsaccessor-perl (1.19-4build5) ... 65s Selecting previously unselected package libb-hooks-op-check-perl:amd64. 65s Preparing to unpack .../015-libb-hooks-op-check-perl_0.22-3build2_amd64.deb ... 65s Unpacking libb-hooks-op-check-perl:amd64 (0.22-3build2) ... 65s Selecting previously unselected package libdynaloader-functions-perl. 65s Preparing to unpack .../016-libdynaloader-functions-perl_0.004-1_all.deb ... 65s Unpacking libdynaloader-functions-perl (0.004-1) ... 65s Selecting previously unselected package libdevel-callchecker-perl:amd64. 65s Preparing to unpack .../017-libdevel-callchecker-perl_0.009-1build1_amd64.deb ... 65s Unpacking libdevel-callchecker-perl:amd64 (0.009-1build1) ... 65s Selecting previously unselected package libparams-classify-perl:amd64. 65s Preparing to unpack .../018-libparams-classify-perl_0.015-2build6_amd64.deb ... 65s Unpacking libparams-classify-perl:amd64 (0.015-2build6) ... 65s Selecting previously unselected package libmodule-runtime-perl. 65s Preparing to unpack .../019-libmodule-runtime-perl_0.016-2_all.deb ... 65s Unpacking libmodule-runtime-perl (0.016-2) ... 65s Selecting previously unselected package libimport-into-perl. 65s Preparing to unpack .../020-libimport-into-perl_1.002005-2_all.deb ... 65s Unpacking libimport-into-perl (1.002005-2) ... 65s Selecting previously unselected package librole-tiny-perl. 65s Preparing to unpack .../021-librole-tiny-perl_2.002004-1_all.deb ... 65s Unpacking librole-tiny-perl (2.002004-1) ... 65s Selecting previously unselected package libsub-quote-perl. 65s Preparing to unpack .../022-libsub-quote-perl_2.006008-1ubuntu1_all.deb ... 65s Unpacking libsub-quote-perl (2.006008-1ubuntu1) ... 65s Selecting previously unselected package libmoo-perl. 65s Preparing to unpack .../023-libmoo-perl_2.005005-1_all.deb ... 65s Unpacking libmoo-perl (2.005005-1) ... 65s Selecting previously unselected package libencode-locale-perl. 65s Preparing to unpack .../024-libencode-locale-perl_1.05-3_all.deb ... 65s Unpacking libencode-locale-perl (1.05-3) ... 65s Selecting previously unselected package libtimedate-perl. 65s Preparing to unpack .../025-libtimedate-perl_2.3300-2_all.deb ... 65s Unpacking libtimedate-perl (2.3300-2) ... 65s Selecting previously unselected package libhttp-date-perl. 65s Preparing to unpack .../026-libhttp-date-perl_6.06-1_all.deb ... 65s Unpacking libhttp-date-perl (6.06-1) ... 65s Selecting previously unselected package libfile-listing-perl. 65s Preparing to unpack .../027-libfile-listing-perl_6.16-1_all.deb ... 65s Unpacking libfile-listing-perl (6.16-1) ... 65s Selecting previously unselected package libhtml-tagset-perl. 65s Preparing to unpack .../028-libhtml-tagset-perl_3.24-1_all.deb ... 65s Unpacking libhtml-tagset-perl (3.24-1) ... 65s Selecting previously unselected package liburi-perl. 65s Preparing to unpack .../029-liburi-perl_5.30-1_all.deb ... 65s Unpacking liburi-perl (5.30-1) ... 65s Selecting previously unselected package libhtml-parser-perl:amd64. 65s Preparing to unpack .../030-libhtml-parser-perl_3.83-1build1_amd64.deb ... 65s Unpacking libhtml-parser-perl:amd64 (3.83-1build1) ... 65s Selecting previously unselected package libhtml-tree-perl. 66s Preparing to unpack .../031-libhtml-tree-perl_5.07-3_all.deb ... 66s Unpacking libhtml-tree-perl (5.07-3) ... 66s Selecting previously unselected package libclone-perl:amd64. 66s Preparing to unpack .../032-libclone-perl_0.47-1_amd64.deb ... 66s Unpacking libclone-perl:amd64 (0.47-1) ... 66s Selecting previously unselected package libio-html-perl. 66s Preparing to unpack .../033-libio-html-perl_1.004-3_all.deb ... 66s Unpacking libio-html-perl (1.004-3) ... 66s Selecting previously unselected package liblwp-mediatypes-perl. 66s Preparing to unpack .../034-liblwp-mediatypes-perl_6.04-2_all.deb ... 66s Unpacking liblwp-mediatypes-perl (6.04-2) ... 66s Selecting previously unselected package libhttp-message-perl. 66s Preparing to unpack .../035-libhttp-message-perl_7.00-2ubuntu1_all.deb ... 66s Unpacking libhttp-message-perl (7.00-2ubuntu1) ... 66s Selecting previously unselected package libhttp-cookies-perl. 66s Preparing to unpack .../036-libhttp-cookies-perl_6.11-1_all.deb ... 66s Unpacking libhttp-cookies-perl (6.11-1) ... 66s Selecting previously unselected package libhttp-negotiate-perl. 66s Preparing to unpack .../037-libhttp-negotiate-perl_6.01-2_all.deb ... 66s Unpacking libhttp-negotiate-perl (6.01-2) ... 66s Selecting previously unselected package perl-openssl-defaults:amd64. 66s Preparing to unpack .../038-perl-openssl-defaults_7build3_amd64.deb ... 66s Unpacking perl-openssl-defaults:amd64 (7build3) ... 66s Selecting previously unselected package libnet-ssleay-perl:amd64. 66s Preparing to unpack .../039-libnet-ssleay-perl_1.94-2_amd64.deb ... 66s Unpacking libnet-ssleay-perl:amd64 (1.94-2) ... 66s Selecting previously unselected package libio-socket-ssl-perl. 66s Preparing to unpack .../040-libio-socket-ssl-perl_2.089-1_all.deb ... 66s Unpacking libio-socket-ssl-perl (2.089-1) ... 66s Selecting previously unselected package libnet-http-perl. 66s Preparing to unpack .../041-libnet-http-perl_6.23-1_all.deb ... 66s Unpacking libnet-http-perl (6.23-1) ... 66s Selecting previously unselected package liblwp-protocol-https-perl. 66s Preparing to unpack .../042-liblwp-protocol-https-perl_6.14-1_all.deb ... 66s Unpacking liblwp-protocol-https-perl (6.14-1) ... 66s Selecting previously unselected package libtry-tiny-perl. 66s Preparing to unpack .../043-libtry-tiny-perl_0.32-1_all.deb ... 66s Unpacking libtry-tiny-perl (0.32-1) ... 66s Selecting previously unselected package libwww-robotrules-perl. 66s Preparing to unpack .../044-libwww-robotrules-perl_6.02-1_all.deb ... 66s Unpacking libwww-robotrules-perl (6.02-1) ... 66s Selecting previously unselected package libwww-perl. 66s Preparing to unpack .../045-libwww-perl_6.77-1_all.deb ... 66s Unpacking libwww-perl (6.77-1) ... 66s Selecting previously unselected package patchutils. 66s Preparing to unpack .../046-patchutils_0.4.2-1build3_amd64.deb ... 66s Unpacking patchutils (0.4.2-1build3) ... 66s Selecting previously unselected package wdiff. 66s Preparing to unpack .../047-wdiff_1.2.2-6build1_amd64.deb ... 66s Unpacking wdiff (1.2.2-6build1) ... 66s Selecting previously unselected package devscripts. 66s Preparing to unpack .../048-devscripts_2.24.5_all.deb ... 66s Unpacking devscripts (2.24.5) ... 66s Selecting previously unselected package diffstat. 66s Preparing to unpack .../049-diffstat_1.67-1_amd64.deb ... 66s Unpacking diffstat (1.67-1) ... 66s Selecting previously unselected package python3-debian. 66s Preparing to unpack .../050-python3-debian_0.1.49ubuntu3_all.deb ... 66s Unpacking python3-debian (0.1.49ubuntu3) ... 66s Selecting previously unselected package python3-gpg. 66s Preparing to unpack .../051-python3-gpg_1.24.0-2ubuntu1_amd64.deb ... 66s Unpacking python3-gpg (1.24.0-2ubuntu1) ... 66s Selecting previously unselected package python3-xdg. 66s Preparing to unpack .../052-python3-xdg_0.28-2_all.deb ... 66s Unpacking python3-xdg (0.28-2) ... 66s Selecting previously unselected package dput. 66s Preparing to unpack .../053-dput_1.2.4ubuntu1_all.deb ... 66s Unpacking dput (1.2.4ubuntu1) ... 66s Selecting previously unselected package libgomp1:amd64. 66s Preparing to unpack .../054-libgomp1_14.2.0-9ubuntu1_amd64.deb ... 66s Unpacking libgomp1:amd64 (14.2.0-9ubuntu1) ... 66s Selecting previously unselected package gettext. 66s Preparing to unpack .../055-gettext_0.22.5-2_amd64.deb ... 66s Unpacking gettext (0.22.5-2) ... 66s Selecting previously unselected package liberror-perl. 66s Preparing to unpack .../056-liberror-perl_0.17029-2_all.deb ... 66s Unpacking liberror-perl (0.17029-2) ... 67s Selecting previously unselected package git-man. 67s Preparing to unpack .../057-git-man_1%3a2.45.2-1.2ubuntu1_all.deb ... 67s Unpacking git-man (1:2.45.2-1.2ubuntu1) ... 67s Selecting previously unselected package git. 67s Preparing to unpack .../058-git_1%3a2.45.2-1.2ubuntu1_amd64.deb ... 67s Unpacking git (1:2.45.2-1.2ubuntu1) ... 67s Selecting previously unselected package python3-dateutil. 67s Preparing to unpack .../059-python3-dateutil_2.9.0-3_all.deb ... 67s Unpacking python3-dateutil (2.9.0-3) ... 67s Selecting previously unselected package python3-importlib-metadata. 67s Preparing to unpack .../060-python3-importlib-metadata_8.5.0-1_all.deb ... 67s Unpacking python3-importlib-metadata (8.5.0-1) ... 67s Selecting previously unselected package git-buildpackage. 67s Preparing to unpack .../061-git-buildpackage_0.9.35_all.deb ... 67s Unpacking git-buildpackage (0.9.35) ... 67s Selecting previously unselected package libsys-cpuaffinity-perl. 67s Preparing to unpack .../062-libsys-cpuaffinity-perl_1.13~03-2build4_amd64.deb ... 67s Unpacking libsys-cpuaffinity-perl (1.13~03-2build4) ... 67s Selecting previously unselected package pbzip2. 67s Preparing to unpack .../063-pbzip2_1.1.13-1build1_amd64.deb ... 67s Unpacking pbzip2 (1.1.13-1build1) ... 67s Selecting previously unselected package pixz. 67s Preparing to unpack .../064-pixz_1.0.7-3_amd64.deb ... 67s Unpacking pixz (1.0.7-3) ... 67s Selecting previously unselected package libxdelta2t64:amd64. 67s Preparing to unpack .../065-libxdelta2t64_1.1.3-10.7_amd64.deb ... 67s Unpacking libxdelta2t64:amd64 (1.1.3-10.7) ... 67s Selecting previously unselected package xdelta. 67s Preparing to unpack .../066-xdelta_1.1.3-10.7_amd64.deb ... 67s Unpacking xdelta (1.1.3-10.7) ... 67s Selecting previously unselected package xdelta3. 67s Preparing to unpack .../067-xdelta3_3.0.11-dfsg-1.2_amd64.deb ... 67s Unpacking xdelta3 (3.0.11-dfsg-1.2) ... 67s Selecting previously unselected package pristine-tar. 67s Preparing to unpack .../068-pristine-tar_1.50+nmu2build1_amd64.deb ... 67s Unpacking pristine-tar (1.50+nmu2build1) ... 67s Selecting previously unselected package quilt. 67s Preparing to unpack .../069-quilt_0.68-1_all.deb ... 67s Unpacking quilt (0.68-1) ... 67s Selecting previously unselected package python3-debianbts. 67s Preparing to unpack .../070-python3-debianbts_4.1.1_all.deb ... 67s Unpacking python3-debianbts (4.1.1) ... 67s Selecting previously unselected package python3-jeepney. 67s Preparing to unpack .../071-python3-jeepney_0.8.0-4_all.deb ... 67s Unpacking python3-jeepney (0.8.0-4) ... 67s Selecting previously unselected package python3-secretstorage. 67s Preparing to unpack .../072-python3-secretstorage_3.3.3-3_all.deb ... 67s Unpacking python3-secretstorage (3.3.3-3) ... 67s Selecting previously unselected package python3-jaraco.classes. 67s Preparing to unpack .../073-python3-jaraco.classes_3.4.0-1_all.deb ... 67s Unpacking python3-jaraco.classes (3.4.0-1) ... 67s Selecting previously unselected package python3-keyring. 67s Preparing to unpack .../074-python3-keyring_25.4.1-1_all.deb ... 67s Unpacking python3-keyring (25.4.1-1) ... 67s Selecting previously unselected package python3-launchpadlib-desktop. 67s Preparing to unpack .../075-python3-launchpadlib-desktop_2.0.0-1_all.deb ... 67s Unpacking python3-launchpadlib-desktop (2.0.0-1) ... 67s Selecting previously unselected package python3-ubuntutools. 67s Preparing to unpack .../076-python3-ubuntutools_0.203_all.deb ... 67s Unpacking python3-ubuntutools (0.203) ... 67s Selecting previously unselected package ubuntu-dev-tools. 67s Preparing to unpack .../077-ubuntu-dev-tools_0.203_all.deb ... 67s Unpacking ubuntu-dev-tools (0.203) ... 67s Selecting previously unselected package python3-astroid. 67s Preparing to unpack .../078-python3-astroid_3.3.5-1_all.deb ... 67s Unpacking python3-astroid (3.3.5-1) ... 68s Selecting previously unselected package python3-isort. 68s Preparing to unpack .../079-python3-isort_5.13.2-2_all.deb ... 68s Unpacking python3-isort (5.13.2-2) ... 68s Selecting previously unselected package python3-mypy-extensions. 68s Preparing to unpack .../080-python3-mypy-extensions_1.0.0-1_all.deb ... 68s Unpacking python3-mypy-extensions (1.0.0-1) ... 68s Selecting previously unselected package libjs-underscore. 68s Preparing to unpack .../081-libjs-underscore_1.13.4~dfsg+~1.11.4-3_all.deb ... 68s Unpacking libjs-underscore (1.13.4~dfsg+~1.11.4-3) ... 68s Selecting previously unselected package libjs-sphinxdoc. 68s Preparing to unpack .../082-libjs-sphinxdoc_7.4.7-4_all.deb ... 68s Unpacking libjs-sphinxdoc (7.4.7-4) ... 68s Selecting previously unselected package python3-logilab-common. 68s Preparing to unpack .../083-python3-logilab-common_2.0.0-1_all.deb ... 68s Unpacking python3-logilab-common (2.0.0-1) ... 68s Selecting previously unselected package python3-dill. 68s Preparing to unpack .../084-python3-dill_0.3.9-1_all.deb ... 68s Unpacking python3-dill (0.3.9-1) ... 68s Selecting previously unselected package python3-mccabe. 68s Preparing to unpack .../085-python3-mccabe_0.7.0-1_all.deb ... 68s Unpacking python3-mccabe (0.7.0-1) ... 68s Selecting previously unselected package python3-platformdirs. 68s Preparing to unpack .../086-python3-platformdirs_4.3.6-1_all.deb ... 68s Unpacking python3-platformdirs (4.3.6-1) ... 68s Selecting previously unselected package python3-tomlkit. 68s Preparing to unpack .../087-python3-tomlkit_0.13.2-1_all.deb ... 68s Unpacking python3-tomlkit (0.13.2-1) ... 68s Selecting previously unselected package pylint. 68s Preparing to unpack .../088-pylint_3.3.1-2_all.deb ... 68s Unpacking pylint (3.3.1-2) ... 68s Selecting previously unselected package python3-argcomplete. 68s Preparing to unpack .../089-python3-argcomplete_3.5.1-1ubuntu1_all.deb ... 68s Unpacking python3-argcomplete (3.5.1-1ubuntu1) ... 68s Selecting previously unselected package python3-cachetools. 68s Preparing to unpack .../090-python3-cachetools_5.3.3-1_all.deb ... 68s Unpacking python3-cachetools (5.3.3-1) ... 68s Selecting previously unselected package python3-pycryptodome. 68s Preparing to unpack .../091-python3-pycryptodome_3.20.0+dfsg-3build1_amd64.deb ... 68s Unpacking python3-pycryptodome (3.20.0+dfsg-3build1) ... 68s Selecting previously unselected package python3-keyrings.alt. 68s Preparing to unpack .../092-python3-keyrings.alt_5.0.2-1_all.deb ... 68s Unpacking python3-keyrings.alt (5.0.2-1) ... 68s Selecting previously unselected package libhttp-parser2.9:amd64. 68s Preparing to unpack .../093-libhttp-parser2.9_2.9.4-6build1_amd64.deb ... 68s Unpacking libhttp-parser2.9:amd64 (2.9.4-6build1) ... 68s Selecting previously unselected package libgit2-1.8:amd64. 68s Preparing to unpack .../094-libgit2-1.8_1.8.4+ds-1ubuntu1_amd64.deb ... 68s Unpacking libgit2-1.8:amd64 (1.8.4+ds-1ubuntu1) ... 68s Selecting previously unselected package python3-pygit2. 68s Preparing to unpack .../095-python3-pygit2_1.16.0-2_amd64.deb ... 68s Unpacking python3-pygit2 (1.16.0-2) ... 68s Selecting previously unselected package python3-iniconfig. 68s Preparing to unpack .../096-python3-iniconfig_1.1.1-2_all.deb ... 68s Unpacking python3-iniconfig (1.1.1-2) ... 68s Selecting previously unselected package python3-packaging. 68s Preparing to unpack .../097-python3-packaging_24.2-1_all.deb ... 68s Unpacking python3-packaging (24.2-1) ... 68s Selecting previously unselected package python3-pluggy. 68s Preparing to unpack .../098-python3-pluggy_1.5.0-1_all.deb ... 68s Unpacking python3-pluggy (1.5.0-1) ... 68s Selecting previously unselected package python3-pytest. 68s Preparing to unpack .../099-python3-pytest_8.3.3-1_all.deb ... 68s Unpacking python3-pytest (8.3.3-1) ... 68s Selecting previously unselected package libpython3.13-stdlib:amd64. 68s Preparing to unpack .../100-libpython3.13-stdlib_3.13.0-2_amd64.deb ... 68s Unpacking libpython3.13-stdlib:amd64 (3.13.0-2) ... 68s Selecting previously unselected package python3.13. 68s Preparing to unpack .../101-python3.13_3.13.0-2_amd64.deb ... 68s Unpacking python3.13 (3.13.0-2) ... 68s Selecting previously unselected package python3-coverage. 68s Preparing to unpack .../102-python3-coverage_7.4.4+dfsg1-0ubuntu3_amd64.deb ... 68s Unpacking python3-coverage (7.4.4+dfsg1-0ubuntu3) ... 68s Selecting previously unselected package libjs-jquery-isonscreen. 68s Preparing to unpack .../103-libjs-jquery-isonscreen_1.2.0-1.1_all.deb ... 68s Unpacking libjs-jquery-isonscreen (1.2.0-1.1) ... 68s Selecting previously unselected package libjs-jquery-metadata. 68s Preparing to unpack .../104-libjs-jquery-metadata_12-4_all.deb ... 68s Unpacking libjs-jquery-metadata (12-4) ... 68s Selecting previously unselected package libjs-jquery-tablesorter. 68s Preparing to unpack .../105-libjs-jquery-tablesorter_1%3a2.31.3+dfsg1-4_all.deb ... 68s Unpacking libjs-jquery-tablesorter (1:2.31.3+dfsg1-4) ... 68s Selecting previously unselected package libjs-jquery-throttle-debounce. 68s Preparing to unpack .../106-libjs-jquery-throttle-debounce_1.1+dfsg.1-2_all.deb ... 68s Unpacking libjs-jquery-throttle-debounce (1.1+dfsg.1-2) ... 68s Selecting previously unselected package python3-pytest-cov. 68s Preparing to unpack .../107-python3-pytest-cov_5.0.0-1_all.deb ... 68s Unpacking python3-pytest-cov (5.0.0-1) ... 68s Selecting previously unselected package python3-tenacity. 68s Preparing to unpack .../108-python3-tenacity_8.5.0-0ubuntu1_all.deb ... 68s Unpacking python3-tenacity (8.5.0-0ubuntu1) ... 68s Selecting previously unselected package python3-py. 68s Preparing to unpack .../109-python3-py_1.11.0-2_all.deb ... 68s Unpacking python3-py (1.11.0-2) ... 68s Selecting previously unselected package libnorm1t64:amd64. 68s Preparing to unpack .../110-libnorm1t64_1.5.9+dfsg-3.1build1_amd64.deb ... 68s Unpacking libnorm1t64:amd64 (1.5.9+dfsg-3.1build1) ... 68s Selecting previously unselected package libpgm-5.3-0t64:amd64. 68s Preparing to unpack .../111-libpgm-5.3-0t64_5.3.128~dfsg-2.1build1_amd64.deb ... 68s Unpacking libpgm-5.3-0t64:amd64 (5.3.128~dfsg-2.1build1) ... 68s Selecting previously unselected package libsodium23:amd64. 68s Preparing to unpack .../112-libsodium23_1.0.18-1build3_amd64.deb ... 68s Unpacking libsodium23:amd64 (1.0.18-1build3) ... 69s Selecting previously unselected package libzmq5:amd64. 69s Preparing to unpack .../113-libzmq5_4.3.5-1build2_amd64.deb ... 69s Unpacking libzmq5:amd64 (4.3.5-1build2) ... 69s Selecting previously unselected package python3-zmq. 69s Preparing to unpack .../114-python3-zmq_24.0.1-5build2_amd64.deb ... 69s Unpacking python3-zmq (24.0.1-5build2) ... 69s Selecting previously unselected package git-ubuntu. 69s Preparing to unpack .../115-git-ubuntu_1.1-1_all.deb ... 69s Unpacking git-ubuntu (1.1-1) ... 69s Setting up python3-iniconfig (1.1.1-2) ... 69s Setting up libnorm1t64:amd64 (1.5.9+dfsg-3.1build1) ... 69s Setting up wdiff (1.2.2-6build1) ... 69s Setting up libfile-which-perl (1.27-2) ... 69s Setting up libsodium23:amd64 (1.0.18-1build3) ... 69s Setting up python3-jaraco.classes (3.4.0-1) ... 69s Setting up libxdelta2t64:amd64 (1.1.3-10.7) ... 69s Setting up python3-importlib-metadata (8.5.0-1) ... 69s Setting up xdelta (1.1.3-10.7) ... 69s Setting up libsys-cpuaffinity-perl (1.13~03-2build4) ... 69s Setting up python3-py (1.11.0-2) ... 69s Setting up libdynaloader-functions-perl (0.004-1) ... 69s Setting up libclass-method-modifiers-perl (2.15-1) ... 69s Setting up libio-pty-perl (1:1.20-1build3) ... 69s Setting up python3-cachetools (5.3.3-1) ... 69s Setting up python3-debianbts (4.1.1) ... 69s Setting up libclone-perl:amd64 (0.47-1) ... 69s Setting up libhtml-tagset-perl (3.24-1) ... 69s Setting up python3-mypy-extensions (1.0.0-1) ... 69s Setting up python3-pycryptodome (3.20.0+dfsg-3build1) ... 70s Setting up python3-tenacity (8.5.0-0ubuntu1) ... 70s Setting up liblwp-mediatypes-perl (6.04-2) ... 70s Setting up debian-archive-keyring (2023.4ubuntu1) ... 70s Setting up libtry-tiny-perl (0.32-1) ... 70s Setting up perl-openssl-defaults:amd64 (7build3) ... 70s Setting up libencode-locale-perl (1.05-3) ... 70s Setting up libjs-jquery-throttle-debounce (1.1+dfsg.1-2) ... 70s Setting up libgomp1:amd64 (14.2.0-9ubuntu1) ... 70s Setting up python3-xdg (0.28-2) ... 70s Setting up pbzip2 (1.1.13-1build1) ... 70s Setting up python3-platformdirs (4.3.6-1) ... 70s Setting up liberror-perl (0.17029-2) ... 70s Setting up libpython3.13-minimal:amd64 (3.13.0-2) ... 70s Setting up patchutils (0.4.2-1build3) ... 70s Setting up libpgm-5.3-0t64:amd64 (5.3.128~dfsg-2.1build1) ... 70s Setting up python3-packaging (24.2-1) ... 70s Setting up python3-gpg (1.24.0-2ubuntu1) ... 70s Setting up python3-dill (0.3.9-1) ... 70s Setting up python3-debian (0.1.49ubuntu3) ... 71s Setting up diffstat (1.67-1) ... 71s Setting up libio-html-perl (1.004-3) ... 71s Setting up libb-hooks-op-check-perl:amd64 (0.22-3build2) ... 71s Setting up libipc-run-perl (20231003.0-2) ... 71s Setting up python3-jeepney (0.8.0-4) ... 71s Setting up python3-isort (5.13.2-2) ... 71s Setting up python3-pluggy (1.5.0-1) ... 71s Setting up libtimedate-perl (2.3300-2) ... 71s Setting up python3-astroid (3.3.5-1) ... 71s Setting up xdelta3 (3.0.11-dfsg-1.2) ... 71s Setting up pixz (1.0.7-3) ... 71s Setting up librole-tiny-perl (2.002004-1) ... 71s Setting up python3.13-minimal (3.13.0-2) ... 72s Setting up git-man (1:2.45.2-1.2ubuntu1) ... 72s Setting up python3-dateutil (2.9.0-3) ... 72s Setting up python3-mccabe (0.7.0-1) ... 72s Setting up libsub-quote-perl (2.006008-1ubuntu1) ... 72s Setting up libclass-xsaccessor-perl (1.19-4build5) ... 72s Setting up libjs-jquery (3.6.1+dfsg+~3.5.14-1) ... 72s Setting up libfile-dirlist-perl (0.05-3) ... 72s Setting up libjs-jquery-hotkeys (0~20130707+git2d51e3a9+dfsg-2.1) ... 72s Setting up python3-argcomplete (3.5.1-1ubuntu1) ... 72s Setting up libfile-homedir-perl (1.006-2) ... 72s Setting up python3-tomlkit (0.13.2-1) ... 72s Setting up python3-distro-info (1.12) ... 73s Setting up libpython3.13-stdlib:amd64 (3.13.0-2) ... 73s Setting up liburi-perl (5.30-1) ... 73s Setting up pristine-tar (1.50+nmu2build1) ... 73s Setting up libfile-touch-perl (0.12-2) ... 73s Setting up dctrl-tools (2.24-3build3) ... 73s Setting up libhttp-parser2.9:amd64 (2.9.4-6build1) ... 73s Setting up libjs-underscore (1.13.4~dfsg+~1.11.4-3) ... 73s Setting up libnet-ssleay-perl:amd64 (1.94-2) ... 73s Setting up libhttp-date-perl (6.06-1) ... 73s Setting up gettext (0.22.5-2) ... 73s Setting up libfile-listing-perl (6.16-1) ... 73s Setting up libzmq5:amd64 (4.3.5-1build2) ... 73s Setting up python3.13 (3.13.0-2) ... 73s Setting up python3-pytest (8.3.3-1) ... 74s Setting up libnet-http-perl (6.23-1) ... 74s Setting up python3-coverage (7.4.4+dfsg1-0ubuntu3) ... 74s Setting up quilt (0.68-1) ... 74s Setting up libdevel-callchecker-perl:amd64 (0.009-1build1) ... 74s Setting up dput (1.2.4ubuntu1) ... 74s Setting up python3-secretstorage (3.3.3-3) ... 74s Setting up python3-zmq (24.0.1-5build2) ... 74s Setting up libjs-jquery-metadata (12-4) ... 74s Setting up libgit2-1.8:amd64 (1.8.4+ds-1ubuntu1) ... 74s Setting up libjs-jquery-isonscreen (1.2.0-1.1) ... 74s Setting up git (1:2.45.2-1.2ubuntu1) ... 74s Setting up libjs-sphinxdoc (7.4.7-4) ... 74s Setting up libwww-robotrules-perl (6.02-1) ... 74s Setting up libjs-jquery-tablesorter (1:2.31.3+dfsg1-4) ... 74s Setting up libhtml-parser-perl:amd64 (3.83-1build1) ... 74s Setting up python3-keyring (25.4.1-1) ... 74s Setting up libio-socket-ssl-perl (2.089-1) ... 74s Setting up libhttp-message-perl (7.00-2ubuntu1) ... 74s Setting up libhttp-negotiate-perl (6.01-2) ... 74s Setting up libhttp-cookies-perl (6.11-1) ... 74s Setting up python3-logilab-common (2.0.0-1) ... 74s Setting up python3-pygit2 (1.16.0-2) ... 75s Setting up libhtml-tree-perl (5.07-3) ... 75s Setting up libparams-classify-perl:amd64 (0.015-2build6) ... 75s Setting up python3-pytest-cov (5.0.0-1) ... 75s Setting up libmodule-runtime-perl (0.016-2) ... 75s Setting up python3-launchpadlib-desktop (2.0.0-1) ... 75s Setting up python3-keyrings.alt (5.0.2-1) ... 75s Setting up pylint (3.3.1-2) ... 75s Setting up libimport-into-perl (1.002005-2) ... 75s Setting up libmoo-perl (2.005005-1) ... 75s Setting up python3-ubuntutools (0.203) ... 75s Setting up liblwp-protocol-https-perl (6.14-1) ... 75s Setting up libwww-perl (6.77-1) ... 75s Setting up devscripts (2.24.5) ... 75s Setting up git-buildpackage (0.9.35) ... 76s Setting up ubuntu-dev-tools (0.203) ... 76s Setting up git-ubuntu (1.1-1) ... 76s Processing triggers for libc-bin (2.40-1ubuntu3) ... 76s Processing triggers for systemd (256.5-2ubuntu4) ... 76s Processing triggers for man-db (2.13.0-1) ... 77s Processing triggers for install-info (7.1.1-1) ... 78s autopkgtest [09:54:51]: test self-test: TEST_SYSTEM_TREE=1 /usr/share/git-ubuntu/self-test 78s autopkgtest [09:54:51]: test self-test: [----------------------- 79s Testing git-ubuntu system installation. 79s Testing tree in /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu 79s Working dir /tmp/autopkgtest.lcxmNn/build.LCU/src 90s pylint passed! 95s ============================= test session starts ============================== 95s platform linux -- Python 3.12.7, pytest-8.3.3, pluggy-1.5.0 95s rootdir: /tmp/autopkgtest.lcxmNn/build.LCU/src 95s configfile: pytest.ini 95s plugins: typeguard-4.4.1, cov-5.0.0 95s collected 459 items 95s 96s gitubuntu/build.py ..... [ 1%] 97s gitubuntu/git_repository_test.py ....................................... [ 9%] 107s ...FFFFF.FFF...........................F.FFFFFFF.FFF.......FFFFFFFFFF [ 24%] 107s gitubuntu/importer_service_test.py ..................................... [ 32%] 107s ..... [ 33%] 107s gitubuntu/importer_service_worker_test.py ... [ 34%] 117s gitubuntu/importer_tag_test.py FFFFFFFFFxF [ 36%] 132s gitubuntu/importer_test.py .......FF.FFFFFFFFFFF.FFF.FFF..FFFFFFFFFFFFFF [ 46%] 145s FFFFxx..FF.................................................F....FFFF. [ 61%] 146s gitubuntu/integration_test.py ...............Fsss [ 65%] 147s gitubuntu/prepare_upload_test.py .............. [ 68%] 147s gitubuntu/repo_builder_test.py .........FF.F................ [ 75%] 147s gitubuntu/rich_history_test.py FFF.FFFF [ 76%] 152s gitubuntu/source_builder_test.py .FF.......FFFFFFFFF.. [ 81%] 152s gitubuntu/source_information_test.py ................................... [ 89%] 152s ... [ 89%] 152s gitubuntu/versioning.py ............................................... [100%] 152s 152s =================================== FAILURES =================================== 152s ___________________ test_follow_symlinks_to_blob[0] ____________________ 152s 152s pygit2_repo = pygit2.Repository('/tmp/tmpmk291xw1/.git/') 152s tree_func = at 0x7b51553e8180> 152s 152s @pytest.mark.parametrize('tree_func', [ 152s # The tree_func parameter is a function that accepts a mock Blob that is to 152s # represent the changelog blob itself and returns a mock Tree with the mock 152s # Blob embedded somewhere within it. The test function can then ensure that 152s # follow_symlinks_to_blob can correctly find the changelog Blob given the 152s # Tree. 152s 152s # Of course this is only expected to work if, after checking out the Tree, 152s # "cat debian/changelog" would work. But this allows us to test the various 152s # permutations of symlink following in Trees that _are_ valid. 152s 152s # Simple case 152s lambda b: Tree({ 152s 'debian': Tree({'changelog': b}), 152s }), 152s 152s # Symlink in debian/ 152s lambda b: Tree({ 152s 'debian': Tree({ 152s 'changelog.real': b, 152s 'changelog': Symlink('changelog.real'), 152s }), 152s }), 152s 152s # Symlink to parent directory 152s lambda b: Tree({ 152s 'changelog': b, 152s 'debian': Tree({ 152s 'changelog': Symlink('../changelog'), 152s }) 152s }), 152s 152s # Symlink to subdirectory 152s lambda b: Tree({ 152s 'debian': Tree({ 152s 'changelog': Symlink('subdirectory/changelog'), 152s 'subdirectory': Tree({'changelog': b}), 152s }) 152s }), 152s 152s # debian/ itself is a symlink to a different directory 152s lambda b: Tree({ 152s 'pkg': Tree({'changelog': b}), 152s 'debian': Symlink('pkg'), 152s }) 152s ]) 152s def test_follow_symlinks_to_blob(pygit2_repo, tree_func): 152s blob = Blob(b'') 152s blob_id = blob.write(pygit2_repo) 152s tree = pygit2_repo.get(tree_func(blob).write(pygit2_repo)) 152s > result_blob = target.follow_symlinks_to_blob( 152s pygit2_repo, 152s tree, 152s 'debian/changelog', 152s ) 152s 152s gitubuntu/git_repository_test.py:342: 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 152s return _follow_symlinks_to_blob( 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s 152s repo = pygit2.Repository('/tmp/tmpmk291xw1/.git/') 152s top_tree_object = 152s search_path = 'debian/changelog' 152s _rel_tree = 152s _rel_path = '' 152s 152s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 152s _rel_tree=None, _rel_path='' 152s ): 152s '''Recursively follow a path down a tree, following symlinks, to find blob 152s 152s repo: pygit2.Repository object 152s top_tree: pygit2.Tree object of the top of the tree structure 152s search_path: '/'-separated path string of blob to find 152s _rel_tree: (internal) which tree to look further into 152s _rel_path: (internal) the path we are in so far 152s ''' 152s 152s NORMAL_BLOB_MODES = set([ 152s pygit2.GIT_FILEMODE_BLOB, 152s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 152s ]) 152s 152s _rel_tree = _rel_tree or top_tree_object 152s head, tail = posixpath.split(search_path) 152s 152s # A traditional functional split would put a single entry in head with tail 152s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 152s # to make it appear to have traditional semantics. 152s if not head: 152s head = tail 152s tail = None 152s 152s entry = _rel_tree[head] 152s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 152s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 152s 152s gitubuntu/git_repository.py:68: AttributeError 152s ___________________ test_follow_symlinks_to_blob[1] ____________________ 152s 152s pygit2_repo = pygit2.Repository('/tmp/tmpuj9ben9b/.git/') 152s tree_func = at 0x7b51553e8220> 152s 152s @pytest.mark.parametrize('tree_func', [ 152s # The tree_func parameter is a function that accepts a mock Blob that is to 152s # represent the changelog blob itself and returns a mock Tree with the mock 152s # Blob embedded somewhere within it. The test function can then ensure that 152s # follow_symlinks_to_blob can correctly find the changelog Blob given the 152s # Tree. 152s 152s # Of course this is only expected to work if, after checking out the Tree, 152s # "cat debian/changelog" would work. But this allows us to test the various 152s # permutations of symlink following in Trees that _are_ valid. 152s 152s # Simple case 152s lambda b: Tree({ 152s 'debian': Tree({'changelog': b}), 152s }), 152s 152s # Symlink in debian/ 152s lambda b: Tree({ 152s 'debian': Tree({ 152s 'changelog.real': b, 152s 'changelog': Symlink('changelog.real'), 152s }), 152s }), 152s 152s # Symlink to parent directory 152s lambda b: Tree({ 152s 'changelog': b, 152s 'debian': Tree({ 152s 'changelog': Symlink('../changelog'), 152s }) 152s }), 152s 152s # Symlink to subdirectory 152s lambda b: Tree({ 152s 'debian': Tree({ 152s 'changelog': Symlink('subdirectory/changelog'), 152s 'subdirectory': Tree({'changelog': b}), 152s }) 152s }), 152s 152s # debian/ itself is a symlink to a different directory 152s lambda b: Tree({ 152s 'pkg': Tree({'changelog': b}), 152s 'debian': Symlink('pkg'), 152s }) 152s ]) 152s def test_follow_symlinks_to_blob(pygit2_repo, tree_func): 152s blob = Blob(b'') 152s blob_id = blob.write(pygit2_repo) 152s tree = pygit2_repo.get(tree_func(blob).write(pygit2_repo)) 152s > result_blob = target.follow_symlinks_to_blob( 152s pygit2_repo, 152s tree, 152s 'debian/changelog', 152s ) 152s 152s gitubuntu/git_repository_test.py:342: 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 152s return _follow_symlinks_to_blob( 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s 152s repo = pygit2.Repository('/tmp/tmpuj9ben9b/.git/') 152s top_tree_object = 152s search_path = 'debian/changelog' 152s _rel_tree = 152s _rel_path = '' 152s 152s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 152s _rel_tree=None, _rel_path='' 152s ): 152s '''Recursively follow a path down a tree, following symlinks, to find blob 152s 152s repo: pygit2.Repository object 152s top_tree: pygit2.Tree object of the top of the tree structure 152s search_path: '/'-separated path string of blob to find 152s _rel_tree: (internal) which tree to look further into 152s _rel_path: (internal) the path we are in so far 152s ''' 152s 152s NORMAL_BLOB_MODES = set([ 152s pygit2.GIT_FILEMODE_BLOB, 152s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 152s ]) 152s 152s _rel_tree = _rel_tree or top_tree_object 152s head, tail = posixpath.split(search_path) 152s 152s # A traditional functional split would put a single entry in head with tail 152s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 152s # to make it appear to have traditional semantics. 152s if not head: 152s head = tail 152s tail = None 152s 152s entry = _rel_tree[head] 152s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 152s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 152s 152s gitubuntu/git_repository.py:68: AttributeError 152s ___________________ test_follow_symlinks_to_blob[2] ____________________ 152s 152s pygit2_repo = pygit2.Repository('/tmp/tmpj102w_yu/.git/') 152s tree_func = at 0x7b51553e82c0> 152s 152s @pytest.mark.parametrize('tree_func', [ 152s # The tree_func parameter is a function that accepts a mock Blob that is to 152s # represent the changelog blob itself and returns a mock Tree with the mock 152s # Blob embedded somewhere within it. The test function can then ensure that 152s # follow_symlinks_to_blob can correctly find the changelog Blob given the 152s # Tree. 152s 152s # Of course this is only expected to work if, after checking out the Tree, 152s # "cat debian/changelog" would work. But this allows us to test the various 152s # permutations of symlink following in Trees that _are_ valid. 152s 152s # Simple case 152s lambda b: Tree({ 152s 'debian': Tree({'changelog': b}), 152s }), 152s 152s # Symlink in debian/ 152s lambda b: Tree({ 152s 'debian': Tree({ 152s 'changelog.real': b, 152s 'changelog': Symlink('changelog.real'), 152s }), 152s }), 152s 152s # Symlink to parent directory 152s lambda b: Tree({ 152s 'changelog': b, 152s 'debian': Tree({ 152s 'changelog': Symlink('../changelog'), 152s }) 152s }), 152s 152s # Symlink to subdirectory 152s lambda b: Tree({ 152s 'debian': Tree({ 152s 'changelog': Symlink('subdirectory/changelog'), 152s 'subdirectory': Tree({'changelog': b}), 152s }) 152s }), 152s 152s # debian/ itself is a symlink to a different directory 152s lambda b: Tree({ 152s 'pkg': Tree({'changelog': b}), 152s 'debian': Symlink('pkg'), 152s }) 152s ]) 152s def test_follow_symlinks_to_blob(pygit2_repo, tree_func): 152s blob = Blob(b'') 152s blob_id = blob.write(pygit2_repo) 152s tree = pygit2_repo.get(tree_func(blob).write(pygit2_repo)) 152s > result_blob = target.follow_symlinks_to_blob( 152s pygit2_repo, 152s tree, 152s 'debian/changelog', 152s ) 152s 152s gitubuntu/git_repository_test.py:342: 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 152s return _follow_symlinks_to_blob( 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s 152s repo = pygit2.Repository('/tmp/tmpj102w_yu/.git/') 152s top_tree_object = 152s search_path = 'debian/changelog' 152s _rel_tree = 152s _rel_path = '' 152s 152s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 152s _rel_tree=None, _rel_path='' 152s ): 152s '''Recursively follow a path down a tree, following symlinks, to find blob 152s 152s repo: pygit2.Repository object 152s top_tree: pygit2.Tree object of the top of the tree structure 152s search_path: '/'-separated path string of blob to find 152s _rel_tree: (internal) which tree to look further into 152s _rel_path: (internal) the path we are in so far 152s ''' 152s 152s NORMAL_BLOB_MODES = set([ 152s pygit2.GIT_FILEMODE_BLOB, 152s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 152s ]) 152s 152s _rel_tree = _rel_tree or top_tree_object 152s head, tail = posixpath.split(search_path) 152s 152s # A traditional functional split would put a single entry in head with tail 152s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 152s # to make it appear to have traditional semantics. 152s if not head: 152s head = tail 152s tail = None 152s 152s entry = _rel_tree[head] 152s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 152s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 152s 152s gitubuntu/git_repository.py:68: AttributeError 152s ___________________ test_follow_symlinks_to_blob[3] ____________________ 152s 152s pygit2_repo = pygit2.Repository('/tmp/tmpw75asa0t/.git/') 152s tree_func = at 0x7b51553e8360> 152s 152s @pytest.mark.parametrize('tree_func', [ 152s # The tree_func parameter is a function that accepts a mock Blob that is to 152s # represent the changelog blob itself and returns a mock Tree with the mock 152s # Blob embedded somewhere within it. The test function can then ensure that 152s # follow_symlinks_to_blob can correctly find the changelog Blob given the 152s # Tree. 152s 152s # Of course this is only expected to work if, after checking out the Tree, 152s # "cat debian/changelog" would work. But this allows us to test the various 152s # permutations of symlink following in Trees that _are_ valid. 152s 152s # Simple case 152s lambda b: Tree({ 152s 'debian': Tree({'changelog': b}), 152s }), 152s 152s # Symlink in debian/ 152s lambda b: Tree({ 152s 'debian': Tree({ 152s 'changelog.real': b, 152s 'changelog': Symlink('changelog.real'), 152s }), 152s }), 152s 152s # Symlink to parent directory 152s lambda b: Tree({ 152s 'changelog': b, 152s 'debian': Tree({ 152s 'changelog': Symlink('../changelog'), 152s }) 152s }), 152s 152s # Symlink to subdirectory 152s lambda b: Tree({ 152s 'debian': Tree({ 152s 'changelog': Symlink('subdirectory/changelog'), 152s 'subdirectory': Tree({'changelog': b}), 152s }) 152s }), 152s 152s # debian/ itself is a symlink to a different directory 152s lambda b: Tree({ 152s 'pkg': Tree({'changelog': b}), 152s 'debian': Symlink('pkg'), 152s }) 152s ]) 152s def test_follow_symlinks_to_blob(pygit2_repo, tree_func): 152s blob = Blob(b'') 152s blob_id = blob.write(pygit2_repo) 152s tree = pygit2_repo.get(tree_func(blob).write(pygit2_repo)) 152s > result_blob = target.follow_symlinks_to_blob( 152s pygit2_repo, 152s tree, 152s 'debian/changelog', 152s ) 152s 152s gitubuntu/git_repository_test.py:342: 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 152s return _follow_symlinks_to_blob( 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s 152s repo = pygit2.Repository('/tmp/tmpw75asa0t/.git/') 152s top_tree_object = 152s search_path = 'debian/changelog' 152s _rel_tree = 152s _rel_path = '' 152s 152s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 152s _rel_tree=None, _rel_path='' 152s ): 152s '''Recursively follow a path down a tree, following symlinks, to find blob 152s 152s repo: pygit2.Repository object 152s top_tree: pygit2.Tree object of the top of the tree structure 152s search_path: '/'-separated path string of blob to find 152s _rel_tree: (internal) which tree to look further into 152s _rel_path: (internal) the path we are in so far 152s ''' 152s 152s NORMAL_BLOB_MODES = set([ 152s pygit2.GIT_FILEMODE_BLOB, 152s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 152s ]) 152s 152s _rel_tree = _rel_tree or top_tree_object 152s head, tail = posixpath.split(search_path) 152s 152s # A traditional functional split would put a single entry in head with tail 152s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 152s # to make it appear to have traditional semantics. 152s if not head: 152s head = tail 152s tail = None 152s 152s entry = _rel_tree[head] 152s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 152s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 152s 152s gitubuntu/git_repository.py:68: AttributeError 152s ___________________ test_follow_symlinks_to_blob[4] ____________________ 152s 152s pygit2_repo = pygit2.Repository('/tmp/tmpy4q_sowc/.git/') 152s tree_func = at 0x7b51553e8400> 152s 152s @pytest.mark.parametrize('tree_func', [ 152s # The tree_func parameter is a function that accepts a mock Blob that is to 152s # represent the changelog blob itself and returns a mock Tree with the mock 152s # Blob embedded somewhere within it. The test function can then ensure that 152s # follow_symlinks_to_blob can correctly find the changelog Blob given the 152s # Tree. 152s 152s # Of course this is only expected to work if, after checking out the Tree, 152s # "cat debian/changelog" would work. But this allows us to test the various 152s # permutations of symlink following in Trees that _are_ valid. 152s 152s # Simple case 152s lambda b: Tree({ 152s 'debian': Tree({'changelog': b}), 152s }), 152s 152s # Symlink in debian/ 152s lambda b: Tree({ 152s 'debian': Tree({ 152s 'changelog.real': b, 152s 'changelog': Symlink('changelog.real'), 152s }), 152s }), 152s 152s # Symlink to parent directory 152s lambda b: Tree({ 152s 'changelog': b, 152s 'debian': Tree({ 152s 'changelog': Symlink('../changelog'), 152s }) 152s }), 152s 152s # Symlink to subdirectory 152s lambda b: Tree({ 152s 'debian': Tree({ 152s 'changelog': Symlink('subdirectory/changelog'), 152s 'subdirectory': Tree({'changelog': b}), 152s }) 152s }), 152s 152s # debian/ itself is a symlink to a different directory 152s lambda b: Tree({ 152s 'pkg': Tree({'changelog': b}), 152s 'debian': Symlink('pkg'), 152s }) 152s ]) 152s def test_follow_symlinks_to_blob(pygit2_repo, tree_func): 152s blob = Blob(b'') 152s blob_id = blob.write(pygit2_repo) 152s tree = pygit2_repo.get(tree_func(blob).write(pygit2_repo)) 152s > result_blob = target.follow_symlinks_to_blob( 152s pygit2_repo, 152s tree, 152s 'debian/changelog', 152s ) 152s 152s gitubuntu/git_repository_test.py:342: 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 152s return _follow_symlinks_to_blob( 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s 152s repo = pygit2.Repository('/tmp/tmpy4q_sowc/.git/') 152s top_tree_object = 152s search_path = 'debian/changelog' 152s _rel_tree = 152s _rel_path = '' 152s 152s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 152s _rel_tree=None, _rel_path='' 152s ): 152s '''Recursively follow a path down a tree, following symlinks, to find blob 152s 152s repo: pygit2.Repository object 152s top_tree: pygit2.Tree object of the top of the tree structure 152s search_path: '/'-separated path string of blob to find 152s _rel_tree: (internal) which tree to look further into 152s _rel_path: (internal) the path we are in so far 152s ''' 152s 152s NORMAL_BLOB_MODES = set([ 152s pygit2.GIT_FILEMODE_BLOB, 152s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 152s ]) 152s 152s _rel_tree = _rel_tree or top_tree_object 152s head, tail = posixpath.split(search_path) 152s 152s # A traditional functional split would put a single entry in head with tail 152s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 152s # to make it appear to have traditional semantics. 152s if not head: 152s head = tail 152s tail = None 152s 152s entry = _rel_tree[head] 152s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 152s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 152s 152s gitubuntu/git_repository.py:68: AttributeError 152s ________________ test_follow_symlinks_to_blob_not_found[tree1] _________________ 152s 152s pygit2_repo = pygit2.Repository('/tmp/tmpfi_akuag/.git/') 152s tree = 152s 152s @pytest.mark.parametrize('tree', [ 152s Tree({}), 152s Tree({'debian': Tree({})}), 152s Tree({'debian': Tree({'changelog': Symlink('other')})}), 152s Tree({'debian': Tree({'changelog': Symlink('../other')})}), 152s ]) 152s def test_follow_symlinks_to_blob_not_found(pygit2_repo, tree): 152s pygit2_tree = pygit2_repo.get(tree.write(pygit2_repo)) 152s with pytest.raises(KeyError): 152s > target.follow_symlinks_to_blob( 152s pygit2_repo, 152s pygit2_tree, 152s 'debian/changelog', 152s ) 152s 152s gitubuntu/git_repository_test.py:359: 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 152s return _follow_symlinks_to_blob( 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s 152s repo = pygit2.Repository('/tmp/tmpfi_akuag/.git/') 152s top_tree_object = 152s search_path = 'debian/changelog' 152s _rel_tree = 152s _rel_path = '' 152s 152s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 152s _rel_tree=None, _rel_path='' 152s ): 152s '''Recursively follow a path down a tree, following symlinks, to find blob 152s 152s repo: pygit2.Repository object 152s top_tree: pygit2.Tree object of the top of the tree structure 152s search_path: '/'-separated path string of blob to find 152s _rel_tree: (internal) which tree to look further into 152s _rel_path: (internal) the path we are in so far 152s ''' 152s 152s NORMAL_BLOB_MODES = set([ 152s pygit2.GIT_FILEMODE_BLOB, 152s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 152s ]) 152s 152s _rel_tree = _rel_tree or top_tree_object 152s head, tail = posixpath.split(search_path) 152s 152s # A traditional functional split would put a single entry in head with tail 152s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 152s # to make it appear to have traditional semantics. 152s if not head: 152s head = tail 152s tail = None 152s 152s entry = _rel_tree[head] 152s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 152s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 152s 152s gitubuntu/git_repository.py:68: AttributeError 152s ________________ test_follow_symlinks_to_blob_not_found[tree2] _________________ 152s 152s pygit2_repo = pygit2.Repository('/tmp/tmpzijrxnyk/.git/') 152s tree = 152s 152s @pytest.mark.parametrize('tree', [ 152s Tree({}), 152s Tree({'debian': Tree({})}), 152s Tree({'debian': Tree({'changelog': Symlink('other')})}), 152s Tree({'debian': Tree({'changelog': Symlink('../other')})}), 152s ]) 152s def test_follow_symlinks_to_blob_not_found(pygit2_repo, tree): 152s pygit2_tree = pygit2_repo.get(tree.write(pygit2_repo)) 152s with pytest.raises(KeyError): 152s > target.follow_symlinks_to_blob( 152s pygit2_repo, 152s pygit2_tree, 152s 'debian/changelog', 152s ) 152s 152s gitubuntu/git_repository_test.py:359: 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 152s return _follow_symlinks_to_blob( 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s 152s repo = pygit2.Repository('/tmp/tmpzijrxnyk/.git/') 152s top_tree_object = 152s search_path = 'debian/changelog' 152s _rel_tree = 152s _rel_path = '' 152s 152s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 152s _rel_tree=None, _rel_path='' 152s ): 152s '''Recursively follow a path down a tree, following symlinks, to find blob 152s 152s repo: pygit2.Repository object 152s top_tree: pygit2.Tree object of the top of the tree structure 152s search_path: '/'-separated path string of blob to find 152s _rel_tree: (internal) which tree to look further into 152s _rel_path: (internal) the path we are in so far 152s ''' 152s 152s NORMAL_BLOB_MODES = set([ 152s pygit2.GIT_FILEMODE_BLOB, 152s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 152s ]) 152s 152s _rel_tree = _rel_tree or top_tree_object 152s head, tail = posixpath.split(search_path) 152s 152s # A traditional functional split would put a single entry in head with tail 152s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 152s # to make it appear to have traditional semantics. 152s if not head: 152s head = tail 152s tail = None 152s 152s entry = _rel_tree[head] 152s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 152s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 152s 152s gitubuntu/git_repository.py:68: AttributeError 152s ________________ test_follow_symlinks_to_blob_not_found[tree3] _________________ 152s 152s pygit2_repo = pygit2.Repository('/tmp/tmp4avpp3nj/.git/') 152s tree = 152s 152s @pytest.mark.parametrize('tree', [ 152s Tree({}), 152s Tree({'debian': Tree({})}), 152s Tree({'debian': Tree({'changelog': Symlink('other')})}), 152s Tree({'debian': Tree({'changelog': Symlink('../other')})}), 152s ]) 152s def test_follow_symlinks_to_blob_not_found(pygit2_repo, tree): 152s pygit2_tree = pygit2_repo.get(tree.write(pygit2_repo)) 152s with pytest.raises(KeyError): 152s > target.follow_symlinks_to_blob( 152s pygit2_repo, 152s pygit2_tree, 152s 'debian/changelog', 152s ) 152s 152s gitubuntu/git_repository_test.py:359: 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 152s return _follow_symlinks_to_blob( 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s 152s repo = pygit2.Repository('/tmp/tmp4avpp3nj/.git/') 152s top_tree_object = 152s search_path = 'debian/changelog' 152s _rel_tree = 152s _rel_path = '' 152s 152s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 152s _rel_tree=None, _rel_path='' 152s ): 152s '''Recursively follow a path down a tree, following symlinks, to find blob 152s 152s repo: pygit2.Repository object 152s top_tree: pygit2.Tree object of the top of the tree structure 152s search_path: '/'-separated path string of blob to find 152s _rel_tree: (internal) which tree to look further into 152s _rel_path: (internal) the path we are in so far 152s ''' 152s 152s NORMAL_BLOB_MODES = set([ 152s pygit2.GIT_FILEMODE_BLOB, 152s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 152s ]) 152s 152s _rel_tree = _rel_tree or top_tree_object 152s head, tail = posixpath.split(search_path) 152s 152s # A traditional functional split would put a single entry in head with tail 152s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 152s # to make it appear to have traditional semantics. 152s if not head: 152s head = tail 152s tail = None 152s 152s entry = _rel_tree[head] 152s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 152s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 152s 152s gitubuntu/git_repository.py:68: AttributeError 152s _________________________ test_git_escape_dir_to_tree __________________________ 152s 152s pygit2_repo = pygit2.Repository('/tmp/tmp7kquu926/.git/') 152s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_git_escape_dir_to_tree0') 152s 152s def test_git_escape_dir_to_tree(pygit2_repo, tmpdir): 152s tmpdir.mkdir('.git') 152s > tree_hash = target.GitUbuntuRepository.dir_to_tree( 152s pygit2_repo, 152s str(tmpdir), 152s escape=True, 152s ) 152s 152s gitubuntu/git_repository_test.py:668: 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s gitubuntu/git_repository.py:2463: in dir_to_tree 152s replacement_oid = cls._add_missing_tree_dirs( 152s gitubuntu/git_repository.py:2397: in _add_missing_tree_dirs 152s tree_builder = cls._create_replacement_tree_builder( 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s 152s cls = 152s repo = pygit2.Repository('/tmp/tmp7kquu926/.git/') 152s treeish = 152s sub_path = '' 152s 152s @classmethod 152s def _create_replacement_tree_builder(cls, repo, treeish, sub_path): 152s '''Create a replacement TreeBuilder 152s 152s Create a TreeBuilder based on an existing repository, top-level 152s tree-ish and path inside that tree. 152s 152s A sub_path of '' is taken to mean a request for a replacement 152s TreeBuilder for the top level tree. 152s 152s Returns a TreeBuilder object pre-populated with the previous contents. 152s If the path did not previously exist in the tree-ish, then return an 152s empty TreeBuilder instead. 152s ''' 152s 152s > tree = treeish.peel(pygit2.GIT_OBJ_TREE) 152s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 152s 152s gitubuntu/git_repository.py:2331: AttributeError 152s ______ test_determine_quilt_series_path[tree_data1-debian/patches/series] ______ 152s 152s pygit2_repo = pygit2.Repository('/tmp/tmpohq1m387/.git/') 152s tree_data = 152s expected_path = 'debian/patches/series' 152s 152s @pytest.mark.parametrize('tree_data,expected_path', [ 152s # Empty tree -> default 152s (Tree({}), 'debian/patches/series'), 152s 152s # Empty debian/patches directory -> default 152s (Tree({'debian': Tree({'patches': Tree({})})}), 'debian/patches/series'), 152s 152s # Only debian/patches/series -> that one 152s ( 152s Tree({'debian': Tree({'patches': Tree({'series': Blob(b'')})})}), 152s 'debian/patches/series', 152s ), 152s 152s # Only debian/patches/debian.series -> that one 152s ( 152s Tree({'debian': Tree({'patches': Tree({ 152s 'debian.series': Blob(b'') 152s })})}), 152s 'debian/patches/debian.series', 152s ), 152s 152s # Both -> debian.series 152s ( 152s Tree({'debian': Tree({'patches': Tree({ 152s 'debian.series': Blob(b''), 152s 'series': Blob(b''), 152s })})}), 152s 'debian/patches/debian.series', 152s ), 152s ]) 152s def test_determine_quilt_series_path(pygit2_repo, tree_data, expected_path): 152s tree_obj = pygit2_repo.get(tree_data.write(pygit2_repo)) 152s > path = target.determine_quilt_series_path(pygit2_repo, tree_obj) 152s 152s gitubuntu/git_repository_test.py:708: 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s gitubuntu/git_repository.py:991: in determine_quilt_series_path 152s blob = follow_symlinks_to_blob( 152s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 152s return _follow_symlinks_to_blob( 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s 152s repo = pygit2.Repository('/tmp/tmpohq1m387/.git/') 152s top_tree_object = 152s search_path = 'debian/patches/debian.series' 152s _rel_tree = 152s _rel_path = '' 152s 152s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 152s _rel_tree=None, _rel_path='' 152s ): 152s '''Recursively follow a path down a tree, following symlinks, to find blob 152s 152s repo: pygit2.Repository object 152s top_tree: pygit2.Tree object of the top of the tree structure 152s search_path: '/'-separated path string of blob to find 152s _rel_tree: (internal) which tree to look further into 152s _rel_path: (internal) the path we are in so far 152s ''' 152s 152s NORMAL_BLOB_MODES = set([ 152s pygit2.GIT_FILEMODE_BLOB, 152s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 152s ]) 152s 152s _rel_tree = _rel_tree or top_tree_object 152s head, tail = posixpath.split(search_path) 152s 152s # A traditional functional split would put a single entry in head with tail 152s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 152s # to make it appear to have traditional semantics. 152s if not head: 152s head = tail 152s tail = None 152s 152s entry = _rel_tree[head] 152s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 152s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 152s 152s gitubuntu/git_repository.py:68: AttributeError 152s ______ test_determine_quilt_series_path[tree_data2-debian/patches/series] ______ 152s 152s pygit2_repo = pygit2.Repository('/tmp/tmp1r2i9pl8/.git/') 152s tree_data = 152s expected_path = 'debian/patches/series' 152s 152s @pytest.mark.parametrize('tree_data,expected_path', [ 152s # Empty tree -> default 152s (Tree({}), 'debian/patches/series'), 152s 152s # Empty debian/patches directory -> default 152s (Tree({'debian': Tree({'patches': Tree({})})}), 'debian/patches/series'), 152s 152s # Only debian/patches/series -> that one 152s ( 152s Tree({'debian': Tree({'patches': Tree({'series': Blob(b'')})})}), 152s 'debian/patches/series', 152s ), 152s 152s # Only debian/patches/debian.series -> that one 152s ( 152s Tree({'debian': Tree({'patches': Tree({ 152s 'debian.series': Blob(b'') 152s })})}), 152s 'debian/patches/debian.series', 152s ), 152s 152s # Both -> debian.series 152s ( 152s Tree({'debian': Tree({'patches': Tree({ 152s 'debian.series': Blob(b''), 152s 'series': Blob(b''), 152s })})}), 152s 'debian/patches/debian.series', 152s ), 152s ]) 152s def test_determine_quilt_series_path(pygit2_repo, tree_data, expected_path): 152s tree_obj = pygit2_repo.get(tree_data.write(pygit2_repo)) 152s > path = target.determine_quilt_series_path(pygit2_repo, tree_obj) 152s 152s gitubuntu/git_repository_test.py:708: 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s gitubuntu/git_repository.py:991: in determine_quilt_series_path 152s blob = follow_symlinks_to_blob( 152s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 152s return _follow_symlinks_to_blob( 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s 152s repo = pygit2.Repository('/tmp/tmp1r2i9pl8/.git/') 152s top_tree_object = 152s search_path = 'debian/patches/debian.series' 152s _rel_tree = 152s _rel_path = '' 152s 152s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 152s _rel_tree=None, _rel_path='' 152s ): 152s '''Recursively follow a path down a tree, following symlinks, to find blob 152s 152s repo: pygit2.Repository object 152s top_tree: pygit2.Tree object of the top of the tree structure 152s search_path: '/'-separated path string of blob to find 152s _rel_tree: (internal) which tree to look further into 152s _rel_path: (internal) the path we are in so far 152s ''' 152s 152s NORMAL_BLOB_MODES = set([ 152s pygit2.GIT_FILEMODE_BLOB, 152s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 152s ]) 152s 152s _rel_tree = _rel_tree or top_tree_object 152s head, tail = posixpath.split(search_path) 152s 152s # A traditional functional split would put a single entry in head with tail 152s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 152s # to make it appear to have traditional semantics. 152s if not head: 152s head = tail 152s tail = None 152s 152s entry = _rel_tree[head] 152s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 152s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 152s 152s gitubuntu/git_repository.py:68: AttributeError 152s __ test_determine_quilt_series_path[tree_data3-debian/patches/debian.series] ___ 152s 152s pygit2_repo = pygit2.Repository('/tmp/tmpdk2cnj3r/.git/') 152s tree_data = 152s expected_path = 'debian/patches/debian.series' 152s 152s @pytest.mark.parametrize('tree_data,expected_path', [ 152s # Empty tree -> default 152s (Tree({}), 'debian/patches/series'), 152s 152s # Empty debian/patches directory -> default 152s (Tree({'debian': Tree({'patches': Tree({})})}), 'debian/patches/series'), 152s 152s # Only debian/patches/series -> that one 152s ( 152s Tree({'debian': Tree({'patches': Tree({'series': Blob(b'')})})}), 152s 'debian/patches/series', 152s ), 152s 152s # Only debian/patches/debian.series -> that one 152s ( 152s Tree({'debian': Tree({'patches': Tree({ 152s 'debian.series': Blob(b'') 152s })})}), 152s 'debian/patches/debian.series', 152s ), 152s 152s # Both -> debian.series 152s ( 152s Tree({'debian': Tree({'patches': Tree({ 152s 'debian.series': Blob(b''), 152s 'series': Blob(b''), 152s })})}), 152s 'debian/patches/debian.series', 152s ), 152s ]) 152s def test_determine_quilt_series_path(pygit2_repo, tree_data, expected_path): 152s tree_obj = pygit2_repo.get(tree_data.write(pygit2_repo)) 152s > path = target.determine_quilt_series_path(pygit2_repo, tree_obj) 152s 152s gitubuntu/git_repository_test.py:708: 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s gitubuntu/git_repository.py:991: in determine_quilt_series_path 152s blob = follow_symlinks_to_blob( 152s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 152s return _follow_symlinks_to_blob( 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s 152s repo = pygit2.Repository('/tmp/tmpdk2cnj3r/.git/') 152s top_tree_object = 152s search_path = 'debian/patches/debian.series' 152s _rel_tree = 152s _rel_path = '' 152s 152s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 152s _rel_tree=None, _rel_path='' 152s ): 152s '''Recursively follow a path down a tree, following symlinks, to find blob 152s 152s repo: pygit2.Repository object 152s top_tree: pygit2.Tree object of the top of the tree structure 152s search_path: '/'-separated path string of blob to find 152s _rel_tree: (internal) which tree to look further into 152s _rel_path: (internal) the path we are in so far 152s ''' 152s 152s NORMAL_BLOB_MODES = set([ 152s pygit2.GIT_FILEMODE_BLOB, 152s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 152s ]) 152s 152s _rel_tree = _rel_tree or top_tree_object 152s head, tail = posixpath.split(search_path) 152s 152s # A traditional functional split would put a single entry in head with tail 152s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 152s # to make it appear to have traditional semantics. 152s if not head: 152s head = tail 152s tail = None 152s 152s entry = _rel_tree[head] 152s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 152s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 152s 152s gitubuntu/git_repository.py:68: AttributeError 152s __ test_determine_quilt_series_path[tree_data4-debian/patches/debian.series] ___ 152s 152s pygit2_repo = pygit2.Repository('/tmp/tmpclwxhxu7/.git/') 152s tree_data = 152s expected_path = 'debian/patches/debian.series' 152s 152s @pytest.mark.parametrize('tree_data,expected_path', [ 152s # Empty tree -> default 152s (Tree({}), 'debian/patches/series'), 152s 152s # Empty debian/patches directory -> default 152s (Tree({'debian': Tree({'patches': Tree({})})}), 'debian/patches/series'), 152s 152s # Only debian/patches/series -> that one 152s ( 152s Tree({'debian': Tree({'patches': Tree({'series': Blob(b'')})})}), 152s 'debian/patches/series', 152s ), 152s 152s # Only debian/patches/debian.series -> that one 152s ( 152s Tree({'debian': Tree({'patches': Tree({ 152s 'debian.series': Blob(b'') 152s })})}), 152s 'debian/patches/debian.series', 152s ), 152s 152s # Both -> debian.series 152s ( 152s Tree({'debian': Tree({'patches': Tree({ 152s 'debian.series': Blob(b''), 152s 'series': Blob(b''), 152s })})}), 152s 'debian/patches/debian.series', 152s ), 152s ]) 152s def test_determine_quilt_series_path(pygit2_repo, tree_data, expected_path): 152s tree_obj = pygit2_repo.get(tree_data.write(pygit2_repo)) 152s > path = target.determine_quilt_series_path(pygit2_repo, tree_obj) 152s 152s gitubuntu/git_repository_test.py:708: 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s gitubuntu/git_repository.py:991: in determine_quilt_series_path 152s blob = follow_symlinks_to_blob( 152s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 152s return _follow_symlinks_to_blob( 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s 152s repo = pygit2.Repository('/tmp/tmpclwxhxu7/.git/') 152s top_tree_object = 152s search_path = 'debian/patches/debian.series' 152s _rel_tree = 152s _rel_path = '' 152s 152s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 152s _rel_tree=None, _rel_path='' 152s ): 152s '''Recursively follow a path down a tree, following symlinks, to find blob 152s 152s repo: pygit2.Repository object 152s top_tree: pygit2.Tree object of the top of the tree structure 152s search_path: '/'-separated path string of blob to find 152s _rel_tree: (internal) which tree to look further into 152s _rel_path: (internal) the path we are in so far 152s ''' 152s 152s NORMAL_BLOB_MODES = set([ 152s pygit2.GIT_FILEMODE_BLOB, 152s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 152s ]) 152s 152s _rel_tree = _rel_tree or top_tree_object 152s head, tail = posixpath.split(search_path) 152s 152s # A traditional functional split would put a single entry in head with tail 152s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 152s # to make it appear to have traditional semantics. 152s if not head: 152s head = tail 152s tail = None 152s 152s entry = _rel_tree[head] 152s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 152s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 152s 152s gitubuntu/git_repository.py:68: AttributeError 152s ________________________________ test_quilt_env ________________________________ 152s 152s pygit2_repo = pygit2.Repository('/tmp/tmp3lxr4h04/.git/') 152s 152s def test_quilt_env(pygit2_repo): 152s tree_builder = Tree({'debian': 152s Tree({'patches': Tree({'debian.series': Blob(b'')})}) 152s }) 152s tree_obj = pygit2_repo.get(tree_builder.write(pygit2_repo)) 152s > env = target.quilt_env(pygit2_repo, tree_obj) 152s 152s gitubuntu/git_repository_test.py:717: 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s gitubuntu/git_repository.py:1022: in quilt_env 152s 'QUILT_SERIES': determine_quilt_series_path(pygit2_repo, treeish), 152s gitubuntu/git_repository.py:991: in determine_quilt_series_path 152s blob = follow_symlinks_to_blob( 152s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 152s return _follow_symlinks_to_blob( 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s 152s repo = pygit2.Repository('/tmp/tmp3lxr4h04/.git/') 152s top_tree_object = 152s search_path = 'debian/patches/debian.series' 152s _rel_tree = 152s _rel_path = '' 152s 152s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 152s _rel_tree=None, _rel_path='' 152s ): 152s '''Recursively follow a path down a tree, following symlinks, to find blob 152s 152s repo: pygit2.Repository object 152s top_tree: pygit2.Tree object of the top of the tree structure 152s search_path: '/'-separated path string of blob to find 152s _rel_tree: (internal) which tree to look further into 152s _rel_path: (internal) the path we are in so far 152s ''' 152s 152s NORMAL_BLOB_MODES = set([ 152s pygit2.GIT_FILEMODE_BLOB, 152s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 152s ]) 152s 152s _rel_tree = _rel_tree or top_tree_object 152s head, tail = posixpath.split(search_path) 152s 152s # A traditional functional split would put a single entry in head with tail 152s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 152s # to make it appear to have traditional semantics. 152s if not head: 152s head = tail 152s tail = None 152s 152s entry = _rel_tree[head] 152s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 152s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 152s 152s gitubuntu/git_repository.py:68: AttributeError 152s _____________________________ test_repo_quilt_env ______________________________ 152s 152s repo = 152s 152s def test_repo_quilt_env(repo): 152s tree_builder = Tree({'debian': 152s Tree({'patches': Tree({'debian.series': Blob(b'')})}) 152s }) 152s tree_obj = repo.raw_repo.get(tree_builder.write(repo.raw_repo)) 152s > env = repo.quilt_env(tree_obj) 152s 152s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository_test.py:732: 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:2575: in quilt_env 152s env.update(quilt_env(self.raw_repo, treeish)) 152s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:1022: in quilt_env 152s 'QUILT_SERIES': determine_quilt_series_path(pygit2_repo, treeish), 152s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:991: in determine_quilt_series_path 152s blob = follow_symlinks_to_blob( 152s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 152s return _follow_symlinks_to_blob( 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s 152s repo = pygit2.Repository('/tmp/tmp6fdz1ea8/.git/') 152s top_tree_object = 152s search_path = 'debian/patches/debian.series' 152s _rel_tree = 152s _rel_path = '' 152s 152s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 152s _rel_tree=None, _rel_path='' 152s ): 152s '''Recursively follow a path down a tree, following symlinks, to find blob 152s 152s repo: pygit2.Repository object 152s top_tree: pygit2.Tree object of the top of the tree structure 152s search_path: '/'-separated path string of blob to find 152s _rel_tree: (internal) which tree to look further into 152s _rel_path: (internal) the path we are in so far 152s ''' 152s 152s NORMAL_BLOB_MODES = set([ 152s pygit2.GIT_FILEMODE_BLOB, 152s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 152s ]) 152s 152s _rel_tree = _rel_tree or top_tree_object 152s head, tail = posixpath.split(search_path) 152s 152s # A traditional functional split would put a single entry in head with tail 152s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 152s # to make it appear to have traditional semantics. 152s if not head: 152s head = tail 152s tail = None 152s 152s entry = _rel_tree[head] 152s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 152s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 152s 152s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:68: AttributeError 152s _____________________ test_repo_quilt_env_from_treeish_str _____________________ 152s 152s repo = 152s 152s def test_repo_quilt_env_from_treeish_str(repo): 152s tree_builder = Tree({'debian': 152s Tree({'patches': Tree({'debian.series': Blob(b'')})}) 152s }) 152s tree_obj = repo.raw_repo.get(tree_builder.write(repo.raw_repo)) 152s > env = repo.quilt_env_from_treeish_str(str(tree_obj.id)) 152s 152s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository_test.py:757: 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:2589: in quilt_env_from_treeish_str 152s return self.quilt_env(self.raw_repo.get(treeish_str)) 152s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:2575: in quilt_env 152s env.update(quilt_env(self.raw_repo, treeish)) 152s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:1022: in quilt_env 152s 'QUILT_SERIES': determine_quilt_series_path(pygit2_repo, treeish), 152s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:991: in determine_quilt_series_path 152s blob = follow_symlinks_to_blob( 152s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 152s return _follow_symlinks_to_blob( 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s 152s repo = pygit2.Repository('/tmp/tmpbux0f7dg/.git/') 152s top_tree_object = 152s search_path = 'debian/patches/debian.series' 152s _rel_tree = 152s _rel_path = '' 152s 152s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 152s _rel_tree=None, _rel_path='' 152s ): 152s '''Recursively follow a path down a tree, following symlinks, to find blob 152s 152s repo: pygit2.Repository object 152s top_tree: pygit2.Tree object of the top of the tree structure 152s search_path: '/'-separated path string of blob to find 152s _rel_tree: (internal) which tree to look further into 152s _rel_path: (internal) the path we are in so far 152s ''' 152s 152s NORMAL_BLOB_MODES = set([ 152s pygit2.GIT_FILEMODE_BLOB, 152s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 152s ]) 152s 152s _rel_tree = _rel_tree or top_tree_object 152s head, tail = posixpath.split(search_path) 152s 152s # A traditional functional split would put a single entry in head with tail 152s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 152s # to make it appear to have traditional semantics. 152s if not head: 152s head = tail 152s tail = None 152s 152s entry = _rel_tree[head] 152s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 152s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 152s 152s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:68: AttributeError 152s _ test_repo_find_ubuntu_merge[Common case-input_data0-pkg/import/1-1ubuntu1-pkg/import/2-1-pkg/import/1-1] _ 152s 152s description = 'Common case' 152s repo = 152s input_data = 152s old_ubuntu = 'pkg/import/1-1ubuntu1', new_debian = 'pkg/import/2-1' 152s expected = 'pkg/import/1-1' 152s 152s @pytest.mark.parametrize( 152s 'description, input_data, old_ubuntu, new_debian, expected', 152s [ 152s ( 152s 'Common case', 152s Repo( 152s commits=[ 152s Commit.from_spec( 152s name='old/debian' 152s ), 152s Commit.from_spec( 152s parents=[Placeholder('old/debian')], 152s name='old/ubuntu', 152s changelog_versions=['1-1ubuntu1', '1-1'], 152s ), 152s Commit.from_spec( 152s parents=[Placeholder('old/debian')], 152s name='new/debian', 152s changelog_versions=['2-1', '1-1'], 152s ), 152s ], 152s tags={ 152s 'pkg/import/1-1': Placeholder('old/debian'), 152s 'pkg/import/1-1ubuntu1': Placeholder('old/ubuntu'), 152s 'pkg/import/2-1': Placeholder('new/debian'), 152s }, 152s ), 152s 'pkg/import/1-1ubuntu1', 152s 'pkg/import/2-1', 152s 'pkg/import/1-1', 152s ), 152s ( 152s 'Ubuntu delta based on a NMU', 152s Repo( 152s commits=[ 152s Commit.from_spec( 152s name='fork_point' 152s ), 152s Commit.from_spec( 152s parents=[Placeholder('fork_point')], 152s name='old/debian', 152s changelog_versions=['1-1.1', '1-1'], 152s ), 152s Commit.from_spec( 152s parents=[Placeholder('old/debian')], 152s name='old/ubuntu', 152s changelog_versions=['1-1.1ubuntu1', '1-1.1', '1-1'], 152s ), 152s Commit.from_spec( 152s parents=[Placeholder('fork_point')], 152s name='new/debian', 152s changelog_versions=['2-1', '1-1'], 152s ), 152s ], 152s tags={ 152s 'pkg/import/1-1': Placeholder('fork_point'), 152s 'pkg/import/1-1.1': Placeholder('old/debian'), 152s 'pkg/import/1-1.1ubuntu1': Placeholder('old/ubuntu'), 152s 'pkg/import/2-1': Placeholder('new/debian'), 152s }, 152s ), 152s 'pkg/import/1-1.1ubuntu1', 152s 'pkg/import/2-1', 152s 'pkg/import/1-1.1', 152s ), 152s ( 152s 'Ubuntu upstream version head of Debian', 152s Repo( 152s commits=[ 152s Commit.from_spec( 152s name='old/debian' 152s ), 152s Commit.from_spec( 152s parents=[Placeholder('old/debian')], 152s name='mid_ubuntu', 152s changelog_versions=['1-1ubuntu1', '1-1'], 152s ), 152s Commit.from_spec( 152s parents=[Placeholder('mid_ubuntu')], 152s name='old/ubuntu', 152s changelog_versions=['2-0ubuntu1', '1-1ubuntu1', '1-1'], 152s ), 152s Commit.from_spec( 152s parents=[Placeholder('old/debian')], 152s name='new/debian', 152s changelog_versions=['3-1', '1-1'], 152s ), 152s ], 152s tags={ 152s 'pkg/import/1-1': Placeholder('old/debian'), 152s 'pkg/import/1-1ubuntu1': Placeholder('mid_ubuntu'), 152s 'pkg/import/2-0ubuntu1': Placeholder('old/ubuntu'), 152s 'pkg/import/3-1': Placeholder('new/debian'), 152s }, 152s ), 152s 'pkg/import/2-0ubuntu1', 152s 'pkg/import/3-1', 152s 'pkg/import/1-1', 152s ), 152s ], 152s ) 152s def test_repo_find_ubuntu_merge( 152s description, 152s repo, 152s input_data, 152s old_ubuntu, 152s new_debian, 152s expected, 152s ): 152s > input_data.write(repo.raw_repo) 152s 152s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository_test.py:889: 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s 152s self = 152s repo = pygit2.Repository('/tmp/tmp8kqq1_io/.git/'), record = {} 152s 152s def write(self, repo, record=None): 152s replace_placeholders(self) 152s record = record or dict() 152s written_commits = [ 152s commit.write(repo=repo, record=record) 152s for commit 152s in self.commit_list 152s ] 152s for name, target in self.branches.items(): 152s repo.create_branch( 152s name, 152s repo.get(target.write(repo)).peel(pygit2.Commit), 152s ) 152s for name, target in self.tags.items(): 152s repo.create_tag( 152s name, 152s target.write(repo), 152s > pygit2.GIT_OBJ_COMMIT, 152s self.tagger.signature, 152s 'Tag message', 152s ) 152s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 152s 152s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 152s ----------------------------- Captured stdout call ----------------------------- 152s dpkg-source: info: using source format '3.0 (quilt)' 152s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 152s dpkg-source: info: using source format '3.0 (quilt)' 152s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1ubuntu1.debian.tar.xz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1ubuntu1.dsc 152s dpkg-source: info: using source format '3.0 (quilt)' 152s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 152s dpkg-source: info: using source format '3.0 (quilt)' 152s dpkg-source: info: building source-builder-package using existing ./source-builder-package_2.orig.tar.gz 152s dpkg-source: info: building source-builder-package in source-builder-package_2-1.debian.tar.xz 152s dpkg-source: info: building source-builder-package in source-builder-package_2-1.dsc 152s dpkg-source: info: using source format '3.0 (quilt)' 152s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 152s dpkg-source: info: using source format '3.0 (quilt)' 152s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 152s ----------------------------- Captured stderr call ----------------------------- 152s dpkg-source: warning: missing information for output field Standards-Version 152s dpkg-source: warning: Version number suggests Ubuntu changes, but there is no XSBC-Original-Maintainer field 152s dpkg-source: warning: missing information for output field Standards-Version 152s dpkg-source: warning: missing information for output field Standards-Version 152s dpkg-source: warning: missing information for output field Standards-Version 152s dpkg-source: warning: missing information for output field Standards-Version 152s dpkg-source: warning: missing information for output field Standards-Version 152s _ 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] _ 152s 152s description = 'Ubuntu delta based on a NMU' 152s repo = 152s input_data = 152s old_ubuntu = 'pkg/import/1-1.1ubuntu1', new_debian = 'pkg/import/2-1' 152s expected = 'pkg/import/1-1.1' 152s 152s @pytest.mark.parametrize( 152s 'description, input_data, old_ubuntu, new_debian, expected', 152s [ 152s ( 152s 'Common case', 152s Repo( 152s commits=[ 152s Commit.from_spec( 152s name='old/debian' 152s ), 152s Commit.from_spec( 152s parents=[Placeholder('old/debian')], 152s name='old/ubuntu', 152s changelog_versions=['1-1ubuntu1', '1-1'], 152s ), 152s Commit.from_spec( 152s parents=[Placeholder('old/debian')], 152s name='new/debian', 152s changelog_versions=['2-1', '1-1'], 152s ), 152s ], 152s tags={ 152s 'pkg/import/1-1': Placeholder('old/debian'), 152s 'pkg/import/1-1ubuntu1': Placeholder('old/ubuntu'), 152s 'pkg/import/2-1': Placeholder('new/debian'), 152s }, 152s ), 152s 'pkg/import/1-1ubuntu1', 152s 'pkg/import/2-1', 152s 'pkg/import/1-1', 152s ), 152s ( 152s 'Ubuntu delta based on a NMU', 152s Repo( 152s commits=[ 152s Commit.from_spec( 152s name='fork_point' 152s ), 152s Commit.from_spec( 152s parents=[Placeholder('fork_point')], 152s name='old/debian', 152s changelog_versions=['1-1.1', '1-1'], 152s ), 152s Commit.from_spec( 152s parents=[Placeholder('old/debian')], 152s name='old/ubuntu', 152s changelog_versions=['1-1.1ubuntu1', '1-1.1', '1-1'], 152s ), 152s Commit.from_spec( 152s parents=[Placeholder('fork_point')], 152s name='new/debian', 152s changelog_versions=['2-1', '1-1'], 152s ), 152s ], 152s tags={ 152s 'pkg/import/1-1': Placeholder('fork_point'), 152s 'pkg/import/1-1.1': Placeholder('old/debian'), 152s 'pkg/import/1-1.1ubuntu1': Placeholder('old/ubuntu'), 152s 'pkg/import/2-1': Placeholder('new/debian'), 152s }, 152s ), 152s 'pkg/import/1-1.1ubuntu1', 152s 'pkg/import/2-1', 152s 'pkg/import/1-1.1', 152s ), 152s ( 152s 'Ubuntu upstream version head of Debian', 152s Repo( 152s commits=[ 152s Commit.from_spec( 152s name='old/debian' 152s ), 152s Commit.from_spec( 152s parents=[Placeholder('old/debian')], 152s name='mid_ubuntu', 152s changelog_versions=['1-1ubuntu1', '1-1'], 152s ), 152s Commit.from_spec( 152s parents=[Placeholder('mid_ubuntu')], 152s name='old/ubuntu', 152s changelog_versions=['2-0ubuntu1', '1-1ubuntu1', '1-1'], 152s ), 152s Commit.from_spec( 152s parents=[Placeholder('old/debian')], 152s name='new/debian', 152s changelog_versions=['3-1', '1-1'], 152s ), 152s ], 152s tags={ 152s 'pkg/import/1-1': Placeholder('old/debian'), 152s 'pkg/import/1-1ubuntu1': Placeholder('mid_ubuntu'), 152s 'pkg/import/2-0ubuntu1': Placeholder('old/ubuntu'), 152s 'pkg/import/3-1': Placeholder('new/debian'), 152s }, 152s ), 152s 'pkg/import/2-0ubuntu1', 152s 'pkg/import/3-1', 152s 'pkg/import/1-1', 152s ), 152s ], 152s ) 152s def test_repo_find_ubuntu_merge( 152s description, 152s repo, 152s input_data, 152s old_ubuntu, 152s new_debian, 152s expected, 152s ): 152s > input_data.write(repo.raw_repo) 152s 152s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository_test.py:889: 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s 152s self = 152s repo = pygit2.Repository('/tmp/tmpetv4oavv/.git/'), record = {} 152s 152s def write(self, repo, record=None): 152s replace_placeholders(self) 152s record = record or dict() 152s written_commits = [ 152s commit.write(repo=repo, record=record) 152s for commit 152s in self.commit_list 152s ] 152s for name, target in self.branches.items(): 152s repo.create_branch( 152s name, 152s repo.get(target.write(repo)).peel(pygit2.Commit), 152s ) 152s for name, target in self.tags.items(): 152s repo.create_tag( 152s name, 152s target.write(repo), 152s > pygit2.GIT_OBJ_COMMIT, 152s self.tagger.signature, 152s 'Tag message', 152s ) 152s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 152s 152s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 152s ----------------------------- Captured stdout call ----------------------------- 152s dpkg-source: info: using source format '3.0 (quilt)' 152s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 152s dpkg-source: info: using source format '3.0 (quilt)' 152s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.1.debian.tar.xz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.1.dsc 152s dpkg-source: info: using source format '3.0 (quilt)' 152s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 152s dpkg-source: info: using source format '3.0 (quilt)' 152s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.1ubuntu1.debian.tar.xz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.1ubuntu1.dsc 152s dpkg-source: info: using source format '3.0 (quilt)' 152s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.1.debian.tar.xz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.1.dsc 152s dpkg-source: info: using source format '3.0 (quilt)' 152s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 152s dpkg-source: info: using source format '3.0 (quilt)' 152s dpkg-source: info: building source-builder-package using existing ./source-builder-package_2.orig.tar.gz 152s dpkg-source: info: building source-builder-package in source-builder-package_2-1.debian.tar.xz 152s dpkg-source: info: building source-builder-package in source-builder-package_2-1.dsc 152s dpkg-source: info: using source format '3.0 (quilt)' 152s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 152s dpkg-source: info: using source format '3.0 (quilt)' 152s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 152s ----------------------------- Captured stderr call ----------------------------- 152s dpkg-source: warning: missing information for output field Standards-Version 152s dpkg-source: warning: missing information for output field Standards-Version 152s dpkg-source: warning: missing information for output field Standards-Version 152s dpkg-source: warning: Version number suggests Ubuntu changes, but there is no XSBC-Original-Maintainer field 152s dpkg-source: warning: missing information for output field Standards-Version 152s dpkg-source: warning: missing information for output field Standards-Version 152s dpkg-source: warning: missing information for output field Standards-Version 152s dpkg-source: warning: missing information for output field Standards-Version 152s dpkg-source: warning: missing information for output field Standards-Version 152s dpkg-source: warning: missing information for output field Standards-Version 152s _ 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] _ 152s 152s description = 'Ubuntu upstream version head of Debian' 152s repo = 152s input_data = 152s old_ubuntu = 'pkg/import/2-0ubuntu1', new_debian = 'pkg/import/3-1' 152s expected = 'pkg/import/1-1' 152s 152s @pytest.mark.parametrize( 152s 'description, input_data, old_ubuntu, new_debian, expected', 152s [ 152s ( 152s 'Common case', 152s Repo( 152s commits=[ 152s Commit.from_spec( 152s name='old/debian' 152s ), 152s Commit.from_spec( 152s parents=[Placeholder('old/debian')], 152s name='old/ubuntu', 152s changelog_versions=['1-1ubuntu1', '1-1'], 152s ), 152s Commit.from_spec( 152s parents=[Placeholder('old/debian')], 152s name='new/debian', 152s changelog_versions=['2-1', '1-1'], 152s ), 152s ], 152s tags={ 152s 'pkg/import/1-1': Placeholder('old/debian'), 152s 'pkg/import/1-1ubuntu1': Placeholder('old/ubuntu'), 152s 'pkg/import/2-1': Placeholder('new/debian'), 152s }, 152s ), 152s 'pkg/import/1-1ubuntu1', 152s 'pkg/import/2-1', 152s 'pkg/import/1-1', 152s ), 152s ( 152s 'Ubuntu delta based on a NMU', 152s Repo( 152s commits=[ 152s Commit.from_spec( 152s name='fork_point' 152s ), 152s Commit.from_spec( 152s parents=[Placeholder('fork_point')], 152s name='old/debian', 152s changelog_versions=['1-1.1', '1-1'], 152s ), 152s Commit.from_spec( 152s parents=[Placeholder('old/debian')], 152s name='old/ubuntu', 152s changelog_versions=['1-1.1ubuntu1', '1-1.1', '1-1'], 152s ), 152s Commit.from_spec( 152s parents=[Placeholder('fork_point')], 152s name='new/debian', 152s changelog_versions=['2-1', '1-1'], 152s ), 152s ], 152s tags={ 152s 'pkg/import/1-1': Placeholder('fork_point'), 152s 'pkg/import/1-1.1': Placeholder('old/debian'), 152s 'pkg/import/1-1.1ubuntu1': Placeholder('old/ubuntu'), 152s 'pkg/import/2-1': Placeholder('new/debian'), 152s }, 152s ), 152s 'pkg/import/1-1.1ubuntu1', 152s 'pkg/import/2-1', 152s 'pkg/import/1-1.1', 152s ), 152s ( 152s 'Ubuntu upstream version head of Debian', 152s Repo( 152s commits=[ 152s Commit.from_spec( 152s name='old/debian' 152s ), 152s Commit.from_spec( 152s parents=[Placeholder('old/debian')], 152s name='mid_ubuntu', 152s changelog_versions=['1-1ubuntu1', '1-1'], 152s ), 152s Commit.from_spec( 152s parents=[Placeholder('mid_ubuntu')], 152s name='old/ubuntu', 152s changelog_versions=['2-0ubuntu1', '1-1ubuntu1', '1-1'], 152s ), 152s Commit.from_spec( 152s parents=[Placeholder('old/debian')], 152s name='new/debian', 152s changelog_versions=['3-1', '1-1'], 152s ), 152s ], 152s tags={ 152s 'pkg/import/1-1': Placeholder('old/debian'), 152s 'pkg/import/1-1ubuntu1': Placeholder('mid_ubuntu'), 152s 'pkg/import/2-0ubuntu1': Placeholder('old/ubuntu'), 152s 'pkg/import/3-1': Placeholder('new/debian'), 152s }, 152s ), 152s 'pkg/import/2-0ubuntu1', 152s 'pkg/import/3-1', 152s 'pkg/import/1-1', 152s ), 152s ], 152s ) 152s def test_repo_find_ubuntu_merge( 152s description, 152s repo, 152s input_data, 152s old_ubuntu, 152s new_debian, 152s expected, 152s ): 152s > input_data.write(repo.raw_repo) 152s 152s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository_test.py:889: 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s 152s self = 152s repo = pygit2.Repository('/tmp/tmp46m6fkii/.git/'), record = {} 152s 152s def write(self, repo, record=None): 152s replace_placeholders(self) 152s record = record or dict() 152s written_commits = [ 152s commit.write(repo=repo, record=record) 152s for commit 152s in self.commit_list 152s ] 152s for name, target in self.branches.items(): 152s repo.create_branch( 152s name, 152s repo.get(target.write(repo)).peel(pygit2.Commit), 152s ) 152s for name, target in self.tags.items(): 152s repo.create_tag( 152s name, 152s target.write(repo), 152s > pygit2.GIT_OBJ_COMMIT, 152s self.tagger.signature, 152s 'Tag message', 152s ) 152s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 152s 152s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 152s ----------------------------- Captured stdout call ----------------------------- 152s dpkg-source: info: using source format '3.0 (quilt)' 152s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 152s dpkg-source: info: using source format '3.0 (quilt)' 152s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1ubuntu1.debian.tar.xz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1ubuntu1.dsc 152s dpkg-source: info: using source format '3.0 (quilt)' 152s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 152s dpkg-source: info: using source format '3.0 (quilt)' 152s dpkg-source: info: building source-builder-package using existing ./source-builder-package_2.orig.tar.gz 152s dpkg-source: info: building source-builder-package in source-builder-package_2-0ubuntu1.debian.tar.xz 152s dpkg-source: info: building source-builder-package in source-builder-package_2-0ubuntu1.dsc 152s dpkg-source: info: using source format '3.0 (quilt)' 152s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1ubuntu1.debian.tar.xz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1ubuntu1.dsc 152s dpkg-source: info: using source format '3.0 (quilt)' 152s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 152s dpkg-source: info: using source format '3.0 (quilt)' 152s dpkg-source: info: building source-builder-package using existing ./source-builder-package_3.orig.tar.gz 152s dpkg-source: info: building source-builder-package in source-builder-package_3-1.debian.tar.xz 152s dpkg-source: info: building source-builder-package in source-builder-package_3-1.dsc 152s dpkg-source: info: using source format '3.0 (quilt)' 152s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 152s dpkg-source: info: using source format '3.0 (quilt)' 152s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 152s ----------------------------- Captured stderr call ----------------------------- 152s dpkg-source: warning: missing information for output field Standards-Version 152s dpkg-source: warning: Version number suggests Ubuntu changes, but there is no XSBC-Original-Maintainer field 152s dpkg-source: warning: missing information for output field Standards-Version 152s dpkg-source: warning: missing information for output field Standards-Version 152s dpkg-source: warning: Version number suggests Ubuntu changes, but there is no XSBC-Original-Maintainer field 152s dpkg-source: warning: missing information for output field Standards-Version 152s dpkg-source: warning: Version number suggests Ubuntu changes, but there is no XSBC-Original-Maintainer field 152s dpkg-source: warning: missing information for output field Standards-Version 152s dpkg-source: warning: missing information for output field Standards-Version 152s dpkg-source: warning: missing information for output field Standards-Version 152s dpkg-source: warning: missing information for output field Standards-Version 152s dpkg-source: warning: missing information for output field Standards-Version 152s _______________________________ test_commit_tree _______________________________ 152s 152s repo = 152s 152s def test_commit_tree(repo): 152s # Construct a repository with an initial commit on the master branch so 152s # that we can verify later parentage and lack of branch movement 152s parent_commit_oid = Repo( 152s commits=[Commit(name='master')], 152s branches={'master': Placeholder('master')} 152s ).write(repo.raw_repo) 152s repo.raw_repo.lookup_reference('HEAD').set_target('refs/heads/master') 152s 152s # Construct a tree inside the repository with a debian/changelog in it to 152s # feed to the method under test 152s test_changelog_path = os.path.join( 152s pkg_resources.resource_filename('gitubuntu', 'changelog_tests'), 152s 'test_date_1', 152s ) 152s with open(test_changelog_path, 'rb') as f: 152s test_changelog_bytes = f.read() 152s test_changelog_blob = Blob(test_changelog_bytes) 152s source_tree = Tree({'debian': Tree({'changelog': test_changelog_blob})}) 152s source_tree_oid = source_tree.write(repo.raw_repo) 152s 152s # Call the method under test 152s > commit_oid = repo.commit_source_tree( 152s tree=source_tree_oid, 152s parents=[parent_commit_oid], 152s log_message='test_commit_msg', 152s commit_date=datetime.datetime( 152s 1971, # year 152s 2, # month 152s 3, # day 152s 4, # hours 152s 5, # minutes 152s 6, # seconds 152s 7, # milliseconds (this should get truncated down to 0) 152s datetime.timezone(datetime.timedelta(hours=-8)) 152s ), 152s ) 152s 152s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository_test.py:993: 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:2299: in commit_source_tree 152s changelog = self.get_changelog_from_treeish(str(tree)) 152s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 152s return Changelog.from_treeish( 152s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:569: in from_treeish 152s blob = follow_symlinks_to_blob( 152s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 152s return _follow_symlinks_to_blob( 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s 152s repo = pygit2.Repository('/tmp/tmpdaw_ammj/.git/') 152s top_tree_object = 152s search_path = 'debian/changelog' 152s _rel_tree = 152s _rel_path = '' 152s 152s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 152s _rel_tree=None, _rel_path='' 152s ): 152s '''Recursively follow a path down a tree, following symlinks, to find blob 152s 152s repo: pygit2.Repository object 152s top_tree: pygit2.Tree object of the top of the tree structure 152s search_path: '/'-separated path string of blob to find 152s _rel_tree: (internal) which tree to look further into 152s _rel_path: (internal) the path we are in so far 152s ''' 152s 152s NORMAL_BLOB_MODES = set([ 152s pygit2.GIT_FILEMODE_BLOB, 152s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 152s ]) 152s 152s _rel_tree = _rel_tree or top_tree_object 152s head, tail = posixpath.split(search_path) 152s 152s # A traditional functional split would put a single entry in head with tail 152s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 152s # to make it appear to have traditional semantics. 152s if not head: 152s head = tail 152s tail = None 152s 152s entry = _rel_tree[head] 152s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 152s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 152s 152s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:68: AttributeError 152s _____________________ test_descendant_of[root-root-False] ______________________ 152s 152s pygit2_repo = pygit2.Repository('/tmp/tmpcs69b7ge/.git/'), a = 'root' 152s b = 'root', expected = False 152s 152s @pytest.mark.parametrize(['a', 'b', 'expected'], 152s [ 152s ('root', 'root', False), 152s ('child1', 'root', True), 152s ('root', 'child1', False), 152s ('grandchild1', 'root', True), 152s ('child1', 'child2', False), 152s ('root', 'disjoint', False), 152s ] 152s ) 152s def test_descendant_of(pygit2_repo, a, b, expected): 152s """ 152s General test for pygit2.Repository.descendant_of(). 152s 152s This test was formerly for a temporary alternative implementation of 152s pygit2.Repository.descendant_of() in our GitUbuntuRepository wrapper for 152s use until we updated our pinning to use a newer version of pygit2 that 152s included the pygit2.Repository.descendant_of() method. After the pinning 152s was removed and this implementation replacement took place, we kept the 152s test to ensure that actual behaviour did not change. 152s 152s This unit tests validate_upload_tag() for various parameterized cases. The 152s paramater sets assume the repository structure encoded in the Repo() call 152s below. 152s 152s :param pygit2.Repository pygit2_repo: fixture providing a temporary 152s pygit2.Repository instance to use 152s :param str a: tag name of the first commit to pass to descendant_of() 152s :param str b: tag name of the second commit to pass to descendant_of() 152s :param bool expected: the expected result of descendant_of() 152s """ 152s Repo( 152s # Unique message parameters are used in each entry here in order to 152s # ensure that otherwise-identical commits do not end up being the same 152s # commit (with the same hash, etc). 152s commits=[ 152s Commit(name='root', message='1'), 152s Commit(name='child1', parents=[Placeholder('root')], message='2'), 152s Commit(name='child2', parents=[Placeholder('root')], message='3'), 152s Commit( 152s name='grandchild1', 152s parents=[Placeholder('child1')], 152s message='4' 152s ), 152s Commit(name='disjoint', message='5'), 152s ], 152s tags={ 152s 'root': Placeholder('root'), 152s 'child1': Placeholder('child1'), 152s 'child2': Placeholder('child2'), 152s 'grandchild1': Placeholder('grandchild1'), 152s 'disjoint': Placeholder('disjoint'), 152s } 152s > ).write(pygit2_repo) 152s 152s gitubuntu/git_repository_test.py:1099: 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s 152s self = 152s repo = pygit2.Repository('/tmp/tmpcs69b7ge/.git/'), record = {} 152s 152s def write(self, repo, record=None): 152s replace_placeholders(self) 152s record = record or dict() 152s written_commits = [ 152s commit.write(repo=repo, record=record) 152s for commit 152s in self.commit_list 152s ] 152s for name, target in self.branches.items(): 152s repo.create_branch( 152s name, 152s repo.get(target.write(repo)).peel(pygit2.Commit), 152s ) 152s for name, target in self.tags.items(): 152s repo.create_tag( 152s name, 152s target.write(repo), 152s > pygit2.GIT_OBJ_COMMIT, 152s self.tagger.signature, 152s 'Tag message', 152s ) 152s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 152s 152s gitubuntu/repo_builder.py:389: AttributeError 152s _____________________ test_descendant_of[child1-root-True] _____________________ 152s 152s pygit2_repo = pygit2.Repository('/tmp/tmp7jah6fuz/.git/'), a = 'child1' 152s b = 'root', expected = True 152s 152s @pytest.mark.parametrize(['a', 'b', 'expected'], 152s [ 152s ('root', 'root', False), 152s ('child1', 'root', True), 152s ('root', 'child1', False), 152s ('grandchild1', 'root', True), 152s ('child1', 'child2', False), 152s ('root', 'disjoint', False), 152s ] 152s ) 152s def test_descendant_of(pygit2_repo, a, b, expected): 152s """ 152s General test for pygit2.Repository.descendant_of(). 152s 152s This test was formerly for a temporary alternative implementation of 152s pygit2.Repository.descendant_of() in our GitUbuntuRepository wrapper for 152s use until we updated our pinning to use a newer version of pygit2 that 152s included the pygit2.Repository.descendant_of() method. After the pinning 152s was removed and this implementation replacement took place, we kept the 152s test to ensure that actual behaviour did not change. 152s 152s This unit tests validate_upload_tag() for various parameterized cases. The 152s paramater sets assume the repository structure encoded in the Repo() call 152s below. 152s 152s :param pygit2.Repository pygit2_repo: fixture providing a temporary 152s pygit2.Repository instance to use 152s :param str a: tag name of the first commit to pass to descendant_of() 152s :param str b: tag name of the second commit to pass to descendant_of() 152s :param bool expected: the expected result of descendant_of() 152s """ 152s Repo( 152s # Unique message parameters are used in each entry here in order to 152s # ensure that otherwise-identical commits do not end up being the same 152s # commit (with the same hash, etc). 152s commits=[ 152s Commit(name='root', message='1'), 152s Commit(name='child1', parents=[Placeholder('root')], message='2'), 152s Commit(name='child2', parents=[Placeholder('root')], message='3'), 152s Commit( 152s name='grandchild1', 152s parents=[Placeholder('child1')], 152s message='4' 152s ), 152s Commit(name='disjoint', message='5'), 152s ], 152s tags={ 152s 'root': Placeholder('root'), 152s 'child1': Placeholder('child1'), 152s 'child2': Placeholder('child2'), 152s 'grandchild1': Placeholder('grandchild1'), 152s 'disjoint': Placeholder('disjoint'), 152s } 152s > ).write(pygit2_repo) 152s 152s gitubuntu/git_repository_test.py:1099: 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s 152s self = 152s repo = pygit2.Repository('/tmp/tmp7jah6fuz/.git/'), record = {} 152s 152s def write(self, repo, record=None): 152s replace_placeholders(self) 152s record = record or dict() 152s written_commits = [ 152s commit.write(repo=repo, record=record) 152s for commit 152s in self.commit_list 152s ] 152s for name, target in self.branches.items(): 152s repo.create_branch( 152s name, 152s repo.get(target.write(repo)).peel(pygit2.Commit), 152s ) 152s for name, target in self.tags.items(): 152s repo.create_tag( 152s name, 152s target.write(repo), 152s > pygit2.GIT_OBJ_COMMIT, 152s self.tagger.signature, 152s 'Tag message', 152s ) 152s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 152s 152s gitubuntu/repo_builder.py:389: AttributeError 152s ____________________ test_descendant_of[root-child1-False] _____________________ 152s 152s pygit2_repo = pygit2.Repository('/tmp/tmp4m_isu8n/.git/'), a = 'root' 152s b = 'child1', expected = False 152s 152s @pytest.mark.parametrize(['a', 'b', 'expected'], 152s [ 152s ('root', 'root', False), 152s ('child1', 'root', True), 152s ('root', 'child1', False), 152s ('grandchild1', 'root', True), 152s ('child1', 'child2', False), 152s ('root', 'disjoint', False), 152s ] 152s ) 152s def test_descendant_of(pygit2_repo, a, b, expected): 152s """ 152s General test for pygit2.Repository.descendant_of(). 152s 152s This test was formerly for a temporary alternative implementation of 152s pygit2.Repository.descendant_of() in our GitUbuntuRepository wrapper for 152s use until we updated our pinning to use a newer version of pygit2 that 152s included the pygit2.Repository.descendant_of() method. After the pinning 152s was removed and this implementation replacement took place, we kept the 152s test to ensure that actual behaviour did not change. 152s 152s This unit tests validate_upload_tag() for various parameterized cases. The 152s paramater sets assume the repository structure encoded in the Repo() call 152s below. 152s 152s :param pygit2.Repository pygit2_repo: fixture providing a temporary 152s pygit2.Repository instance to use 152s :param str a: tag name of the first commit to pass to descendant_of() 152s :param str b: tag name of the second commit to pass to descendant_of() 152s :param bool expected: the expected result of descendant_of() 152s """ 152s Repo( 152s # Unique message parameters are used in each entry here in order to 152s # ensure that otherwise-identical commits do not end up being the same 152s # commit (with the same hash, etc). 152s commits=[ 152s Commit(name='root', message='1'), 152s Commit(name='child1', parents=[Placeholder('root')], message='2'), 152s Commit(name='child2', parents=[Placeholder('root')], message='3'), 152s Commit( 152s name='grandchild1', 152s parents=[Placeholder('child1')], 152s message='4' 152s ), 152s Commit(name='disjoint', message='5'), 152s ], 152s tags={ 152s 'root': Placeholder('root'), 152s 'child1': Placeholder('child1'), 152s 'child2': Placeholder('child2'), 152s 'grandchild1': Placeholder('grandchild1'), 152s 'disjoint': Placeholder('disjoint'), 152s } 152s > ).write(pygit2_repo) 152s 152s gitubuntu/git_repository_test.py:1099: 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s 152s self = 152s repo = pygit2.Repository('/tmp/tmp4m_isu8n/.git/'), record = {} 152s 152s def write(self, repo, record=None): 152s replace_placeholders(self) 152s record = record or dict() 152s written_commits = [ 152s commit.write(repo=repo, record=record) 152s for commit 152s in self.commit_list 152s ] 152s for name, target in self.branches.items(): 152s repo.create_branch( 152s name, 152s repo.get(target.write(repo)).peel(pygit2.Commit), 152s ) 152s for name, target in self.tags.items(): 152s repo.create_tag( 152s name, 152s target.write(repo), 152s > pygit2.GIT_OBJ_COMMIT, 152s self.tagger.signature, 152s 'Tag message', 152s ) 152s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 152s 152s gitubuntu/repo_builder.py:389: AttributeError 152s __________________ test_descendant_of[grandchild1-root-True] ___________________ 152s 152s pygit2_repo = pygit2.Repository('/tmp/tmp6o4t3thx/.git/'), a = 'grandchild1' 152s b = 'root', expected = True 152s 152s @pytest.mark.parametrize(['a', 'b', 'expected'], 152s [ 152s ('root', 'root', False), 152s ('child1', 'root', True), 152s ('root', 'child1', False), 152s ('grandchild1', 'root', True), 152s ('child1', 'child2', False), 152s ('root', 'disjoint', False), 152s ] 152s ) 152s def test_descendant_of(pygit2_repo, a, b, expected): 152s """ 152s General test for pygit2.Repository.descendant_of(). 152s 152s This test was formerly for a temporary alternative implementation of 152s pygit2.Repository.descendant_of() in our GitUbuntuRepository wrapper for 152s use until we updated our pinning to use a newer version of pygit2 that 152s included the pygit2.Repository.descendant_of() method. After the pinning 152s was removed and this implementation replacement took place, we kept the 152s test to ensure that actual behaviour did not change. 152s 152s This unit tests validate_upload_tag() for various parameterized cases. The 152s paramater sets assume the repository structure encoded in the Repo() call 152s below. 152s 152s :param pygit2.Repository pygit2_repo: fixture providing a temporary 152s pygit2.Repository instance to use 152s :param str a: tag name of the first commit to pass to descendant_of() 152s :param str b: tag name of the second commit to pass to descendant_of() 152s :param bool expected: the expected result of descendant_of() 152s """ 152s Repo( 152s # Unique message parameters are used in each entry here in order to 152s # ensure that otherwise-identical commits do not end up being the same 152s # commit (with the same hash, etc). 152s commits=[ 152s Commit(name='root', message='1'), 152s Commit(name='child1', parents=[Placeholder('root')], message='2'), 152s Commit(name='child2', parents=[Placeholder('root')], message='3'), 152s Commit( 152s name='grandchild1', 152s parents=[Placeholder('child1')], 152s message='4' 152s ), 152s Commit(name='disjoint', message='5'), 152s ], 152s tags={ 152s 'root': Placeholder('root'), 152s 'child1': Placeholder('child1'), 152s 'child2': Placeholder('child2'), 152s 'grandchild1': Placeholder('grandchild1'), 152s 'disjoint': Placeholder('disjoint'), 152s } 152s > ).write(pygit2_repo) 152s 152s gitubuntu/git_repository_test.py:1099: 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s 152s self = 152s repo = pygit2.Repository('/tmp/tmp6o4t3thx/.git/'), record = {} 152s 152s def write(self, repo, record=None): 152s replace_placeholders(self) 152s record = record or dict() 152s written_commits = [ 152s commit.write(repo=repo, record=record) 152s for commit 152s in self.commit_list 152s ] 152s for name, target in self.branches.items(): 152s repo.create_branch( 152s name, 152s repo.get(target.write(repo)).peel(pygit2.Commit), 152s ) 152s for name, target in self.tags.items(): 152s repo.create_tag( 152s name, 152s target.write(repo), 152s > pygit2.GIT_OBJ_COMMIT, 152s self.tagger.signature, 152s 'Tag message', 152s ) 152s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 152s 152s gitubuntu/repo_builder.py:389: AttributeError 152s ___________________ test_descendant_of[child1-child2-False] ____________________ 152s 152s pygit2_repo = pygit2.Repository('/tmp/tmpj89w07zt/.git/'), a = 'child1' 152s b = 'child2', expected = False 152s 152s @pytest.mark.parametrize(['a', 'b', 'expected'], 152s [ 152s ('root', 'root', False), 152s ('child1', 'root', True), 152s ('root', 'child1', False), 152s ('grandchild1', 'root', True), 152s ('child1', 'child2', False), 152s ('root', 'disjoint', False), 152s ] 152s ) 152s def test_descendant_of(pygit2_repo, a, b, expected): 152s """ 152s General test for pygit2.Repository.descendant_of(). 152s 152s This test was formerly for a temporary alternative implementation of 152s pygit2.Repository.descendant_of() in our GitUbuntuRepository wrapper for 152s use until we updated our pinning to use a newer version of pygit2 that 152s included the pygit2.Repository.descendant_of() method. After the pinning 152s was removed and this implementation replacement took place, we kept the 152s test to ensure that actual behaviour did not change. 152s 152s This unit tests validate_upload_tag() for various parameterized cases. The 152s paramater sets assume the repository structure encoded in the Repo() call 152s below. 152s 152s :param pygit2.Repository pygit2_repo: fixture providing a temporary 152s pygit2.Repository instance to use 152s :param str a: tag name of the first commit to pass to descendant_of() 152s :param str b: tag name of the second commit to pass to descendant_of() 152s :param bool expected: the expected result of descendant_of() 152s """ 152s Repo( 152s # Unique message parameters are used in each entry here in order to 152s # ensure that otherwise-identical commits do not end up being the same 152s # commit (with the same hash, etc). 152s commits=[ 152s Commit(name='root', message='1'), 152s Commit(name='child1', parents=[Placeholder('root')], message='2'), 152s Commit(name='child2', parents=[Placeholder('root')], message='3'), 152s Commit( 152s name='grandchild1', 152s parents=[Placeholder('child1')], 152s message='4' 152s ), 152s Commit(name='disjoint', message='5'), 152s ], 152s tags={ 152s 'root': Placeholder('root'), 152s 'child1': Placeholder('child1'), 152s 'child2': Placeholder('child2'), 152s 'grandchild1': Placeholder('grandchild1'), 152s 'disjoint': Placeholder('disjoint'), 152s } 152s > ).write(pygit2_repo) 152s 152s gitubuntu/git_repository_test.py:1099: 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s 152s self = 152s repo = pygit2.Repository('/tmp/tmpj89w07zt/.git/'), record = {} 152s 152s def write(self, repo, record=None): 152s replace_placeholders(self) 152s record = record or dict() 152s written_commits = [ 152s commit.write(repo=repo, record=record) 152s for commit 152s in self.commit_list 152s ] 152s for name, target in self.branches.items(): 152s repo.create_branch( 152s name, 152s repo.get(target.write(repo)).peel(pygit2.Commit), 152s ) 152s for name, target in self.tags.items(): 152s repo.create_tag( 152s name, 152s target.write(repo), 152s > pygit2.GIT_OBJ_COMMIT, 152s self.tagger.signature, 152s 'Tag message', 152s ) 152s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 152s 152s gitubuntu/repo_builder.py:389: AttributeError 152s ___________________ test_descendant_of[root-disjoint-False] ____________________ 152s 152s pygit2_repo = pygit2.Repository('/tmp/tmpmnewzflk/.git/'), a = 'root' 152s b = 'disjoint', expected = False 152s 152s @pytest.mark.parametrize(['a', 'b', 'expected'], 152s [ 152s ('root', 'root', False), 152s ('child1', 'root', True), 152s ('root', 'child1', False), 152s ('grandchild1', 'root', True), 152s ('child1', 'child2', False), 152s ('root', 'disjoint', False), 152s ] 152s ) 152s def test_descendant_of(pygit2_repo, a, b, expected): 152s """ 152s General test for pygit2.Repository.descendant_of(). 152s 152s This test was formerly for a temporary alternative implementation of 152s pygit2.Repository.descendant_of() in our GitUbuntuRepository wrapper for 152s use until we updated our pinning to use a newer version of pygit2 that 152s included the pygit2.Repository.descendant_of() method. After the pinning 152s was removed and this implementation replacement took place, we kept the 152s test to ensure that actual behaviour did not change. 152s 152s This unit tests validate_upload_tag() for various parameterized cases. The 152s paramater sets assume the repository structure encoded in the Repo() call 152s below. 152s 152s :param pygit2.Repository pygit2_repo: fixture providing a temporary 152s pygit2.Repository instance to use 152s :param str a: tag name of the first commit to pass to descendant_of() 152s :param str b: tag name of the second commit to pass to descendant_of() 152s :param bool expected: the expected result of descendant_of() 152s """ 152s Repo( 152s # Unique message parameters are used in each entry here in order to 152s # ensure that otherwise-identical commits do not end up being the same 152s # commit (with the same hash, etc). 152s commits=[ 152s Commit(name='root', message='1'), 152s Commit(name='child1', parents=[Placeholder('root')], message='2'), 152s Commit(name='child2', parents=[Placeholder('root')], message='3'), 152s Commit( 152s name='grandchild1', 152s parents=[Placeholder('child1')], 152s message='4' 152s ), 152s Commit(name='disjoint', message='5'), 152s ], 152s tags={ 152s 'root': Placeholder('root'), 152s 'child1': Placeholder('child1'), 152s 'child2': Placeholder('child2'), 152s 'grandchild1': Placeholder('grandchild1'), 152s 'disjoint': Placeholder('disjoint'), 152s } 152s > ).write(pygit2_repo) 152s 152s gitubuntu/git_repository_test.py:1099: 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s 152s self = 152s repo = pygit2.Repository('/tmp/tmpmnewzflk/.git/'), record = {} 152s 152s def write(self, repo, record=None): 152s replace_placeholders(self) 152s record = record or dict() 152s written_commits = [ 152s commit.write(repo=repo, record=record) 152s for commit 152s in self.commit_list 152s ] 152s for name, target in self.branches.items(): 152s repo.create_branch( 152s name, 152s repo.get(target.write(repo)).peel(pygit2.Commit), 152s ) 152s for name, target in self.tags.items(): 152s repo.create_tag( 152s name, 152s target.write(repo), 152s > pygit2.GIT_OBJ_COMMIT, 152s self.tagger.signature, 152s 'Tag message', 152s ) 152s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 152s 152s gitubuntu/repo_builder.py:389: AttributeError 152s _______________________________ test_create_tag ________________________________ 152s 152s repo = 152s 152s def test_create_tag(repo): 152s """create_tag() should create a tag 152s 152s :param GitUbuntuRepository repo: fixture providing a temporary 152s GitUbuntuRepository instance to use 152s """ 152s Repo( 152s commits=[Commit(name='root')], 152s tags={'root': Placeholder('root')}, 152s > ).write(repo.raw_repo) 152s 152s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository_test.py:1127: 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s 152s self = 152s repo = pygit2.Repository('/tmp/tmpeiced3yh/.git/'), record = {} 152s 152s def write(self, repo, record=None): 152s replace_placeholders(self) 152s record = record or dict() 152s written_commits = [ 152s commit.write(repo=repo, record=record) 152s for commit 152s in self.commit_list 152s ] 152s for name, target in self.branches.items(): 152s repo.create_branch( 152s name, 152s repo.get(target.write(repo)).peel(pygit2.Commit), 152s ) 152s for name, target in self.tags.items(): 152s repo.create_tag( 152s name, 152s target.write(repo), 152s > pygit2.GIT_OBJ_COMMIT, 152s self.tagger.signature, 152s 'Tag message', 152s ) 152s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 152s 152s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 152s __________________________ test_get_all_reimport_tags __________________________ 152s 152s repo = 152s 152s def test_get_all_reimport_tags(repo): 152s """get_all_reimport_tags() should return only matching reimport tags 152s 152s :param GitUbuntuRepository repo: fixture providing a temporary 152s GitUbuntuRepository instance to use 152s """ 152s Repo( 152s commits=[Commit(name='root')], 152s tags={ 152s 'importer/reimport/import/1/0': Placeholder('root'), 152s 'importer/reimport/import/1/1': Placeholder('root'), 152s 152s # This entry must not be identified as one of version 1's reimport 152s # tags, even though it shares the same base prefix. 152s 'importer/reimport/import/11/0': Placeholder('root'), 152s }, 152s > ).write(repo.raw_repo) 152s 152s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository_test.py:1165: 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s 152s self = 152s repo = pygit2.Repository('/tmp/tmp_9656sak/.git/'), record = {} 152s 152s def write(self, repo, record=None): 152s replace_placeholders(self) 152s record = record or dict() 152s written_commits = [ 152s commit.write(repo=repo, record=record) 152s for commit 152s in self.commit_list 152s ] 152s for name, target in self.branches.items(): 152s repo.create_branch( 152s name, 152s repo.get(target.write(repo)).peel(pygit2.Commit), 152s ) 152s for name, target in self.tags.items(): 152s repo.create_tag( 152s name, 152s target.write(repo), 152s > pygit2.GIT_OBJ_COMMIT, 152s self.tagger.signature, 152s 'Tag message', 152s ) 152s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 152s 152s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 152s ______________________________ test_get_head_info ______________________________ 152s 152s repo = 152s 152s def test_get_head_info(repo): 152s """get_head_info() extracts expected commit and version info from the head 152s commit 152s """ 152s Repo( 152s commits=[ 152s Commit(name='foo', tree=SourceTree(source=Source())), 152s ], 152s branches={ 152s 'importer/ubuntu/foo': Placeholder('foo'), 152s 'importer/debian/bar': Placeholder('foo'), 152s 'other/ubuntu/baz': Placeholder('foo'), 152s }, 152s ).write(repo.raw_repo) 152s foo_commit_id = ( 152s repo.raw_repo 152s .lookup_reference('refs/heads/importer/ubuntu/foo') 152s .peel(pygit2.Commit).id 152s ) 152s > assert repo.get_head_info('ubuntu', 'importer') == { 152s 'importer/ubuntu/foo': HeadInfoItem( 152s version='1-1', 152s commit_time=0, 152s commit_id=foo_commit_id, 152s ), 152s } 152s 152s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository_test.py:1193: 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:1952: in get_head_info 152s self.get_changelog_versions_from_treeish(str(head.peel().id)) 152s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:1888: in get_changelog_versions_from_treeish 152s changelog = self.get_changelog_from_treeish(treeish_string) 152s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 152s return Changelog.from_treeish( 152s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:569: in from_treeish 152s blob = follow_symlinks_to_blob( 152s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 152s return _follow_symlinks_to_blob( 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s 152s repo = pygit2.Repository('/tmp/tmp9b35ogxu/.git/') 152s top_tree_object = 152s search_path = 'debian/changelog' 152s _rel_tree = 152s _rel_path = '' 152s 152s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 152s _rel_tree=None, _rel_path='' 152s ): 152s '''Recursively follow a path down a tree, following symlinks, to find blob 152s 152s repo: pygit2.Repository object 152s top_tree: pygit2.Tree object of the top of the tree structure 152s search_path: '/'-separated path string of blob to find 152s _rel_tree: (internal) which tree to look further into 152s _rel_path: (internal) the path we are in so far 152s ''' 152s 152s NORMAL_BLOB_MODES = set([ 152s pygit2.GIT_FILEMODE_BLOB, 152s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 152s ]) 152s 152s _rel_tree = _rel_tree or top_tree_object 152s head, tail = posixpath.split(search_path) 152s 152s # A traditional functional split would put a single entry in head with tail 152s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 152s # to make it appear to have traditional semantics. 152s if not head: 152s head = tail 152s tail = None 152s 152s entry = _rel_tree[head] 152s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 152s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 152s 152s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:68: AttributeError 152s ----------------------------- Captured stdout call ----------------------------- 152s dpkg-source: info: using source format '3.0 (quilt)' 152s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 152s dpkg-source: info: using source format '3.0 (quilt)' 152s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 152s dpkg-source: info: using source format '3.0 (quilt)' 152s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 152s dpkg-source: info: using source format '3.0 (quilt)' 152s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 152s ----------------------------- Captured stderr call ----------------------------- 152s dpkg-source: warning: missing information for output field Standards-Version 152s dpkg-source: warning: missing information for output field Standards-Version 152s dpkg-source: warning: missing information for output field Standards-Version 152s dpkg-source: warning: missing information for output field Standards-Version 152s _ test_import_unapplied_spi_tags[input_repo0-expected_output_refs0-validation_repo_delta0-validation_repo_expected_identical_refs0-True] _ 152s 152s get_import_commit_msg_mock = 152s get_import_tag_msg_mock = 152s repo = 152s input_repo = 152s 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'] 152s validation_repo_delta = {'update_branches': {'importer/ubuntu/trusty': }} 152s validation_repo_expected_identical_refs = ['refs/heads/importer/ubuntu/trusty-proposed', 'refs/heads/importer/ubuntu/trusty', 'refs/tags/importer/import/1-1'] 152s reuse = True 152s 152s @pytest.mark.parametrize( 152s [ 152s 'input_repo', 152s 'expected_output_refs', 152s 'validation_repo_delta', 152s 'validation_repo_expected_identical_refs', 152s 'reuse', 152s ], 152s [ 152s # 1) An existing import tag (or reimport tag) with the same Git tree 152s # - Reuse import tag 152s pytest.param( 152s # input_repo: 152s repo_builder.Repo( 152s commits=[Commit.from_spec(name='import')], 152s branches={ 152s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 152s }, 152s tags={'importer/import/1-1': Placeholder('import')}, 152s ), 152s # expected_output_refs: 152s [ 152s 'refs/heads/do-not-push', 152s 'refs/tags/importer/upstream/ubuntu/1.gz', 152s 'refs/heads/importer/importer/ubuntu/dsc', 152s 'refs/heads/importer/importer/ubuntu/pristine-tar', 152s ], 152s # validation_repo_delta: 152s { 152s 'update_branches': { 152s 'importer/ubuntu/trusty': Placeholder('import'), 152s }, 152s }, 152s # validation_repo_expected_identical_refs: 152s [ 152s 'refs/heads/importer/ubuntu/trusty-proposed', 152s 'refs/heads/importer/ubuntu/trusty', 152s 'refs/tags/importer/import/1-1', 152s ], 152s # reuse: 152s True, 152s ), 152s pytest.param( 152s # input_repo: 152s repo_builder.Repo( 152s commits=[ 152s Commit.from_spec( 152s name='import', 152s mutate='import tag contents', 152s ), 152s Commit.from_spec(name='reimport'), 152s ], 152s branches={ 152s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 152s }, 152s tags={ 152s 'importer/import/1-1': Placeholder('import'), 152s 'importer/reimport/import/1-1/0': Placeholder('import'), 152s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 152s }, 152s ), 152s # expected_output_refs: 152s [ 152s 'refs/heads/do-not-push', 152s 'refs/tags/importer/upstream/ubuntu/1.gz', 152s 'refs/heads/importer/importer/ubuntu/dsc', 152s 'refs/heads/importer/importer/ubuntu/pristine-tar', 152s ], 152s # validation_repo_delta: 152s { 152s 'update_branches': { 152s 'importer/ubuntu/trusty': Placeholder('reimport'), 152s }, 152s }, 152s # validation_repo_expected_identical_refs: 152s [ 152s 'refs/heads/importer/ubuntu/trusty-proposed', 152s 'refs/heads/importer/ubuntu/trusty', 152s 'refs/tags/importer/import/1-1', 152s 'refs/tags/importer/reimport/import/1-1/0', 152s 'refs/tags/importer/reimport/import/1-1/1', 152s ], 152s # reuse: 152s True, 152s ), 152s 152s # 2) An existing import tag with a different Git tree and an existing 152s # upload tag with the same Git tree 152s # - Reuse upload tag, create reimport tag 152s pytest.param( 152s # input_repo: 152s repo_builder.Repo( 152s commits=[ 152s Commit.from_spec( 152s name='import', 152s mutate='The import tag contents', 152s ), 152s Commit.from_spec(name='upload'), 152s ], 152s branches={ 152s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 152s }, 152s tags={ 152s 'importer/import/1-1': Placeholder('import'), 152s 'importer/upload/1-1': Placeholder('upload'), 152s }, 152s ), 152s # expected_output_refs: 152s [ 152s 'refs/heads/do-not-push', 152s 'refs/tags/importer/upstream/ubuntu/1.gz', 152s 'refs/heads/importer/importer/ubuntu/dsc', 152s 'refs/heads/importer/importer/ubuntu/pristine-tar', 152s 'refs/notes/importer/importer', 152s ], 152s # validation_repo_delta: 152s { 152s 'update_tags': { 152s 'importer/reimport/import/1-1/0': Placeholder('import'), 152s 'importer/reimport/import/1-1/1': Placeholder('upload'), 152s }, 152s 'update_branches': { 152s 'importer/ubuntu/trusty': Placeholder('upload'), 152s }, 152s }, 152s # validation_repo_expected_identical_refs: 152s [ 152s 'refs/heads/importer/ubuntu/trusty-proposed', 152s 'refs/heads/importer/ubuntu/trusty', 152s 'refs/tags/importer/import/1-1', 152s 'refs/tags/importer/upload/1-1', 152s 'refs/tags/importer/reimport/import/1-1/0', 152s 'refs/tags/importer/reimport/import/1-1/1', 152s ], 152s # reuse: 152s True, 152s ), 152s 152s # 3) An existing import tag with a different Git tree and an existing 152s # upload tag with a different Git tree 152s # - Create reimport tag 152s pytest.param( 152s # input_repo: 152s repo_builder.Repo( 152s commits=[ 152s Commit.from_spec( 152s name='import', 152s mutate='The import tag contents', 152s ), 152s Commit.from_spec( 152s name='upload', 152s mutate='The upload tag contents', 152s ), 152s ], 152s branches={ 152s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 152s }, 152s tags={ 152s 'importer/import/1-1': Placeholder('import'), 152s 'importer/upload/1-1': Placeholder('upload'), 152s }, 152s ), 152s # expected_output_refs: 152s [ 152s 'refs/heads/do-not-push', 152s 'refs/tags/importer/upstream/ubuntu/1.gz', 152s 'refs/heads/importer/importer/ubuntu/dsc', 152s 'refs/heads/importer/importer/ubuntu/pristine-tar', 152s 'refs/notes/importer/changelog', 152s 'refs/notes/importer/importer', 152s ], 152s # validation_repo_delta: 152s { 152s 'add_commits': [Commit.from_spec( 152s name='reimport', 152s message='Test commit (new)', 152s )], 152s 'update_tags': { 152s 'importer/reimport/import/1-1/0': Placeholder('import'), 152s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 152s }, 152s 'update_branches': { 152s 'importer/ubuntu/trusty': Placeholder('reimport'), 152s }, 152s }, 152s # validation_repo_expected_identical_refs: 152s [ 152s 'refs/heads/importer/ubuntu/trusty-proposed', 152s 'refs/heads/importer/ubuntu/trusty', 152s 'refs/tags/importer/import/1-1', 152s 'refs/tags/importer/upload/1-1', 152s 'refs/tags/importer/reimport/import/1-1/0', 152s 'refs/tags/importer/reimport/import/1-1/1', 152s ], 152s # reuse: 152s False, 152s ), 152s 152s # 4) An existing import tag with a different Git tree and no upload tag 152s # - Create reimport tag 152s pytest.param( 152s # input_repo: 152s repo_builder.Repo( 152s commits=[ 152s Commit.from_spec( 152s name='import', 152s mutate='The import tag contents', 152s ), 152s ], 152s branches={ 152s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 152s }, 152s tags={'importer/import/1-1': Placeholder('import')}, 152s ), 152s # expected_output_refs: 152s [ 152s 'refs/heads/do-not-push', 152s 'refs/tags/importer/upstream/ubuntu/1.gz', 152s 'refs/heads/importer/importer/ubuntu/dsc', 152s 'refs/heads/importer/importer/ubuntu/pristine-tar', 152s 'refs/notes/importer/changelog', 152s 'refs/notes/importer/importer', 152s ], 152s # validation_repo_delta: 152s { 152s 'add_commits': [Commit.from_spec( 152s name='reimport', 152s message='Test commit (new)', 152s )], 152s 'update_tags': { 152s 'importer/reimport/import/1-1/0': Placeholder('import'), 152s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 152s }, 152s 'update_branches': { 152s 'importer/ubuntu/trusty': Placeholder('reimport'), 152s }, 152s }, 152s # validation_repo_expected_identical_refs: 152s [ 152s 'refs/heads/importer/ubuntu/trusty-proposed', 152s 'refs/heads/importer/ubuntu/trusty', 152s 'refs/tags/importer/import/1-1', 152s 'refs/tags/importer/reimport/import/1-1/0', 152s 'refs/tags/importer/reimport/import/1-1/1', 152s ], 152s # reuse: 152s False, 152s ), 152s 152s # 5) No import tag and an existing upload tag with the same Git tree 152s # - Reuse upload tag, create import tag 152s pytest.param( 152s # input_repo: 152s repo_builder.Repo( 152s commits=[Commit.from_spec(name='upload')], 152s tags={'importer/upload/1-1': Placeholder('upload')}, 152s ), 152s # expected_output_refs: 152s [ 152s 'refs/heads/do-not-push', 152s 'refs/tags/importer/upstream/ubuntu/1.gz', 152s 'refs/heads/importer/importer/ubuntu/dsc', 152s 'refs/heads/importer/importer/ubuntu/pristine-tar', 152s 'refs/notes/importer/importer', 152s ], 152s # validation_repo_delta: 152s { 152s 'update_tags': { 152s 'importer/import/1-1': Placeholder('upload'), 152s }, 152s 'update_branches': { 152s 'importer/ubuntu/trusty': Placeholder('upload'), 152s }, 152s }, 152s # validation_repo_expected_identical_refs: 152s [ 152s 'refs/heads/importer/ubuntu/trusty', 152s 'refs/tags/importer/import/1-1', 152s 'refs/tags/importer/upload/1-1', 152s ], 152s # reuse: 152s True, 152s ), 152s 152s # 6) No import tag and an existing upload tag with a different Git tree 152s # - Create import tag 152s pytest.param( 152s # input_repo: 152s repo_builder.Repo( 152s commits=[ 152s Commit.from_spec( 152s name='upload', 152s mutate='The upload tag contents', 152s ), 152s ], 152s tags={'importer/upload/1-1': Placeholder('upload')}, 152s ), 152s # expected_output_refs: 152s [ 152s 'refs/heads/do-not-push', 152s 'refs/tags/importer/upstream/ubuntu/1.gz', 152s 'refs/heads/importer/importer/ubuntu/dsc', 152s 'refs/heads/importer/importer/ubuntu/pristine-tar', 152s 'refs/notes/importer/changelog', 152s 'refs/notes/importer/importer', 152s ], 152s # validation_repo_delta: 152s { 152s 'add_commits': [ 152s Commit.from_spec( 152s name='publish', 152s message='Test commit (new)', 152s ), 152s ], 152s 'update_tags': { 152s 'importer/import/1-1': Placeholder('publish'), 152s }, 152s 'update_branches': { 152s 'importer/ubuntu/trusty': Placeholder('publish'), 152s }, 152s }, 152s # validation_repo_expected_identical_refs: 152s [ 152s 'refs/heads/importer/ubuntu/trusty', 152s 'refs/tags/importer/import/1-1', 152s 'refs/tags/importer/upload/1-1', 152s ], 152s # reuse: 152s False, 152s ), 152s 152s # 7) No import tags or upload tags 152s # - Create import tag 152s pytest.param( 152s # input_repo: 152s repo_builder.Repo(), 152s # expected_output_refs: 152s [ 152s 'refs/heads/do-not-push', 152s 'refs/tags/importer/upstream/ubuntu/1.gz', 152s 'refs/heads/importer/importer/ubuntu/dsc', 152s 'refs/heads/importer/importer/ubuntu/pristine-tar', 152s 'refs/notes/importer/changelog', 152s 'refs/notes/importer/importer', 152s ], 152s # validation_repo_delta: 152s { 152s 'add_commits': [ 152s Commit.from_spec( 152s name='publish', 152s message='Test commit (new)', 152s ), 152s ], 152s 'update_tags': { 152s 'importer/import/1-1': Placeholder('publish'), 152s }, 152s 'update_branches': { 152s 'importer/ubuntu/trusty': Placeholder('publish'), 152s }, 152s }, 152s # validation_repo_expected_identical_refs: 152s [ 152s 'refs/heads/importer/ubuntu/trusty', 152s 'refs/tags/importer/import/1-1' 152s ], 152s # reuse: 152s False, 152s ), 152s ] 152s ) 152s @patch('gitubuntu.importer.get_import_tag_msg') 152s @patch('gitubuntu.importer.get_import_commit_msg') 152s def test_import_unapplied_spi_tags( 152s get_import_commit_msg_mock, 152s get_import_tag_msg_mock, 152s repo, 152s input_repo, 152s expected_output_refs, 152s validation_repo_delta, 152s validation_repo_expected_identical_refs, 152s reuse, 152s ): 152s """Test that unapplied tags are correctly created, adjusted and/or reused 152s 152s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 152s that determines the commit message to use for a given import 152s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 152s that determines the tag message to use for a given import 152s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 152s temporary output repository 152s :param repo_builder.Repo input_repo: input repository data 152s :param list(str) expected_output_refs: refs that must exist in the output 152s repository 152s :param dict validation_repo_delta: how to transform the input 152s repository into a "validation repository", expressed as a dict to 152s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 152s input repository. The validation repository is then used for the 152s purposes of comparison against the output repository. 152s :param list(str) validation_repo_expected_identical_refs: refs that must be 152s identical between the validation repository and the output repository 152s :param bool reuse: if set, the output ref importer/ubuntu/trusty must be 152s one supplied by the input repository (assumed to have a commit message 152s of "Test commit") and not one created by the importer in this run 152s (arranged by this test to have a different commit message) 152s 152s The input repository data is written into the output repository and then a 152s fake non-native source package publication of version 1-1 in the Trusty 152s release pocket is imported into it by calling import_unapplied_spi() 152s directly. expected_output_refs, validation_repo_expected_identical_refs and 152s reuse are then asserted. It is further asserted that no other refs exist in 152s the output repository except for those listed in expected_output_refs and 152s validation_repo_expected_identical_refs. 152s """ 152s # Match the repo_builder objects 152s get_import_tag_msg_mock.return_value = 'Test tag' 152s # Importantly, the following commit message must not be the same as the 152s # commit messages used by the test input repository commits, so that we can 152s # later detect the difference between commits that were already there and 152s # new commits created by the importer for the purposes of asserting the 152s # reuse parameter correctly. 152s get_import_commit_msg_mock.return_value = b'Test commit (new)' 152s 152s > input_repo.write(repo.raw_repo) 152s 152s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_tag_test.py:463: 152s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 152s 152s self = 152s repo = pygit2.Repository('/tmp/tmpclkfw05u/.git/'), record = {} 152s 152s def write(self, repo, record=None): 152s replace_placeholders(self) 152s record = record or dict() 152s written_commits = [ 152s commit.write(repo=repo, record=record) 152s for commit 152s in self.commit_list 152s ] 152s for name, target in self.branches.items(): 152s repo.create_branch( 152s name, 152s repo.get(target.write(repo)).peel(pygit2.Commit), 152s ) 152s for name, target in self.tags.items(): 152s repo.create_tag( 152s name, 152s target.write(repo), 152s > pygit2.GIT_OBJ_COMMIT, 152s self.tagger.signature, 152s 'Tag message', 152s ) 152s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 152s 152s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 152s ----------------------------- Captured stdout call ----------------------------- 152s dpkg-source: info: using source format '3.0 (quilt)' 152s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 152s dpkg-source: info: using source format '3.0 (quilt)' 152s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 152s dpkg-source: info: using source format '3.0 (quilt)' 152s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 152s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 152s ----------------------------- Captured stderr call ----------------------------- 152s dpkg-source: warning: missing information for output field Standards-Version 152s dpkg-source: warning: missing information for output field Standards-Version 152s dpkg-source: warning: missing information for output field Standards-Version 152s _ test_import_unapplied_spi_tags[input_repo1-expected_output_refs1-validation_repo_delta1-validation_repo_expected_identical_refs1-True] _ 152s 152s get_import_commit_msg_mock = 152s get_import_tag_msg_mock = 152s repo = 152s input_repo = 152s 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'] 152s validation_repo_delta = {'update_branches': {'importer/ubuntu/trusty': }} 152s 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'] 152s reuse = True 152s 152s @pytest.mark.parametrize( 152s [ 152s 'input_repo', 152s 'expected_output_refs', 152s 'validation_repo_delta', 152s 'validation_repo_expected_identical_refs', 152s 'reuse', 152s ], 152s [ 152s # 1) An existing import tag (or reimport tag) with the same Git tree 152s # - Reuse import tag 152s pytest.param( 152s # input_repo: 152s repo_builder.Repo( 152s commits=[Commit.from_spec(name='import')], 152s branches={ 152s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 152s }, 152s tags={'importer/import/1-1': Placeholder('import')}, 152s ), 152s # expected_output_refs: 152s [ 152s 'refs/heads/do-not-push', 152s 'refs/tags/importer/upstream/ubuntu/1.gz', 152s 'refs/heads/importer/importer/ubuntu/dsc', 152s 'refs/heads/importer/importer/ubuntu/pristine-tar', 152s ], 152s # validation_repo_delta: 152s { 152s 'update_branches': { 152s 'importer/ubuntu/trusty': Placeholder('import'), 152s }, 152s }, 152s # validation_repo_expected_identical_refs: 152s [ 152s 'refs/heads/importer/ubuntu/trusty-proposed', 152s 'refs/heads/importer/ubuntu/trusty', 152s 'refs/tags/importer/import/1-1', 152s ], 152s # reuse: 152s True, 152s ), 152s pytest.param( 152s # input_repo: 152s repo_builder.Repo( 152s commits=[ 152s Commit.from_spec( 152s name='import', 152s mutate='import tag contents', 152s ), 152s Commit.from_spec(name='reimport'), 152s ], 152s branches={ 152s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 152s }, 152s tags={ 152s 'importer/import/1-1': Placeholder('import'), 152s 'importer/reimport/import/1-1/0': Placeholder('import'), 152s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 152s }, 152s ), 152s # expected_output_refs: 152s [ 152s 'refs/heads/do-not-push', 152s 'refs/tags/importer/upstream/ubuntu/1.gz', 152s 'refs/heads/importer/importer/ubuntu/dsc', 152s 'refs/heads/importer/importer/ubuntu/pristine-tar', 152s ], 152s # validation_repo_delta: 152s { 152s 'update_branches': { 152s 'importer/ubuntu/trusty': Placeholder('reimport'), 152s }, 152s }, 152s # validation_repo_expected_identical_refs: 152s [ 152s 'refs/heads/importer/ubuntu/trusty-proposed', 152s 'refs/heads/importer/ubuntu/trusty', 152s 'refs/tags/importer/import/1-1', 152s 'refs/tags/importer/reimport/import/1-1/0', 152s 'refs/tags/importer/reimport/import/1-1/1', 152s ], 152s # reuse: 152s True, 152s ), 152s 152s # 2) An existing import tag with a different Git tree and an existing 152s # upload tag with the same Git tree 152s # - Reuse upload tag, create reimport tag 152s pytest.param( 152s # input_repo: 152s repo_builder.Repo( 152s commits=[ 152s Commit.from_spec( 152s name='import', 152s mutate='The import tag contents', 152s ), 152s Commit.from_spec(name='upload'), 152s ], 152s branches={ 152s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 152s }, 152s tags={ 152s 'importer/import/1-1': Placeholder('import'), 152s 'importer/upload/1-1': Placeholder('upload'), 152s }, 152s ), 152s # expected_output_refs: 152s [ 152s 'refs/heads/do-not-push', 152s 'refs/tags/importer/upstream/ubuntu/1.gz', 152s 'refs/heads/importer/importer/ubuntu/dsc', 152s 'refs/heads/importer/importer/ubuntu/pristine-tar', 152s 'refs/notes/importer/importer', 152s ], 152s # validation_repo_delta: 152s { 152s 'update_tags': { 152s 'importer/reimport/import/1-1/0': Placeholder('import'), 152s 'importer/reimport/import/1-1/1': Placeholder('upload'), 152s }, 152s 'update_branches': { 152s 'importer/ubuntu/trusty': Placeholder('upload'), 152s }, 152s }, 152s # validation_repo_expected_identical_refs: 152s [ 152s 'refs/heads/importer/ubuntu/trusty-proposed', 152s 'refs/heads/importer/ubuntu/trusty', 152s 'refs/tags/importer/import/1-1', 152s 'refs/tags/importer/upload/1-1', 152s 'refs/tags/importer/reimport/import/1-1/0', 152s 'refs/tags/importer/reimport/import/1-1/1', 152s ], 152s # reuse: 152s True, 152s ), 152s 152s # 3) An existing import tag with a different Git tree and an existing 152s # upload tag with a different Git tree 152s # - Create reimport tag 152s pytest.param( 152s # input_repo: 152s repo_builder.Repo( 152s commits=[ 152s Commit.from_spec( 152s name='import', 152s mutate='The import tag contents', 152s ), 152s Commit.from_spec( 152s name='upload', 152s mutate='The upload tag contents', 152s ), 152s ], 152s branches={ 152s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 152s }, 152s tags={ 152s 'importer/import/1-1': Placeholder('import'), 152s 'importer/upload/1-1': Placeholder('upload'), 152s }, 152s ), 152s # expected_output_refs: 152s [ 152s 'refs/heads/do-not-push', 152s 'refs/tags/importer/upstream/ubuntu/1.gz', 152s 'refs/heads/importer/importer/ubuntu/dsc', 152s 'refs/heads/importer/importer/ubuntu/pristine-tar', 152s 'refs/notes/importer/changelog', 152s 'refs/notes/importer/importer', 152s ], 152s # validation_repo_delta: 152s { 152s 'add_commits': [Commit.from_spec( 152s name='reimport', 152s message='Test commit (new)', 152s )], 152s 'update_tags': { 152s 'importer/reimport/import/1-1/0': Placeholder('import'), 152s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 152s }, 152s 'update_branches': { 152s 'importer/ubuntu/trusty': Placeholder('reimport'), 152s }, 152s }, 152s # validation_repo_expected_identical_refs: 152s [ 152s 'refs/heads/importer/ubuntu/trusty-proposed', 152s 'refs/heads/importer/ubuntu/trusty', 152s 'refs/tags/importer/import/1-1', 152s 'refs/tags/importer/upload/1-1', 152s 'refs/tags/importer/reimport/import/1-1/0', 152s 'refs/tags/importer/reimport/import/1-1/1', 152s ], 152s # reuse: 152s False, 152s ), 152s 152s # 4) An existing import tag with a different Git tree and no upload tag 152s # - Create reimport tag 152s pytest.param( 152s # input_repo: 152s repo_builder.Repo( 152s commits=[ 152s Commit.from_spec( 152s name='import', 152s mutate='The import tag contents', 152s ), 152s ], 152s branches={ 152s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 152s }, 152s tags={'importer/import/1-1': Placeholder('import')}, 152s ), 152s # expected_output_refs: 152s [ 152s 'refs/heads/do-not-push', 152s 'refs/tags/importer/upstream/ubuntu/1.gz', 152s 'refs/heads/importer/importer/ubuntu/dsc', 152s 'refs/heads/importer/importer/ubuntu/pristine-tar', 152s 'refs/notes/importer/changelog', 152s 'refs/notes/importer/importer', 152s ], 152s # validation_repo_delta: 152s { 152s 'add_commits': [Commit.from_spec( 152s name='reimport', 152s message='Test commit (new)', 152s )], 152s 'update_tags': { 152s 'importer/reimport/import/1-1/0': Placeholder('import'), 152s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 152s }, 152s 'update_branches': { 152s 'importer/ubuntu/trusty': Placeholder('reimport'), 152s }, 152s }, 152s # validation_repo_expected_identical_refs: 152s [ 152s 'refs/heads/importer/ubuntu/trusty-proposed', 152s 'refs/heads/importer/ubuntu/trusty', 152s 'refs/tags/importer/import/1-1', 152s 'refs/tags/importer/reimport/import/1-1/0', 152s 'refs/tags/importer/reimport/import/1-1/1', 152s ], 152s # reuse: 152s False, 152s ), 152s 152s # 5) No import tag and an existing upload tag with the same Git tree 152s # - Reuse upload tag, create import tag 152s pytest.param( 152s # input_repo: 152s repo_builder.Repo( 152s commits=[Commit.from_spec(name='upload')], 152s tags={'importer/upload/1-1': Placeholder('upload')}, 152s ), 152s # expected_output_refs: 152s [ 152s 'refs/heads/do-not-push', 152s 'refs/tags/importer/upstream/ubuntu/1.gz', 152s 'refs/heads/importer/importer/ubuntu/dsc', 152s 'refs/heads/importer/importer/ubuntu/pristine-tar', 152s 'refs/notes/importer/importer', 152s ], 152s # validation_repo_delta: 152s { 152s 'update_tags': { 152s 'importer/import/1-1': Placeholder('upload'), 152s }, 152s 'update_branches': { 152s 'importer/ubuntu/trusty': Placeholder('upload'), 152s }, 152s }, 152s # validation_repo_expected_identical_refs: 152s [ 152s 'refs/heads/importer/ubuntu/trusty', 152s 'refs/tags/importer/import/1-1', 152s 'refs/tags/importer/upload/1-1', 152s ], 152s # reuse: 152s True, 152s ), 152s 152s # 6) No import tag and an existing upload tag with a different Git tree 152s # - Create import tag 152s pytest.param( 152s # input_repo: 152s repo_builder.Repo( 152s commits=[ 152s Commit.from_spec( 152s name='upload', 152s mutate='The upload tag contents', 152s ), 152s ], 152s tags={'importer/upload/1-1': Placeholder('upload')}, 152s ), 152s # expected_output_refs: 152s [ 152s 'refs/heads/do-not-push', 152s 'refs/tags/importer/upstream/ubuntu/1.gz', 152s 'refs/heads/importer/importer/ubuntu/dsc', 152s 'refs/heads/importer/importer/ubuntu/pristine-tar', 152s 'refs/notes/importer/changelog', 152s 'refs/notes/importer/importer', 152s ], 152s # validation_repo_delta: 152s { 152s 'add_commits': [ 152s Commit.from_spec( 152s name='publish', 152s message='Test commit (new)', 152s ), 152s ], 152s 'update_tags': { 152s 'importer/import/1-1': Placeholder('publish'), 152s }, 152s 'update_branches': { 152s 'importer/ubuntu/trusty': Placeholder('publish'), 152s }, 152s }, 152s # validation_repo_expected_identical_refs: 152s [ 152s 'refs/heads/importer/ubuntu/trusty', 152s 'refs/tags/importer/import/1-1', 152s 'refs/tags/importer/upload/1-1', 152s ], 152s # reuse: 152s False, 152s ), 152s 152s # 7) No import tags or upload tags 152s # - Create import tag 152s pytest.param( 152s # input_repo: 152s repo_builder.Repo(), 152s # expected_output_refs: 152s [ 152s 'refs/heads/do-not-push', 152s 'refs/tags/importer/upstream/ubuntu/1.gz', 152s 'refs/heads/importer/importer/ubuntu/dsc', 152s 'refs/heads/importer/importer/ubuntu/pristine-tar', 152s 'refs/notes/importer/changelog', 152s 'refs/notes/importer/importer', 152s ], 152s # validation_repo_delta: 152s { 152s 'add_commits': [ 152s Commit.from_spec( 152s name='publish', 152s message='Test commit (new)', 152s ), 152s ], 152s 'update_tags': { 152s 'importer/import/1-1': Placeholder('publish'), 152s }, 152s 'update_branches': { 152s 'importer/ubuntu/trusty': Placeholder('publish'), 152s }, 152s }, 152s # validation_repo_expected_identical_refs: 152s [ 152s 'refs/heads/importer/ubuntu/trusty', 152s 'refs/tags/importer/import/1-1' 152s ], 152s # reuse: 152s False, 152s ), 152s ] 152s ) 152s @patch('gitubuntu.importer.get_import_tag_msg') 152s @patch('gitubuntu.importer.get_import_commit_msg') 152s def test_import_unapplied_spi_tags( 152s get_import_commit_msg_mock, 152s get_import_tag_msg_mock, 152s repo, 152s input_repo, 152s expected_output_refs, 152s validation_repo_delta, 152s validation_repo_expected_identical_refs, 152s reuse, 152s ): 152s """Test that unapplied tags are correctly created, adjusted and/or reused 152s 152s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 152s that determines the commit message to use for a given import 152s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 152s that determines the tag message to use for a given import 152s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 152s temporary output repository 152s :param repo_builder.Repo input_repo: input repository data 152s :param list(str) expected_output_refs: refs that must exist in the output 152s repository 152s :param dict validation_repo_delta: how to transform the input 152s repository into a "validation repository", expressed as a dict to 152s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 152s input repository. The validation repository is then used for the 152s purposes of comparison against the output repository. 152s :param list(str) validation_repo_expected_identical_refs: refs that must be 152s identical between the validation repository and the output repository 152s :param bool reuse: if set, the output ref importer/ubuntu/trusty must be 152s one supplied by the input repository (assumed to have a commit message 152s of "Test commit") and not one created by the importer in this run 152s (arranged by this test to have a different commit message) 152s 152s The input repository data is written into the output repository and then a 152s fake non-native source package publication of version 1-1 in the Trusty 152s release pocket is imported into it by calling import_unapplied_spi() 152s directly. expected_output_refs, validation_repo_expected_identical_refs and 152s reuse are then asserted. It is further asserted that no other refs exist in 152s the output repository except for those listed in expected_output_refs and 152s validation_repo_expected_identical_refs. 152s """ 152s # Match the repo_builder objects 152s get_import_tag_msg_mock.return_value = 'Test tag' 152s # Importantly, the following commit message must not be the same as the 153s # commit messages used by the test input repository commits, so that we can 153s # later detect the difference between commits that were already there and 153s # new commits created by the importer for the purposes of asserting the 153s # reuse parameter correctly. 153s get_import_commit_msg_mock.return_value = b'Test commit (new)' 153s 153s > input_repo.write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_tag_test.py:463: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmpbjx0j2me/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s _ test_import_unapplied_spi_tags[input_repo2-expected_output_refs2-validation_repo_delta2-validation_repo_expected_identical_refs2-True] _ 153s 153s get_import_commit_msg_mock = 153s get_import_tag_msg_mock = 153s repo = 153s input_repo = 153s 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'] 153s validation_repo_delta = {'update_branches': {'importer/ubuntu/trusty': }, 'update...t at 0x7b5155a7ed50>, 'importer/reimport/import/1-1/1': }} 153s 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'] 153s reuse = True 153s 153s @pytest.mark.parametrize( 153s [ 153s 'input_repo', 153s 'expected_output_refs', 153s 'validation_repo_delta', 153s 'validation_repo_expected_identical_refs', 153s 'reuse', 153s ], 153s [ 153s # 1) An existing import tag (or reimport tag) with the same Git tree 153s # - Reuse import tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[Commit.from_spec(name='import')], 153s branches={ 153s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 153s }, 153s tags={'importer/import/1-1': Placeholder('import')}, 153s ), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s ], 153s # validation_repo_delta: 153s { 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('import'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty-proposed', 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s ], 153s # reuse: 153s True, 153s ), 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[ 153s Commit.from_spec( 153s name='import', 153s mutate='import tag contents', 153s ), 153s Commit.from_spec(name='reimport'), 153s ], 153s branches={ 153s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 153s }, 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/reimport/import/1-1/0': Placeholder('import'), 153s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 153s }, 153s ), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s ], 153s # validation_repo_delta: 153s { 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('reimport'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty-proposed', 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s ], 153s # reuse: 153s True, 153s ), 153s 153s # 2) An existing import tag with a different Git tree and an existing 153s # upload tag with the same Git tree 153s # - Reuse upload tag, create reimport tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[ 153s Commit.from_spec( 153s name='import', 153s mutate='The import tag contents', 153s ), 153s Commit.from_spec(name='upload'), 153s ], 153s branches={ 153s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 153s }, 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/upload/1-1': Placeholder('upload'), 153s }, 153s ), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s 'refs/notes/importer/importer', 153s ], 153s # validation_repo_delta: 153s { 153s 'update_tags': { 153s 'importer/reimport/import/1-1/0': Placeholder('import'), 153s 'importer/reimport/import/1-1/1': Placeholder('upload'), 153s }, 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('upload'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty-proposed', 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/upload/1-1', 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s ], 153s # reuse: 153s True, 153s ), 153s 153s # 3) An existing import tag with a different Git tree and an existing 153s # upload tag with a different Git tree 153s # - Create reimport tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[ 153s Commit.from_spec( 153s name='import', 153s mutate='The import tag contents', 153s ), 153s Commit.from_spec( 153s name='upload', 153s mutate='The upload tag contents', 153s ), 153s ], 153s branches={ 153s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 153s }, 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/upload/1-1': Placeholder('upload'), 153s }, 153s ), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s 'refs/notes/importer/changelog', 153s 'refs/notes/importer/importer', 153s ], 153s # validation_repo_delta: 153s { 153s 'add_commits': [Commit.from_spec( 153s name='reimport', 153s message='Test commit (new)', 153s )], 153s 'update_tags': { 153s 'importer/reimport/import/1-1/0': Placeholder('import'), 153s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 153s }, 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('reimport'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty-proposed', 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/upload/1-1', 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s ], 153s # reuse: 153s False, 153s ), 153s 153s # 4) An existing import tag with a different Git tree and no upload tag 153s # - Create reimport tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[ 153s Commit.from_spec( 153s name='import', 153s mutate='The import tag contents', 153s ), 153s ], 153s branches={ 153s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 153s }, 153s tags={'importer/import/1-1': Placeholder('import')}, 153s ), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s 'refs/notes/importer/changelog', 153s 'refs/notes/importer/importer', 153s ], 153s # validation_repo_delta: 153s { 153s 'add_commits': [Commit.from_spec( 153s name='reimport', 153s message='Test commit (new)', 153s )], 153s 'update_tags': { 153s 'importer/reimport/import/1-1/0': Placeholder('import'), 153s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 153s }, 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('reimport'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty-proposed', 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s ], 153s # reuse: 153s False, 153s ), 153s 153s # 5) No import tag and an existing upload tag with the same Git tree 153s # - Reuse upload tag, create import tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[Commit.from_spec(name='upload')], 153s tags={'importer/upload/1-1': Placeholder('upload')}, 153s ), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s 'refs/notes/importer/importer', 153s ], 153s # validation_repo_delta: 153s { 153s 'update_tags': { 153s 'importer/import/1-1': Placeholder('upload'), 153s }, 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('upload'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/upload/1-1', 153s ], 153s # reuse: 153s True, 153s ), 153s 153s # 6) No import tag and an existing upload tag with a different Git tree 153s # - Create import tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[ 153s Commit.from_spec( 153s name='upload', 153s mutate='The upload tag contents', 153s ), 153s ], 153s tags={'importer/upload/1-1': Placeholder('upload')}, 153s ), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s 'refs/notes/importer/changelog', 153s 'refs/notes/importer/importer', 153s ], 153s # validation_repo_delta: 153s { 153s 'add_commits': [ 153s Commit.from_spec( 153s name='publish', 153s message='Test commit (new)', 153s ), 153s ], 153s 'update_tags': { 153s 'importer/import/1-1': Placeholder('publish'), 153s }, 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('publish'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/upload/1-1', 153s ], 153s # reuse: 153s False, 153s ), 153s 153s # 7) No import tags or upload tags 153s # - Create import tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo(), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s 'refs/notes/importer/changelog', 153s 'refs/notes/importer/importer', 153s ], 153s # validation_repo_delta: 153s { 153s 'add_commits': [ 153s Commit.from_spec( 153s name='publish', 153s message='Test commit (new)', 153s ), 153s ], 153s 'update_tags': { 153s 'importer/import/1-1': Placeholder('publish'), 153s }, 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('publish'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1' 153s ], 153s # reuse: 153s False, 153s ), 153s ] 153s ) 153s @patch('gitubuntu.importer.get_import_tag_msg') 153s @patch('gitubuntu.importer.get_import_commit_msg') 153s def test_import_unapplied_spi_tags( 153s get_import_commit_msg_mock, 153s get_import_tag_msg_mock, 153s repo, 153s input_repo, 153s expected_output_refs, 153s validation_repo_delta, 153s validation_repo_expected_identical_refs, 153s reuse, 153s ): 153s """Test that unapplied tags are correctly created, adjusted and/or reused 153s 153s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 153s that determines the commit message to use for a given import 153s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 153s that determines the tag message to use for a given import 153s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 153s temporary output repository 153s :param repo_builder.Repo input_repo: input repository data 153s :param list(str) expected_output_refs: refs that must exist in the output 153s repository 153s :param dict validation_repo_delta: how to transform the input 153s repository into a "validation repository", expressed as a dict to 153s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 153s input repository. The validation repository is then used for the 153s purposes of comparison against the output repository. 153s :param list(str) validation_repo_expected_identical_refs: refs that must be 153s identical between the validation repository and the output repository 153s :param bool reuse: if set, the output ref importer/ubuntu/trusty must be 153s one supplied by the input repository (assumed to have a commit message 153s of "Test commit") and not one created by the importer in this run 153s (arranged by this test to have a different commit message) 153s 153s The input repository data is written into the output repository and then a 153s fake non-native source package publication of version 1-1 in the Trusty 153s release pocket is imported into it by calling import_unapplied_spi() 153s directly. expected_output_refs, validation_repo_expected_identical_refs and 153s reuse are then asserted. It is further asserted that no other refs exist in 153s the output repository except for those listed in expected_output_refs and 153s validation_repo_expected_identical_refs. 153s """ 153s # Match the repo_builder objects 153s get_import_tag_msg_mock.return_value = 'Test tag' 153s # Importantly, the following commit message must not be the same as the 153s # commit messages used by the test input repository commits, so that we can 153s # later detect the difference between commits that were already there and 153s # new commits created by the importer for the purposes of asserting the 153s # reuse parameter correctly. 153s get_import_commit_msg_mock.return_value = b'Test commit (new)' 153s 153s > input_repo.write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_tag_test.py:463: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmp3azfusd6/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s _ test_import_unapplied_spi_tags[input_repo3-expected_output_refs3-validation_repo_delta3-validation_repo_expected_identical_refs3-False] _ 153s 153s get_import_commit_msg_mock = 153s get_import_tag_msg_mock = 153s repo = 153s input_repo = 153s 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'] 153s validation_repo_delta = {'add_commits': [], 'update_branches': {'importer/ubuntu/trust...t at 0x7b5155a7f3e0>, 'importer/reimport/import/1-1/1': }} 153s 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'] 153s reuse = False 153s 153s @pytest.mark.parametrize( 153s [ 153s 'input_repo', 153s 'expected_output_refs', 153s 'validation_repo_delta', 153s 'validation_repo_expected_identical_refs', 153s 'reuse', 153s ], 153s [ 153s # 1) An existing import tag (or reimport tag) with the same Git tree 153s # - Reuse import tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[Commit.from_spec(name='import')], 153s branches={ 153s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 153s }, 153s tags={'importer/import/1-1': Placeholder('import')}, 153s ), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s ], 153s # validation_repo_delta: 153s { 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('import'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty-proposed', 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s ], 153s # reuse: 153s True, 153s ), 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[ 153s Commit.from_spec( 153s name='import', 153s mutate='import tag contents', 153s ), 153s Commit.from_spec(name='reimport'), 153s ], 153s branches={ 153s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 153s }, 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/reimport/import/1-1/0': Placeholder('import'), 153s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 153s }, 153s ), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s ], 153s # validation_repo_delta: 153s { 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('reimport'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty-proposed', 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s ], 153s # reuse: 153s True, 153s ), 153s 153s # 2) An existing import tag with a different Git tree and an existing 153s # upload tag with the same Git tree 153s # - Reuse upload tag, create reimport tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[ 153s Commit.from_spec( 153s name='import', 153s mutate='The import tag contents', 153s ), 153s Commit.from_spec(name='upload'), 153s ], 153s branches={ 153s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 153s }, 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/upload/1-1': Placeholder('upload'), 153s }, 153s ), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s 'refs/notes/importer/importer', 153s ], 153s # validation_repo_delta: 153s { 153s 'update_tags': { 153s 'importer/reimport/import/1-1/0': Placeholder('import'), 153s 'importer/reimport/import/1-1/1': Placeholder('upload'), 153s }, 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('upload'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty-proposed', 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/upload/1-1', 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s ], 153s # reuse: 153s True, 153s ), 153s 153s # 3) An existing import tag with a different Git tree and an existing 153s # upload tag with a different Git tree 153s # - Create reimport tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[ 153s Commit.from_spec( 153s name='import', 153s mutate='The import tag contents', 153s ), 153s Commit.from_spec( 153s name='upload', 153s mutate='The upload tag contents', 153s ), 153s ], 153s branches={ 153s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 153s }, 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/upload/1-1': Placeholder('upload'), 153s }, 153s ), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s 'refs/notes/importer/changelog', 153s 'refs/notes/importer/importer', 153s ], 153s # validation_repo_delta: 153s { 153s 'add_commits': [Commit.from_spec( 153s name='reimport', 153s message='Test commit (new)', 153s )], 153s 'update_tags': { 153s 'importer/reimport/import/1-1/0': Placeholder('import'), 153s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 153s }, 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('reimport'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty-proposed', 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/upload/1-1', 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s ], 153s # reuse: 153s False, 153s ), 153s 153s # 4) An existing import tag with a different Git tree and no upload tag 153s # - Create reimport tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[ 153s Commit.from_spec( 153s name='import', 153s mutate='The import tag contents', 153s ), 153s ], 153s branches={ 153s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 153s }, 153s tags={'importer/import/1-1': Placeholder('import')}, 153s ), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s 'refs/notes/importer/changelog', 153s 'refs/notes/importer/importer', 153s ], 153s # validation_repo_delta: 153s { 153s 'add_commits': [Commit.from_spec( 153s name='reimport', 153s message='Test commit (new)', 153s )], 153s 'update_tags': { 153s 'importer/reimport/import/1-1/0': Placeholder('import'), 153s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 153s }, 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('reimport'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty-proposed', 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s ], 153s # reuse: 153s False, 153s ), 153s 153s # 5) No import tag and an existing upload tag with the same Git tree 153s # - Reuse upload tag, create import tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[Commit.from_spec(name='upload')], 153s tags={'importer/upload/1-1': Placeholder('upload')}, 153s ), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s 'refs/notes/importer/importer', 153s ], 153s # validation_repo_delta: 153s { 153s 'update_tags': { 153s 'importer/import/1-1': Placeholder('upload'), 153s }, 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('upload'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/upload/1-1', 153s ], 153s # reuse: 153s True, 153s ), 153s 153s # 6) No import tag and an existing upload tag with a different Git tree 153s # - Create import tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[ 153s Commit.from_spec( 153s name='upload', 153s mutate='The upload tag contents', 153s ), 153s ], 153s tags={'importer/upload/1-1': Placeholder('upload')}, 153s ), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s 'refs/notes/importer/changelog', 153s 'refs/notes/importer/importer', 153s ], 153s # validation_repo_delta: 153s { 153s 'add_commits': [ 153s Commit.from_spec( 153s name='publish', 153s message='Test commit (new)', 153s ), 153s ], 153s 'update_tags': { 153s 'importer/import/1-1': Placeholder('publish'), 153s }, 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('publish'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/upload/1-1', 153s ], 153s # reuse: 153s False, 153s ), 153s 153s # 7) No import tags or upload tags 153s # - Create import tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo(), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s 'refs/notes/importer/changelog', 153s 'refs/notes/importer/importer', 153s ], 153s # validation_repo_delta: 153s { 153s 'add_commits': [ 153s Commit.from_spec( 153s name='publish', 153s message='Test commit (new)', 153s ), 153s ], 153s 'update_tags': { 153s 'importer/import/1-1': Placeholder('publish'), 153s }, 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('publish'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1' 153s ], 153s # reuse: 153s False, 153s ), 153s ] 153s ) 153s @patch('gitubuntu.importer.get_import_tag_msg') 153s @patch('gitubuntu.importer.get_import_commit_msg') 153s def test_import_unapplied_spi_tags( 153s get_import_commit_msg_mock, 153s get_import_tag_msg_mock, 153s repo, 153s input_repo, 153s expected_output_refs, 153s validation_repo_delta, 153s validation_repo_expected_identical_refs, 153s reuse, 153s ): 153s """Test that unapplied tags are correctly created, adjusted and/or reused 153s 153s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 153s that determines the commit message to use for a given import 153s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 153s that determines the tag message to use for a given import 153s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 153s temporary output repository 153s :param repo_builder.Repo input_repo: input repository data 153s :param list(str) expected_output_refs: refs that must exist in the output 153s repository 153s :param dict validation_repo_delta: how to transform the input 153s repository into a "validation repository", expressed as a dict to 153s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 153s input repository. The validation repository is then used for the 153s purposes of comparison against the output repository. 153s :param list(str) validation_repo_expected_identical_refs: refs that must be 153s identical between the validation repository and the output repository 153s :param bool reuse: if set, the output ref importer/ubuntu/trusty must be 153s one supplied by the input repository (assumed to have a commit message 153s of "Test commit") and not one created by the importer in this run 153s (arranged by this test to have a different commit message) 153s 153s The input repository data is written into the output repository and then a 153s fake non-native source package publication of version 1-1 in the Trusty 153s release pocket is imported into it by calling import_unapplied_spi() 153s directly. expected_output_refs, validation_repo_expected_identical_refs and 153s reuse are then asserted. It is further asserted that no other refs exist in 153s the output repository except for those listed in expected_output_refs and 153s validation_repo_expected_identical_refs. 153s """ 153s # Match the repo_builder objects 153s get_import_tag_msg_mock.return_value = 'Test tag' 153s # Importantly, the following commit message must not be the same as the 153s # commit messages used by the test input repository commits, so that we can 153s # later detect the difference between commits that were already there and 153s # new commits created by the importer for the purposes of asserting the 153s # reuse parameter correctly. 153s get_import_commit_msg_mock.return_value = b'Test commit (new)' 153s 153s > input_repo.write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_tag_test.py:463: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmp7wxqizz2/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s _ test_import_unapplied_spi_tags[input_repo4-expected_output_refs4-validation_repo_delta4-validation_repo_expected_identical_refs4-False] _ 153s 153s get_import_commit_msg_mock = 153s get_import_tag_msg_mock = 153s repo = 153s input_repo = 153s 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'] 153s validation_repo_delta = {'add_commits': [], 'update_branches': {'importer/ubuntu/trust...t at 0x7b5155a7f8f0>, 'importer/reimport/import/1-1/1': }} 153s 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'] 153s reuse = False 153s 153s @pytest.mark.parametrize( 153s [ 153s 'input_repo', 153s 'expected_output_refs', 153s 'validation_repo_delta', 153s 'validation_repo_expected_identical_refs', 153s 'reuse', 153s ], 153s [ 153s # 1) An existing import tag (or reimport tag) with the same Git tree 153s # - Reuse import tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[Commit.from_spec(name='import')], 153s branches={ 153s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 153s }, 153s tags={'importer/import/1-1': Placeholder('import')}, 153s ), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s ], 153s # validation_repo_delta: 153s { 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('import'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty-proposed', 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s ], 153s # reuse: 153s True, 153s ), 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[ 153s Commit.from_spec( 153s name='import', 153s mutate='import tag contents', 153s ), 153s Commit.from_spec(name='reimport'), 153s ], 153s branches={ 153s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 153s }, 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/reimport/import/1-1/0': Placeholder('import'), 153s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 153s }, 153s ), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s ], 153s # validation_repo_delta: 153s { 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('reimport'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty-proposed', 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s ], 153s # reuse: 153s True, 153s ), 153s 153s # 2) An existing import tag with a different Git tree and an existing 153s # upload tag with the same Git tree 153s # - Reuse upload tag, create reimport tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[ 153s Commit.from_spec( 153s name='import', 153s mutate='The import tag contents', 153s ), 153s Commit.from_spec(name='upload'), 153s ], 153s branches={ 153s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 153s }, 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/upload/1-1': Placeholder('upload'), 153s }, 153s ), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s 'refs/notes/importer/importer', 153s ], 153s # validation_repo_delta: 153s { 153s 'update_tags': { 153s 'importer/reimport/import/1-1/0': Placeholder('import'), 153s 'importer/reimport/import/1-1/1': Placeholder('upload'), 153s }, 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('upload'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty-proposed', 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/upload/1-1', 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s ], 153s # reuse: 153s True, 153s ), 153s 153s # 3) An existing import tag with a different Git tree and an existing 153s # upload tag with a different Git tree 153s # - Create reimport tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[ 153s Commit.from_spec( 153s name='import', 153s mutate='The import tag contents', 153s ), 153s Commit.from_spec( 153s name='upload', 153s mutate='The upload tag contents', 153s ), 153s ], 153s branches={ 153s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 153s }, 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/upload/1-1': Placeholder('upload'), 153s }, 153s ), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s 'refs/notes/importer/changelog', 153s 'refs/notes/importer/importer', 153s ], 153s # validation_repo_delta: 153s { 153s 'add_commits': [Commit.from_spec( 153s name='reimport', 153s message='Test commit (new)', 153s )], 153s 'update_tags': { 153s 'importer/reimport/import/1-1/0': Placeholder('import'), 153s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 153s }, 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('reimport'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty-proposed', 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/upload/1-1', 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s ], 153s # reuse: 153s False, 153s ), 153s 153s # 4) An existing import tag with a different Git tree and no upload tag 153s # - Create reimport tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[ 153s Commit.from_spec( 153s name='import', 153s mutate='The import tag contents', 153s ), 153s ], 153s branches={ 153s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 153s }, 153s tags={'importer/import/1-1': Placeholder('import')}, 153s ), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s 'refs/notes/importer/changelog', 153s 'refs/notes/importer/importer', 153s ], 153s # validation_repo_delta: 153s { 153s 'add_commits': [Commit.from_spec( 153s name='reimport', 153s message='Test commit (new)', 153s )], 153s 'update_tags': { 153s 'importer/reimport/import/1-1/0': Placeholder('import'), 153s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 153s }, 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('reimport'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty-proposed', 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s ], 153s # reuse: 153s False, 153s ), 153s 153s # 5) No import tag and an existing upload tag with the same Git tree 153s # - Reuse upload tag, create import tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[Commit.from_spec(name='upload')], 153s tags={'importer/upload/1-1': Placeholder('upload')}, 153s ), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s 'refs/notes/importer/importer', 153s ], 153s # validation_repo_delta: 153s { 153s 'update_tags': { 153s 'importer/import/1-1': Placeholder('upload'), 153s }, 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('upload'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/upload/1-1', 153s ], 153s # reuse: 153s True, 153s ), 153s 153s # 6) No import tag and an existing upload tag with a different Git tree 153s # - Create import tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[ 153s Commit.from_spec( 153s name='upload', 153s mutate='The upload tag contents', 153s ), 153s ], 153s tags={'importer/upload/1-1': Placeholder('upload')}, 153s ), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s 'refs/notes/importer/changelog', 153s 'refs/notes/importer/importer', 153s ], 153s # validation_repo_delta: 153s { 153s 'add_commits': [ 153s Commit.from_spec( 153s name='publish', 153s message='Test commit (new)', 153s ), 153s ], 153s 'update_tags': { 153s 'importer/import/1-1': Placeholder('publish'), 153s }, 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('publish'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/upload/1-1', 153s ], 153s # reuse: 153s False, 153s ), 153s 153s # 7) No import tags or upload tags 153s # - Create import tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo(), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s 'refs/notes/importer/changelog', 153s 'refs/notes/importer/importer', 153s ], 153s # validation_repo_delta: 153s { 153s 'add_commits': [ 153s Commit.from_spec( 153s name='publish', 153s message='Test commit (new)', 153s ), 153s ], 153s 'update_tags': { 153s 'importer/import/1-1': Placeholder('publish'), 153s }, 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('publish'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1' 153s ], 153s # reuse: 153s False, 153s ), 153s ] 153s ) 153s @patch('gitubuntu.importer.get_import_tag_msg') 153s @patch('gitubuntu.importer.get_import_commit_msg') 153s def test_import_unapplied_spi_tags( 153s get_import_commit_msg_mock, 153s get_import_tag_msg_mock, 153s repo, 153s input_repo, 153s expected_output_refs, 153s validation_repo_delta, 153s validation_repo_expected_identical_refs, 153s reuse, 153s ): 153s """Test that unapplied tags are correctly created, adjusted and/or reused 153s 153s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 153s that determines the commit message to use for a given import 153s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 153s that determines the tag message to use for a given import 153s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 153s temporary output repository 153s :param repo_builder.Repo input_repo: input repository data 153s :param list(str) expected_output_refs: refs that must exist in the output 153s repository 153s :param dict validation_repo_delta: how to transform the input 153s repository into a "validation repository", expressed as a dict to 153s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 153s input repository. The validation repository is then used for the 153s purposes of comparison against the output repository. 153s :param list(str) validation_repo_expected_identical_refs: refs that must be 153s identical between the validation repository and the output repository 153s :param bool reuse: if set, the output ref importer/ubuntu/trusty must be 153s one supplied by the input repository (assumed to have a commit message 153s of "Test commit") and not one created by the importer in this run 153s (arranged by this test to have a different commit message) 153s 153s The input repository data is written into the output repository and then a 153s fake non-native source package publication of version 1-1 in the Trusty 153s release pocket is imported into it by calling import_unapplied_spi() 153s directly. expected_output_refs, validation_repo_expected_identical_refs and 153s reuse are then asserted. It is further asserted that no other refs exist in 153s the output repository except for those listed in expected_output_refs and 153s validation_repo_expected_identical_refs. 153s """ 153s # Match the repo_builder objects 153s get_import_tag_msg_mock.return_value = 'Test tag' 153s # Importantly, the following commit message must not be the same as the 153s # commit messages used by the test input repository commits, so that we can 153s # later detect the difference between commits that were already there and 153s # new commits created by the importer for the purposes of asserting the 153s # reuse parameter correctly. 153s get_import_commit_msg_mock.return_value = b'Test commit (new)' 153s 153s > input_repo.write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_tag_test.py:463: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmpvrtu1n2x/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s _ test_import_unapplied_spi_tags[input_repo5-expected_output_refs5-validation_repo_delta5-validation_repo_expected_identical_refs5-True] _ 153s 153s get_import_commit_msg_mock = 153s get_import_tag_msg_mock = 153s repo = 153s input_repo = 153s 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'] 153s validation_repo_delta = {'update_branches': {'importer/ubuntu/trusty': }, 'update_tags': {'importer/import/1-1': }} 153s validation_repo_expected_identical_refs = ['refs/heads/importer/ubuntu/trusty', 'refs/tags/importer/import/1-1', 'refs/tags/importer/upload/1-1'] 153s reuse = True 153s 153s @pytest.mark.parametrize( 153s [ 153s 'input_repo', 153s 'expected_output_refs', 153s 'validation_repo_delta', 153s 'validation_repo_expected_identical_refs', 153s 'reuse', 153s ], 153s [ 153s # 1) An existing import tag (or reimport tag) with the same Git tree 153s # - Reuse import tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[Commit.from_spec(name='import')], 153s branches={ 153s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 153s }, 153s tags={'importer/import/1-1': Placeholder('import')}, 153s ), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s ], 153s # validation_repo_delta: 153s { 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('import'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty-proposed', 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s ], 153s # reuse: 153s True, 153s ), 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[ 153s Commit.from_spec( 153s name='import', 153s mutate='import tag contents', 153s ), 153s Commit.from_spec(name='reimport'), 153s ], 153s branches={ 153s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 153s }, 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/reimport/import/1-1/0': Placeholder('import'), 153s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 153s }, 153s ), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s ], 153s # validation_repo_delta: 153s { 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('reimport'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty-proposed', 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s ], 153s # reuse: 153s True, 153s ), 153s 153s # 2) An existing import tag with a different Git tree and an existing 153s # upload tag with the same Git tree 153s # - Reuse upload tag, create reimport tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[ 153s Commit.from_spec( 153s name='import', 153s mutate='The import tag contents', 153s ), 153s Commit.from_spec(name='upload'), 153s ], 153s branches={ 153s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 153s }, 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/upload/1-1': Placeholder('upload'), 153s }, 153s ), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s 'refs/notes/importer/importer', 153s ], 153s # validation_repo_delta: 153s { 153s 'update_tags': { 153s 'importer/reimport/import/1-1/0': Placeholder('import'), 153s 'importer/reimport/import/1-1/1': Placeholder('upload'), 153s }, 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('upload'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty-proposed', 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/upload/1-1', 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s ], 153s # reuse: 153s True, 153s ), 153s 153s # 3) An existing import tag with a different Git tree and an existing 153s # upload tag with a different Git tree 153s # - Create reimport tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[ 153s Commit.from_spec( 153s name='import', 153s mutate='The import tag contents', 153s ), 153s Commit.from_spec( 153s name='upload', 153s mutate='The upload tag contents', 153s ), 153s ], 153s branches={ 153s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 153s }, 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/upload/1-1': Placeholder('upload'), 153s }, 153s ), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s 'refs/notes/importer/changelog', 153s 'refs/notes/importer/importer', 153s ], 153s # validation_repo_delta: 153s { 153s 'add_commits': [Commit.from_spec( 153s name='reimport', 153s message='Test commit (new)', 153s )], 153s 'update_tags': { 153s 'importer/reimport/import/1-1/0': Placeholder('import'), 153s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 153s }, 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('reimport'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty-proposed', 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/upload/1-1', 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s ], 153s # reuse: 153s False, 153s ), 153s 153s # 4) An existing import tag with a different Git tree and no upload tag 153s # - Create reimport tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[ 153s Commit.from_spec( 153s name='import', 153s mutate='The import tag contents', 153s ), 153s ], 153s branches={ 153s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 153s }, 153s tags={'importer/import/1-1': Placeholder('import')}, 153s ), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s 'refs/notes/importer/changelog', 153s 'refs/notes/importer/importer', 153s ], 153s # validation_repo_delta: 153s { 153s 'add_commits': [Commit.from_spec( 153s name='reimport', 153s message='Test commit (new)', 153s )], 153s 'update_tags': { 153s 'importer/reimport/import/1-1/0': Placeholder('import'), 153s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 153s }, 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('reimport'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty-proposed', 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s ], 153s # reuse: 153s False, 153s ), 153s 153s # 5) No import tag and an existing upload tag with the same Git tree 153s # - Reuse upload tag, create import tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[Commit.from_spec(name='upload')], 153s tags={'importer/upload/1-1': Placeholder('upload')}, 153s ), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s 'refs/notes/importer/importer', 153s ], 153s # validation_repo_delta: 153s { 153s 'update_tags': { 153s 'importer/import/1-1': Placeholder('upload'), 153s }, 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('upload'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/upload/1-1', 153s ], 153s # reuse: 153s True, 153s ), 153s 153s # 6) No import tag and an existing upload tag with a different Git tree 153s # - Create import tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[ 153s Commit.from_spec( 153s name='upload', 153s mutate='The upload tag contents', 153s ), 153s ], 153s tags={'importer/upload/1-1': Placeholder('upload')}, 153s ), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s 'refs/notes/importer/changelog', 153s 'refs/notes/importer/importer', 153s ], 153s # validation_repo_delta: 153s { 153s 'add_commits': [ 153s Commit.from_spec( 153s name='publish', 153s message='Test commit (new)', 153s ), 153s ], 153s 'update_tags': { 153s 'importer/import/1-1': Placeholder('publish'), 153s }, 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('publish'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/upload/1-1', 153s ], 153s # reuse: 153s False, 153s ), 153s 153s # 7) No import tags or upload tags 153s # - Create import tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo(), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s 'refs/notes/importer/changelog', 153s 'refs/notes/importer/importer', 153s ], 153s # validation_repo_delta: 153s { 153s 'add_commits': [ 153s Commit.from_spec( 153s name='publish', 153s message='Test commit (new)', 153s ), 153s ], 153s 'update_tags': { 153s 'importer/import/1-1': Placeholder('publish'), 153s }, 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('publish'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1' 153s ], 153s # reuse: 153s False, 153s ), 153s ] 153s ) 153s @patch('gitubuntu.importer.get_import_tag_msg') 153s @patch('gitubuntu.importer.get_import_commit_msg') 153s def test_import_unapplied_spi_tags( 153s get_import_commit_msg_mock, 153s get_import_tag_msg_mock, 153s repo, 153s input_repo, 153s expected_output_refs, 153s validation_repo_delta, 153s validation_repo_expected_identical_refs, 153s reuse, 153s ): 153s """Test that unapplied tags are correctly created, adjusted and/or reused 153s 153s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 153s that determines the commit message to use for a given import 153s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 153s that determines the tag message to use for a given import 153s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 153s temporary output repository 153s :param repo_builder.Repo input_repo: input repository data 153s :param list(str) expected_output_refs: refs that must exist in the output 153s repository 153s :param dict validation_repo_delta: how to transform the input 153s repository into a "validation repository", expressed as a dict to 153s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 153s input repository. The validation repository is then used for the 153s purposes of comparison against the output repository. 153s :param list(str) validation_repo_expected_identical_refs: refs that must be 153s identical between the validation repository and the output repository 153s :param bool reuse: if set, the output ref importer/ubuntu/trusty must be 153s one supplied by the input repository (assumed to have a commit message 153s of "Test commit") and not one created by the importer in this run 153s (arranged by this test to have a different commit message) 153s 153s The input repository data is written into the output repository and then a 153s fake non-native source package publication of version 1-1 in the Trusty 153s release pocket is imported into it by calling import_unapplied_spi() 153s directly. expected_output_refs, validation_repo_expected_identical_refs and 153s reuse are then asserted. It is further asserted that no other refs exist in 153s the output repository except for those listed in expected_output_refs and 153s validation_repo_expected_identical_refs. 153s """ 153s # Match the repo_builder objects 153s get_import_tag_msg_mock.return_value = 'Test tag' 153s # Importantly, the following commit message must not be the same as the 153s # commit messages used by the test input repository commits, so that we can 153s # later detect the difference between commits that were already there and 153s # new commits created by the importer for the purposes of asserting the 153s # reuse parameter correctly. 153s get_import_commit_msg_mock.return_value = b'Test commit (new)' 153s 153s > input_repo.write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_tag_test.py:463: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmprjhiyy2i/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s _ test_import_unapplied_spi_tags[input_repo6-expected_output_refs6-validation_repo_delta6-validation_repo_expected_identical_refs6-False] _ 153s 153s get_import_commit_msg_mock = 153s get_import_tag_msg_mock = 153s repo = 153s input_repo = 153s 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'] 153s validation_repo_delta = {'add_commits': [], 'update_branches': {'importer/ubuntu/trust...x7b5155a97ce0>}, 'update_tags': {'importer/import/1-1': }} 153s validation_repo_expected_identical_refs = ['refs/heads/importer/ubuntu/trusty', 'refs/tags/importer/import/1-1', 'refs/tags/importer/upload/1-1'] 153s reuse = False 153s 153s @pytest.mark.parametrize( 153s [ 153s 'input_repo', 153s 'expected_output_refs', 153s 'validation_repo_delta', 153s 'validation_repo_expected_identical_refs', 153s 'reuse', 153s ], 153s [ 153s # 1) An existing import tag (or reimport tag) with the same Git tree 153s # - Reuse import tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[Commit.from_spec(name='import')], 153s branches={ 153s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 153s }, 153s tags={'importer/import/1-1': Placeholder('import')}, 153s ), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s ], 153s # validation_repo_delta: 153s { 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('import'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty-proposed', 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s ], 153s # reuse: 153s True, 153s ), 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[ 153s Commit.from_spec( 153s name='import', 153s mutate='import tag contents', 153s ), 153s Commit.from_spec(name='reimport'), 153s ], 153s branches={ 153s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 153s }, 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/reimport/import/1-1/0': Placeholder('import'), 153s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 153s }, 153s ), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s ], 153s # validation_repo_delta: 153s { 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('reimport'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty-proposed', 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s ], 153s # reuse: 153s True, 153s ), 153s 153s # 2) An existing import tag with a different Git tree and an existing 153s # upload tag with the same Git tree 153s # - Reuse upload tag, create reimport tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[ 153s Commit.from_spec( 153s name='import', 153s mutate='The import tag contents', 153s ), 153s Commit.from_spec(name='upload'), 153s ], 153s branches={ 153s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 153s }, 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/upload/1-1': Placeholder('upload'), 153s }, 153s ), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s 'refs/notes/importer/importer', 153s ], 153s # validation_repo_delta: 153s { 153s 'update_tags': { 153s 'importer/reimport/import/1-1/0': Placeholder('import'), 153s 'importer/reimport/import/1-1/1': Placeholder('upload'), 153s }, 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('upload'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty-proposed', 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/upload/1-1', 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s ], 153s # reuse: 153s True, 153s ), 153s 153s # 3) An existing import tag with a different Git tree and an existing 153s # upload tag with a different Git tree 153s # - Create reimport tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[ 153s Commit.from_spec( 153s name='import', 153s mutate='The import tag contents', 153s ), 153s Commit.from_spec( 153s name='upload', 153s mutate='The upload tag contents', 153s ), 153s ], 153s branches={ 153s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 153s }, 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/upload/1-1': Placeholder('upload'), 153s }, 153s ), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s 'refs/notes/importer/changelog', 153s 'refs/notes/importer/importer', 153s ], 153s # validation_repo_delta: 153s { 153s 'add_commits': [Commit.from_spec( 153s name='reimport', 153s message='Test commit (new)', 153s )], 153s 'update_tags': { 153s 'importer/reimport/import/1-1/0': Placeholder('import'), 153s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 153s }, 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('reimport'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty-proposed', 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/upload/1-1', 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s ], 153s # reuse: 153s False, 153s ), 153s 153s # 4) An existing import tag with a different Git tree and no upload tag 153s # - Create reimport tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[ 153s Commit.from_spec( 153s name='import', 153s mutate='The import tag contents', 153s ), 153s ], 153s branches={ 153s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 153s }, 153s tags={'importer/import/1-1': Placeholder('import')}, 153s ), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s 'refs/notes/importer/changelog', 153s 'refs/notes/importer/importer', 153s ], 153s # validation_repo_delta: 153s { 153s 'add_commits': [Commit.from_spec( 153s name='reimport', 153s message='Test commit (new)', 153s )], 153s 'update_tags': { 153s 'importer/reimport/import/1-1/0': Placeholder('import'), 153s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 153s }, 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('reimport'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty-proposed', 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s ], 153s # reuse: 153s False, 153s ), 153s 153s # 5) No import tag and an existing upload tag with the same Git tree 153s # - Reuse upload tag, create import tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[Commit.from_spec(name='upload')], 153s tags={'importer/upload/1-1': Placeholder('upload')}, 153s ), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s 'refs/notes/importer/importer', 153s ], 153s # validation_repo_delta: 153s { 153s 'update_tags': { 153s 'importer/import/1-1': Placeholder('upload'), 153s }, 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('upload'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/upload/1-1', 153s ], 153s # reuse: 153s True, 153s ), 153s 153s # 6) No import tag and an existing upload tag with a different Git tree 153s # - Create import tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[ 153s Commit.from_spec( 153s name='upload', 153s mutate='The upload tag contents', 153s ), 153s ], 153s tags={'importer/upload/1-1': Placeholder('upload')}, 153s ), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s 'refs/notes/importer/changelog', 153s 'refs/notes/importer/importer', 153s ], 153s # validation_repo_delta: 153s { 153s 'add_commits': [ 153s Commit.from_spec( 153s name='publish', 153s message='Test commit (new)', 153s ), 153s ], 153s 'update_tags': { 153s 'importer/import/1-1': Placeholder('publish'), 153s }, 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('publish'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/upload/1-1', 153s ], 153s # reuse: 153s False, 153s ), 153s 153s # 7) No import tags or upload tags 153s # - Create import tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo(), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s 'refs/notes/importer/changelog', 153s 'refs/notes/importer/importer', 153s ], 153s # validation_repo_delta: 153s { 153s 'add_commits': [ 153s Commit.from_spec( 153s name='publish', 153s message='Test commit (new)', 153s ), 153s ], 153s 'update_tags': { 153s 'importer/import/1-1': Placeholder('publish'), 153s }, 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('publish'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1' 153s ], 153s # reuse: 153s False, 153s ), 153s ] 153s ) 153s @patch('gitubuntu.importer.get_import_tag_msg') 153s @patch('gitubuntu.importer.get_import_commit_msg') 153s def test_import_unapplied_spi_tags( 153s get_import_commit_msg_mock, 153s get_import_tag_msg_mock, 153s repo, 153s input_repo, 153s expected_output_refs, 153s validation_repo_delta, 153s validation_repo_expected_identical_refs, 153s reuse, 153s ): 153s """Test that unapplied tags are correctly created, adjusted and/or reused 153s 153s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 153s that determines the commit message to use for a given import 153s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 153s that determines the tag message to use for a given import 153s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 153s temporary output repository 153s :param repo_builder.Repo input_repo: input repository data 153s :param list(str) expected_output_refs: refs that must exist in the output 153s repository 153s :param dict validation_repo_delta: how to transform the input 153s repository into a "validation repository", expressed as a dict to 153s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 153s input repository. The validation repository is then used for the 153s purposes of comparison against the output repository. 153s :param list(str) validation_repo_expected_identical_refs: refs that must be 153s identical between the validation repository and the output repository 153s :param bool reuse: if set, the output ref importer/ubuntu/trusty must be 153s one supplied by the input repository (assumed to have a commit message 153s of "Test commit") and not one created by the importer in this run 153s (arranged by this test to have a different commit message) 153s 153s The input repository data is written into the output repository and then a 153s fake non-native source package publication of version 1-1 in the Trusty 153s release pocket is imported into it by calling import_unapplied_spi() 153s directly. expected_output_refs, validation_repo_expected_identical_refs and 153s reuse are then asserted. It is further asserted that no other refs exist in 153s the output repository except for those listed in expected_output_refs and 153s validation_repo_expected_identical_refs. 153s """ 153s # Match the repo_builder objects 153s get_import_tag_msg_mock.return_value = 'Test tag' 153s # Importantly, the following commit message must not be the same as the 153s # commit messages used by the test input repository commits, so that we can 153s # later detect the difference between commits that were already there and 153s # new commits created by the importer for the purposes of asserting the 153s # reuse parameter correctly. 153s get_import_commit_msg_mock.return_value = b'Test commit (new)' 153s 153s > input_repo.write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_tag_test.py:463: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmp_6wg0y7l/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s _ test_import_unapplied_spi_tags[input_repo7-expected_output_refs7-validation_repo_delta7-validation_repo_expected_identical_refs7-False] _ 153s 153s get_import_commit_msg_mock = 153s get_import_tag_msg_mock = 153s repo = 153s input_repo = 153s 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'] 153s validation_repo_delta = {'add_commits': [], 'update_branches': {'importer/ubuntu/trust...x7b5155a94290>}, 'update_tags': {'importer/import/1-1': }} 153s validation_repo_expected_identical_refs = ['refs/heads/importer/ubuntu/trusty', 'refs/tags/importer/import/1-1'] 153s reuse = False 153s 153s @pytest.mark.parametrize( 153s [ 153s 'input_repo', 153s 'expected_output_refs', 153s 'validation_repo_delta', 153s 'validation_repo_expected_identical_refs', 153s 'reuse', 153s ], 153s [ 153s # 1) An existing import tag (or reimport tag) with the same Git tree 153s # - Reuse import tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[Commit.from_spec(name='import')], 153s branches={ 153s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 153s }, 153s tags={'importer/import/1-1': Placeholder('import')}, 153s ), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s ], 153s # validation_repo_delta: 153s { 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('import'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty-proposed', 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s ], 153s # reuse: 153s True, 153s ), 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[ 153s Commit.from_spec( 153s name='import', 153s mutate='import tag contents', 153s ), 153s Commit.from_spec(name='reimport'), 153s ], 153s branches={ 153s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 153s }, 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/reimport/import/1-1/0': Placeholder('import'), 153s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 153s }, 153s ), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s ], 153s # validation_repo_delta: 153s { 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('reimport'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty-proposed', 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s ], 153s # reuse: 153s True, 153s ), 153s 153s # 2) An existing import tag with a different Git tree and an existing 153s # upload tag with the same Git tree 153s # - Reuse upload tag, create reimport tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[ 153s Commit.from_spec( 153s name='import', 153s mutate='The import tag contents', 153s ), 153s Commit.from_spec(name='upload'), 153s ], 153s branches={ 153s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 153s }, 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/upload/1-1': Placeholder('upload'), 153s }, 153s ), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s 'refs/notes/importer/importer', 153s ], 153s # validation_repo_delta: 153s { 153s 'update_tags': { 153s 'importer/reimport/import/1-1/0': Placeholder('import'), 153s 'importer/reimport/import/1-1/1': Placeholder('upload'), 153s }, 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('upload'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty-proposed', 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/upload/1-1', 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s ], 153s # reuse: 153s True, 153s ), 153s 153s # 3) An existing import tag with a different Git tree and an existing 153s # upload tag with a different Git tree 153s # - Create reimport tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[ 153s Commit.from_spec( 153s name='import', 153s mutate='The import tag contents', 153s ), 153s Commit.from_spec( 153s name='upload', 153s mutate='The upload tag contents', 153s ), 153s ], 153s branches={ 153s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 153s }, 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/upload/1-1': Placeholder('upload'), 153s }, 153s ), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s 'refs/notes/importer/changelog', 153s 'refs/notes/importer/importer', 153s ], 153s # validation_repo_delta: 153s { 153s 'add_commits': [Commit.from_spec( 153s name='reimport', 153s message='Test commit (new)', 153s )], 153s 'update_tags': { 153s 'importer/reimport/import/1-1/0': Placeholder('import'), 153s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 153s }, 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('reimport'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty-proposed', 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/upload/1-1', 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s ], 153s # reuse: 153s False, 153s ), 153s 153s # 4) An existing import tag with a different Git tree and no upload tag 153s # - Create reimport tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[ 153s Commit.from_spec( 153s name='import', 153s mutate='The import tag contents', 153s ), 153s ], 153s branches={ 153s 'importer/ubuntu/trusty-proposed': Placeholder('import'), 153s }, 153s tags={'importer/import/1-1': Placeholder('import')}, 153s ), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s 'refs/notes/importer/changelog', 153s 'refs/notes/importer/importer', 153s ], 153s # validation_repo_delta: 153s { 153s 'add_commits': [Commit.from_spec( 153s name='reimport', 153s message='Test commit (new)', 153s )], 153s 'update_tags': { 153s 'importer/reimport/import/1-1/0': Placeholder('import'), 153s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 153s }, 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('reimport'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty-proposed', 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s ], 153s # reuse: 153s False, 153s ), 153s 153s # 5) No import tag and an existing upload tag with the same Git tree 153s # - Reuse upload tag, create import tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[Commit.from_spec(name='upload')], 153s tags={'importer/upload/1-1': Placeholder('upload')}, 153s ), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s 'refs/notes/importer/importer', 153s ], 153s # validation_repo_delta: 153s { 153s 'update_tags': { 153s 'importer/import/1-1': Placeholder('upload'), 153s }, 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('upload'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/upload/1-1', 153s ], 153s # reuse: 153s True, 153s ), 153s 153s # 6) No import tag and an existing upload tag with a different Git tree 153s # - Create import tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[ 153s Commit.from_spec( 153s name='upload', 153s mutate='The upload tag contents', 153s ), 153s ], 153s tags={'importer/upload/1-1': Placeholder('upload')}, 153s ), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s 'refs/notes/importer/changelog', 153s 'refs/notes/importer/importer', 153s ], 153s # validation_repo_delta: 153s { 153s 'add_commits': [ 153s Commit.from_spec( 153s name='publish', 153s message='Test commit (new)', 153s ), 153s ], 153s 'update_tags': { 153s 'importer/import/1-1': Placeholder('publish'), 153s }, 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('publish'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/upload/1-1', 153s ], 153s # reuse: 153s False, 153s ), 153s 153s # 7) No import tags or upload tags 153s # - Create import tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo(), 153s # expected_output_refs: 153s [ 153s 'refs/heads/do-not-push', 153s 'refs/tags/importer/upstream/ubuntu/1.gz', 153s 'refs/heads/importer/importer/ubuntu/dsc', 153s 'refs/heads/importer/importer/ubuntu/pristine-tar', 153s 'refs/notes/importer/changelog', 153s 'refs/notes/importer/importer', 153s ], 153s # validation_repo_delta: 153s { 153s 'add_commits': [ 153s Commit.from_spec( 153s name='publish', 153s message='Test commit (new)', 153s ), 153s ], 153s 'update_tags': { 153s 'importer/import/1-1': Placeholder('publish'), 153s }, 153s 'update_branches': { 153s 'importer/ubuntu/trusty': Placeholder('publish'), 153s }, 153s }, 153s # validation_repo_expected_identical_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1' 153s ], 153s # reuse: 153s False, 153s ), 153s ] 153s ) 153s @patch('gitubuntu.importer.get_import_tag_msg') 153s @patch('gitubuntu.importer.get_import_commit_msg') 153s def test_import_unapplied_spi_tags( 153s get_import_commit_msg_mock, 153s get_import_tag_msg_mock, 153s repo, 153s input_repo, 153s expected_output_refs, 153s validation_repo_delta, 153s validation_repo_expected_identical_refs, 153s reuse, 153s ): 153s """Test that unapplied tags are correctly created, adjusted and/or reused 153s 153s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 153s that determines the commit message to use for a given import 153s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 153s that determines the tag message to use for a given import 153s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 153s temporary output repository 153s :param repo_builder.Repo input_repo: input repository data 153s :param list(str) expected_output_refs: refs that must exist in the output 153s repository 153s :param dict validation_repo_delta: how to transform the input 153s repository into a "validation repository", expressed as a dict to 153s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 153s input repository. The validation repository is then used for the 153s purposes of comparison against the output repository. 153s :param list(str) validation_repo_expected_identical_refs: refs that must be 153s identical between the validation repository and the output repository 153s :param bool reuse: if set, the output ref importer/ubuntu/trusty must be 153s one supplied by the input repository (assumed to have a commit message 153s of "Test commit") and not one created by the importer in this run 153s (arranged by this test to have a different commit message) 153s 153s The input repository data is written into the output repository and then a 153s fake non-native source package publication of version 1-1 in the Trusty 153s release pocket is imported into it by calling import_unapplied_spi() 153s directly. expected_output_refs, validation_repo_expected_identical_refs and 153s reuse are then asserted. It is further asserted that no other refs exist in 153s the output repository except for those listed in expected_output_refs and 153s validation_repo_expected_identical_refs. 153s """ 153s # Match the repo_builder objects 153s get_import_tag_msg_mock.return_value = 'Test tag' 153s # Importantly, the following commit message must not be the same as the 153s # commit messages used by the test input repository commits, so that we can 153s # later detect the difference between commits that were already there and 153s # new commits created by the importer for the purposes of asserting the 153s # reuse parameter correctly. 153s get_import_commit_msg_mock.return_value = b'Test commit (new)' 153s 153s input_repo.write(repo.raw_repo) 153s 153s publish_spec = source_builder.SourceSpec( 153s version='1-1', 153s native=False, 153s ) 153s 153s with source_builder.Source(publish_spec) as dsc_path: 153s > target.import_unapplied_spi( 153s repo=repo, 153s spi=MockSPI(dsc_path, publish_spec.version), 153s namespace='importer', 153s skip_orig=False, 153s parent_overrides={}, 153s ) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_tag_test.py:471: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer.py:2308: in import_unapplied_spi 153s import_unapplied_dsc( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer.py:2230: in import_unapplied_dsc 153s commit, tag = find_or_create_unapplied_commit( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer.py:2052: in find_or_create_unapplied_commit 153s changelog_parents = get_unapplied_import_parents( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer.py:1503: in get_unapplied_import_parents 153s import_tree_versions = repo.get_all_changelog_versions_from_treeish( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:2230: in get_all_changelog_versions_from_treeish 153s changelog = self.get_changelog_from_treeish(treeish) 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 153s return Changelog.from_treeish( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:569: in from_treeish 153s blob = follow_symlinks_to_blob( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 153s return _follow_symlinks_to_blob( 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s repo = pygit2.Repository('/tmp/tmpfnley_3e/.git/') 153s top_tree_object = 153s search_path = 'debian/changelog' 153s _rel_tree = 153s _rel_path = '' 153s 153s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 153s _rel_tree=None, _rel_path='' 153s ): 153s '''Recursively follow a path down a tree, following symlinks, to find blob 153s 153s repo: pygit2.Repository object 153s top_tree: pygit2.Tree object of the top of the tree structure 153s search_path: '/'-separated path string of blob to find 153s _rel_tree: (internal) which tree to look further into 153s _rel_path: (internal) the path we are in so far 153s ''' 153s 153s NORMAL_BLOB_MODES = set([ 153s pygit2.GIT_FILEMODE_BLOB, 153s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 153s ]) 153s 153s _rel_tree = _rel_tree or top_tree_object 153s head, tail = posixpath.split(search_path) 153s 153s # A traditional functional split would put a single entry in head with tail 153s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 153s # to make it appear to have traditional semantics. 153s if not head: 153s head = tail 153s tail = None 153s 153s entry = _rel_tree[head] 153s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:68: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s _ test_import_applied_spi_tags[input_repo0-validation_repo_delta0-validation_repo_expected_treewise_refs0-True] _ 153s 153s get_import_commit_msg_mock = 153s get_import_tag_msg_mock = 153s repo = 153s input_repo = 153s validation_repo_delta = {} 153s 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'] 153s reuse = True 153s 153s @pytest.mark.parametrize( 153s [ 153s 'input_repo', 153s 'validation_repo_delta', 153s 'validation_repo_expected_treewise_refs', 153s 'reuse', 153s ], 153s [ 153s # 1) An existing applied tag (or reimport tag) with the same Git tree 153s # - Reuse applied tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[ 153s Commit.from_spec(name='unapplied', has_patches=True), 153s Commit.from_spec(name='applied', patches_applied=True), 153s ], 153s branches={ 153s 'importer/ubuntu/trusty': Placeholder('unapplied'), 153s 'importer/applied/ubuntu/trusty': Placeholder('applied'), 153s }, 153s tags={ 153s 'importer/import/1-1': Placeholder('unapplied'), 153s 'importer/applied/1-1': Placeholder('applied'), 153s }, 153s ), 153s # validation_repo_delta: 153s { 153s # no output repository delta 153s }, 153s # validation_repo_expected_treewise_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/heads/importer/applied/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/applied/1-1', 153s ], 153s # reuse: 153s True, 153s ), 153s 153s # 2) An existing applied tag with a different Git tree 153s # - Create reimport tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[ 153s Commit.from_spec( 153s name='unapplied', 153s has_patches=True, 153s mutate='import tag contents', 153s ), 153s Commit.from_spec( 153s name='unapplied_reimport', 153s has_patches=True, 153s ), 153s Commit.from_spec( 153s name='applied', 153s patches_applied=True, 153s mutate='import tag contents', 153s ) 153s ], 153s branches={'importer/ubuntu/trusty': Placeholder('unapplied')}, 153s tags={ 153s 'importer/import/1-1': 153s Placeholder('unapplied'), 153s 'importer/reimport/import/1-1/0': 153s Placeholder('unapplied'), 153s 'importer/reimport/import/1-1/1': 153s Placeholder('unapplied_reimport'), 153s 'importer/applied/1-1': 153s Placeholder('applied'), 153s }, 153s ), 153s # validation_repo_delta: 153s { 153s 'add_commits': [ 153s Commit.from_spec( 153s name='applied_reimport', 153s patches_applied=True, 153s parents=[Placeholder('unapplied_reimport')], 153s ), 153s ], 153s 'update_tags': { 153s 'importer/reimport/applied/1-1/0': 153s Placeholder('applied'), 153s 'importer/reimport/applied/1-1/1': 153s Placeholder('applied_reimport'), 153s }, 153s 'update_branches': { 153s 'importer/applied/ubuntu/trusty': 153s Placeholder('applied_reimport'), 153s }, 153s }, 153s # validation_repo_expected_treewise_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/heads/importer/applied/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s 'refs/tags/importer/applied/1-1', 153s 'refs/tags/importer/reimport/applied/1-1/0', 153s 'refs/tags/importer/reimport/applied/1-1/1', 153s ], 153s # reuse: 153s False, 153s 153s marks=pytest.mark.xfail(reason='LP: #1755247'), 153s ), 153s 153s # 3) No applied tags 153s # - Create applied tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[Commit.from_spec(name='unapplied', has_patches=True)], 153s branches={'importer/ubuntu/trusty': Placeholder('unapplied')}, 153s tags={'importer/import/1-1': Placeholder('unapplied')}, 153s ), 153s # validation_repo_delta: 153s { 153s 'add_commits': [ 153s Commit.from_spec( 153s name='applied', 153s patches_applied=True, 153s parents=[Placeholder('unapplied')], 153s ), 153s ], 153s 'update_tags': { 153s 'importer/applied/1-1': Placeholder('applied') 153s }, 153s 'update_branches': { 153s 'importer/applied/ubuntu/trusty': Placeholder('applied'), 153s }, 153s }, 153s # validation_repo_expected_treewise_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/heads/importer/applied/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/applied/1-1' 153s ], 153s # reuse: 153s False, 153s ), 153s ] 153s ) 153s @patch('gitubuntu.importer.get_import_tag_msg') 153s @patch('gitubuntu.importer.get_import_commit_msg') 153s def test_import_applied_spi_tags( 153s get_import_commit_msg_mock, 153s get_import_tag_msg_mock, 153s repo, 153s input_repo, 153s validation_repo_delta, 153s validation_repo_expected_treewise_refs, 153s reuse, 153s ): 153s """Test that applied tags are correctly created, adjusted and/or reused 153s 153s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 153s that determines the commit message to use for a given import 153s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 153s that determines the tag message to use for a given import 153s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 153s temporary output repository 153s :param repo_builder.Repo input_repo: input repository data 153s :param dict validation_repo_delta: how to transform the input repository 153s into a "validation repository", expressed as a dict to 153s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 153s input repository. The validation repository is then used for the 153s purposes of comparison against the output repository. 153s :param list(str) validation_repo_expected_treewise_refs: refs whose trees 153s must be identical between the validation repository and the output 153s repository 153s :param bool reuse: if set, the output ref importer/ubuntu/trusty must be 153s one supplied by the input repository (assumed to have a commit message 153s of "Test commit") and not one created by the importer in this run 153s (arranged by this test to have a different commit message) 153s 153s The input repository data is written into the output repository and then a 153s fake non-native source package publication of version 1-1 in the Trusty 153s release pocket is imported into it by calling import_applied_spi() 153s directly. reuse and validation_repo_expected_treewise_refs are then 153s asserted. 153s 153s This is similar to test_unapplied_spi_tags except that it calls 153s import_applied_spi() instead of import_unapplied_spi() and only treewise 153s ref comparisons are made. 153s """ 153s # Match the repo_builder objects 153s get_import_tag_msg_mock.return_value = 'Test tag' 153s # Importantly, the following commit message must not be the same as the 153s # commit messages used by the test input repository commits, so that we can 153s # later detect the difference between commits that were already there and 153s # new commits created by the importer for the purposes of asserting the 153s # reuse parameter correctly. 153s get_import_commit_msg_mock.return_value = b'Test commit (new)' 153s 153s > input_repo.write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_tag_test.py:711: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmp2f2zmam4/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: using patch list from debian/patches/series 153s dpkg-source: info: applying a 153s dpkg-source: info: applying b 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: using patch list from debian/patches/series 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: using patch list from debian/patches/series 153s dpkg-source: info: applying a 153s dpkg-source: info: applying b 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: using patch list from debian/patches/series 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: using patch list from debian/patches/series 153s dpkg-source: info: applying a 153s dpkg-source: info: applying b 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: using patch list from debian/patches/series 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: using patch list from debian/patches/series 153s dpkg-source: info: applying a 153s dpkg-source: info: applying b 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: using patch list from debian/patches/series 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: using patch list from debian/patches/series 153s dpkg-source: info: applying a 153s dpkg-source: info: applying b 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: using patch list from debian/patches/series 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s _ test_import_applied_spi_tags[input_repo2-validation_repo_delta2-validation_repo_expected_treewise_refs2-False] _ 153s 153s get_import_commit_msg_mock = 153s get_import_tag_msg_mock = 153s repo = 153s input_repo = 153s validation_repo_delta = {'add_commits': [], 'update_branches': {'importer/applied/ubun...7b5155a955e0>}, 'update_tags': {'importer/applied/1-1': }} 153s 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'] 153s reuse = False 153s 153s @pytest.mark.parametrize( 153s [ 153s 'input_repo', 153s 'validation_repo_delta', 153s 'validation_repo_expected_treewise_refs', 153s 'reuse', 153s ], 153s [ 153s # 1) An existing applied tag (or reimport tag) with the same Git tree 153s # - Reuse applied tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[ 153s Commit.from_spec(name='unapplied', has_patches=True), 153s Commit.from_spec(name='applied', patches_applied=True), 153s ], 153s branches={ 153s 'importer/ubuntu/trusty': Placeholder('unapplied'), 153s 'importer/applied/ubuntu/trusty': Placeholder('applied'), 153s }, 153s tags={ 153s 'importer/import/1-1': Placeholder('unapplied'), 153s 'importer/applied/1-1': Placeholder('applied'), 153s }, 153s ), 153s # validation_repo_delta: 153s { 153s # no output repository delta 153s }, 153s # validation_repo_expected_treewise_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/heads/importer/applied/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/applied/1-1', 153s ], 153s # reuse: 153s True, 153s ), 153s 153s # 2) An existing applied tag with a different Git tree 153s # - Create reimport tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[ 153s Commit.from_spec( 153s name='unapplied', 153s has_patches=True, 153s mutate='import tag contents', 153s ), 153s Commit.from_spec( 153s name='unapplied_reimport', 153s has_patches=True, 153s ), 153s Commit.from_spec( 153s name='applied', 153s patches_applied=True, 153s mutate='import tag contents', 153s ) 153s ], 153s branches={'importer/ubuntu/trusty': Placeholder('unapplied')}, 153s tags={ 153s 'importer/import/1-1': 153s Placeholder('unapplied'), 153s 'importer/reimport/import/1-1/0': 153s Placeholder('unapplied'), 153s 'importer/reimport/import/1-1/1': 153s Placeholder('unapplied_reimport'), 153s 'importer/applied/1-1': 153s Placeholder('applied'), 153s }, 153s ), 153s # validation_repo_delta: 153s { 153s 'add_commits': [ 153s Commit.from_spec( 153s name='applied_reimport', 153s patches_applied=True, 153s parents=[Placeholder('unapplied_reimport')], 153s ), 153s ], 153s 'update_tags': { 153s 'importer/reimport/applied/1-1/0': 153s Placeholder('applied'), 153s 'importer/reimport/applied/1-1/1': 153s Placeholder('applied_reimport'), 153s }, 153s 'update_branches': { 153s 'importer/applied/ubuntu/trusty': 153s Placeholder('applied_reimport'), 153s }, 153s }, 153s # validation_repo_expected_treewise_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/heads/importer/applied/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s 'refs/tags/importer/applied/1-1', 153s 'refs/tags/importer/reimport/applied/1-1/0', 153s 'refs/tags/importer/reimport/applied/1-1/1', 153s ], 153s # reuse: 153s False, 153s 153s marks=pytest.mark.xfail(reason='LP: #1755247'), 153s ), 153s 153s # 3) No applied tags 153s # - Create applied tag 153s pytest.param( 153s # input_repo: 153s repo_builder.Repo( 153s commits=[Commit.from_spec(name='unapplied', has_patches=True)], 153s branches={'importer/ubuntu/trusty': Placeholder('unapplied')}, 153s tags={'importer/import/1-1': Placeholder('unapplied')}, 153s ), 153s # validation_repo_delta: 153s { 153s 'add_commits': [ 153s Commit.from_spec( 153s name='applied', 153s patches_applied=True, 153s parents=[Placeholder('unapplied')], 153s ), 153s ], 153s 'update_tags': { 153s 'importer/applied/1-1': Placeholder('applied') 153s }, 153s 'update_branches': { 153s 'importer/applied/ubuntu/trusty': Placeholder('applied'), 153s }, 153s }, 153s # validation_repo_expected_treewise_refs: 153s [ 153s 'refs/heads/importer/ubuntu/trusty', 153s 'refs/heads/importer/applied/ubuntu/trusty', 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/applied/1-1' 153s ], 153s # reuse: 153s False, 153s ), 153s ] 153s ) 153s @patch('gitubuntu.importer.get_import_tag_msg') 153s @patch('gitubuntu.importer.get_import_commit_msg') 153s def test_import_applied_spi_tags( 153s get_import_commit_msg_mock, 153s get_import_tag_msg_mock, 153s repo, 153s input_repo, 153s validation_repo_delta, 153s validation_repo_expected_treewise_refs, 153s reuse, 153s ): 153s """Test that applied tags are correctly created, adjusted and/or reused 153s 153s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 153s that determines the commit message to use for a given import 153s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 153s that determines the tag message to use for a given import 153s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 153s temporary output repository 153s :param repo_builder.Repo input_repo: input repository data 153s :param dict validation_repo_delta: how to transform the input repository 153s into a "validation repository", expressed as a dict to 153s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 153s input repository. The validation repository is then used for the 153s purposes of comparison against the output repository. 153s :param list(str) validation_repo_expected_treewise_refs: refs whose trees 153s must be identical between the validation repository and the output 153s repository 153s :param bool reuse: if set, the output ref importer/ubuntu/trusty must be 153s one supplied by the input repository (assumed to have a commit message 153s of "Test commit") and not one created by the importer in this run 153s (arranged by this test to have a different commit message) 153s 153s The input repository data is written into the output repository and then a 153s fake non-native source package publication of version 1-1 in the Trusty 153s release pocket is imported into it by calling import_applied_spi() 153s directly. reuse and validation_repo_expected_treewise_refs are then 153s asserted. 153s 153s This is similar to test_unapplied_spi_tags except that it calls 153s import_applied_spi() instead of import_unapplied_spi() and only treewise 153s ref comparisons are made. 153s """ 153s # Match the repo_builder objects 153s get_import_tag_msg_mock.return_value = 'Test tag' 153s # Importantly, the following commit message must not be the same as the 153s # commit messages used by the test input repository commits, so that we can 153s # later detect the difference between commits that were already there and 153s # new commits created by the importer for the purposes of asserting the 153s # reuse parameter correctly. 153s get_import_commit_msg_mock.return_value = b'Test commit (new)' 153s 153s > input_repo.write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_tag_test.py:711: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmpesv1izpu/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: using patch list from debian/patches/series 153s dpkg-source: info: applying a 153s dpkg-source: info: applying b 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: using patch list from debian/patches/series 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: using patch list from debian/patches/series 153s dpkg-source: info: applying a 153s dpkg-source: info: applying b 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: using patch list from debian/patches/series 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: using patch list from debian/patches/series 153s dpkg-source: info: applying a 153s dpkg-source: info: applying b 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: using patch list from debian/patches/series 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s __ test_get_existing_import_tags[input_repo1-PatchState.UNAPPLIED-expected1] ___ 153s 153s repo = 153s patch_state = 153s input_repo = 153s expected = ['refs/tags/importer/import/1-1'] 153s 153s @pytest.mark.parametrize( 153s 'input_repo, patch_state, expected', [ 153s ( 153s repo_builder.Repo(), 153s PatchState.UNAPPLIED, 153s [], 153s ), 153s ( 153s repo_builder.Repo( 153s tags={'importer/import/1-1': repo_builder.Commit()}, 153s ), 153s PatchState.UNAPPLIED, 153s ['refs/tags/importer/import/1-1'], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit(name='import'), 153s repo_builder.Commit(name='reimport1'), 153s ], 153s tags={ 153s 'importer/import/1-1': repo_builder.Commit(), 153s 'importer/reimport/import/1-1/0': repo_builder.Commit(), 153s 'importer/reimport/import/1-1/1': repo_builder.Commit(), 153s }, 153s ), 153s PatchState.UNAPPLIED, 153s [ 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s ], 153s ), 153s ( 153s repo_builder.Repo(), 153s PatchState.APPLIED, 153s [], 153s ), 153s ( 153s repo_builder.Repo( 153s tags={'importer/applied/1-1': repo_builder.Commit()}, 153s ), 153s PatchState.APPLIED, 153s ['refs/tags/importer/applied/1-1'], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit(name='applied'), 153s repo_builder.Commit(name='reimport1'), 153s ], 153s tags={ 153s 'importer/applied/1-1': repo_builder.Commit(), 153s 'importer/reimport/applied/1-1/0': repo_builder.Commit(), 153s 'importer/reimport/applied/1-1/1': repo_builder.Commit(), 153s }, 153s ), 153s PatchState.APPLIED, 153s [ 153s 'refs/tags/importer/reimport/applied/1-1/0', 153s 'refs/tags/importer/reimport/applied/1-1/1', 153s ], 153s ), 153s ], 153s ) 153s def test_get_existing_import_tags(repo, patch_state, input_repo, expected): 153s """Test that get_existing_import_tags is generally correct 153s 153s This is the general parameterised test for the common case uses of 153s target.get_existing_import_tags. 153s 153s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 153s temporary output repository 153s :param PatchState patch_state: passed through to get_existing_import_tags 153s :param repo_builder.Repo input_repo: input repository data 153s :param list(str) expected: the names of the references that are expected to 153s be returned, in order. 153s """ 153s > input_repo.write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:214: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmp_mdg5csp/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s __ test_get_existing_import_tags[input_repo2-PatchState.UNAPPLIED-expected2] ___ 153s 153s repo = 153s patch_state = 153s input_repo = 153s expected = ['refs/tags/importer/reimport/import/1-1/0', 'refs/tags/importer/reimport/import/1-1/1'] 153s 153s @pytest.mark.parametrize( 153s 'input_repo, patch_state, expected', [ 153s ( 153s repo_builder.Repo(), 153s PatchState.UNAPPLIED, 153s [], 153s ), 153s ( 153s repo_builder.Repo( 153s tags={'importer/import/1-1': repo_builder.Commit()}, 153s ), 153s PatchState.UNAPPLIED, 153s ['refs/tags/importer/import/1-1'], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit(name='import'), 153s repo_builder.Commit(name='reimport1'), 153s ], 153s tags={ 153s 'importer/import/1-1': repo_builder.Commit(), 153s 'importer/reimport/import/1-1/0': repo_builder.Commit(), 153s 'importer/reimport/import/1-1/1': repo_builder.Commit(), 153s }, 153s ), 153s PatchState.UNAPPLIED, 153s [ 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s ], 153s ), 153s ( 153s repo_builder.Repo(), 153s PatchState.APPLIED, 153s [], 153s ), 153s ( 153s repo_builder.Repo( 153s tags={'importer/applied/1-1': repo_builder.Commit()}, 153s ), 153s PatchState.APPLIED, 153s ['refs/tags/importer/applied/1-1'], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit(name='applied'), 153s repo_builder.Commit(name='reimport1'), 153s ], 153s tags={ 153s 'importer/applied/1-1': repo_builder.Commit(), 153s 'importer/reimport/applied/1-1/0': repo_builder.Commit(), 153s 'importer/reimport/applied/1-1/1': repo_builder.Commit(), 153s }, 153s ), 153s PatchState.APPLIED, 153s [ 153s 'refs/tags/importer/reimport/applied/1-1/0', 153s 'refs/tags/importer/reimport/applied/1-1/1', 153s ], 153s ), 153s ], 153s ) 153s def test_get_existing_import_tags(repo, patch_state, input_repo, expected): 153s """Test that get_existing_import_tags is generally correct 153s 153s This is the general parameterised test for the common case uses of 153s target.get_existing_import_tags. 153s 153s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 153s temporary output repository 153s :param PatchState patch_state: passed through to get_existing_import_tags 153s :param repo_builder.Repo input_repo: input repository data 153s :param list(str) expected: the names of the references that are expected to 153s be returned, in order. 153s """ 153s > input_repo.write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:214: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmplt3q0qgt/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s ___ test_get_existing_import_tags[input_repo4-PatchState.APPLIED-expected4] ____ 153s 153s repo = 153s patch_state = 153s input_repo = 153s expected = ['refs/tags/importer/applied/1-1'] 153s 153s @pytest.mark.parametrize( 153s 'input_repo, patch_state, expected', [ 153s ( 153s repo_builder.Repo(), 153s PatchState.UNAPPLIED, 153s [], 153s ), 153s ( 153s repo_builder.Repo( 153s tags={'importer/import/1-1': repo_builder.Commit()}, 153s ), 153s PatchState.UNAPPLIED, 153s ['refs/tags/importer/import/1-1'], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit(name='import'), 153s repo_builder.Commit(name='reimport1'), 153s ], 153s tags={ 153s 'importer/import/1-1': repo_builder.Commit(), 153s 'importer/reimport/import/1-1/0': repo_builder.Commit(), 153s 'importer/reimport/import/1-1/1': repo_builder.Commit(), 153s }, 153s ), 153s PatchState.UNAPPLIED, 153s [ 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s ], 153s ), 153s ( 153s repo_builder.Repo(), 153s PatchState.APPLIED, 153s [], 153s ), 153s ( 153s repo_builder.Repo( 153s tags={'importer/applied/1-1': repo_builder.Commit()}, 153s ), 153s PatchState.APPLIED, 153s ['refs/tags/importer/applied/1-1'], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit(name='applied'), 153s repo_builder.Commit(name='reimport1'), 153s ], 153s tags={ 153s 'importer/applied/1-1': repo_builder.Commit(), 153s 'importer/reimport/applied/1-1/0': repo_builder.Commit(), 153s 'importer/reimport/applied/1-1/1': repo_builder.Commit(), 153s }, 153s ), 153s PatchState.APPLIED, 153s [ 153s 'refs/tags/importer/reimport/applied/1-1/0', 153s 'refs/tags/importer/reimport/applied/1-1/1', 153s ], 153s ), 153s ], 153s ) 153s def test_get_existing_import_tags(repo, patch_state, input_repo, expected): 153s """Test that get_existing_import_tags is generally correct 153s 153s This is the general parameterised test for the common case uses of 153s target.get_existing_import_tags. 153s 153s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 153s temporary output repository 153s :param PatchState patch_state: passed through to get_existing_import_tags 153s :param repo_builder.Repo input_repo: input repository data 153s :param list(str) expected: the names of the references that are expected to 153s be returned, in order. 153s """ 153s > input_repo.write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:214: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmp6h72p8er/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s ___ test_get_existing_import_tags[input_repo5-PatchState.APPLIED-expected5] ____ 153s 153s repo = 153s patch_state = 153s input_repo = 153s expected = ['refs/tags/importer/reimport/applied/1-1/0', 'refs/tags/importer/reimport/applied/1-1/1'] 153s 153s @pytest.mark.parametrize( 153s 'input_repo, patch_state, expected', [ 153s ( 153s repo_builder.Repo(), 153s PatchState.UNAPPLIED, 153s [], 153s ), 153s ( 153s repo_builder.Repo( 153s tags={'importer/import/1-1': repo_builder.Commit()}, 153s ), 153s PatchState.UNAPPLIED, 153s ['refs/tags/importer/import/1-1'], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit(name='import'), 153s repo_builder.Commit(name='reimport1'), 153s ], 153s tags={ 153s 'importer/import/1-1': repo_builder.Commit(), 153s 'importer/reimport/import/1-1/0': repo_builder.Commit(), 153s 'importer/reimport/import/1-1/1': repo_builder.Commit(), 153s }, 153s ), 153s PatchState.UNAPPLIED, 153s [ 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s ], 153s ), 153s ( 153s repo_builder.Repo(), 153s PatchState.APPLIED, 153s [], 153s ), 153s ( 153s repo_builder.Repo( 153s tags={'importer/applied/1-1': repo_builder.Commit()}, 153s ), 153s PatchState.APPLIED, 153s ['refs/tags/importer/applied/1-1'], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit(name='applied'), 153s repo_builder.Commit(name='reimport1'), 153s ], 153s tags={ 153s 'importer/applied/1-1': repo_builder.Commit(), 153s 'importer/reimport/applied/1-1/0': repo_builder.Commit(), 153s 'importer/reimport/applied/1-1/1': repo_builder.Commit(), 153s }, 153s ), 153s PatchState.APPLIED, 153s [ 153s 'refs/tags/importer/reimport/applied/1-1/0', 153s 'refs/tags/importer/reimport/applied/1-1/1', 153s ], 153s ), 153s ], 153s ) 153s def test_get_existing_import_tags(repo, patch_state, input_repo, expected): 153s """Test that get_existing_import_tags is generally correct 153s 153s This is the general parameterised test for the common case uses of 153s target.get_existing_import_tags. 153s 153s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 153s temporary output repository 153s :param PatchState patch_state: passed through to get_existing_import_tags 153s :param repo_builder.Repo input_repo: input repository data 153s :param list(str) expected: the names of the references that are expected to 153s be returned, in order. 153s """ 153s > input_repo.write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:214: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmp0e1em9rx/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s ____________________ test_get_existing_import_tags_ordering ____________________ 153s 153s repo = 153s 153s def test_get_existing_import_tags_ordering(repo): 153s """Test that get_existing_import_tags returns results in the correct order 153s 153s To maintain hash stability, the spec defines that multiple changelog 153s parents must appear in the order that they were published. For this to 153s work, get_existing_import_tags must return the tags in the correct order 153s even if the underlying git repository tags appear in an arbitrary order. 153s 153s :param GitUbuntuRepository repo: fixture of a temporary repository to use 153s """ 153s 153s # Construct a synthetic git repository containing tags 153s repo_builder.Repo( 153s tags={ 153s 'importer/import/1-1': repo_builder.Commit(), 153s 'importer/reimport/import/1-1/0': repo_builder.Commit(), 153s 'importer/reimport/import/1-1/1': repo_builder.Commit(), 153s } 153s > ).write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:240: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmpqux4i3t5/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s _ test_create_import_tag[input_repo0-validation_repo_delta0-validation_repo_expected_identical_refs0] _ 153s 153s repo = 153s input_repo = 153s validation_repo_delta = {'add_commits': [], 'update_tags': {'importer/import/1-1': }} 153s validation_repo_expected_identical_refs = ['refs/tags/importer/import/1-1'] 153s 153s @pytest.mark.parametrize( 153s [ 153s 'input_repo', 153s 'validation_repo_delta', 153s 'validation_repo_expected_identical_refs', 153s ], 153s [ 153s ( 153s repo_builder.Repo(), 153s { 153s 'add_commits': [ 153s repo_builder.Commit(name='import'), 153s ], 153s 'update_tags': { 153s 'importer/import/1-1': Placeholder('import'), 153s }, 153s }, 153s [ 153s 'refs/tags/importer/import/1-1', 153s ], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[repo_builder.Commit(name='import')], 153s tags={'importer/import/1-1': Placeholder('import')}, 153s ), 153s { 153s 'add_commits': [ 153s repo_builder.Commit(name='reimport'), 153s ], 153s 'update_tags': { 153s 'importer/reimport/import/1-1/0': Placeholder('import'), 153s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 153s }, 153s }, 153s [ 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s ], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit(name='import'), 153s repo_builder.Commit(name='reimport1'), 153s ], 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/reimport/import/1-1/0': Placeholder('import'), 153s 'importer/reimport/import/1-1/1': Placeholder('reimport1'), 153s }, 153s ), 153s { 153s 'add_commits': [ 153s repo_builder.Commit(name='reimport2'), 153s ], 153s 'update_tags': { 153s 'importer/reimport/import/1-1/2': Placeholder('reimport2'), 153s }, 153s }, 153s [ 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s 'refs/tags/importer/reimport/import/1-1/2', 153s ], 153s ), 153s ], 153s ) 153s def test_create_import_tag( 153s repo, 153s input_repo, 153s validation_repo_delta, 153s validation_repo_expected_identical_refs, 153s ): 153s """ 153s Unit test that create_import_tag creates the correct import tag 153s 153s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 153s temporary output repository 153s :param repo_builder.Repo input_repo: input repository data 153s :param dict validation_repo_delta: how to transform the input repository 153s into a "validation repository", expressed as a dict to 153s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 153s input repository. The validation repository is then used for the 153s purposes of comparison against the output repository. 153s :param list(str) validation_repo_expected_identical_refs: refs that must be 153s identical between the validation repository and the output repository 153s """ 153s publish_commit = repo.raw_repo.get( 153s repo_builder.Commit().write(repo.raw_repo) 153s ).peel(pygit2.Commit) 153s input_repo.write(repo.raw_repo) 153s 153s > target.create_import_tag(repo, publish_commit, '1-1', 'importer') 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:370: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer.py:1379: in create_import_tag 153s repo.create_tag( 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s commit_hash = '240dd844a69653244edb52c57c42d709512d64cd' 153s tag_name = 'importer/import/1-1', tag_msg = 'git-ubuntu import' 153s tagger = pygit2.Signature('git-ubuntu importer', 'ubuntu-devel-discuss@lists.ubuntu.com', 0, 0, None) 153s 153s def create_tag(self, 153s commit_hash, 153s tag_name, 153s tag_msg, 153s tagger=None, 153s ): 153s """Create a tag in the repository 153s 153s :param str commit_hash: the commit hash the tag will point to. 153s :param str tag_name: the name of the tag to be created. 153s :param str tag_msg: the text of the tag annotation. 153s :param pygit2.Signature tagger: if supplied, use this signature in the 153s created tag's "tagger" metadata. If not supplied, an arbitrary name 153s and email address is used with the current time. 153s :returns: None 153s """ 153s if not tagger: 153s tagger_time, tagger_offset = datetime_to_signature_spec( 153s datetime.datetime.now(), 153s ) 153s tagger = pygit2.Signature( 153s gitubuntu.spec.SYNTHESIZED_COMMITTER_NAME, 153s gitubuntu.spec.SYNTHESIZED_COMMITTER_EMAIL, 153s tagger_time, 153s tagger_offset, 153s ) 153s 153s logging.debug("Creating tag %s pointing to %s", tag_name, commit_hash) 153s self.raw_repo.create_tag( 153s tag_name, 153s pygit2.Oid(hex=commit_hash), 153s > pygit2.GIT_OBJ_COMMIT, 153s tagger, 153s tag_msg, 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:2114: AttributeError 153s _ test_create_import_tag[input_repo1-validation_repo_delta1-validation_repo_expected_identical_refs1] _ 153s 153s repo = 153s input_repo = 153s validation_repo_delta = {'add_commits': [], 'update_tags': {'importer/reimport/import/...t at 0x7b5155abae70>, 'importer/reimport/import/1-1/1': }} 153s 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'] 153s 153s @pytest.mark.parametrize( 153s [ 153s 'input_repo', 153s 'validation_repo_delta', 153s 'validation_repo_expected_identical_refs', 153s ], 153s [ 153s ( 153s repo_builder.Repo(), 153s { 153s 'add_commits': [ 153s repo_builder.Commit(name='import'), 153s ], 153s 'update_tags': { 153s 'importer/import/1-1': Placeholder('import'), 153s }, 153s }, 153s [ 153s 'refs/tags/importer/import/1-1', 153s ], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[repo_builder.Commit(name='import')], 153s tags={'importer/import/1-1': Placeholder('import')}, 153s ), 153s { 153s 'add_commits': [ 153s repo_builder.Commit(name='reimport'), 153s ], 153s 'update_tags': { 153s 'importer/reimport/import/1-1/0': Placeholder('import'), 153s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 153s }, 153s }, 153s [ 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s ], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit(name='import'), 153s repo_builder.Commit(name='reimport1'), 153s ], 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/reimport/import/1-1/0': Placeholder('import'), 153s 'importer/reimport/import/1-1/1': Placeholder('reimport1'), 153s }, 153s ), 153s { 153s 'add_commits': [ 153s repo_builder.Commit(name='reimport2'), 153s ], 153s 'update_tags': { 153s 'importer/reimport/import/1-1/2': Placeholder('reimport2'), 153s }, 153s }, 153s [ 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s 'refs/tags/importer/reimport/import/1-1/2', 153s ], 153s ), 153s ], 153s ) 153s def test_create_import_tag( 153s repo, 153s input_repo, 153s validation_repo_delta, 153s validation_repo_expected_identical_refs, 153s ): 153s """ 153s Unit test that create_import_tag creates the correct import tag 153s 153s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 153s temporary output repository 153s :param repo_builder.Repo input_repo: input repository data 153s :param dict validation_repo_delta: how to transform the input repository 153s into a "validation repository", expressed as a dict to 153s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 153s input repository. The validation repository is then used for the 153s purposes of comparison against the output repository. 153s :param list(str) validation_repo_expected_identical_refs: refs that must be 153s identical between the validation repository and the output repository 153s """ 153s publish_commit = repo.raw_repo.get( 153s repo_builder.Commit().write(repo.raw_repo) 153s ).peel(pygit2.Commit) 153s > input_repo.write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:368: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmpfxcqllc7/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s _ test_create_import_tag[input_repo2-validation_repo_delta2-validation_repo_expected_identical_refs2] _ 153s 153s repo = 153s input_repo = 153s validation_repo_delta = {'add_commits': [], 'update_tags': {'importer/reimport/import/1-1/2': }} 153s 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'] 153s 153s @pytest.mark.parametrize( 153s [ 153s 'input_repo', 153s 'validation_repo_delta', 153s 'validation_repo_expected_identical_refs', 153s ], 153s [ 153s ( 153s repo_builder.Repo(), 153s { 153s 'add_commits': [ 153s repo_builder.Commit(name='import'), 153s ], 153s 'update_tags': { 153s 'importer/import/1-1': Placeholder('import'), 153s }, 153s }, 153s [ 153s 'refs/tags/importer/import/1-1', 153s ], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[repo_builder.Commit(name='import')], 153s tags={'importer/import/1-1': Placeholder('import')}, 153s ), 153s { 153s 'add_commits': [ 153s repo_builder.Commit(name='reimport'), 153s ], 153s 'update_tags': { 153s 'importer/reimport/import/1-1/0': Placeholder('import'), 153s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 153s }, 153s }, 153s [ 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s ], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit(name='import'), 153s repo_builder.Commit(name='reimport1'), 153s ], 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/reimport/import/1-1/0': Placeholder('import'), 153s 'importer/reimport/import/1-1/1': Placeholder('reimport1'), 153s }, 153s ), 153s { 153s 'add_commits': [ 153s repo_builder.Commit(name='reimport2'), 153s ], 153s 'update_tags': { 153s 'importer/reimport/import/1-1/2': Placeholder('reimport2'), 153s }, 153s }, 153s [ 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s 'refs/tags/importer/reimport/import/1-1/2', 153s ], 153s ), 153s ], 153s ) 153s def test_create_import_tag( 153s repo, 153s input_repo, 153s validation_repo_delta, 153s validation_repo_expected_identical_refs, 153s ): 153s """ 153s Unit test that create_import_tag creates the correct import tag 153s 153s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 153s temporary output repository 153s :param repo_builder.Repo input_repo: input repository data 153s :param dict validation_repo_delta: how to transform the input repository 153s into a "validation repository", expressed as a dict to 153s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 153s input repository. The validation repository is then used for the 153s purposes of comparison against the output repository. 153s :param list(str) validation_repo_expected_identical_refs: refs that must be 153s identical between the validation repository and the output repository 153s """ 153s publish_commit = repo.raw_repo.get( 153s repo_builder.Commit().write(repo.raw_repo) 153s ).peel(pygit2.Commit) 153s > input_repo.write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:368: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmp52j2x3tc/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s ____________ test_create_import_tag_hash_stability_on_first_import _____________ 153s 153s repo = 153s 153s def test_create_import_tag_hash_stability_on_first_import(repo): 153s """Created import tags should be hash stable on first import 153s 153s :param GitUbuntuRepository repo: fixture providing a temporary 153s GitUbuntuRepository instance to use 153s """ 153s publish_commit = repo.raw_repo.get( 153s repo_builder.Commit( 153s author=pygit2.Signature( 153s 'Hash stability test author', 153s 'newauthor@example.com', 153s 1, 153s 2, 153s ), 153s committer=pygit2.Signature( 153s 'Hash stability test committer', 153s 'newcommitter@example.com', 153s 3, 153s 4, 153s ), 153s ).write(repo.raw_repo) 153s ).peel(pygit2.Commit) 153s > target.create_import_tag(repo, publish_commit, '1-1', 'importer') 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:402: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer.py:1379: in create_import_tag 153s repo.create_tag( 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s commit_hash = '65729a1dca101328820bf4f49fbca4e9571a772a' 153s tag_name = 'importer/import/1-1', tag_msg = 'git-ubuntu import' 153s tagger = pygit2.Signature('git-ubuntu importer', 'ubuntu-devel-discuss@lists.ubuntu.com', 3, 4, None) 153s 153s def create_tag(self, 153s commit_hash, 153s tag_name, 153s tag_msg, 153s tagger=None, 153s ): 153s """Create a tag in the repository 153s 153s :param str commit_hash: the commit hash the tag will point to. 153s :param str tag_name: the name of the tag to be created. 153s :param str tag_msg: the text of the tag annotation. 153s :param pygit2.Signature tagger: if supplied, use this signature in the 153s created tag's "tagger" metadata. If not supplied, an arbitrary name 153s and email address is used with the current time. 153s :returns: None 153s """ 153s if not tagger: 153s tagger_time, tagger_offset = datetime_to_signature_spec( 153s datetime.datetime.now(), 153s ) 153s tagger = pygit2.Signature( 153s gitubuntu.spec.SYNTHESIZED_COMMITTER_NAME, 153s gitubuntu.spec.SYNTHESIZED_COMMITTER_EMAIL, 153s tagger_time, 153s tagger_offset, 153s ) 153s 153s logging.debug("Creating tag %s pointing to %s", tag_name, commit_hash) 153s self.raw_repo.create_tag( 153s tag_name, 153s pygit2.Oid(hex=commit_hash), 153s > pygit2.GIT_OBJ_COMMIT, 153s tagger, 153s tag_msg, 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:2114: AttributeError 153s ______________ test_create_import_tag_hash_stability_on_reimport _______________ 153s 153s repo = 153s 153s def test_create_import_tag_hash_stability_on_reimport(repo): 153s """Created import tags should be hash stable on reimport 153s 153s This includes both the /0 duplicate reimport tag of the original import tag 153s as well as the /1 reimport tag being created. 153s 153s :param GitUbuntuRepository repo: fixture providing a temporary 153s GitUbuntuRepository instance to use 153s """ 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit( 153s name='root', 153s author=pygit2.Signature( 153s 'Hash stability test author', 153s 'author@example.com', 153s 1, 153s 2, 153s ), 153s committer=pygit2.Signature( 153s 'Hash stability test committer', 153s 'committer@example.com', 153s 3, 153s 4, 153s ), 153s ), 153s ], 153s tags={ 153s 'importer/import/1-1': Placeholder('root'), 153s }, 153s tagger=pygit2.Signature( 153s 'Hash stability test name', 153s 'stability@example.com', 153s 5, 153s 6, 153s ), 153s > ).write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:449: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmpbgcxc7gh/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s _ test_create_applied_tag[input_repo0-validation_repo_delta0-validation_repo_expected_identical_refs0] _ 153s 153s repo = 153s input_repo = 153s validation_repo_delta = {'add_commits': [], 'update_tags': {'importer/applied/1-1': }} 153s validation_repo_expected_identical_refs = ['refs/tags/importer/applied/1-1'] 153s 153s @pytest.mark.parametrize( 153s [ 153s 'input_repo', 153s 'validation_repo_delta', 153s 'validation_repo_expected_identical_refs', 153s ], 153s [ 153s ( 153s repo_builder.Repo(), 153s { 153s 'add_commits': [repo_builder.Commit(name='import')], 153s 'update_tags': {'importer/applied/1-1': Placeholder('import')}, 153s }, 153s [ 153s 'refs/tags/importer/applied/1-1', 153s ], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[repo_builder.Commit(name='import')], 153s tags={'importer/applied/1-1': Placeholder('import')}, 153s ), 153s { 153s 'add_commits': [repo_builder.Commit(name='reimport')], 153s 'update_tags': { 153s 'importer/reimport/applied/1-1/0': Placeholder('import'), 153s 'importer/reimport/applied/1-1/1': Placeholder('reimport'), 153s }, 153s }, 153s [ 153s 'refs/tags/importer/applied/1-1', 153s 'refs/tags/importer/reimport/applied/1-1/0', 153s 'refs/tags/importer/reimport/applied/1-1/1', 153s ], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit(name='import'), 153s repo_builder.Commit(name='reimport1'), 153s ], 153s tags={ 153s 'importer/applied/1-1': Placeholder('import'), 153s 'importer/reimport/applied/1-1/0': Placeholder('import'), 153s 'importer/reimport/applied/1-1/1': Placeholder('reimport1'), 153s }, 153s ), 153s { 153s 'add_commits': [ 153s repo_builder.Commit(name='reimport2') 153s ], 153s 'update_tags': { 153s 'importer/reimport/applied/1-1/2': Placeholder('reimport2'), 153s }, 153s }, 153s [ 153s 'refs/tags/importer/applied/1-1', 153s 'refs/tags/importer/reimport/applied/1-1/0', 153s 'refs/tags/importer/reimport/applied/1-1/1', 153s 'refs/tags/importer/reimport/applied/1-1/2', 153s ], 153s ), 153s ], 153s ) 153s def test_create_applied_tag( 153s repo, 153s input_repo, 153s validation_repo_delta, 153s validation_repo_expected_identical_refs, 153s ): 153s """ 153s Unit test that create_applied_tag creates the correct import tag 153s 153s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 153s temporary output repository 153s :param repo_builder.Repo input_repo: input repository data 153s :param dict validation_repo_delta: how to transform the input repository 153s into a "validation repository", expressed as a dict to 153s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 153s input repository. The validation repository is then used for the 153s purposes of comparison against the output repository. 153s :param list(str) validation_repo_expected_identical_refs: refs that must be 153s identical between the validation repository and the output repository 153s """ 153s publish_commit_str = str( 153s repo.raw_repo.get( 153s repo_builder.Commit().write(repo.raw_repo) 153s ).peel(pygit2.Commit).id 153s ) 153s 153s input_repo.write(repo.raw_repo) 153s 153s > target.create_applied_tag(repo, publish_commit_str, '1-1', 'importer') 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:577: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer.py:1309: in create_applied_tag 153s repo.create_tag( 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s commit_hash = '240dd844a69653244edb52c57c42d709512d64cd' 153s tag_name = 'importer/applied/1-1', tag_msg = 'git-ubuntu import' 153s tagger = pygit2.Signature('git-ubuntu importer', 'ubuntu-devel-discuss@lists.ubuntu.com', 1733219732, 0, None) 153s 153s def create_tag(self, 153s commit_hash, 153s tag_name, 153s tag_msg, 153s tagger=None, 153s ): 153s """Create a tag in the repository 153s 153s :param str commit_hash: the commit hash the tag will point to. 153s :param str tag_name: the name of the tag to be created. 153s :param str tag_msg: the text of the tag annotation. 153s :param pygit2.Signature tagger: if supplied, use this signature in the 153s created tag's "tagger" metadata. If not supplied, an arbitrary name 153s and email address is used with the current time. 153s :returns: None 153s """ 153s if not tagger: 153s tagger_time, tagger_offset = datetime_to_signature_spec( 153s datetime.datetime.now(), 153s ) 153s tagger = pygit2.Signature( 153s gitubuntu.spec.SYNTHESIZED_COMMITTER_NAME, 153s gitubuntu.spec.SYNTHESIZED_COMMITTER_EMAIL, 153s tagger_time, 153s tagger_offset, 153s ) 153s 153s logging.debug("Creating tag %s pointing to %s", tag_name, commit_hash) 153s self.raw_repo.create_tag( 153s tag_name, 153s pygit2.Oid(hex=commit_hash), 153s > pygit2.GIT_OBJ_COMMIT, 153s tagger, 153s tag_msg, 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:2114: AttributeError 153s _ test_create_applied_tag[input_repo1-validation_repo_delta1-validation_repo_expected_identical_refs1] _ 153s 153s repo = 153s input_repo = 153s validation_repo_delta = {'add_commits': [], 'update_tags': {'importer/reimport/applied... at 0x7b5155aba1b0>, 'importer/reimport/applied/1-1/1': }} 153s 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'] 153s 153s @pytest.mark.parametrize( 153s [ 153s 'input_repo', 153s 'validation_repo_delta', 153s 'validation_repo_expected_identical_refs', 153s ], 153s [ 153s ( 153s repo_builder.Repo(), 153s { 153s 'add_commits': [repo_builder.Commit(name='import')], 153s 'update_tags': {'importer/applied/1-1': Placeholder('import')}, 153s }, 153s [ 153s 'refs/tags/importer/applied/1-1', 153s ], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[repo_builder.Commit(name='import')], 153s tags={'importer/applied/1-1': Placeholder('import')}, 153s ), 153s { 153s 'add_commits': [repo_builder.Commit(name='reimport')], 153s 'update_tags': { 153s 'importer/reimport/applied/1-1/0': Placeholder('import'), 153s 'importer/reimport/applied/1-1/1': Placeholder('reimport'), 153s }, 153s }, 153s [ 153s 'refs/tags/importer/applied/1-1', 153s 'refs/tags/importer/reimport/applied/1-1/0', 153s 'refs/tags/importer/reimport/applied/1-1/1', 153s ], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit(name='import'), 153s repo_builder.Commit(name='reimport1'), 153s ], 153s tags={ 153s 'importer/applied/1-1': Placeholder('import'), 153s 'importer/reimport/applied/1-1/0': Placeholder('import'), 153s 'importer/reimport/applied/1-1/1': Placeholder('reimport1'), 153s }, 153s ), 153s { 153s 'add_commits': [ 153s repo_builder.Commit(name='reimport2') 153s ], 153s 'update_tags': { 153s 'importer/reimport/applied/1-1/2': Placeholder('reimport2'), 153s }, 153s }, 153s [ 153s 'refs/tags/importer/applied/1-1', 153s 'refs/tags/importer/reimport/applied/1-1/0', 153s 'refs/tags/importer/reimport/applied/1-1/1', 153s 'refs/tags/importer/reimport/applied/1-1/2', 153s ], 153s ), 153s ], 153s ) 153s def test_create_applied_tag( 153s repo, 153s input_repo, 153s validation_repo_delta, 153s validation_repo_expected_identical_refs, 153s ): 153s """ 153s Unit test that create_applied_tag creates the correct import tag 153s 153s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 153s temporary output repository 153s :param repo_builder.Repo input_repo: input repository data 153s :param dict validation_repo_delta: how to transform the input repository 153s into a "validation repository", expressed as a dict to 153s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 153s input repository. The validation repository is then used for the 153s purposes of comparison against the output repository. 153s :param list(str) validation_repo_expected_identical_refs: refs that must be 153s identical between the validation repository and the output repository 153s """ 153s publish_commit_str = str( 153s repo.raw_repo.get( 153s repo_builder.Commit().write(repo.raw_repo) 153s ).peel(pygit2.Commit).id 153s ) 153s 153s > input_repo.write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:575: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmpy2r5e_jn/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s _ test_create_applied_tag[input_repo2-validation_repo_delta2-validation_repo_expected_identical_refs2] _ 153s 153s repo = 153s input_repo = 153s validation_repo_delta = {'add_commits': [], 'update_tags': {'importer/reimport/applied/1-1/2': }} 153s 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'] 153s 153s @pytest.mark.parametrize( 153s [ 153s 'input_repo', 153s 'validation_repo_delta', 153s 'validation_repo_expected_identical_refs', 153s ], 153s [ 153s ( 153s repo_builder.Repo(), 153s { 153s 'add_commits': [repo_builder.Commit(name='import')], 153s 'update_tags': {'importer/applied/1-1': Placeholder('import')}, 153s }, 153s [ 153s 'refs/tags/importer/applied/1-1', 153s ], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[repo_builder.Commit(name='import')], 153s tags={'importer/applied/1-1': Placeholder('import')}, 153s ), 153s { 153s 'add_commits': [repo_builder.Commit(name='reimport')], 153s 'update_tags': { 153s 'importer/reimport/applied/1-1/0': Placeholder('import'), 153s 'importer/reimport/applied/1-1/1': Placeholder('reimport'), 153s }, 153s }, 153s [ 153s 'refs/tags/importer/applied/1-1', 153s 'refs/tags/importer/reimport/applied/1-1/0', 153s 'refs/tags/importer/reimport/applied/1-1/1', 153s ], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit(name='import'), 153s repo_builder.Commit(name='reimport1'), 153s ], 153s tags={ 153s 'importer/applied/1-1': Placeholder('import'), 153s 'importer/reimport/applied/1-1/0': Placeholder('import'), 153s 'importer/reimport/applied/1-1/1': Placeholder('reimport1'), 153s }, 153s ), 153s { 153s 'add_commits': [ 153s repo_builder.Commit(name='reimport2') 153s ], 153s 'update_tags': { 153s 'importer/reimport/applied/1-1/2': Placeholder('reimport2'), 153s }, 153s }, 153s [ 153s 'refs/tags/importer/applied/1-1', 153s 'refs/tags/importer/reimport/applied/1-1/0', 153s 'refs/tags/importer/reimport/applied/1-1/1', 153s 'refs/tags/importer/reimport/applied/1-1/2', 153s ], 153s ), 153s ], 153s ) 153s def test_create_applied_tag( 153s repo, 153s input_repo, 153s validation_repo_delta, 153s validation_repo_expected_identical_refs, 153s ): 153s """ 153s Unit test that create_applied_tag creates the correct import tag 153s 153s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 153s temporary output repository 153s :param repo_builder.Repo input_repo: input repository data 153s :param dict validation_repo_delta: how to transform the input repository 153s into a "validation repository", expressed as a dict to 153s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 153s input repository. The validation repository is then used for the 153s purposes of comparison against the output repository. 153s :param list(str) validation_repo_expected_identical_refs: refs that must be 153s identical between the validation repository and the output repository 153s """ 153s publish_commit_str = str( 153s repo.raw_repo.get( 153s repo_builder.Commit().write(repo.raw_repo) 153s ).peel(pygit2.Commit).id 153s ) 153s 153s > input_repo.write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:575: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmpwvqjnmgw/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s _ test_get_changelog_parent_commits[input_repo1-parent_overrides1-changelog_versions1-PatchState.UNAPPLIED-expected_refs1] _ 153s 153s repo = 153s input_repo = 153s parent_overrides = {}, changelog_versions = ['1-2', '1-1'] 153s patch_state = 153s expected_refs = ['refs/tags/importer/import/1-1'] 153s 153s @pytest.mark.parametrize( 153s [ 153s 'input_repo', 153s 'parent_overrides', 153s 'changelog_versions', 153s 'patch_state', 153s 'expected_refs', 153s ], 153s [ 153s ( 153s repo_builder.Repo(), 153s {}, 153s ['1-2', '1-1',], 153s PatchState.UNAPPLIED, 153s [], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[repo_builder.Commit.from_spec(name='import')], 153s tags={'importer/import/1-1': Placeholder('import')}, 153s ), 153s {}, 153s ['1-2', '1-1'], 153s PatchState.UNAPPLIED, 153s ['refs/tags/importer/import/1-1'], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit.from_spec(name='import'), 153s repo_builder.Commit.from_spec(name='reimport', mutate=1), 153s ], 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/reimport/import/1-1/0': Placeholder('import'), 153s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 153s }, 153s ), 153s {}, 153s ['1-2', '1-1'], 153s PatchState.UNAPPLIED, 153s [ 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s ], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[repo_builder.Commit.from_spec(name='import')], 153s tags={'importer/import/1-1': Placeholder('import')}, 153s ), 153s {}, 153s ['1-3', '1-2', '1-1'], 153s PatchState.UNAPPLIED, 153s ['refs/tags/importer/import/1-1'], 153s ), 153s ( 153s repo_builder.Repo(), 153s {}, 153s ['1-2', '1-1',], 153s PatchState.APPLIED, 153s [], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[repo_builder.Commit.from_spec(name='applied')], 153s tags={'importer/applied/1-1': Placeholder('applied')}, 153s ), 153s {}, 153s ['1-2', '1-1'], 153s PatchState.APPLIED, 153s ['refs/tags/importer/applied/1-1'], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit.from_spec(name='import'), 153s repo_builder.Commit.from_spec(name='reimport', mutate=1), 153s ], 153s tags={ 153s 'importer/applied/1-1': Placeholder('import'), 153s 'importer/reimport/applied/1-1/0': Placeholder('import'), 153s 'importer/reimport/applied/1-1/1': Placeholder('reimport'), 153s }, 153s ), 153s {}, 153s ['1-2', '1-1'], 153s PatchState.APPLIED, 153s [ 153s 'refs/tags/importer/reimport/applied/1-1/0', 153s 'refs/tags/importer/reimport/applied/1-1/1', 153s ], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[repo_builder.Commit.from_spec(name='applied')], 153s tags={'importer/applied/1-1': Placeholder('applied')}, 153s ), 153s {}, 153s ['1-3', '1-2', '1-1'], 153s PatchState.APPLIED, 153s ['refs/tags/importer/applied/1-1'], 153s ), 153s ], 153s ) 153s def test_get_changelog_parent_commits( 153s repo, 153s input_repo, 153s parent_overrides, 153s changelog_versions, 153s patch_state, 153s expected_refs, 153s ): 153s """Test that get_changelog_parent_commits is generally correct 153s 153s This is the general parameterised test for the common case uses of 153s target.get_changelog_parent_commits. 153s 153s :param GitUbuntuRepository repo: fixture providing a temporary 153s GitUbuntuRepository instance to use 153s :param repo_builder.Repo input_repo: the input repository data to use that 153s will be populated into @repo before @repo is passed through to 153s get_changelog_parent_commits 153s :param dict parent_overrides: passed through to 153s get_changelog_parent_commits. 153s :param PatchState patch_state: passed through to 153s get_changelog_parent_commits 153s :param list(str) expected_refs: the expected return value of 153s get_changelog_parent_commits expressed using a list of reference names. 153s Since get_changelog_parent_commits returns a list of commit hash 153s strings, the reference names will need to be dereferenced before 153s comparison; this way the test parameters don't need to be opaque hash 153s strings. 153s """ 153s > input_repo.write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:721: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmp90zrx3ub/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s _ test_get_changelog_parent_commits[input_repo2-parent_overrides2-changelog_versions2-PatchState.UNAPPLIED-expected_refs2] _ 153s 153s repo = 153s input_repo = 153s parent_overrides = {}, changelog_versions = ['1-2', '1-1'] 153s patch_state = 153s expected_refs = ['refs/tags/importer/reimport/import/1-1/0', 'refs/tags/importer/reimport/import/1-1/1'] 153s 153s @pytest.mark.parametrize( 153s [ 153s 'input_repo', 153s 'parent_overrides', 153s 'changelog_versions', 153s 'patch_state', 153s 'expected_refs', 153s ], 153s [ 153s ( 153s repo_builder.Repo(), 153s {}, 153s ['1-2', '1-1',], 153s PatchState.UNAPPLIED, 153s [], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[repo_builder.Commit.from_spec(name='import')], 153s tags={'importer/import/1-1': Placeholder('import')}, 153s ), 153s {}, 153s ['1-2', '1-1'], 153s PatchState.UNAPPLIED, 153s ['refs/tags/importer/import/1-1'], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit.from_spec(name='import'), 153s repo_builder.Commit.from_spec(name='reimport', mutate=1), 153s ], 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/reimport/import/1-1/0': Placeholder('import'), 153s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 153s }, 153s ), 153s {}, 153s ['1-2', '1-1'], 153s PatchState.UNAPPLIED, 153s [ 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s ], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[repo_builder.Commit.from_spec(name='import')], 153s tags={'importer/import/1-1': Placeholder('import')}, 153s ), 153s {}, 153s ['1-3', '1-2', '1-1'], 153s PatchState.UNAPPLIED, 153s ['refs/tags/importer/import/1-1'], 153s ), 153s ( 153s repo_builder.Repo(), 153s {}, 153s ['1-2', '1-1',], 153s PatchState.APPLIED, 153s [], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[repo_builder.Commit.from_spec(name='applied')], 153s tags={'importer/applied/1-1': Placeholder('applied')}, 153s ), 153s {}, 153s ['1-2', '1-1'], 153s PatchState.APPLIED, 153s ['refs/tags/importer/applied/1-1'], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit.from_spec(name='import'), 153s repo_builder.Commit.from_spec(name='reimport', mutate=1), 153s ], 153s tags={ 153s 'importer/applied/1-1': Placeholder('import'), 153s 'importer/reimport/applied/1-1/0': Placeholder('import'), 153s 'importer/reimport/applied/1-1/1': Placeholder('reimport'), 153s }, 153s ), 153s {}, 153s ['1-2', '1-1'], 153s PatchState.APPLIED, 153s [ 153s 'refs/tags/importer/reimport/applied/1-1/0', 153s 'refs/tags/importer/reimport/applied/1-1/1', 153s ], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[repo_builder.Commit.from_spec(name='applied')], 153s tags={'importer/applied/1-1': Placeholder('applied')}, 153s ), 153s {}, 153s ['1-3', '1-2', '1-1'], 153s PatchState.APPLIED, 153s ['refs/tags/importer/applied/1-1'], 153s ), 153s ], 153s ) 153s def test_get_changelog_parent_commits( 153s repo, 153s input_repo, 153s parent_overrides, 153s changelog_versions, 153s patch_state, 153s expected_refs, 153s ): 153s """Test that get_changelog_parent_commits is generally correct 153s 153s This is the general parameterised test for the common case uses of 153s target.get_changelog_parent_commits. 153s 153s :param GitUbuntuRepository repo: fixture providing a temporary 153s GitUbuntuRepository instance to use 153s :param repo_builder.Repo input_repo: the input repository data to use that 153s will be populated into @repo before @repo is passed through to 153s get_changelog_parent_commits 153s :param dict parent_overrides: passed through to 153s get_changelog_parent_commits. 153s :param PatchState patch_state: passed through to 153s get_changelog_parent_commits 153s :param list(str) expected_refs: the expected return value of 153s get_changelog_parent_commits expressed using a list of reference names. 153s Since get_changelog_parent_commits returns a list of commit hash 153s strings, the reference names will need to be dereferenced before 153s comparison; this way the test parameters don't need to be opaque hash 153s strings. 153s """ 153s > input_repo.write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:721: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmpsyiumz9d/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s _ test_get_changelog_parent_commits[input_repo3-parent_overrides3-changelog_versions3-PatchState.UNAPPLIED-expected_refs3] _ 153s 153s repo = 153s input_repo = 153s parent_overrides = {}, changelog_versions = ['1-3', '1-2', '1-1'] 153s patch_state = 153s expected_refs = ['refs/tags/importer/import/1-1'] 153s 153s @pytest.mark.parametrize( 153s [ 153s 'input_repo', 153s 'parent_overrides', 153s 'changelog_versions', 153s 'patch_state', 153s 'expected_refs', 153s ], 153s [ 153s ( 153s repo_builder.Repo(), 153s {}, 153s ['1-2', '1-1',], 153s PatchState.UNAPPLIED, 153s [], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[repo_builder.Commit.from_spec(name='import')], 153s tags={'importer/import/1-1': Placeholder('import')}, 153s ), 153s {}, 153s ['1-2', '1-1'], 153s PatchState.UNAPPLIED, 153s ['refs/tags/importer/import/1-1'], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit.from_spec(name='import'), 153s repo_builder.Commit.from_spec(name='reimport', mutate=1), 153s ], 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/reimport/import/1-1/0': Placeholder('import'), 153s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 153s }, 153s ), 153s {}, 153s ['1-2', '1-1'], 153s PatchState.UNAPPLIED, 153s [ 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s ], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[repo_builder.Commit.from_spec(name='import')], 153s tags={'importer/import/1-1': Placeholder('import')}, 153s ), 153s {}, 153s ['1-3', '1-2', '1-1'], 153s PatchState.UNAPPLIED, 153s ['refs/tags/importer/import/1-1'], 153s ), 153s ( 153s repo_builder.Repo(), 153s {}, 153s ['1-2', '1-1',], 153s PatchState.APPLIED, 153s [], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[repo_builder.Commit.from_spec(name='applied')], 153s tags={'importer/applied/1-1': Placeholder('applied')}, 153s ), 153s {}, 153s ['1-2', '1-1'], 153s PatchState.APPLIED, 153s ['refs/tags/importer/applied/1-1'], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit.from_spec(name='import'), 153s repo_builder.Commit.from_spec(name='reimport', mutate=1), 153s ], 153s tags={ 153s 'importer/applied/1-1': Placeholder('import'), 153s 'importer/reimport/applied/1-1/0': Placeholder('import'), 153s 'importer/reimport/applied/1-1/1': Placeholder('reimport'), 153s }, 153s ), 153s {}, 153s ['1-2', '1-1'], 153s PatchState.APPLIED, 153s [ 153s 'refs/tags/importer/reimport/applied/1-1/0', 153s 'refs/tags/importer/reimport/applied/1-1/1', 153s ], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[repo_builder.Commit.from_spec(name='applied')], 153s tags={'importer/applied/1-1': Placeholder('applied')}, 153s ), 153s {}, 153s ['1-3', '1-2', '1-1'], 153s PatchState.APPLIED, 153s ['refs/tags/importer/applied/1-1'], 153s ), 153s ], 153s ) 153s def test_get_changelog_parent_commits( 153s repo, 153s input_repo, 153s parent_overrides, 153s changelog_versions, 153s patch_state, 153s expected_refs, 153s ): 153s """Test that get_changelog_parent_commits is generally correct 153s 153s This is the general parameterised test for the common case uses of 153s target.get_changelog_parent_commits. 153s 153s :param GitUbuntuRepository repo: fixture providing a temporary 153s GitUbuntuRepository instance to use 153s :param repo_builder.Repo input_repo: the input repository data to use that 153s will be populated into @repo before @repo is passed through to 153s get_changelog_parent_commits 153s :param dict parent_overrides: passed through to 153s get_changelog_parent_commits. 153s :param PatchState patch_state: passed through to 153s get_changelog_parent_commits 153s :param list(str) expected_refs: the expected return value of 153s get_changelog_parent_commits expressed using a list of reference names. 153s Since get_changelog_parent_commits returns a list of commit hash 153s strings, the reference names will need to be dereferenced before 153s comparison; this way the test parameters don't need to be opaque hash 153s strings. 153s """ 153s > input_repo.write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:721: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmpj40bqj_2/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s _ test_get_changelog_parent_commits[input_repo5-parent_overrides5-changelog_versions5-PatchState.APPLIED-expected_refs5] _ 153s 153s repo = 153s input_repo = 153s parent_overrides = {}, changelog_versions = ['1-2', '1-1'] 153s patch_state = 153s expected_refs = ['refs/tags/importer/applied/1-1'] 153s 153s @pytest.mark.parametrize( 153s [ 153s 'input_repo', 153s 'parent_overrides', 153s 'changelog_versions', 153s 'patch_state', 153s 'expected_refs', 153s ], 153s [ 153s ( 153s repo_builder.Repo(), 153s {}, 153s ['1-2', '1-1',], 153s PatchState.UNAPPLIED, 153s [], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[repo_builder.Commit.from_spec(name='import')], 153s tags={'importer/import/1-1': Placeholder('import')}, 153s ), 153s {}, 153s ['1-2', '1-1'], 153s PatchState.UNAPPLIED, 153s ['refs/tags/importer/import/1-1'], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit.from_spec(name='import'), 153s repo_builder.Commit.from_spec(name='reimport', mutate=1), 153s ], 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/reimport/import/1-1/0': Placeholder('import'), 153s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 153s }, 153s ), 153s {}, 153s ['1-2', '1-1'], 153s PatchState.UNAPPLIED, 153s [ 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s ], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[repo_builder.Commit.from_spec(name='import')], 153s tags={'importer/import/1-1': Placeholder('import')}, 153s ), 153s {}, 153s ['1-3', '1-2', '1-1'], 153s PatchState.UNAPPLIED, 153s ['refs/tags/importer/import/1-1'], 153s ), 153s ( 153s repo_builder.Repo(), 153s {}, 153s ['1-2', '1-1',], 153s PatchState.APPLIED, 153s [], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[repo_builder.Commit.from_spec(name='applied')], 153s tags={'importer/applied/1-1': Placeholder('applied')}, 153s ), 153s {}, 153s ['1-2', '1-1'], 153s PatchState.APPLIED, 153s ['refs/tags/importer/applied/1-1'], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit.from_spec(name='import'), 153s repo_builder.Commit.from_spec(name='reimport', mutate=1), 153s ], 153s tags={ 153s 'importer/applied/1-1': Placeholder('import'), 153s 'importer/reimport/applied/1-1/0': Placeholder('import'), 153s 'importer/reimport/applied/1-1/1': Placeholder('reimport'), 153s }, 153s ), 153s {}, 153s ['1-2', '1-1'], 153s PatchState.APPLIED, 153s [ 153s 'refs/tags/importer/reimport/applied/1-1/0', 153s 'refs/tags/importer/reimport/applied/1-1/1', 153s ], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[repo_builder.Commit.from_spec(name='applied')], 153s tags={'importer/applied/1-1': Placeholder('applied')}, 153s ), 153s {}, 153s ['1-3', '1-2', '1-1'], 153s PatchState.APPLIED, 153s ['refs/tags/importer/applied/1-1'], 153s ), 153s ], 153s ) 153s def test_get_changelog_parent_commits( 153s repo, 153s input_repo, 153s parent_overrides, 153s changelog_versions, 153s patch_state, 153s expected_refs, 153s ): 153s """Test that get_changelog_parent_commits is generally correct 153s 153s This is the general parameterised test for the common case uses of 153s target.get_changelog_parent_commits. 153s 153s :param GitUbuntuRepository repo: fixture providing a temporary 153s GitUbuntuRepository instance to use 153s :param repo_builder.Repo input_repo: the input repository data to use that 153s will be populated into @repo before @repo is passed through to 153s get_changelog_parent_commits 153s :param dict parent_overrides: passed through to 153s get_changelog_parent_commits. 153s :param PatchState patch_state: passed through to 153s get_changelog_parent_commits 153s :param list(str) expected_refs: the expected return value of 153s get_changelog_parent_commits expressed using a list of reference names. 153s Since get_changelog_parent_commits returns a list of commit hash 153s strings, the reference names will need to be dereferenced before 153s comparison; this way the test parameters don't need to be opaque hash 153s strings. 153s """ 153s > input_repo.write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:721: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmpt3sa0_y6/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s _ test_get_changelog_parent_commits[input_repo6-parent_overrides6-changelog_versions6-PatchState.APPLIED-expected_refs6] _ 153s 153s repo = 153s input_repo = 153s parent_overrides = {}, changelog_versions = ['1-2', '1-1'] 153s patch_state = 153s expected_refs = ['refs/tags/importer/reimport/applied/1-1/0', 'refs/tags/importer/reimport/applied/1-1/1'] 153s 153s @pytest.mark.parametrize( 153s [ 153s 'input_repo', 153s 'parent_overrides', 153s 'changelog_versions', 153s 'patch_state', 153s 'expected_refs', 153s ], 153s [ 153s ( 153s repo_builder.Repo(), 153s {}, 153s ['1-2', '1-1',], 153s PatchState.UNAPPLIED, 153s [], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[repo_builder.Commit.from_spec(name='import')], 153s tags={'importer/import/1-1': Placeholder('import')}, 153s ), 153s {}, 153s ['1-2', '1-1'], 153s PatchState.UNAPPLIED, 153s ['refs/tags/importer/import/1-1'], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit.from_spec(name='import'), 153s repo_builder.Commit.from_spec(name='reimport', mutate=1), 153s ], 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/reimport/import/1-1/0': Placeholder('import'), 153s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 153s }, 153s ), 153s {}, 153s ['1-2', '1-1'], 153s PatchState.UNAPPLIED, 153s [ 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s ], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[repo_builder.Commit.from_spec(name='import')], 153s tags={'importer/import/1-1': Placeholder('import')}, 153s ), 153s {}, 153s ['1-3', '1-2', '1-1'], 153s PatchState.UNAPPLIED, 153s ['refs/tags/importer/import/1-1'], 153s ), 153s ( 153s repo_builder.Repo(), 153s {}, 153s ['1-2', '1-1',], 153s PatchState.APPLIED, 153s [], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[repo_builder.Commit.from_spec(name='applied')], 153s tags={'importer/applied/1-1': Placeholder('applied')}, 153s ), 153s {}, 153s ['1-2', '1-1'], 153s PatchState.APPLIED, 153s ['refs/tags/importer/applied/1-1'], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit.from_spec(name='import'), 153s repo_builder.Commit.from_spec(name='reimport', mutate=1), 153s ], 153s tags={ 153s 'importer/applied/1-1': Placeholder('import'), 153s 'importer/reimport/applied/1-1/0': Placeholder('import'), 153s 'importer/reimport/applied/1-1/1': Placeholder('reimport'), 153s }, 153s ), 153s {}, 153s ['1-2', '1-1'], 153s PatchState.APPLIED, 153s [ 153s 'refs/tags/importer/reimport/applied/1-1/0', 153s 'refs/tags/importer/reimport/applied/1-1/1', 153s ], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[repo_builder.Commit.from_spec(name='applied')], 153s tags={'importer/applied/1-1': Placeholder('applied')}, 153s ), 153s {}, 153s ['1-3', '1-2', '1-1'], 153s PatchState.APPLIED, 153s ['refs/tags/importer/applied/1-1'], 153s ), 153s ], 153s ) 153s def test_get_changelog_parent_commits( 153s repo, 153s input_repo, 153s parent_overrides, 153s changelog_versions, 153s patch_state, 153s expected_refs, 153s ): 153s """Test that get_changelog_parent_commits is generally correct 153s 153s This is the general parameterised test for the common case uses of 153s target.get_changelog_parent_commits. 153s 153s :param GitUbuntuRepository repo: fixture providing a temporary 153s GitUbuntuRepository instance to use 153s :param repo_builder.Repo input_repo: the input repository data to use that 153s will be populated into @repo before @repo is passed through to 153s get_changelog_parent_commits 153s :param dict parent_overrides: passed through to 153s get_changelog_parent_commits. 153s :param PatchState patch_state: passed through to 153s get_changelog_parent_commits 153s :param list(str) expected_refs: the expected return value of 153s get_changelog_parent_commits expressed using a list of reference names. 153s Since get_changelog_parent_commits returns a list of commit hash 153s strings, the reference names will need to be dereferenced before 153s comparison; this way the test parameters don't need to be opaque hash 153s strings. 153s """ 153s > input_repo.write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:721: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmpc7gfhwto/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s _ test_get_changelog_parent_commits[input_repo7-parent_overrides7-changelog_versions7-PatchState.APPLIED-expected_refs7] _ 153s 153s repo = 153s input_repo = 153s parent_overrides = {}, changelog_versions = ['1-3', '1-2', '1-1'] 153s patch_state = 153s expected_refs = ['refs/tags/importer/applied/1-1'] 153s 153s @pytest.mark.parametrize( 153s [ 153s 'input_repo', 153s 'parent_overrides', 153s 'changelog_versions', 153s 'patch_state', 153s 'expected_refs', 153s ], 153s [ 153s ( 153s repo_builder.Repo(), 153s {}, 153s ['1-2', '1-1',], 153s PatchState.UNAPPLIED, 153s [], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[repo_builder.Commit.from_spec(name='import')], 153s tags={'importer/import/1-1': Placeholder('import')}, 153s ), 153s {}, 153s ['1-2', '1-1'], 153s PatchState.UNAPPLIED, 153s ['refs/tags/importer/import/1-1'], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit.from_spec(name='import'), 153s repo_builder.Commit.from_spec(name='reimport', mutate=1), 153s ], 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/reimport/import/1-1/0': Placeholder('import'), 153s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 153s }, 153s ), 153s {}, 153s ['1-2', '1-1'], 153s PatchState.UNAPPLIED, 153s [ 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s ], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[repo_builder.Commit.from_spec(name='import')], 153s tags={'importer/import/1-1': Placeholder('import')}, 153s ), 153s {}, 153s ['1-3', '1-2', '1-1'], 153s PatchState.UNAPPLIED, 153s ['refs/tags/importer/import/1-1'], 153s ), 153s ( 153s repo_builder.Repo(), 153s {}, 153s ['1-2', '1-1',], 153s PatchState.APPLIED, 153s [], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[repo_builder.Commit.from_spec(name='applied')], 153s tags={'importer/applied/1-1': Placeholder('applied')}, 153s ), 153s {}, 153s ['1-2', '1-1'], 153s PatchState.APPLIED, 153s ['refs/tags/importer/applied/1-1'], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit.from_spec(name='import'), 153s repo_builder.Commit.from_spec(name='reimport', mutate=1), 153s ], 153s tags={ 153s 'importer/applied/1-1': Placeholder('import'), 153s 'importer/reimport/applied/1-1/0': Placeholder('import'), 153s 'importer/reimport/applied/1-1/1': Placeholder('reimport'), 153s }, 153s ), 153s {}, 153s ['1-2', '1-1'], 153s PatchState.APPLIED, 153s [ 153s 'refs/tags/importer/reimport/applied/1-1/0', 153s 'refs/tags/importer/reimport/applied/1-1/1', 153s ], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[repo_builder.Commit.from_spec(name='applied')], 153s tags={'importer/applied/1-1': Placeholder('applied')}, 153s ), 153s {}, 153s ['1-3', '1-2', '1-1'], 153s PatchState.APPLIED, 153s ['refs/tags/importer/applied/1-1'], 153s ), 153s ], 153s ) 153s def test_get_changelog_parent_commits( 153s repo, 153s input_repo, 153s parent_overrides, 153s changelog_versions, 153s patch_state, 153s expected_refs, 153s ): 153s """Test that get_changelog_parent_commits is generally correct 153s 153s This is the general parameterised test for the common case uses of 153s target.get_changelog_parent_commits. 153s 153s :param GitUbuntuRepository repo: fixture providing a temporary 153s GitUbuntuRepository instance to use 153s :param repo_builder.Repo input_repo: the input repository data to use that 153s will be populated into @repo before @repo is passed through to 153s get_changelog_parent_commits 153s :param dict parent_overrides: passed through to 153s get_changelog_parent_commits. 153s :param PatchState patch_state: passed through to 153s get_changelog_parent_commits 153s :param list(str) expected_refs: the expected return value of 153s get_changelog_parent_commits expressed using a list of reference names. 153s Since get_changelog_parent_commits returns a list of commit hash 153s strings, the reference names will need to be dereferenced before 153s comparison; this way the test parameters don't need to be opaque hash 153s strings. 153s """ 153s > input_repo.write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:721: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmp9em3od8z/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s _________ test_validate_rich_history[input_repo0-published_spec0-True] _________ 153s 153s repo = 153s input_repo = 153s published_spec = {'changelog_versions': ['1-2', '1-1']}, expected_result = True 153s 153s @pytest.mark.parametrize( 153s [ 153s 'input_repo', 153s 'published_spec', 153s 'expected_result', 153s ], 153s [ 153s ( 153s # Common case: upload tag has a changelog parent as an ancestor 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit.from_spec(name='import'), 153s repo_builder.Commit.from_spec( 153s name='upload', 153s changelog_versions=['1-2', '1-1'], 153s parents=[Placeholder('import')], 153s ), 153s ], 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/upload/1-2': Placeholder('upload'), 153s }, 153s ), 153s {'changelog_versions': ['1-2', '1-1']}, 153s True, 153s ), 153s ( 153s # Upload tag is the first one, with no parents present 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit.from_spec( 153s name='upload', 153s version='1-2', 153s ), 153s ], 153s tags={ 153s 'importer/upload/1-2': Placeholder('upload'), 153s }, 153s ), 153s {'changelog_versions': ['1-2']}, 153s True, 153s ), 153s ( 153s # Upload tag mismatches published tree but is otherwise correct 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit.from_spec(name='import'), 153s repo_builder.Commit.from_spec( 153s name='upload', 153s changelog_versions=['1-2', '1-1'], 153s parents=[Placeholder('import')], 153s mutate=True, 153s ), 153s ], 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/upload/1-2': Placeholder('upload'), 153s }, 153s ), 153s {'changelog_versions': ['1-2', '1-1']}, 153s target.RichHistoryTreeMismatch, 153s ), 153s ( 153s # Upload tag doesn't have a changelog parent as an ancestor but is 153s # otherwise correct 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit.from_spec(name='import'), 153s repo_builder.Commit.from_spec( 153s name='upload', 153s changelog_versions=['1-2', '1-1'], 153s ), 153s ], 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/upload/1-2': Placeholder('upload'), 153s }, 153s ), 153s {'changelog_versions': ['1-2', '1-1']}, 153s target.RichHistoryHasNoChangelogParentAncestor, 153s ), 153s ], 153s ) 153s def test_validate_rich_history( 153s repo, 153s input_repo, 153s published_spec, 153s expected_result, 153s ): 153s """ 153s General test for validate_rich_history(). 153s 153s This unit tests validate_rich_history() for various parameterized cases. 153s Given an input repository and the specification of a Launchpad publication 153s of a source package, we check that validate_rich_history() correctly 153s accepts or rejects the rich history corresponding to the upload tag named 153s 'importer/upload/1-2'. It is assumed that the package being imported is 153s always of version '1-2' for all parameter sets. 153s 153s Since the target function requires rich history, the case of there not 153s being rich history does not need to be tested here, as it wouldn't be 153s called in this case. 153s 153s validate_rich_history() is generic for all sourced rich history, not just 153s rich history sourced from an upload tag. But since it is independent of how 153s the rich history commit arrived, it is easiest to use upload tags to test 153s it; this results in coverage for all sources. 153s 153s :param GitUbuntuRepository repo: fixture providing a temporary 153s GitUbuntuRepository instance to use 153s :param repo_builder.Repo input_repo: input repository data 153s :param dict published_spec: the package simulated being imported from the 153s archive, specified as a dict to pass as **kwargs to 153s repo_builder.Commit.from_spec() 153s :param bool expected_result: the expected return value of, or exception 153s raised by, the call to validate_rich_history() 153s """ 153s > input_repo.write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:910: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmpwt7ll1xw/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-2.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-2.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s _________ test_validate_rich_history[input_repo1-published_spec1-True] _________ 153s 153s repo = 153s input_repo = 153s published_spec = {'changelog_versions': ['1-2']}, expected_result = True 153s 153s @pytest.mark.parametrize( 153s [ 153s 'input_repo', 153s 'published_spec', 153s 'expected_result', 153s ], 153s [ 153s ( 153s # Common case: upload tag has a changelog parent as an ancestor 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit.from_spec(name='import'), 153s repo_builder.Commit.from_spec( 153s name='upload', 153s changelog_versions=['1-2', '1-1'], 153s parents=[Placeholder('import')], 153s ), 153s ], 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/upload/1-2': Placeholder('upload'), 153s }, 153s ), 153s {'changelog_versions': ['1-2', '1-1']}, 153s True, 153s ), 153s ( 153s # Upload tag is the first one, with no parents present 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit.from_spec( 153s name='upload', 153s version='1-2', 153s ), 153s ], 153s tags={ 153s 'importer/upload/1-2': Placeholder('upload'), 153s }, 153s ), 153s {'changelog_versions': ['1-2']}, 153s True, 153s ), 153s ( 153s # Upload tag mismatches published tree but is otherwise correct 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit.from_spec(name='import'), 153s repo_builder.Commit.from_spec( 153s name='upload', 153s changelog_versions=['1-2', '1-1'], 153s parents=[Placeholder('import')], 153s mutate=True, 153s ), 153s ], 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/upload/1-2': Placeholder('upload'), 153s }, 153s ), 153s {'changelog_versions': ['1-2', '1-1']}, 153s target.RichHistoryTreeMismatch, 153s ), 153s ( 153s # Upload tag doesn't have a changelog parent as an ancestor but is 153s # otherwise correct 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit.from_spec(name='import'), 153s repo_builder.Commit.from_spec( 153s name='upload', 153s changelog_versions=['1-2', '1-1'], 153s ), 153s ], 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/upload/1-2': Placeholder('upload'), 153s }, 153s ), 153s {'changelog_versions': ['1-2', '1-1']}, 153s target.RichHistoryHasNoChangelogParentAncestor, 153s ), 153s ], 153s ) 153s def test_validate_rich_history( 153s repo, 153s input_repo, 153s published_spec, 153s expected_result, 153s ): 153s """ 153s General test for validate_rich_history(). 153s 153s This unit tests validate_rich_history() for various parameterized cases. 153s Given an input repository and the specification of a Launchpad publication 153s of a source package, we check that validate_rich_history() correctly 153s accepts or rejects the rich history corresponding to the upload tag named 153s 'importer/upload/1-2'. It is assumed that the package being imported is 153s always of version '1-2' for all parameter sets. 153s 153s Since the target function requires rich history, the case of there not 153s being rich history does not need to be tested here, as it wouldn't be 153s called in this case. 153s 153s validate_rich_history() is generic for all sourced rich history, not just 153s rich history sourced from an upload tag. But since it is independent of how 153s the rich history commit arrived, it is easiest to use upload tags to test 153s it; this results in coverage for all sources. 153s 153s :param GitUbuntuRepository repo: fixture providing a temporary 153s GitUbuntuRepository instance to use 153s :param repo_builder.Repo input_repo: input repository data 153s :param dict published_spec: the package simulated being imported from the 153s archive, specified as a dict to pass as **kwargs to 153s repo_builder.Commit.from_spec() 153s :param bool expected_result: the expected return value of, or exception 153s raised by, the call to validate_rich_history() 153s """ 153s > input_repo.write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:910: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmpbp16reib/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-2.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-2.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-2.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-2.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s _ test_validate_rich_history[input_repo2-published_spec2-RichHistoryTreeMismatch] _ 153s 153s repo = 153s input_repo = 153s published_spec = {'changelog_versions': ['1-2', '1-1']} 153s expected_result = 153s 153s @pytest.mark.parametrize( 153s [ 153s 'input_repo', 153s 'published_spec', 153s 'expected_result', 153s ], 153s [ 153s ( 153s # Common case: upload tag has a changelog parent as an ancestor 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit.from_spec(name='import'), 153s repo_builder.Commit.from_spec( 153s name='upload', 153s changelog_versions=['1-2', '1-1'], 153s parents=[Placeholder('import')], 153s ), 153s ], 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/upload/1-2': Placeholder('upload'), 153s }, 153s ), 153s {'changelog_versions': ['1-2', '1-1']}, 153s True, 153s ), 153s ( 153s # Upload tag is the first one, with no parents present 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit.from_spec( 153s name='upload', 153s version='1-2', 153s ), 153s ], 153s tags={ 153s 'importer/upload/1-2': Placeholder('upload'), 153s }, 153s ), 153s {'changelog_versions': ['1-2']}, 153s True, 153s ), 153s ( 153s # Upload tag mismatches published tree but is otherwise correct 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit.from_spec(name='import'), 153s repo_builder.Commit.from_spec( 153s name='upload', 153s changelog_versions=['1-2', '1-1'], 153s parents=[Placeholder('import')], 153s mutate=True, 153s ), 153s ], 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/upload/1-2': Placeholder('upload'), 153s }, 153s ), 153s {'changelog_versions': ['1-2', '1-1']}, 153s target.RichHistoryTreeMismatch, 153s ), 153s ( 153s # Upload tag doesn't have a changelog parent as an ancestor but is 153s # otherwise correct 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit.from_spec(name='import'), 153s repo_builder.Commit.from_spec( 153s name='upload', 153s changelog_versions=['1-2', '1-1'], 153s ), 153s ], 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/upload/1-2': Placeholder('upload'), 153s }, 153s ), 153s {'changelog_versions': ['1-2', '1-1']}, 153s target.RichHistoryHasNoChangelogParentAncestor, 153s ), 153s ], 153s ) 153s def test_validate_rich_history( 153s repo, 153s input_repo, 153s published_spec, 153s expected_result, 153s ): 153s """ 153s General test for validate_rich_history(). 153s 153s This unit tests validate_rich_history() for various parameterized cases. 153s Given an input repository and the specification of a Launchpad publication 153s of a source package, we check that validate_rich_history() correctly 153s accepts or rejects the rich history corresponding to the upload tag named 153s 'importer/upload/1-2'. It is assumed that the package being imported is 153s always of version '1-2' for all parameter sets. 153s 153s Since the target function requires rich history, the case of there not 153s being rich history does not need to be tested here, as it wouldn't be 153s called in this case. 153s 153s validate_rich_history() is generic for all sourced rich history, not just 153s rich history sourced from an upload tag. But since it is independent of how 153s the rich history commit arrived, it is easiest to use upload tags to test 153s it; this results in coverage for all sources. 153s 153s :param GitUbuntuRepository repo: fixture providing a temporary 153s GitUbuntuRepository instance to use 153s :param repo_builder.Repo input_repo: input repository data 153s :param dict published_spec: the package simulated being imported from the 153s archive, specified as a dict to pass as **kwargs to 153s repo_builder.Commit.from_spec() 153s :param bool expected_result: the expected return value of, or exception 153s raised by, the call to validate_rich_history() 153s """ 153s > input_repo.write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:910: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmpx2hqiuq6/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-2.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-2.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s _ test_validate_rich_history[input_repo3-published_spec3-RichHistoryHasNoChangelogParentAncestor] _ 153s 153s repo = 153s input_repo = 153s published_spec = {'changelog_versions': ['1-2', '1-1']} 153s expected_result = 153s 153s @pytest.mark.parametrize( 153s [ 153s 'input_repo', 153s 'published_spec', 153s 'expected_result', 153s ], 153s [ 153s ( 153s # Common case: upload tag has a changelog parent as an ancestor 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit.from_spec(name='import'), 153s repo_builder.Commit.from_spec( 153s name='upload', 153s changelog_versions=['1-2', '1-1'], 153s parents=[Placeholder('import')], 153s ), 153s ], 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/upload/1-2': Placeholder('upload'), 153s }, 153s ), 153s {'changelog_versions': ['1-2', '1-1']}, 153s True, 153s ), 153s ( 153s # Upload tag is the first one, with no parents present 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit.from_spec( 153s name='upload', 153s version='1-2', 153s ), 153s ], 153s tags={ 153s 'importer/upload/1-2': Placeholder('upload'), 153s }, 153s ), 153s {'changelog_versions': ['1-2']}, 153s True, 153s ), 153s ( 153s # Upload tag mismatches published tree but is otherwise correct 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit.from_spec(name='import'), 153s repo_builder.Commit.from_spec( 153s name='upload', 153s changelog_versions=['1-2', '1-1'], 153s parents=[Placeholder('import')], 153s mutate=True, 153s ), 153s ], 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/upload/1-2': Placeholder('upload'), 153s }, 153s ), 153s {'changelog_versions': ['1-2', '1-1']}, 153s target.RichHistoryTreeMismatch, 153s ), 153s ( 153s # Upload tag doesn't have a changelog parent as an ancestor but is 153s # otherwise correct 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit.from_spec(name='import'), 153s repo_builder.Commit.from_spec( 153s name='upload', 153s changelog_versions=['1-2', '1-1'], 153s ), 153s ], 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/upload/1-2': Placeholder('upload'), 153s }, 153s ), 153s {'changelog_versions': ['1-2', '1-1']}, 153s target.RichHistoryHasNoChangelogParentAncestor, 153s ), 153s ], 153s ) 153s def test_validate_rich_history( 153s repo, 153s input_repo, 153s published_spec, 153s expected_result, 153s ): 153s """ 153s General test for validate_rich_history(). 153s 153s This unit tests validate_rich_history() for various parameterized cases. 153s Given an input repository and the specification of a Launchpad publication 153s of a source package, we check that validate_rich_history() correctly 153s accepts or rejects the rich history corresponding to the upload tag named 153s 'importer/upload/1-2'. It is assumed that the package being imported is 153s always of version '1-2' for all parameter sets. 153s 153s Since the target function requires rich history, the case of there not 153s being rich history does not need to be tested here, as it wouldn't be 153s called in this case. 153s 153s validate_rich_history() is generic for all sourced rich history, not just 153s rich history sourced from an upload tag. But since it is independent of how 153s the rich history commit arrived, it is easiest to use upload tags to test 153s it; this results in coverage for all sources. 153s 153s :param GitUbuntuRepository repo: fixture providing a temporary 153s GitUbuntuRepository instance to use 153s :param repo_builder.Repo input_repo: input repository data 153s :param dict published_spec: the package simulated being imported from the 153s archive, specified as a dict to pass as **kwargs to 153s repo_builder.Commit.from_spec() 153s :param bool expected_result: the expected return value of, or exception 153s raised by, the call to validate_rich_history() 153s """ 153s > input_repo.write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:910: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmp1_j_iiz6/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-2.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-2.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s ______________________ test_add_changelog_note_to_commit _______________________ 153s 153s repo = 153s 153s def test_add_changelog_note_to_commit(repo): 153s """add_changelog_note_to_commit should add the expected note""" 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit.from_spec(name='1-1'), 153s repo_builder.Commit.from_spec( 153s name='1-2', 153s changelog_versions=['1-1', '1-2'], 153s parents=[Placeholder('1-1')], 153s ), 153s ], 153s tags={'1-1': Placeholder('1-1'), '1-2': Placeholder('1-2')}, 153s > ).write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:953: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmp62z6azmp/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s ____________________ test_add_changelog_note_to_commit_utf8 ____________________ 153s 153s repo = 153s 153s def test_add_changelog_note_to_commit_utf8(repo): 153s """A changelog file with non-UTF8 should have such characters substituted 153s 153s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 153s temporary output repository 153s """ 153s test_utf8_error_changelog_path = os.path.join( 153s pkg_resources.resource_filename('gitubuntu', 'changelog_tests'), 153s 'test_utf8_error', 153s ) 153s with open(test_utf8_error_changelog_path, 'rb') as f: 153s utf8_changelog_blob = f.read() 153s 153s # We only need an example child commit with a debian/changelog file since 153s # this is the only file accessed by add_changelog_note_to_commit(). 153s # Further, the parent need only exist and can be empty. 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit(name='parent'), 153s repo_builder.Commit( 153s tree=repo_builder.Tree({'debian': repo_builder.Tree( 153s {'changelog': repo_builder.Blob(utf8_changelog_blob)} 153s )}), 153s name='child', 153s ) 153s ], 153s tags={'parent': Placeholder('parent'), 'child': Placeholder('child')}, 153s > ).write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:1002: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmpp_4eoyzm/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s _________________ test_double_changelog_note_add_does_not_fail _________________ 153s 153s repo = 153s 153s def test_double_changelog_note_add_does_not_fail(repo): 153s """add_changelog_note_to_commit shouldn't fail if a note already exists""" 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit.from_spec(name='1-1'), 153s repo_builder.Commit.from_spec( 153s name='1-2', 153s changelog_versions=['1-1', '1-2'], 153s parents=[Placeholder('1-1')], 153s ), 153s ], 153s tags={'1-1': Placeholder('1-1'), '1-2': Placeholder('1-2')}, 153s > ).write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:1035: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmppxswvcbo/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s ___________________________ test_create_import_note ____________________________ 153s 153s repo = 153s 153s def test_create_import_note(repo): 153s """create_import_note() should create a note in the correct ref""" 153s repo_builder.Repo( 153s commits=[repo_builder.Commit(name='root')], 153s tags={'root': repo_builder.Placeholder('root')}, 153s > ).write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:1066: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmp30vp2qgq/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s ______________________ test_create_import_note_timestamp _______________________ 153s 153s repo = 153s 153s def test_create_import_note_timestamp(repo): 153s """create_import_note() should include the timestamp in the note""" 153s repo_builder.Repo( 153s commits=[repo_builder.Commit(name='root')], 153s tags={'root': repo_builder.Placeholder('root')}, 153s > ).write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:1082: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmpe9_xl7j3/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s _______________________ test_import_creates_import_note ________________________ 153s 153s repo = 153s 153s def test_import_creates_import_note(repo): 153s """When an import runs, the note should appear in the correct ref""" 153s with source_builder.Source() as dsc_pathname: 153s > target.import_unapplied_dsc( 153s repo=repo, 153s version='1-1', 153s namespace='importer', 153s dist='ubuntu', 153s dsc_pathname=dsc_pathname, 153s head_name='ubuntu/focal', 153s skip_orig=True, 153s parent_overrides={}, 153s ) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:1102: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer.py:2230: in import_unapplied_dsc 153s commit, tag = find_or_create_unapplied_commit( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer.py:2052: in find_or_create_unapplied_commit 153s changelog_parents = get_unapplied_import_parents( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer.py:1503: in get_unapplied_import_parents 153s import_tree_versions = repo.get_all_changelog_versions_from_treeish( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:2230: in get_all_changelog_versions_from_treeish 153s changelog = self.get_changelog_from_treeish(treeish) 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 153s return Changelog.from_treeish( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:569: in from_treeish 153s blob = follow_symlinks_to_blob( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 153s return _follow_symlinks_to_blob( 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s repo = pygit2.Repository('/tmp/tmp7jpw7mnj/.git/') 153s top_tree_object = 153s search_path = 'debian/changelog' 153s _rel_tree = 153s _rel_path = '' 153s 153s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 153s _rel_tree=None, _rel_path='' 153s ): 153s '''Recursively follow a path down a tree, following symlinks, to find blob 153s 153s repo: pygit2.Repository object 153s top_tree: pygit2.Tree object of the top of the tree structure 153s search_path: '/'-separated path string of blob to find 153s _rel_tree: (internal) which tree to look further into 153s _rel_path: (internal) the path we are in so far 153s ''' 153s 153s NORMAL_BLOB_MODES = set([ 153s pygit2.GIT_FILEMODE_BLOB, 153s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 153s ]) 153s 153s _rel_tree = _rel_tree or top_tree_object 153s head, tail = posixpath.split(search_path) 153s 153s # A traditional functional split would put a single entry in head with tail 153s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 153s # to make it appear to have traditional semantics. 153s if not head: 153s head = tail 153s tail = None 153s 153s entry = _rel_tree[head] 153s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:68: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s ___________________ test_import_unapplied_spi_quilt_patches ____________________ 153s 153s get_import_commit_msg_mock = 153s get_import_tag_msg_mock = 153s repo = 153s 153s @patch('gitubuntu.importer.get_import_tag_msg') 153s @patch('gitubuntu.importer.get_import_commit_msg') 153s def test_import_unapplied_spi_quilt_patches( 153s get_import_commit_msg_mock, 153s get_import_tag_msg_mock, 153s repo, 153s ): 153s """Test that a package with quilt patches is imported with correct 153s unapplied refs 153s 153s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 153s that determines the commit message to use for a given import 153s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 153s that determines the tag message to use for a given import 153s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 153s temporary output repository 153s """ 153s # Match the repo_builder objects 153s get_import_tag_msg_mock.return_value = 'Test tag' 153s get_import_commit_msg_mock.return_value = b'Test commit' 153s 153s publish_spec = source_builder.SourceSpec(has_patches=True) 153s 153s input_repo = repo_builder.Repo() 153s input_repo.write(repo.raw_repo) 153s expected_result = repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit( 153s tree=repo_builder.SourceTree( 153s source_builder.Source(publish_spec) 153s ), 153s name='publish' 153s ), 153s ], 153s tags={'importer/import/1-1': Placeholder('publish')}, 153s branches={'importer/ubuntu/trusty': Placeholder('publish')}, 153s ) 153s 153s with source_builder.Source(publish_spec) as dsc_path: 153s # import_unapplied_spi currently assumes it is called from the 153s # repository directory (pristine-tar and other commands rely on 153s # this) 153s > target.import_unapplied_spi( 153s repo=repo, 153s spi=MockSPI(dsc_path, publish_spec.version), 153s namespace='importer', 153s skip_orig=False, 153s parent_overrides={}, 153s ) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:1222: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer.py:2308: in import_unapplied_spi 153s import_unapplied_dsc( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer.py:2230: in import_unapplied_dsc 153s commit, tag = find_or_create_unapplied_commit( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer.py:2052: in find_or_create_unapplied_commit 153s changelog_parents = get_unapplied_import_parents( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer.py:1503: in get_unapplied_import_parents 153s import_tree_versions = repo.get_all_changelog_versions_from_treeish( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:2230: in get_all_changelog_versions_from_treeish 153s changelog = self.get_changelog_from_treeish(treeish) 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 153s return Changelog.from_treeish( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:569: in from_treeish 153s blob = follow_symlinks_to_blob( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 153s return _follow_symlinks_to_blob( 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s repo = pygit2.Repository('/tmp/tmpac82reyh/.git/') 153s top_tree_object = 153s search_path = 'debian/changelog' 153s _rel_tree = 153s _rel_path = '' 153s 153s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 153s _rel_tree=None, _rel_path='' 153s ): 153s '''Recursively follow a path down a tree, following symlinks, to find blob 153s 153s repo: pygit2.Repository object 153s top_tree: pygit2.Tree object of the top of the tree structure 153s search_path: '/'-separated path string of blob to find 153s _rel_tree: (internal) which tree to look further into 153s _rel_path: (internal) the path we are in so far 153s ''' 153s 153s NORMAL_BLOB_MODES = set([ 153s pygit2.GIT_FILEMODE_BLOB, 153s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 153s ]) 153s 153s _rel_tree = _rel_tree or top_tree_object 153s head, tail = posixpath.split(search_path) 153s 153s # A traditional functional split would put a single entry in head with tail 153s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 153s # to make it appear to have traditional semantics. 153s if not head: 153s head = tail 153s tail = None 153s 153s entry = _rel_tree[head] 153s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:68: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: using patch list from debian/patches/series 153s dpkg-source: info: applying a 153s dpkg-source: info: applying b 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: using patch list from debian/patches/series 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s _ test_import_unapplied_spi_parenting[input_repo0-changelog_versions0-validation_repo_delta0-validation_repo_expected_identical_refs0] _ 153s 153s get_import_commit_msg_mock = 153s get_import_tag_msg_mock = 153s repo = 153s input_repo = 153s changelog_versions = ['1-1'] 153s validation_repo_delta = {'add_commits': [], 'update_tags': {'importer/import/1-1': }} 153s validation_repo_expected_identical_refs = ['refs/tags/importer/import/1-1'] 153s 153s @pytest.mark.parametrize( 153s [ 153s 'input_repo', 153s 'changelog_versions', 153s 'validation_repo_delta', 153s 'validation_repo_expected_identical_refs', 153s ], 153s [ 153s pytest.param( 153s repo_builder.Repo(), 153s ['1-1'], 153s { 153s 'add_commits': [ 153s repo_builder.Commit.from_spec(name='publish'), 153s ], 153s 'update_tags': {'importer/import/1-1': Placeholder('publish')}, 153s }, 153s [ 153s 'refs/tags/importer/import/1-1', 153s ] 153s ), 153s pytest.param( 153s repo_builder.Repo( 153s commits=[repo_builder.Commit.from_spec(name='import')], 153s tags={'importer/import/1-1': Placeholder('import')}, 153s ), 153s ['1-2', '1-1'], 153s { 153s 'add_commits': [ 153s repo_builder.Commit.from_spec( 153s name='publish', 153s parents=[Placeholder('import')], 153s changelog_versions=['1-2', '1-1'], 153s ), 153s ], 153s 'update_tags': {'importer/import/1-2': Placeholder('publish')}, 153s }, 153s [ 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/import/1-2', 153s ], 153s ), 153s pytest.param( 153s repo_builder.Repo( 153s commits=[repo_builder.Commit.from_spec(name='import')], 153s tags={'importer/import/1-1': Placeholder('import')}, 153s ), 153s ['1-3', '1-2', '1-1'], 153s { 153s 'add_commits': [ 153s repo_builder.Commit.from_spec( 153s parents=[Placeholder('import')], 153s name='publish', 153s changelog_versions=['1-3', '1-2', '1-1'], 153s ), 153s ], 153s 'update_tags': {'importer/import/1-3': Placeholder('publish')}, 153s }, 153s [ 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/import/1-3', 153s ], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit.from_spec(name='import'), 153s repo_builder.Commit.from_spec( 153s name='reimport', 153s mutate='Reimport tag contents', 153s ), 153s ], 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/reimport/import/1-1/0': Placeholder('import'), 153s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 153s }, 153s ), 153s ['1-2', '1-1'], 153s { 153s 'add_commits': [ 153s repo_builder.Commit.from_spec( 153s parents=[ 153s Placeholder('import'), 153s Placeholder('reimport'), 153s ], 153s name='publish', 153s changelog_versions=['1-2', '1-1'], 153s ), 153s ], 153s 'update_tags': {'importer/import/1-2': Placeholder('publish')}, 153s }, 153s [ 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s 'refs/tags/importer/import/1-2', 153s ], 153s ), 153s ] 153s ) 153s @patch('gitubuntu.importer.get_import_tag_msg') 153s @patch('gitubuntu.importer.get_import_commit_msg') 153s def test_import_unapplied_spi_parenting( 153s get_import_commit_msg_mock, 153s get_import_tag_msg_mock, 153s repo, 153s input_repo, 153s changelog_versions, 153s validation_repo_delta, 153s validation_repo_expected_identical_refs, 153s ): 153s """Test that unapplied import commits have the correct parents 153s 153s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 153s that determines the commit message to use for a given import 153s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 153s that determines the tag message to use for a given import 153s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 153s temporary output repository 153s :param repo_builder.Repo input_repo: input repository data 153s :param list(str) changelog_versions: the versions in the changelog of a 153s fake package to test import 153s :param dict validation_repo_delta: how to transform the input 153s repository into a "validation repository", expressed as a dict to 153s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 153s input repository. The validation repository is then used for the 153s purposes of comparison against the output repository. 153s :param list(str) validation_repo_expected_identical_refs: refs that must be 153s identical between the validation repository and the output repository 153s 153s Verify that if an import of a package is made into input_repo where the 153s package being imported has the given changelog_versions, then the output 153s repository has commits with the parents we expect. This is tested by 153s comparing specific output references against the validation repository. 153s """ 153s 153s # Match the repo_builder objects 153s get_import_tag_msg_mock.return_value = 'Test tag' 153s get_import_commit_msg_mock.return_value = b'Test commit' 153s 153s input_repo.write(repo.raw_repo) 153s 153s publish_spec = source_builder.SourceSpec( 153s changelog_versions=changelog_versions, 153s ) 153s 153s with source_builder.Source(publish_spec) as dsc_path: 153s # import_unapplied_spi currently assumes it is called from the 153s # repository directory (pristine-tar and other commands rely on 153s # this) 153s > target.import_unapplied_spi( 153s repo=repo, 153s spi=MockSPI(dsc_path, publish_spec.version), 153s namespace='importer', 153s skip_orig=False, 153s parent_overrides={}, 153s ) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:1391: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer.py:2308: in import_unapplied_spi 153s import_unapplied_dsc( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer.py:2230: in import_unapplied_dsc 153s commit, tag = find_or_create_unapplied_commit( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer.py:2052: in find_or_create_unapplied_commit 153s changelog_parents = get_unapplied_import_parents( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer.py:1503: in get_unapplied_import_parents 153s import_tree_versions = repo.get_all_changelog_versions_from_treeish( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:2230: in get_all_changelog_versions_from_treeish 153s changelog = self.get_changelog_from_treeish(treeish) 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 153s return Changelog.from_treeish( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:569: in from_treeish 153s blob = follow_symlinks_to_blob( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 153s return _follow_symlinks_to_blob( 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s repo = pygit2.Repository('/tmp/tmpkqdh6gob/.git/') 153s top_tree_object = 153s search_path = 'debian/changelog' 153s _rel_tree = 153s _rel_path = '' 153s 153s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 153s _rel_tree=None, _rel_path='' 153s ): 153s '''Recursively follow a path down a tree, following symlinks, to find blob 153s 153s repo: pygit2.Repository object 153s top_tree: pygit2.Tree object of the top of the tree structure 153s search_path: '/'-separated path string of blob to find 153s _rel_tree: (internal) which tree to look further into 153s _rel_path: (internal) the path we are in so far 153s ''' 153s 153s NORMAL_BLOB_MODES = set([ 153s pygit2.GIT_FILEMODE_BLOB, 153s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 153s ]) 153s 153s _rel_tree = _rel_tree or top_tree_object 153s head, tail = posixpath.split(search_path) 153s 153s # A traditional functional split would put a single entry in head with tail 153s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 153s # to make it appear to have traditional semantics. 153s if not head: 153s head = tail 153s tail = None 153s 153s entry = _rel_tree[head] 153s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:68: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s _ test_import_unapplied_spi_parenting[input_repo1-changelog_versions1-validation_repo_delta1-validation_repo_expected_identical_refs1] _ 153s 153s get_import_commit_msg_mock = 153s get_import_tag_msg_mock = 153s repo = 153s input_repo = 153s changelog_versions = ['1-2', '1-1'] 153s validation_repo_delta = {'add_commits': [], 'update_tags': {'importer/import/1-2': }} 153s validation_repo_expected_identical_refs = ['refs/tags/importer/import/1-1', 'refs/tags/importer/import/1-2'] 153s 153s @pytest.mark.parametrize( 153s [ 153s 'input_repo', 153s 'changelog_versions', 153s 'validation_repo_delta', 153s 'validation_repo_expected_identical_refs', 153s ], 153s [ 153s pytest.param( 153s repo_builder.Repo(), 153s ['1-1'], 153s { 153s 'add_commits': [ 153s repo_builder.Commit.from_spec(name='publish'), 153s ], 153s 'update_tags': {'importer/import/1-1': Placeholder('publish')}, 153s }, 153s [ 153s 'refs/tags/importer/import/1-1', 153s ] 153s ), 153s pytest.param( 153s repo_builder.Repo( 153s commits=[repo_builder.Commit.from_spec(name='import')], 153s tags={'importer/import/1-1': Placeholder('import')}, 153s ), 153s ['1-2', '1-1'], 153s { 153s 'add_commits': [ 153s repo_builder.Commit.from_spec( 153s name='publish', 153s parents=[Placeholder('import')], 153s changelog_versions=['1-2', '1-1'], 153s ), 153s ], 153s 'update_tags': {'importer/import/1-2': Placeholder('publish')}, 153s }, 153s [ 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/import/1-2', 153s ], 153s ), 153s pytest.param( 153s repo_builder.Repo( 153s commits=[repo_builder.Commit.from_spec(name='import')], 153s tags={'importer/import/1-1': Placeholder('import')}, 153s ), 153s ['1-3', '1-2', '1-1'], 153s { 153s 'add_commits': [ 153s repo_builder.Commit.from_spec( 153s parents=[Placeholder('import')], 153s name='publish', 153s changelog_versions=['1-3', '1-2', '1-1'], 153s ), 153s ], 153s 'update_tags': {'importer/import/1-3': Placeholder('publish')}, 153s }, 153s [ 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/import/1-3', 153s ], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit.from_spec(name='import'), 153s repo_builder.Commit.from_spec( 153s name='reimport', 153s mutate='Reimport tag contents', 153s ), 153s ], 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/reimport/import/1-1/0': Placeholder('import'), 153s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 153s }, 153s ), 153s ['1-2', '1-1'], 153s { 153s 'add_commits': [ 153s repo_builder.Commit.from_spec( 153s parents=[ 153s Placeholder('import'), 153s Placeholder('reimport'), 153s ], 153s name='publish', 153s changelog_versions=['1-2', '1-1'], 153s ), 153s ], 153s 'update_tags': {'importer/import/1-2': Placeholder('publish')}, 153s }, 153s [ 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s 'refs/tags/importer/import/1-2', 153s ], 153s ), 153s ] 153s ) 153s @patch('gitubuntu.importer.get_import_tag_msg') 153s @patch('gitubuntu.importer.get_import_commit_msg') 153s def test_import_unapplied_spi_parenting( 153s get_import_commit_msg_mock, 153s get_import_tag_msg_mock, 153s repo, 153s input_repo, 153s changelog_versions, 153s validation_repo_delta, 153s validation_repo_expected_identical_refs, 153s ): 153s """Test that unapplied import commits have the correct parents 153s 153s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 153s that determines the commit message to use for a given import 153s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 153s that determines the tag message to use for a given import 153s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 153s temporary output repository 153s :param repo_builder.Repo input_repo: input repository data 153s :param list(str) changelog_versions: the versions in the changelog of a 153s fake package to test import 153s :param dict validation_repo_delta: how to transform the input 153s repository into a "validation repository", expressed as a dict to 153s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 153s input repository. The validation repository is then used for the 153s purposes of comparison against the output repository. 153s :param list(str) validation_repo_expected_identical_refs: refs that must be 153s identical between the validation repository and the output repository 153s 153s Verify that if an import of a package is made into input_repo where the 153s package being imported has the given changelog_versions, then the output 153s repository has commits with the parents we expect. This is tested by 153s comparing specific output references against the validation repository. 153s """ 153s 153s # Match the repo_builder objects 153s get_import_tag_msg_mock.return_value = 'Test tag' 153s get_import_commit_msg_mock.return_value = b'Test commit' 153s 153s > input_repo.write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:1381: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmpq7mk7hax/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s _ test_import_unapplied_spi_parenting[input_repo2-changelog_versions2-validation_repo_delta2-validation_repo_expected_identical_refs2] _ 153s 153s get_import_commit_msg_mock = 153s get_import_tag_msg_mock = 153s repo = 153s input_repo = 153s changelog_versions = ['1-3', '1-2', '1-1'] 153s validation_repo_delta = {'add_commits': [], 'update_tags': {'importer/import/1-3': }} 153s validation_repo_expected_identical_refs = ['refs/tags/importer/import/1-1', 'refs/tags/importer/import/1-3'] 153s 153s @pytest.mark.parametrize( 153s [ 153s 'input_repo', 153s 'changelog_versions', 153s 'validation_repo_delta', 153s 'validation_repo_expected_identical_refs', 153s ], 153s [ 153s pytest.param( 153s repo_builder.Repo(), 153s ['1-1'], 153s { 153s 'add_commits': [ 153s repo_builder.Commit.from_spec(name='publish'), 153s ], 153s 'update_tags': {'importer/import/1-1': Placeholder('publish')}, 153s }, 153s [ 153s 'refs/tags/importer/import/1-1', 153s ] 153s ), 153s pytest.param( 153s repo_builder.Repo( 153s commits=[repo_builder.Commit.from_spec(name='import')], 153s tags={'importer/import/1-1': Placeholder('import')}, 153s ), 153s ['1-2', '1-1'], 153s { 153s 'add_commits': [ 153s repo_builder.Commit.from_spec( 153s name='publish', 153s parents=[Placeholder('import')], 153s changelog_versions=['1-2', '1-1'], 153s ), 153s ], 153s 'update_tags': {'importer/import/1-2': Placeholder('publish')}, 153s }, 153s [ 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/import/1-2', 153s ], 153s ), 153s pytest.param( 153s repo_builder.Repo( 153s commits=[repo_builder.Commit.from_spec(name='import')], 153s tags={'importer/import/1-1': Placeholder('import')}, 153s ), 153s ['1-3', '1-2', '1-1'], 153s { 153s 'add_commits': [ 153s repo_builder.Commit.from_spec( 153s parents=[Placeholder('import')], 153s name='publish', 153s changelog_versions=['1-3', '1-2', '1-1'], 153s ), 153s ], 153s 'update_tags': {'importer/import/1-3': Placeholder('publish')}, 153s }, 153s [ 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/import/1-3', 153s ], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit.from_spec(name='import'), 153s repo_builder.Commit.from_spec( 153s name='reimport', 153s mutate='Reimport tag contents', 153s ), 153s ], 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/reimport/import/1-1/0': Placeholder('import'), 153s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 153s }, 153s ), 153s ['1-2', '1-1'], 153s { 153s 'add_commits': [ 153s repo_builder.Commit.from_spec( 153s parents=[ 153s Placeholder('import'), 153s Placeholder('reimport'), 153s ], 153s name='publish', 153s changelog_versions=['1-2', '1-1'], 153s ), 153s ], 153s 'update_tags': {'importer/import/1-2': Placeholder('publish')}, 153s }, 153s [ 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s 'refs/tags/importer/import/1-2', 153s ], 153s ), 153s ] 153s ) 153s @patch('gitubuntu.importer.get_import_tag_msg') 153s @patch('gitubuntu.importer.get_import_commit_msg') 153s def test_import_unapplied_spi_parenting( 153s get_import_commit_msg_mock, 153s get_import_tag_msg_mock, 153s repo, 153s input_repo, 153s changelog_versions, 153s validation_repo_delta, 153s validation_repo_expected_identical_refs, 153s ): 153s """Test that unapplied import commits have the correct parents 153s 153s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 153s that determines the commit message to use for a given import 153s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 153s that determines the tag message to use for a given import 153s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 153s temporary output repository 153s :param repo_builder.Repo input_repo: input repository data 153s :param list(str) changelog_versions: the versions in the changelog of a 153s fake package to test import 153s :param dict validation_repo_delta: how to transform the input 153s repository into a "validation repository", expressed as a dict to 153s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 153s input repository. The validation repository is then used for the 153s purposes of comparison against the output repository. 153s :param list(str) validation_repo_expected_identical_refs: refs that must be 153s identical between the validation repository and the output repository 153s 153s Verify that if an import of a package is made into input_repo where the 153s package being imported has the given changelog_versions, then the output 153s repository has commits with the parents we expect. This is tested by 153s comparing specific output references against the validation repository. 153s """ 153s 153s # Match the repo_builder objects 153s get_import_tag_msg_mock.return_value = 'Test tag' 153s get_import_commit_msg_mock.return_value = b'Test commit' 153s 153s > input_repo.write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:1381: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmp_tf4dk_6/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s _ test_import_unapplied_spi_parenting[input_repo3-changelog_versions3-validation_repo_delta3-validation_repo_expected_identical_refs3] _ 153s 153s get_import_commit_msg_mock = 153s get_import_tag_msg_mock = 153s repo = 153s input_repo = 153s changelog_versions = ['1-2', '1-1'] 153s validation_repo_delta = {'add_commits': [], 'update_tags': {'importer/import/1-2': }} 153s 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'] 153s 153s @pytest.mark.parametrize( 153s [ 153s 'input_repo', 153s 'changelog_versions', 153s 'validation_repo_delta', 153s 'validation_repo_expected_identical_refs', 153s ], 153s [ 153s pytest.param( 153s repo_builder.Repo(), 153s ['1-1'], 153s { 153s 'add_commits': [ 153s repo_builder.Commit.from_spec(name='publish'), 153s ], 153s 'update_tags': {'importer/import/1-1': Placeholder('publish')}, 153s }, 153s [ 153s 'refs/tags/importer/import/1-1', 153s ] 153s ), 153s pytest.param( 153s repo_builder.Repo( 153s commits=[repo_builder.Commit.from_spec(name='import')], 153s tags={'importer/import/1-1': Placeholder('import')}, 153s ), 153s ['1-2', '1-1'], 153s { 153s 'add_commits': [ 153s repo_builder.Commit.from_spec( 153s name='publish', 153s parents=[Placeholder('import')], 153s changelog_versions=['1-2', '1-1'], 153s ), 153s ], 153s 'update_tags': {'importer/import/1-2': Placeholder('publish')}, 153s }, 153s [ 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/import/1-2', 153s ], 153s ), 153s pytest.param( 153s repo_builder.Repo( 153s commits=[repo_builder.Commit.from_spec(name='import')], 153s tags={'importer/import/1-1': Placeholder('import')}, 153s ), 153s ['1-3', '1-2', '1-1'], 153s { 153s 'add_commits': [ 153s repo_builder.Commit.from_spec( 153s parents=[Placeholder('import')], 153s name='publish', 153s changelog_versions=['1-3', '1-2', '1-1'], 153s ), 153s ], 153s 'update_tags': {'importer/import/1-3': Placeholder('publish')}, 153s }, 153s [ 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/import/1-3', 153s ], 153s ), 153s ( 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit.from_spec(name='import'), 153s repo_builder.Commit.from_spec( 153s name='reimport', 153s mutate='Reimport tag contents', 153s ), 153s ], 153s tags={ 153s 'importer/import/1-1': Placeholder('import'), 153s 'importer/reimport/import/1-1/0': Placeholder('import'), 153s 'importer/reimport/import/1-1/1': Placeholder('reimport'), 153s }, 153s ), 153s ['1-2', '1-1'], 153s { 153s 'add_commits': [ 153s repo_builder.Commit.from_spec( 153s parents=[ 153s Placeholder('import'), 153s Placeholder('reimport'), 153s ], 153s name='publish', 153s changelog_versions=['1-2', '1-1'], 153s ), 153s ], 153s 'update_tags': {'importer/import/1-2': Placeholder('publish')}, 153s }, 153s [ 153s 'refs/tags/importer/import/1-1', 153s 'refs/tags/importer/reimport/import/1-1/0', 153s 'refs/tags/importer/reimport/import/1-1/1', 153s 'refs/tags/importer/import/1-2', 153s ], 153s ), 153s ] 153s ) 153s @patch('gitubuntu.importer.get_import_tag_msg') 153s @patch('gitubuntu.importer.get_import_commit_msg') 153s def test_import_unapplied_spi_parenting( 153s get_import_commit_msg_mock, 153s get_import_tag_msg_mock, 153s repo, 153s input_repo, 153s changelog_versions, 153s validation_repo_delta, 153s validation_repo_expected_identical_refs, 153s ): 153s """Test that unapplied import commits have the correct parents 153s 153s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 153s that determines the commit message to use for a given import 153s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 153s that determines the tag message to use for a given import 153s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 153s temporary output repository 153s :param repo_builder.Repo input_repo: input repository data 153s :param list(str) changelog_versions: the versions in the changelog of a 153s fake package to test import 153s :param dict validation_repo_delta: how to transform the input 153s repository into a "validation repository", expressed as a dict to 153s provide as **kwargs to gitubuntu.repo_builder.Repo.copy() against the 153s input repository. The validation repository is then used for the 153s purposes of comparison against the output repository. 153s :param list(str) validation_repo_expected_identical_refs: refs that must be 153s identical between the validation repository and the output repository 153s 153s Verify that if an import of a package is made into input_repo where the 153s package being imported has the given changelog_versions, then the output 153s repository has commits with the parents we expect. This is tested by 153s comparing specific output references against the validation repository. 153s """ 153s 153s # Match the repo_builder objects 153s get_import_tag_msg_mock.return_value = 'Test tag' 153s get_import_commit_msg_mock.return_value = b'Test commit' 153s 153s > input_repo.write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:1381: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmpbyjkehlg/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s __________________ test_import_unapplied_spi_parent_override ___________________ 153s 153s get_import_commit_msg_mock = 153s get_import_tag_msg_mock = 153s repo = 153s 153s @patch('gitubuntu.importer.get_import_tag_msg') 153s @patch('gitubuntu.importer.get_import_commit_msg') 153s def test_import_unapplied_spi_parent_override( 153s get_import_commit_msg_mock, 153s get_import_tag_msg_mock, 153s repo, 153s ): 153s """Test import_unapplied_spi() parent_override functionality 153s 153s Test that if parent_overrides is used in the import_unapplied_spi call then 153s the resulting commit correctly uses the overridden parents specified. 153s 153s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 153s that determines the commit message to use for a given import 153s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 153s that determines the tag message to use for a given import 153s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 153s temporary output repository 153s :param repo_builder.Repo input_repo: input repository data 153s """ 153s # Match the repo_builder objects 153s get_import_tag_msg_mock.return_value = 'Test tag' 153s get_import_commit_msg_mock.return_value = b'Test commit' 153s 153s input_repo = repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit.from_spec(name='import1-1', version='1-1'), 153s repo_builder.Commit.from_spec(name='import1-2', version='1-2'), 153s ], 153s tags={ 153s 'importer/import/1-1': Placeholder('import1-1'), 153s 'importer/import/1-2': Placeholder('import1-2'), 153s }, 153s ) 153s > input_repo.write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:1444: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmpwyi8hocg/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-2.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-2.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s ______________ test_import_unapplied_spi_parent_override_failure _______________ 153s 153s repo = 153s 153s def test_import_unapplied_spi_parent_override_failure(repo): 153s """ 153s Test override_parents ParentOverrideError raise 153s 153s When a parent override is specified but the specified version doesn't have 153s an import tag, an exception should be raised. 153s 153s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 153s temporary output repository 153s """ 153s repo_builder.Repo( 153s commits=[repo_builder.Commit.from_spec(name='import1-1')], 153s tags={'importer/import/1-1': Placeholder('import1-1')}, 153s > ).write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:1499: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmpu1885q7o/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s _ test_import_applied_spi_parenting[input_repo0-expected_ancestor_commits0-expected_parent_commits0] _ 153s 153s get_import_commit_msg_mock = 153s get_import_tag_msg_mock = 153s repo = 153s input_repo = 153s expected_ancestor_commits = ['refs/tags/importer/import/1-2'] 153s expected_parent_commits = ['refs/tags/importer/applied/1-1'] 153s 153s @pytest.mark.parametrize( 153s 'input_repo, expected_ancestor_commits, expected_parent_commits', [ 153s # In general, these tests do not set applied commit parents in the 153s # input repository since we have no mechanism to do that correctly, but 153s # this doesn't matter for the purposes of these tests. 153s 153s # if only one import tag exists, then it is the parent 153s pytest.param( 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit.from_spec( 153s name='unapplied1', 153s has_patches=True, 153s ), 153s repo_builder.Commit.from_spec( 153s parents=[Placeholder('unapplied1')], 153s name='unapplied2', 153s changelog_versions=['1-2', '1-1'], 153s has_patches=True, 153s ), 153s repo_builder.Commit.from_spec( 153s name='applied1', 153s patches_applied=True, 153s ), 153s ], 153s # no branches: technically not possible but branches are not 153s # relevant to the test 153s branches={}, 153s tags={ 153s 'importer/import/1-1': Placeholder('unapplied1'), 153s 'importer/import/1-2': Placeholder('unapplied2'), 153s 'importer/applied/1-1': Placeholder('applied1'), 153s }, 153s ), 153s ['refs/tags/importer/import/1-2'], 153s ['refs/tags/importer/applied/1-1'], 153s ), 153s 153s # if multiple import tags exist, then do they all end up as parents? 153s pytest.param( 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit.from_spec( 153s name='unapplied1', 153s has_patches=True, 153s ), 153s repo_builder.Commit.from_spec( 153s parents=[Placeholder('unapplied1')], 153s name='unapplied2', 153s changelog_versions=['1-2', '1-1'], 153s has_patches=True, 153s ), 153s repo_builder.Commit.from_spec( 153s parents=[Placeholder('unapplied1')], 153s name='unapplied2reimport', 153s changelog_versions=['1-2', '1-1'], 153s has_patches=True, 153s mutate='reimport tag', 153s ), 153s repo_builder.Commit.from_spec( 153s name='applied1', 153s patches_applied=True, 153s ), 153s ], 153s # no branches: technically not possible but branches are not 153s # relevant to the test 153s branches={}, 153s tags={ 153s 'importer/import/1-1': 153s Placeholder('unapplied1'), 153s 'importer/import/1-2': 153s Placeholder('unapplied2'), 153s 'importer/reimport/import/1-2/0': 153s Placeholder('unapplied2'), 153s 'importer/reimport/import/1-2/1': 153s Placeholder('unapplied2reimport'), 153s 'importer/applied/1-1': 153s Placeholder('applied1'), 153s }, 153s ), 153s [ 153s 'refs/tags/importer/reimport/import/1-2/0', 153s 'refs/tags/importer/reimport/import/1-2/1', 153s ], 153s [ 153s 'refs/tags/importer/applied/1-1', 153s ], 153s marks=pytest.mark.xfail(reason='LP: #1755247'), 153s ), 153s 153s # do we correctly create a reimport tag because a different import 153s # already exists? 153s pytest.param( 153s repo_builder.Repo( 153s commits=[ 153s repo_builder.Commit.from_spec( 153s name='unapplied1', 153s has_patches=True, 153s ), 153s repo_builder.Commit.from_spec( 153s name='unapplied1_reimport', 153s has_patches=True, 153s mutate='reimport contents', 153s ), 153s repo_builder.Commit.from_spec( 153s parents=[Placeholder('unapplied1')], 153s name='unapplied2', 153s changelog_versions=['1-2', '1-1'], 153s has_patches=True, 153s ), 153s repo_builder.Commit.from_spec( 153s name='applied1', 153s patches_applied=True, 153s ), 153s repo_builder.Commit.from_spec( 153s name='applied1_reimport', 153s patches_applied=True, 153s mutate='reimport contents', 153s ), 153s ], 153s # no branches: technically not possible but branches are not 153s # relevant to the test 153s branches={}, 153s tags={ 153s 'importer/import/1-1': 153s Placeholder('unapplied1'), 153s 'importer/reimport/import/1-1/0': 153s Placeholder('unapplied1'), 153s 'importer/reimport/import/1-1/1': 153s Placeholder('unapplied1_reimport'), 153s 'importer/import/1-2': 153s Placeholder('unapplied2'), 153s 'importer/applied/1-1': 153s Placeholder('applied1'), 153s 'importer/reimport/applied/1-1/0': 153s Placeholder('applied1'), 153s 'importer/reimport/applied/1-1/1': 153s Placeholder('applied1_reimport'), 153s }, 153s ), 153s [ 153s 'refs/tags/importer/reimport/import/1-2/0', 153s 'refs/tags/importer/reimport/import/1-2/1', 153s ], 153s [ 153s 'refs/tags/importer/reimport/applied/1-1/0', 153s 'refs/tags/importer/reimport/applied/1-1/1', 153s ], 153s marks=pytest.mark.xfail(reason='LP: #1755247'), 153s ), 153s ], 153s ) 153s @patch('gitubuntu.importer.get_import_tag_msg') 153s @patch('gitubuntu.importer.get_import_commit_msg') 153s def test_import_applied_spi_parenting( 153s get_import_commit_msg_mock, 153s get_import_tag_msg_mock, 153s repo, 153s input_repo, 153s expected_ancestor_commits, 153s expected_parent_commits, 153s ): 153s """Test that applied import commits have the right parents 153s 153s :param unittest.mock.Mock get_import_commit_msg_mock: mock of the function 153s that determines the commit message to use for a given import 153s :param unittest.mock.Mock get_import_tag_msg_mock: mock of the function 153s that determines the tag message to use for a given import 153s :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a 153s temporary output repository 153s :param repo_builder.Repo input_repo: input repository data 153s :param list(str) expected_ancestor_commits: list of commit-ish strings that 153s must be ancestors of the 'applied/1-2' tag following the applied import 153s :param list(str) expected_parent_commits: list of commit-ish strings that 153s must be parents of the 'applied/1-2' tag following the applied import. 153s 153s A fake package with version '1-2' that has a changelog parent of '1-1' is 153s imported on top of the provided input_repo. The test fails if any 153s of the expected_ancestor_commits or expected_parent_commits are not 153s present. 153s 153s This test is ugly because we do not yet have a programmatic way 153s to get the interstitial commits of the patch applications. 153s """ 153s # Match the repo_builder objects 153s get_import_tag_msg_mock.return_value = 'Test tag' 153s get_import_commit_msg_mock.return_value = b'Test commit' 153s 153s > input_repo.write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:1698: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmp2pdkpvf2/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: using patch list from debian/patches/series 153s dpkg-source: info: applying a 153s dpkg-source: info: applying b 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: using patch list from debian/patches/series 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: using patch list from debian/patches/series 153s dpkg-source: info: applying a 153s dpkg-source: info: applying b 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: using patch list from debian/patches/series 153s dpkg-source: info: building source-builder-package in source-builder-package_1-2.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-2.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: using patch list from debian/patches/series 153s dpkg-source: info: applying a 153s dpkg-source: info: applying b 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: using patch list from debian/patches/series 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: using patch list from debian/patches/series 153s dpkg-source: info: applying a 153s dpkg-source: info: applying b 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: using patch list from debian/patches/series 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: using patch list from debian/patches/series 153s dpkg-source: info: applying a 153s dpkg-source: info: applying b 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: using patch list from debian/patches/series 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s _ test_authorship_date[False-Fri, 2 Feb 1971 12:34:56 +0100-expected_result0] __ 153s 153s repo = 153s override = False, input_string = 'Fri, 2 Feb 1971 12:34:56 +0100' 153s expected_result = (1971, 2, 2, 11, 34, 56, ...) 153s 153s @pytest.mark.parametrize(['override', 'input_string', 'expected_result'], [ 153s # Standard date that should parse and be used 153s (False, 'Fri, 2 Feb 1971 12:34:56 +0100', (1971, 2, 2, 11, 34, 56, 60)), 153s # Deliberately illegal date that cannot be parsed 153s (True, 'Failday, 30 Feb 1971 99:99:99 +9999', (1972, 3, 3, 12, 45, 57, 0)), 153s ]) 153s def test_authorship_date(repo, override, input_string, expected_result): 153s """Synthesized commit should use changelog or override when provided 153s 153s A synthesized commit should use the date of the changelog entry in the 153s usual case, or commit_date when an override is requested. 153s 153s :param GitUbuntuRepository repo: fixture providing a temporary 153s GitUbuntuRepository instance to use 153s :param bool override: whether a changelog date override should be requested 153s from import_unapplied_dsc() 153s :param str input_string: the timestamp part of the changelog entry to use 153s :param tuple expected_result: the expected author date of the synthesized 153s commit, specified as six parameters to datetime.datetime() followed by 153s the expected tz offset in minutes. 153s """ 153s spec = source_builder.SourceSpec(changelog_date=input_string) 153s with source_builder.Source(spec) as dsc_pathname: 153s > target.import_unapplied_dsc( 153s repo=repo, 153s version='1-1', 153s namespace='importer', 153s dist='ubuntu', 153s dsc_pathname=dsc_pathname, 153s head_name='ubuntu/focal', 153s skip_orig=True, 153s parent_overrides={}, 153s commit_date=datetime.datetime( 153s 1972, 153s 3, 153s 3, 153s 12, 153s 45, 153s 57, 153s tzinfo=datetime.timezone.utc, 153s ), 153s changelog_date_overrides=( 153s frozenset({'1-1'}) if override else frozenset() 153s ), 153s ) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:1815: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer.py:2230: in import_unapplied_dsc 153s commit, tag = find_or_create_unapplied_commit( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer.py:2052: in find_or_create_unapplied_commit 153s changelog_parents = get_unapplied_import_parents( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer.py:1503: in get_unapplied_import_parents 153s import_tree_versions = repo.get_all_changelog_versions_from_treeish( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:2230: in get_all_changelog_versions_from_treeish 153s changelog = self.get_changelog_from_treeish(treeish) 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 153s return Changelog.from_treeish( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:569: in from_treeish 153s blob = follow_symlinks_to_blob( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 153s return _follow_symlinks_to_blob( 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s repo = pygit2.Repository('/tmp/tmpf942laur/.git/') 153s top_tree_object = 153s search_path = 'debian/changelog' 153s _rel_tree = 153s _rel_path = '' 153s 153s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 153s _rel_tree=None, _rel_path='' 153s ): 153s '''Recursively follow a path down a tree, following symlinks, to find blob 153s 153s repo: pygit2.Repository object 153s top_tree: pygit2.Tree object of the top of the tree structure 153s search_path: '/'-separated path string of blob to find 153s _rel_tree: (internal) which tree to look further into 153s _rel_path: (internal) the path we are in so far 153s ''' 153s 153s NORMAL_BLOB_MODES = set([ 153s pygit2.GIT_FILEMODE_BLOB, 153s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 153s ]) 153s 153s _rel_tree = _rel_tree or top_tree_object 153s head, tail = posixpath.split(search_path) 153s 153s # A traditional functional split would put a single entry in head with tail 153s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 153s # to make it appear to have traditional semantics. 153s if not head: 153s head = tail 153s tail = None 153s 153s entry = _rel_tree[head] 153s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:68: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s _ test_authorship_date[True-Failday, 30 Feb 1971 99:99:99 +9999-expected_result1] _ 153s 153s repo = 153s override = True, input_string = 'Failday, 30 Feb 1971 99:99:99 +9999' 153s expected_result = (1972, 3, 3, 12, 45, 57, ...) 153s 153s @pytest.mark.parametrize(['override', 'input_string', 'expected_result'], [ 153s # Standard date that should parse and be used 153s (False, 'Fri, 2 Feb 1971 12:34:56 +0100', (1971, 2, 2, 11, 34, 56, 60)), 153s # Deliberately illegal date that cannot be parsed 153s (True, 'Failday, 30 Feb 1971 99:99:99 +9999', (1972, 3, 3, 12, 45, 57, 0)), 153s ]) 153s def test_authorship_date(repo, override, input_string, expected_result): 153s """Synthesized commit should use changelog or override when provided 153s 153s A synthesized commit should use the date of the changelog entry in the 153s usual case, or commit_date when an override is requested. 153s 153s :param GitUbuntuRepository repo: fixture providing a temporary 153s GitUbuntuRepository instance to use 153s :param bool override: whether a changelog date override should be requested 153s from import_unapplied_dsc() 153s :param str input_string: the timestamp part of the changelog entry to use 153s :param tuple expected_result: the expected author date of the synthesized 153s commit, specified as six parameters to datetime.datetime() followed by 153s the expected tz offset in minutes. 153s """ 153s spec = source_builder.SourceSpec(changelog_date=input_string) 153s with source_builder.Source(spec) as dsc_pathname: 153s > target.import_unapplied_dsc( 153s repo=repo, 153s version='1-1', 153s namespace='importer', 153s dist='ubuntu', 153s dsc_pathname=dsc_pathname, 153s head_name='ubuntu/focal', 153s skip_orig=True, 153s parent_overrides={}, 153s commit_date=datetime.datetime( 153s 1972, 153s 3, 153s 3, 153s 12, 153s 45, 153s 57, 153s tzinfo=datetime.timezone.utc, 153s ), 153s changelog_date_overrides=( 153s frozenset({'1-1'}) if override else frozenset() 153s ), 153s ) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:1815: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer.py:2230: in import_unapplied_dsc 153s commit, tag = find_or_create_unapplied_commit( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer.py:2052: in find_or_create_unapplied_commit 153s changelog_parents = get_unapplied_import_parents( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer.py:1503: in get_unapplied_import_parents 153s import_tree_versions = repo.get_all_changelog_versions_from_treeish( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:2230: in get_all_changelog_versions_from_treeish 153s changelog = self.get_changelog_from_treeish(treeish) 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 153s return Changelog.from_treeish( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:569: in from_treeish 153s blob = follow_symlinks_to_blob( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 153s return _follow_symlinks_to_blob( 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s repo = pygit2.Repository('/tmp/tmpljngtmnj/.git/') 153s top_tree_object = 153s search_path = 'debian/changelog' 153s _rel_tree = 153s _rel_path = '' 153s 153s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 153s _rel_tree=None, _rel_path='' 153s ): 153s '''Recursively follow a path down a tree, following symlinks, to find blob 153s 153s repo: pygit2.Repository object 153s top_tree: pygit2.Tree object of the top of the tree structure 153s search_path: '/'-separated path string of blob to find 153s _rel_tree: (internal) which tree to look further into 153s _rel_path: (internal) the path we are in so far 153s ''' 153s 153s NORMAL_BLOB_MODES = set([ 153s pygit2.GIT_FILEMODE_BLOB, 153s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 153s ]) 153s 153s _rel_tree = _rel_tree or top_tree_object 153s head, tail = posixpath.split(search_path) 153s 153s # A traditional functional split would put a single entry in head with tail 153s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 153s # to make it appear to have traditional semantics. 153s if not head: 153s head = tail 153s tail = None 153s 153s entry = _rel_tree[head] 153s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:68: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: srcpkg/debian/changelog(l4): ignoring invalid week day 'Failday' 153s LINE: -- git ubuntu Failday, 30 Feb 1971 99:99:99 +9999 153s dpkg-source: warning: srcpkg/debian/changelog(l4): cannot parse non-conformant date '30 Feb 1971 99:99:99 +9999' 153s LINE: -- git ubuntu Failday, 30 Feb 1971 99:99:99 +9999 153s dpkg-source: warning: missing information for output field Standards-Version 153s __________________ test_fetch_rich_history_from_changes_file ___________________ 153s 153s repo = 153s pygit2_repo = pygit2.Repository('/tmp/tmp3kxffxbe/.git/') 153s 153s @patch('gitubuntu.importer.LAUNCHPAD_GIT_HOSTING_URL_PREFIX', 'file://') 153s @patch('gitubuntu.importer.VCS_GIT_URL_VALIDATION', re.compile(r'.*')) 153s def test_fetch_rich_history_from_changes_file(repo, pygit2_repo): 153s """Rich history specified in a changes file is found and validated""" 153s > rich_commit, parent_commit, import_tree = populate_rich_history( 153s import_repo=repo.raw_repo, 153s uploader_repo=pygit2_repo, 153s ) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:2111: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:2080: in populate_rich_history 153s ).write(import_repo) 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmp49gh5z7w/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s ________ test_fetch_rich_history_from_changes_file_fetch_failure_retry _________ 153s 153s repo = 153s pygit2_repo = pygit2.Repository('/tmp/tmpi5wgxgf_/.git/') 153s 153s @patch('gitubuntu.importer.LAUNCHPAD_GIT_HOSTING_URL_PREFIX', 'file://') 153s @patch('gitubuntu.importer.VCS_GIT_URL_VALIDATION', re.compile(r'.*')) 153s def test_fetch_rich_history_from_changes_file_fetch_failure_retry( 153s repo, 153s pygit2_repo, 153s ): 153s """If rich history cannot be fetched once, it is retried""" 153s > rich_commit, parent_commit, import_tree = populate_rich_history( 153s import_repo=repo.raw_repo, 153s uploader_repo=pygit2_repo, 153s ) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:2204: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:2080: in populate_rich_history 153s ).write(import_repo) 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmp9ihj8djw/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s ____________ test_fetch_rich_history_from_changes_file_missing_ref _____________ 153s 153s repo = 153s pygit2_repo = pygit2.Repository('/tmp/tmp1rjy8hbb/.git/') 153s 153s @patch('gitubuntu.importer.LAUNCHPAD_GIT_HOSTING_URL_PREFIX', 'file://') 153s @patch('gitubuntu.importer.VCS_GIT_URL_VALIDATION', re.compile(r'.*')) 153s def test_fetch_rich_history_from_changes_file_missing_ref( 153s repo, 153s pygit2_repo, 153s ): 153s """If rich history is specified but the ref cannot be found, a hard 153s exception is raised 153s """ 153s > rich_commit, _, _ = populate_rich_history( 153s import_repo=repo.raw_repo, 153s uploader_repo=pygit2_repo, 153s ) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:2243: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:2080: in populate_rich_history 153s ).write(import_repo) 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmpuhnyguqr/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s ___________ test_fetch_rich_history_from_changes_file_missing_commit ___________ 153s 153s repo = 153s pygit2_repo = pygit2.Repository('/tmp/tmpwiot4lqc/.git/') 153s 153s @patch('gitubuntu.importer.LAUNCHPAD_GIT_HOSTING_URL_PREFIX', 'file://') 153s @patch('gitubuntu.importer.VCS_GIT_URL_VALIDATION', re.compile(r'.*')) 153s def test_fetch_rich_history_from_changes_file_missing_commit( 153s repo, 153s pygit2_repo, 153s ): 153s """If rich history is specified but the commit cannot be found, an 153s exception is raised 153s """ 153s > rich_commit, _, _ = populate_rich_history( 153s import_repo=repo.raw_repo, 153s uploader_repo=pygit2_repo, 153s ) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:2271: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:2080: in populate_rich_history 153s ).write(import_repo) 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmp8hcjyjg7/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s ____________ test_fetch_rich_history_from_changes_file_not_a_commit ____________ 153s 153s repo = 153s pygit2_repo = pygit2.Repository('/tmp/tmpirhx3d_v/.git/') 153s 153s @patch('gitubuntu.importer.LAUNCHPAD_GIT_HOSTING_URL_PREFIX', 'file://') 153s @patch('gitubuntu.importer.VCS_GIT_URL_VALIDATION', re.compile(r'.*')) 153s def test_fetch_rich_history_from_changes_file_not_a_commit(repo, pygit2_repo): 153s """If rich history is specified but the commit hash resolves to something 153s other than a commit, an exception is raised 153s """ 153s > rich_commit, _, _ = populate_rich_history( 153s import_repo=repo.raw_repo, 153s uploader_repo=pygit2_repo, 153s ) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:2297: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/importer_test.py:2080: in populate_rich_history 153s ).write(import_repo) 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmp60nac6f7/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s __________________________ test_reconstruct_changelog __________________________ 153s 153s pygit2_repo = pygit2.Repository('/tmp/tmpl46_5nq8/.git/') 153s monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7b5154d422a0> 153s 153s @pytest.mark.skipif( 153s ENTRY_POINT_TYPE is None, 153s reason="Entry point testing not available", 153s ) 153s def test_reconstruct_changelog(pygit2_repo, monkeypatch): 153s '''The reconstruct-changelog endpoint should add the expected commit''' 153s monkeypatch.setenv('DEBFULLNAME', 'Test User') 153s monkeypatch.setenv('DEBEMAIL', 'test@example.com') 153s Repo( 153s commits=[ 153s Commit(tree=SourceTree(Source()), name='root'), 153s Commit( 153s tree=SourceTree(Source(spec=SourceSpec(mutate=1))), 153s message=' * Test changelog entry', 153s name='child', 153s parents=[Placeholder('root')], 153s ), 153s ], 153s tags={'root': Placeholder('root'), 'child': Placeholder('child')}, 153s > ).write(pygit2_repo) 153s 153s gitubuntu/integration_test.py:219: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmpl46_5nq8/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s gitubuntu/repo_builder.py:389: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s dpkg-source: warning: missing information for output field Standards-Version 153s ___________________ TestObjectCreation.testRepoBranchesTags ____________________ 153s 153s self = 153s 153s def testRepoBranchesTags(self): 153s graph = Repo( 153s commits=[ 153s Commit( 153s Tree({}), 153s parents=[Placeholder('parent')], 153s name='child', 153s ), 153s Commit(Tree({}), name='parent'), 153s ], 153s branches={ 153s 'branch1': Placeholder('parent'), 153s 'branch2': Commit(Tree({'foo': Blob(b'qux')})), 153s }, 153s tags={ 153s 'tag1': Placeholder('child'), 153s 'tag2': Commit(Tree({'foo': Blob(b'quz')})), 153s }, 153s ) 153s > child_ref = graph.write(self.repo) 153s 153s gitubuntu/repo_builder_test.py:154: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmp3ic3mdh9/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s gitubuntu/repo_builder.py:389: AttributeError 153s ______________________ TestObjectCreation.testRepoTagger _______________________ 153s 153s self = 153s 153s def testRepoTagger(self): 153s """The tagger parameter should make it through to the tag""" 153s input_repo = Repo( 153s commits=[Commit(name='root')], 153s tags={'root': Placeholder('root')}, 153s tagger=pygit2.Signature( 153s 'Test Tagger', 153s 'test@example.com', 153s 1, 153s 2, 153s ), 153s ) 153s > input_repo.write(self.repo) 153s 153s gitubuntu/repo_builder_test.py:178: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmpp5ftjh5u/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s gitubuntu/repo_builder.py:389: AttributeError 153s _______________________________ test_source_tree _______________________________ 153s 153s pygit2_repo = pygit2.Repository('/tmp/tmp_9f6akbh/.git/') 153s 153s def test_source_tree(pygit2_repo): 153s commit_str = Commit(SourceTree(Source())).write(pygit2_repo) 153s commit = pygit2_repo.get(commit_str) 153s > assert gitubuntu.git_repository.follow_symlinks_to_blob( 153s repo=pygit2_repo, 153s treeish_object=commit, 153s path='debian/changelog', 153s ) 153s 153s gitubuntu/repo_builder_test.py:190: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 153s return _follow_symlinks_to_blob( 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s repo = pygit2.Repository('/tmp/tmp_9f6akbh/.git/') 153s top_tree_object = 153s search_path = 'debian/changelog' 153s _rel_tree = 153s _rel_path = '' 153s 153s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 153s _rel_tree=None, _rel_path='' 153s ): 153s '''Recursively follow a path down a tree, following symlinks, to find blob 153s 153s repo: pygit2.Repository object 153s top_tree: pygit2.Tree object of the top of the tree structure 153s search_path: '/'-separated path string of blob to find 153s _rel_tree: (internal) which tree to look further into 153s _rel_path: (internal) the path we are in so far 153s ''' 153s 153s NORMAL_BLOB_MODES = set([ 153s pygit2.GIT_FILEMODE_BLOB, 153s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 153s ]) 153s 153s _rel_tree = _rel_tree or top_tree_object 153s head, tail = posixpath.split(search_path) 153s 153s # A traditional functional split would put a single entry in head with tail 153s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 153s # to make it appear to have traditional semantics. 153s if not head: 153s head = tail 153s tail = None 153s 153s entry = _rel_tree[head] 153s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 153s 153s gitubuntu/git_repository.py:68: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s ______________________________ test_preservation _______________________________ 153s 153s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_preservation0') 153s repo = 153s 153s def test_preservation(tmpdir, repo): 153s """An export followed by an import should preserve rich history 153s 153s Given a minimal repository that should be able to have upload tags be 153s exported, when we import the export result into a similar repository with a 153s subtly different upload tag in which the rich history should still apply, 153s the result should be a correctly reconstructed upload tag. 153s 153s :param py.path tmpdir: the pytest standard tmpdir fixture. 153s :param repo: our standard repo fixture. 153s """ 153s Repo( 153s commits=[ 153s Commit( 153s name='1', 153s tree=Tree({ 153s 'a': Blob(b'a'), 153s }), 153s ), 153s Commit( 153s name='2', 153s parents=[Placeholder('1')], 153s tree=Tree({ 153s 'a': Blob(b'ab'), 153s }), 153s ), 153s Commit( 153s name='3', 153s parents=[Placeholder('2')], 153s tree=Tree({ 153s 'a': Blob(b'abc'), 153s }), 153s ), 153s ], 153s tags={ 153s 'importer/import/1': Placeholder('1'), 153s 'importer/upload/2': Placeholder('3'), 153s } 153s > ).write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/rich_history_test.py:51: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmpxpy2b5yv/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s ______________________ test_preservation_multiple_parents ______________________ 153s 153s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_preservation_multiple_par0') 153s repo = 153s 153s def test_preservation_multiple_parents(tmpdir, repo): 153s """An export of rich history should omit multiple parent cases 153s 153s If an upload tag leads to multiple parents before we reach an import tag, 153s it should be excluded from the export as this type of upload tag is not 153s supported for rich history preservation. This test also serves to verify 153s code paths that handle the MultipleParentError exception in the export 153s code. 153s 153s :param py.path tmpdir: the pytest standard tmpdir fixture. 153s :param repo: our standard repo fixture. 153s """ 153s Repo( 153s commits=[ 153s Commit(name='1', message='a'), 153s Commit(name='2', message='b'), 153s Commit(name='child', parents=[Placeholder('1'), Placeholder('2')]), 153s ], 153s tags={ 153s 'importer/import/1': Placeholder('1'), 153s 'importer/upload/2': Placeholder('child'), 153s } 153s > ).write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/rich_history_test.py:102: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmp3i9dz7d3/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s _________________________ test_preservation_no_parents _________________________ 153s 153s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_preservation_no_parents0') 153s repo = 153s 153s def test_preservation_no_parents(tmpdir, repo): 153s """An export of rich history should omit no parent cases 153s 153s If an upload tag leads to no parents before we reach an import tag, 153s it should be excluded from the export as this type of upload tag is not 153s supported for rich history preservation. This test also serves to verify 153s code paths that handle the NoParentError exception in the export 153s code. 153s 153s :param py.path tmpdir: the pytest standard tmpdir fixture. 153s :param repo: our standard repo fixture. 153s """ 153s Repo( 153s commits=[ 153s Commit(name='1', message='a'), 153s Commit(name='2', message='b'), 153s ], 153s tags={ 153s 'importer/import/1': Placeholder('1'), 153s 'importer/upload/2': Placeholder('2'), 153s } 153s > ).write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/rich_history_test.py:129: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmp1a9271jv/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s _____________ test_input_edge_cases[before_export0-before_import0] _____________ 153s 153s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_input_edge_cases_before_e0') 153s repo = 153s before_export = {'commits': [, , 'importer/upload/2': }} 153s before_import = {'commits': [], 'tags': {'importer/import/1': }} 153s 153s @pytest.mark.parametrize(['before_export', 'before_import'], [ 153s ( 153s # Commit messages with patch-like contents should not fail 153s 153s # If a commit message in rich history contains text in a patch-like 153s # format (such as a diff of some file), it should not prevent correct 153s # round-tripping. "git format-patch" followed by "git am" fails this 153s # test, for example. 153s { 153s 'commits': [ 153s Commit(name='1', message='a', tree=Tree({'a': Blob(b'a')})), 153s Commit( 153s name='2', 153s message='''First line 153s 153s Inline patch that isn't part of the real patch starts here 153s 153s --- a/foo 153s +++ b/foo 153s @@ -1 +1,2 @@ 153s foo 153s +bar 153s ''', 153s tree=Tree({'a': Blob(b'ab')}), 153s parents=[Placeholder('1')], 153s ), 153s ], 153s 'tags': { 153s 'importer/import/1': Placeholder('1'), 153s 'importer/upload/2': Placeholder('2'), 153s } 153s }, 153s { 153s 'commits': [ 153s Commit(name='b1', message='c', tree=Tree({'a': Blob(b'a')})), 153s ], 153s 'tags': {'importer/import/1': Placeholder('b1')}, 153s }, 153s ), 153s ( 153s # Commits that have no changes should round trip 153s { 153s 'commits': [ 153s Commit( 153s name='1', 153s message='a', 153s ), 153s Commit( 153s name='2', 153s message='b', 153s parents=[Placeholder('1')], 153s ), 153s ], 153s 'tags': { 153s 'importer/import/1': Placeholder('1'), 153s 'importer/upload/2': Placeholder('2'), 153s }, 153s }, 153s { 153s 'commits': [Commit(name='b1', message='c')], 153s 'tags': {'importer/import/1': Placeholder('b1')}, 153s }, 153s ), 153s ( 153s # Commits that have no commit message should round trip 153s { 153s 'commits': [ 153s Commit( 153s name='1', 153s message='a', 153s ), 153s Commit( 153s name='2', 153s message='', 153s tree=Tree({'a': Blob(b'a')}), 153s parents=[Placeholder('1')], 153s ), 153s ], 153s 'tags': { 153s 'importer/import/1': Placeholder('1'), 153s 'importer/upload/2': Placeholder('2'), 153s } 153s }, 153s { 153s 'commits': [Commit(name='b1', message='c')], 153s 'tags': {'importer/import/1': Placeholder('b1')}, 153s }, 153s ), 153s ]) 153s def test_input_edge_cases(tmpdir, repo, before_export, before_import): 153s """ 153s Edge cases in input rich history should reimport without failure 153s 153s Check that rich history preservation completes without an exception in 153s various cases. Details of each case are described in comments in the test 153s parameters above. 153s 153s Since these tests generally cover the mutated case (where rich history has 153s to be ported forward because parent commits have mutated), we must remove 153s and recreate the 'importer/import/1' tag so that it is different before 153s attempting reimport. This is done by deleting all ('importer/*') tags and 153s then using the before_import parameter to recreate it again. 153s 153s :param py.path tmpdir: the pytest standard tmpdir fixture. 153s :param GitUbuntuRepository repo: our standard repo fixture. 153s :param dict before_export: the parameters to supply to Repo() to construct 153s the repository that will be exported. 153s :param dict before_import: the parametsrs to supply to Repo() to add to the 153s repository before attempting reimport. 153s """ 153s > Repo(**before_export).write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/rich_history_test.py:260: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmpgkl1yoop/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s _____________ test_input_edge_cases[before_export1-before_import1] _____________ 153s 153s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_input_edge_cases_before_e1') 153s repo = 153s before_export = {'commits': [, , 'importer/upload/2': }} 153s before_import = {'commits': [], 'tags': {'importer/import/1': }} 153s 153s @pytest.mark.parametrize(['before_export', 'before_import'], [ 153s ( 153s # Commit messages with patch-like contents should not fail 153s 153s # If a commit message in rich history contains text in a patch-like 153s # format (such as a diff of some file), it should not prevent correct 153s # round-tripping. "git format-patch" followed by "git am" fails this 153s # test, for example. 153s { 153s 'commits': [ 153s Commit(name='1', message='a', tree=Tree({'a': Blob(b'a')})), 153s Commit( 153s name='2', 153s message='''First line 153s 153s Inline patch that isn't part of the real patch starts here 153s 153s --- a/foo 153s +++ b/foo 153s @@ -1 +1,2 @@ 153s foo 153s +bar 153s ''', 153s tree=Tree({'a': Blob(b'ab')}), 153s parents=[Placeholder('1')], 153s ), 153s ], 153s 'tags': { 153s 'importer/import/1': Placeholder('1'), 153s 'importer/upload/2': Placeholder('2'), 153s } 153s }, 153s { 153s 'commits': [ 153s Commit(name='b1', message='c', tree=Tree({'a': Blob(b'a')})), 153s ], 153s 'tags': {'importer/import/1': Placeholder('b1')}, 153s }, 153s ), 153s ( 153s # Commits that have no changes should round trip 153s { 153s 'commits': [ 153s Commit( 153s name='1', 153s message='a', 153s ), 153s Commit( 153s name='2', 153s message='b', 153s parents=[Placeholder('1')], 153s ), 153s ], 153s 'tags': { 153s 'importer/import/1': Placeholder('1'), 153s 'importer/upload/2': Placeholder('2'), 153s }, 153s }, 153s { 153s 'commits': [Commit(name='b1', message='c')], 153s 'tags': {'importer/import/1': Placeholder('b1')}, 153s }, 153s ), 153s ( 153s # Commits that have no commit message should round trip 153s { 153s 'commits': [ 153s Commit( 153s name='1', 153s message='a', 153s ), 153s Commit( 153s name='2', 153s message='', 153s tree=Tree({'a': Blob(b'a')}), 153s parents=[Placeholder('1')], 153s ), 153s ], 153s 'tags': { 153s 'importer/import/1': Placeholder('1'), 153s 'importer/upload/2': Placeholder('2'), 153s } 153s }, 153s { 153s 'commits': [Commit(name='b1', message='c')], 153s 'tags': {'importer/import/1': Placeholder('b1')}, 153s }, 153s ), 153s ]) 153s def test_input_edge_cases(tmpdir, repo, before_export, before_import): 153s """ 153s Edge cases in input rich history should reimport without failure 153s 153s Check that rich history preservation completes without an exception in 153s various cases. Details of each case are described in comments in the test 153s parameters above. 153s 153s Since these tests generally cover the mutated case (where rich history has 153s to be ported forward because parent commits have mutated), we must remove 153s and recreate the 'importer/import/1' tag so that it is different before 153s attempting reimport. This is done by deleting all ('importer/*') tags and 153s then using the before_import parameter to recreate it again. 153s 153s :param py.path tmpdir: the pytest standard tmpdir fixture. 153s :param GitUbuntuRepository repo: our standard repo fixture. 153s :param dict before_export: the parameters to supply to Repo() to construct 153s the repository that will be exported. 153s :param dict before_import: the parametsrs to supply to Repo() to add to the 153s repository before attempting reimport. 153s """ 153s > Repo(**before_export).write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/rich_history_test.py:260: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmpdg1tg3gv/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s _____________ test_input_edge_cases[before_export2-before_import2] _____________ 153s 153s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_input_edge_cases_before_e2') 153s repo = 153s before_export = {'commits': [, , 'importer/upload/2': }} 153s before_import = {'commits': [], 'tags': {'importer/import/1': }} 153s 153s @pytest.mark.parametrize(['before_export', 'before_import'], [ 153s ( 153s # Commit messages with patch-like contents should not fail 153s 153s # If a commit message in rich history contains text in a patch-like 153s # format (such as a diff of some file), it should not prevent correct 153s # round-tripping. "git format-patch" followed by "git am" fails this 153s # test, for example. 153s { 153s 'commits': [ 153s Commit(name='1', message='a', tree=Tree({'a': Blob(b'a')})), 153s Commit( 153s name='2', 153s message='''First line 153s 153s Inline patch that isn't part of the real patch starts here 153s 153s --- a/foo 153s +++ b/foo 153s @@ -1 +1,2 @@ 153s foo 153s +bar 153s ''', 153s tree=Tree({'a': Blob(b'ab')}), 153s parents=[Placeholder('1')], 153s ), 153s ], 153s 'tags': { 153s 'importer/import/1': Placeholder('1'), 153s 'importer/upload/2': Placeholder('2'), 153s } 153s }, 153s { 153s 'commits': [ 153s Commit(name='b1', message='c', tree=Tree({'a': Blob(b'a')})), 153s ], 153s 'tags': {'importer/import/1': Placeholder('b1')}, 153s }, 153s ), 153s ( 153s # Commits that have no changes should round trip 153s { 153s 'commits': [ 153s Commit( 153s name='1', 153s message='a', 153s ), 153s Commit( 153s name='2', 153s message='b', 153s parents=[Placeholder('1')], 153s ), 153s ], 153s 'tags': { 153s 'importer/import/1': Placeholder('1'), 153s 'importer/upload/2': Placeholder('2'), 153s }, 153s }, 153s { 153s 'commits': [Commit(name='b1', message='c')], 153s 'tags': {'importer/import/1': Placeholder('b1')}, 153s }, 153s ), 153s ( 153s # Commits that have no commit message should round trip 153s { 153s 'commits': [ 153s Commit( 153s name='1', 153s message='a', 153s ), 153s Commit( 153s name='2', 153s message='', 153s tree=Tree({'a': Blob(b'a')}), 153s parents=[Placeholder('1')], 153s ), 153s ], 153s 'tags': { 153s 'importer/import/1': Placeholder('1'), 153s 'importer/upload/2': Placeholder('2'), 153s } 153s }, 153s { 153s 'commits': [Commit(name='b1', message='c')], 153s 'tags': {'importer/import/1': Placeholder('b1')}, 153s }, 153s ), 153s ]) 153s def test_input_edge_cases(tmpdir, repo, before_export, before_import): 153s """ 153s Edge cases in input rich history should reimport without failure 153s 153s Check that rich history preservation completes without an exception in 153s various cases. Details of each case are described in comments in the test 153s parameters above. 153s 153s Since these tests generally cover the mutated case (where rich history has 153s to be ported forward because parent commits have mutated), we must remove 153s and recreate the 'importer/import/1' tag so that it is different before 153s attempting reimport. This is done by deleting all ('importer/*') tags and 153s then using the before_import parameter to recreate it again. 153s 153s :param py.path tmpdir: the pytest standard tmpdir fixture. 153s :param GitUbuntuRepository repo: our standard repo fixture. 153s :param dict before_export: the parameters to supply to Repo() to construct 153s the repository that will be exported. 153s :param dict before_import: the parametsrs to supply to Repo() to add to the 153s repository before attempting reimport. 153s """ 153s > Repo(**before_export).write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/rich_history_test.py:260: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmpt3oy9ofo/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s _______________________ test_preservation_fast_forwards ________________________ 153s 153s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_preservation_fast_forward0') 153s repo = 153s 153s def test_preservation_fast_forwards(tmpdir, repo): 153s """Rich history that can be fast forwarded should not mutate 153s 153s :param py.path tmpdir: the pytest standard tmpdir fixture. 153s :param GitUbuntuRepository repo: our standard repo fixture. 153s """ 153s Repo( 153s commits=[ 153s Commit( 153s name='1', 153s message='a', 153s ), 153s Commit( 153s name='2', 153s message='', 153s tree=Tree({'a': Blob(b'a')}), 153s parents=[Placeholder('1')], 153s ), 153s ], 153s tags={ 153s 'importer/import/1': Placeholder('1'), 153s 'importer/upload/2': Placeholder('2'), 153s } 153s > ).write(repo.raw_repo) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/rich_history_test.py:294: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s self = 153s repo = pygit2.Repository('/tmp/tmpz59z3o4o/.git/'), record = {} 153s 153s def write(self, repo, record=None): 153s replace_placeholders(self) 153s record = record or dict() 153s written_commits = [ 153s commit.write(repo=repo, record=record) 153s for commit 153s in self.commit_list 153s ] 153s for name, target in self.branches.items(): 153s repo.create_branch( 153s name, 153s repo.get(target.write(repo)).peel(pygit2.Commit), 153s ) 153s for name, target in self.tags.items(): 153s repo.create_tag( 153s name, 153s target.write(repo), 153s > pygit2.GIT_OBJ_COMMIT, 153s self.tagger.signature, 153s 'Tag message', 153s ) 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_COMMIT'. Did you mean: 'GIT_OBJECT_COMMIT'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/repo_builder.py:389: AttributeError 153s _______________________ test_source_create_with_version ________________________ 153s 153s repo = 153s 153s def test_source_create_with_version(repo): 153s > version = get_spec_changelog_version(repo, version='3', native=True) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/source_builder_test.py:57: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/source_builder_test.py:47: in get_spec_changelog_version 153s changelog = repo.get_changelog_from_treeish(tree_hash) 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 153s return Changelog.from_treeish( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:569: in from_treeish 153s blob = follow_symlinks_to_blob( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 153s return _follow_symlinks_to_blob( 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s repo = pygit2.Repository('/tmp/tmpck5bvhhj/.git/') 153s top_tree_object = 153s search_path = 'debian/changelog' 153s _rel_tree = 153s _rel_path = '' 153s 153s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 153s _rel_tree=None, _rel_path='' 153s ): 153s '''Recursively follow a path down a tree, following symlinks, to find blob 153s 153s repo: pygit2.Repository object 153s top_tree: pygit2.Tree object of the top of the tree structure 153s search_path: '/'-separated path string of blob to find 153s _rel_tree: (internal) which tree to look further into 153s _rel_path: (internal) the path we are in so far 153s ''' 153s 153s NORMAL_BLOB_MODES = set([ 153s pygit2.GIT_FILEMODE_BLOB, 153s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 153s ]) 153s 153s _rel_tree = _rel_tree or top_tree_object 153s head, tail = posixpath.split(search_path) 153s 153s # A traditional functional split would put a single entry in head with tail 153s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 153s # to make it appear to have traditional semantics. 153s if not head: 153s head = tail 153s tail = None 153s 153s entry = _rel_tree[head] 153s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:68: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (native)' 153s dpkg-source: info: building source-builder-package in source-builder-package_3.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_3.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s _______________________ test_source_create_with_versions _______________________ 153s 153s repo = 153s 153s def test_source_create_with_versions(repo): 153s source_spec = target.SourceSpec(changelog_versions=['3', '4'], native=True) 153s with target.Source(source_spec) as f: 153s tree_hash = importer.dsc_to_tree_hash(repo.raw_repo, f) 153s > changelog = repo.get_changelog_from_treeish(tree_hash) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/source_builder_test.py:65: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 153s return Changelog.from_treeish( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:569: in from_treeish 153s blob = follow_symlinks_to_blob( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 153s return _follow_symlinks_to_blob( 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s repo = pygit2.Repository('/tmp/tmpywi6fybd/.git/') 153s top_tree_object = 153s search_path = 'debian/changelog' 153s _rel_tree = 153s _rel_path = '' 153s 153s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 153s _rel_tree=None, _rel_path='' 153s ): 153s '''Recursively follow a path down a tree, following symlinks, to find blob 153s 153s repo: pygit2.Repository object 153s top_tree: pygit2.Tree object of the top of the tree structure 153s search_path: '/'-separated path string of blob to find 153s _rel_tree: (internal) which tree to look further into 153s _rel_path: (internal) the path we are in so far 153s ''' 153s 153s NORMAL_BLOB_MODES = set([ 153s pygit2.GIT_FILEMODE_BLOB, 153s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 153s ]) 153s 153s _rel_tree = _rel_tree or top_tree_object 153s head, tail = posixpath.split(search_path) 153s 153s # A traditional functional split would put a single entry in head with tail 153s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 153s # to make it appear to have traditional semantics. 153s if not head: 153s head = tail 153s tail = None 153s 153s entry = _rel_tree[head] 153s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:68: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (native)' 153s dpkg-source: info: building source-builder-package in source-builder-package_3.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_3.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s ____________ test_source_native_source_format[True-3.0 (native)\n] _____________ 153s 153s repo = 153s native = True, expected = b'3.0 (native)\n' 153s 153s @pytest.mark.parametrize('native,expected', [ 153s (True, b"3.0 (native)\n"), 153s (False, b"3.0 (quilt)\n"), 153s ]) 153s def test_source_native_source_format(repo, native, expected): 153s with target.Source(target.SourceSpec(native=native)) as dsc_path: 153s > blob = git_repository.follow_symlinks_to_blob( 153s repo.raw_repo, 153s dsc_path_to_tree(repo, dsc_path), 153s 'debian/source/format', 153s ) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/source_builder_test.py:133: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 153s return _follow_symlinks_to_blob( 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s repo = pygit2.Repository('/tmp/tmpl4l5pfjv/.git/') 153s top_tree_object = 153s search_path = 'debian/source/format' 153s _rel_tree = 153s _rel_path = '' 153s 153s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 153s _rel_tree=None, _rel_path='' 153s ): 153s '''Recursively follow a path down a tree, following symlinks, to find blob 153s 153s repo: pygit2.Repository object 153s top_tree: pygit2.Tree object of the top of the tree structure 153s search_path: '/'-separated path string of blob to find 153s _rel_tree: (internal) which tree to look further into 153s _rel_path: (internal) the path we are in so far 153s ''' 153s 153s NORMAL_BLOB_MODES = set([ 153s pygit2.GIT_FILEMODE_BLOB, 153s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 153s ]) 153s 153s _rel_tree = _rel_tree or top_tree_object 153s head, tail = posixpath.split(search_path) 153s 153s # A traditional functional split would put a single entry in head with tail 153s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 153s # to make it appear to have traditional semantics. 153s if not head: 153s head = tail 153s tail = None 153s 153s entry = _rel_tree[head] 153s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:68: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (native)' 153s dpkg-source: info: building source-builder-package in source-builder-package_1.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s ____________ test_source_native_source_format[False-3.0 (quilt)\n] _____________ 153s 153s repo = 153s native = False, expected = b'3.0 (quilt)\n' 153s 153s @pytest.mark.parametrize('native,expected', [ 153s (True, b"3.0 (native)\n"), 153s (False, b"3.0 (quilt)\n"), 153s ]) 153s def test_source_native_source_format(repo, native, expected): 153s with target.Source(target.SourceSpec(native=native)) as dsc_path: 153s > blob = git_repository.follow_symlinks_to_blob( 153s repo.raw_repo, 153s dsc_path_to_tree(repo, dsc_path), 153s 'debian/source/format', 153s ) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/source_builder_test.py:133: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 153s return _follow_symlinks_to_blob( 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s repo = pygit2.Repository('/tmp/tmpus87j1ua/.git/') 153s top_tree_object = 153s search_path = 'debian/source/format' 153s _rel_tree = 153s _rel_path = '' 153s 153s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 153s _rel_tree=None, _rel_path='' 153s ): 153s '''Recursively follow a path down a tree, following symlinks, to find blob 153s 153s repo: pygit2.Repository object 153s top_tree: pygit2.Tree object of the top of the tree structure 153s search_path: '/'-separated path string of blob to find 153s _rel_tree: (internal) which tree to look further into 153s _rel_path: (internal) the path we are in so far 153s ''' 153s 153s NORMAL_BLOB_MODES = set([ 153s pygit2.GIT_FILEMODE_BLOB, 153s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 153s ]) 153s 153s _rel_tree = _rel_tree or top_tree_object 153s head, tail = posixpath.split(search_path) 153s 153s # A traditional functional split would put a single entry in head with tail 153s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 153s # to make it appear to have traditional semantics. 153s if not head: 153s head = tail 153s tail = None 153s 153s entry = _rel_tree[head] 153s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:68: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s _________________________ test_source_quilt_no_patches _________________________ 153s 153s repo = 153s 153s def test_source_quilt_no_patches(repo): 153s with target.Source(target.SourceSpec()) as dsc_path: 153s top = dsc_path_to_tree(repo, dsc_path) 153s debian_entry = top['debian'] 153s > assert debian_entry.type in [pygit2.GIT_OBJ_TREE, 'tree'] 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/source_builder_test.py:144: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s ________________________ test_source_quilt_with_patches ________________________ 153s 153s repo = 153s 153s def test_source_quilt_with_patches(repo): 153s spec = target.SourceSpec(has_patches=True) 153s with target.Source(spec) as dsc_path: 153s top = dsc_path_to_tree(repo, dsc_path) 153s expected_files = ['series', 'a', 'b'] 153s for basename in expected_files: 153s > assert git_repository.follow_symlinks_to_blob( 153s repo.raw_repo, 153s top, 153s 'debian/patches/%s' % basename, 153s ) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/source_builder_test.py:156: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 153s return _follow_symlinks_to_blob( 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s repo = pygit2.Repository('/tmp/tmpdor9s24d/.git/') 153s top_tree_object = 153s search_path = 'debian/patches/series' 153s _rel_tree = 153s _rel_path = '' 153s 153s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 153s _rel_tree=None, _rel_path='' 153s ): 153s '''Recursively follow a path down a tree, following symlinks, to find blob 153s 153s repo: pygit2.Repository object 153s top_tree: pygit2.Tree object of the top of the tree structure 153s search_path: '/'-separated path string of blob to find 153s _rel_tree: (internal) which tree to look further into 153s _rel_path: (internal) the path we are in so far 153s ''' 153s 153s NORMAL_BLOB_MODES = set([ 153s pygit2.GIT_FILEMODE_BLOB, 153s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 153s ]) 153s 153s _rel_tree = _rel_tree or top_tree_object 153s head, tail = posixpath.split(search_path) 153s 153s # A traditional functional split would put a single entry in head with tail 153s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 153s # to make it appear to have traditional semantics. 153s if not head: 153s head = tail 153s tail = None 153s 153s entry = _rel_tree[head] 153s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:68: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: using patch list from debian/patches/series 153s dpkg-source: info: applying a 153s dpkg-source: info: applying b 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: using patch list from debian/patches/series 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s ____________________ test_source_quilt_with_patches_applied ____________________ 153s 153s repo = 153s 153s def test_source_quilt_with_patches_applied(repo): 153s spec = target.SourceSpec(has_patches=True) 153s with target.Source(spec) as dsc_path: 153s top = dsc_path_to_tree(repo, dsc_path, patches_applied=True) 153s expected_files = [ 153s 'debian/patches/series', 153s 'debian/patches/a', 153s 'debian/patches/b', 153s 'a', 153s 'b', 153s ] 153s for filename in expected_files: 153s > assert git_repository.follow_symlinks_to_blob( 153s repo.raw_repo, 153s top, 153s filename, 153s ) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/source_builder_test.py:183: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 153s return _follow_symlinks_to_blob( 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s repo = pygit2.Repository('/tmp/tmp55lh4mp0/.git/') 153s top_tree_object = 153s search_path = 'debian/patches/series' 153s _rel_tree = 153s _rel_path = '' 153s 153s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 153s _rel_tree=None, _rel_path='' 153s ): 153s '''Recursively follow a path down a tree, following symlinks, to find blob 153s 153s repo: pygit2.Repository object 153s top_tree: pygit2.Tree object of the top of the tree structure 153s search_path: '/'-separated path string of blob to find 153s _rel_tree: (internal) which tree to look further into 153s _rel_path: (internal) the path we are in so far 153s ''' 153s 153s NORMAL_BLOB_MODES = set([ 153s pygit2.GIT_FILEMODE_BLOB, 153s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 153s ]) 153s 153s _rel_tree = _rel_tree or top_tree_object 153s head, tail = posixpath.split(search_path) 153s 153s # A traditional functional split would put a single entry in head with tail 153s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 153s # to make it appear to have traditional semantics. 153s if not head: 153s head = tail 153s tail = None 153s 153s entry = _rel_tree[head] 153s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:68: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: using patch list from debian/patches/series 153s dpkg-source: info: applying a 153s dpkg-source: info: applying b 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: using patch list from debian/patches/series 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s ______________________ test_source_version_native_default ______________________ 153s 153s repo = 153s 153s def test_source_version_native_default(repo): 153s """The default version string for a native package should not have a 153s '-' in it. 153s """ 153s > version = get_spec_changelog_version(repo, native=True) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/source_builder_test.py:194: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/source_builder_test.py:47: in get_spec_changelog_version 153s changelog = repo.get_changelog_from_treeish(tree_hash) 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 153s return Changelog.from_treeish( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:569: in from_treeish 153s blob = follow_symlinks_to_blob( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 153s return _follow_symlinks_to_blob( 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s repo = pygit2.Repository('/tmp/tmpo3a9v38x/.git/') 153s top_tree_object = 153s search_path = 'debian/changelog' 153s _rel_tree = 153s _rel_path = '' 153s 153s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 153s _rel_tree=None, _rel_path='' 153s ): 153s '''Recursively follow a path down a tree, following symlinks, to find blob 153s 153s repo: pygit2.Repository object 153s top_tree: pygit2.Tree object of the top of the tree structure 153s search_path: '/'-separated path string of blob to find 153s _rel_tree: (internal) which tree to look further into 153s _rel_path: (internal) the path we are in so far 153s ''' 153s 153s NORMAL_BLOB_MODES = set([ 153s pygit2.GIT_FILEMODE_BLOB, 153s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 153s ]) 153s 153s _rel_tree = _rel_tree or top_tree_object 153s head, tail = posixpath.split(search_path) 153s 153s # A traditional functional split would put a single entry in head with tail 153s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 153s # to make it appear to have traditional semantics. 153s if not head: 153s head = tail 153s tail = None 153s 153s entry = _rel_tree[head] 153s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:68: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (native)' 153s dpkg-source: info: building source-builder-package in source-builder-package_1.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s ____________________ test_source_version_non_native_default ____________________ 153s 153s repo = 153s 153s def test_source_version_non_native_default(repo): 153s """The default version string for a non-native package should have a 153s '-' in it. 153s """ 153s > version = get_spec_changelog_version(repo, native=False) 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/source_builder_test.py:202: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/source_builder_test.py:47: in get_spec_changelog_version 153s changelog = repo.get_changelog_from_treeish(tree_hash) 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 153s return Changelog.from_treeish( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:569: in from_treeish 153s blob = follow_symlinks_to_blob( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 153s return _follow_symlinks_to_blob( 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s repo = pygit2.Repository('/tmp/tmppp66fr_w/.git/') 153s top_tree_object = 153s search_path = 'debian/changelog' 153s _rel_tree = 153s _rel_path = '' 153s 153s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 153s _rel_tree=None, _rel_path='' 153s ): 153s '''Recursively follow a path down a tree, following symlinks, to find blob 153s 153s repo: pygit2.Repository object 153s top_tree: pygit2.Tree object of the top of the tree structure 153s search_path: '/'-separated path string of blob to find 153s _rel_tree: (internal) which tree to look further into 153s _rel_path: (internal) the path we are in so far 153s ''' 153s 153s NORMAL_BLOB_MODES = set([ 153s pygit2.GIT_FILEMODE_BLOB, 153s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 153s ]) 153s 153s _rel_tree = _rel_tree or top_tree_object 153s head, tail = posixpath.split(search_path) 153s 153s # A traditional functional split would put a single entry in head with tail 153s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 153s # to make it appear to have traditional semantics. 153s if not head: 153s head = tail 153s tail = None 153s 153s entry = _rel_tree[head] 153s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:68: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s _____________________ test_source_version_native_specific ______________________ 153s 153s repo = 153s 153s def test_source_version_native_specific(repo): 153s """We should be able to create a native package with a 153s native-looking version string. 153s """ 153s > version = get_spec_changelog_version(repo, native=True, version='1.0') 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/source_builder_test.py:210: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/source_builder_test.py:47: in get_spec_changelog_version 153s changelog = repo.get_changelog_from_treeish(tree_hash) 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 153s return Changelog.from_treeish( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:569: in from_treeish 153s blob = follow_symlinks_to_blob( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 153s return _follow_symlinks_to_blob( 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s repo = pygit2.Repository('/tmp/tmpazhhpyji/.git/') 153s top_tree_object = 153s search_path = 'debian/changelog' 153s _rel_tree = 153s _rel_path = '' 153s 153s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 153s _rel_tree=None, _rel_path='' 153s ): 153s '''Recursively follow a path down a tree, following symlinks, to find blob 153s 153s repo: pygit2.Repository object 153s top_tree: pygit2.Tree object of the top of the tree structure 153s search_path: '/'-separated path string of blob to find 153s _rel_tree: (internal) which tree to look further into 153s _rel_path: (internal) the path we are in so far 153s ''' 153s 153s NORMAL_BLOB_MODES = set([ 153s pygit2.GIT_FILEMODE_BLOB, 153s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 153s ]) 153s 153s _rel_tree = _rel_tree or top_tree_object 153s head, tail = posixpath.split(search_path) 153s 153s # A traditional functional split would put a single entry in head with tail 153s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 153s # to make it appear to have traditional semantics. 153s if not head: 153s head = tail 153s tail = None 153s 153s entry = _rel_tree[head] 153s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:68: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (native)' 153s dpkg-source: info: building source-builder-package in source-builder-package_1.0.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1.0.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s ___________________ test_source_version_non_native_specific ____________________ 153s 153s repo = 153s 153s def test_source_version_non_native_specific(repo): 153s """We should be able to create a non-native package with a 153s non-native-looking version string. 153s """ 153s > version = get_spec_changelog_version(repo, native=False, version='1.0-1') 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/source_builder_test.py:218: 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/source_builder_test.py:47: in get_spec_changelog_version 153s changelog = repo.get_changelog_from_treeish(tree_hash) 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:1873: in get_changelog_from_treeish 153s return Changelog.from_treeish( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:569: in from_treeish 153s blob = follow_symlinks_to_blob( 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:101: in follow_symlinks_to_blob 153s return _follow_symlinks_to_blob( 153s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 153s 153s repo = pygit2.Repository('/tmp/tmp_0de46sk/.git/') 153s top_tree_object = 153s search_path = 'debian/changelog' 153s _rel_tree = 153s _rel_path = '' 153s 153s def _follow_symlinks_to_blob(repo, top_tree_object, search_path, 153s _rel_tree=None, _rel_path='' 153s ): 153s '''Recursively follow a path down a tree, following symlinks, to find blob 153s 153s repo: pygit2.Repository object 153s top_tree: pygit2.Tree object of the top of the tree structure 153s search_path: '/'-separated path string of blob to find 153s _rel_tree: (internal) which tree to look further into 153s _rel_path: (internal) the path we are in so far 153s ''' 153s 153s NORMAL_BLOB_MODES = set([ 153s pygit2.GIT_FILEMODE_BLOB, 153s pygit2.GIT_FILEMODE_BLOB_EXECUTABLE, 153s ]) 153s 153s _rel_tree = _rel_tree or top_tree_object 153s head, tail = posixpath.split(search_path) 153s 153s # A traditional functional split would put a single entry in head with tail 153s # empty, but posixpath.split doesn't necessarily do this. Jiggle it round 153s # to make it appear to have traditional semantics. 153s if not head: 153s head = tail 153s tail = None 153s 153s entry = _rel_tree[head] 153s > if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: 153s E AttributeError: module 'pygit2' has no attribute 'GIT_OBJ_TREE'. Did you mean: 'GIT_OBJECT_TREE'? 153s 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/git_repository.py:68: AttributeError 153s ----------------------------- Captured stdout call ----------------------------- 153s dpkg-source: info: using source format '3.0 (quilt)' 153s dpkg-source: info: building source-builder-package using existing ./source-builder-package_1.0.orig.tar.gz 153s dpkg-source: info: building source-builder-package in source-builder-package_1.0-1.debian.tar.xz 153s dpkg-source: info: building source-builder-package in source-builder-package_1.0-1.dsc 153s ----------------------------- Captured stderr call ----------------------------- 153s dpkg-source: warning: missing information for output field Standards-Version 153s =============================== warnings summary =============================== 153s gitubuntu/__main__.py:7 153s /tmp/autopkgtest.lcxmNn/build.LCU/src/gitubuntu/__main__.py:7: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html 153s import pkg_resources 153s 153s ../../../../usr/lib/python3/dist-packages/pkg_resources/__init__.py:3154 153s /usr/lib/python3/dist-packages/pkg_resources/__init__.py:3154: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('logilab')`. 153s 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 153s declare_namespace(pkg) 153s 153s -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html 153s 153s ---------- coverage: platform linux, python 3.12.7-final-0 ----------- 153s Name Stmts Miss Cover 153s --------------------------------------------------------------- 153s gitubuntu/__init__.py 0 0 100% 153s gitubuntu/__main__.py 103 94 9% 153s gitubuntu/build.py 185 131 29% 153s gitubuntu/cache.py 1 0 100% 153s gitubuntu/clone.py 70 54 23% 153s gitubuntu/dsc.py 65 16 75% 153s gitubuntu/exportorig.py 48 37 23% 153s gitubuntu/git_repository.py 1103 521 53% 153s gitubuntu/git_repository_test.py 316 40 87% 153s gitubuntu/importer.py 707 446 37% 153s gitubuntu/importer_service.py 215 22 90% 153s gitubuntu/importer_service_broker.py 60 49 18% 153s gitubuntu/importer_service_ipc.py 12 2 83% 153s gitubuntu/importer_service_poller.py 37 25 32% 153s gitubuntu/importer_service_test.py 147 0 100% 153s gitubuntu/importer_service_worker.py 87 64 26% 153s gitubuntu/importer_service_worker_test.py 18 0 100% 153s gitubuntu/importer_tag_test.py 47 20 57% 153s gitubuntu/importer_test.py 388 133 66% 153s gitubuntu/integration_test.py 67 26 61% 153s gitubuntu/logging.py 8 4 50% 153s gitubuntu/merge.py 219 192 12% 153s gitubuntu/patch_state.py 2 0 100% 153s gitubuntu/prepare_upload.py 86 3 97% 153s gitubuntu/prepare_upload_test.py 152 0 100% 153s gitubuntu/queue.py 174 148 15% 153s gitubuntu/remote.py 100 85 15% 153s gitubuntu/repo_builder.py 162 0 100% 153s gitubuntu/repo_builder_test.py 159 12 92% 153s gitubuntu/repo_comparator.py 32 25 22% 153s gitubuntu/rich_history.py 67 45 33% 153s gitubuntu/rich_history_test.py 53 31 42% 153s gitubuntu/run.py 72 12 83% 153s gitubuntu/scriptutils.py 11 0 100% 153s gitubuntu/source_builder.py 119 0 100% 153s gitubuntu/source_builder_test.py 105 18 83% 153s gitubuntu/source_information.py 339 133 61% 153s gitubuntu/source_information_test.py 78 3 96% 153s gitubuntu/spec.py 3 0 100% 153s gitubuntu/submit.py 103 86 17% 153s gitubuntu/tag.py 78 69 12% 153s gitubuntu/test_fixtures.py 29 5 83% 153s gitubuntu/test_util.py 5 0 100% 153s gitubuntu/version.py 1 0 100% 153s gitubuntu/versioning.py 124 16 87% 153s --------------------------------------------------------------- 153s TOTAL 5957 2567 57% 153s 153s =========================== short test summary info ============================ 153s FAILED gitubuntu/git_repository_test.py::test_follow_symlinks_to_blob[0] 153s FAILED gitubuntu/git_repository_test.py::test_follow_symlinks_to_blob[1] 153s FAILED gitubuntu/git_repository_test.py::test_follow_symlinks_to_blob[2] 153s FAILED gitubuntu/git_repository_test.py::test_follow_symlinks_to_blob[3] 153s FAILED gitubuntu/git_repository_test.py::test_follow_symlinks_to_blob[4] 153s FAILED gitubuntu/git_repository_test.py::test_follow_symlinks_to_blob_not_found[tree1] 153s FAILED gitubuntu/git_repository_test.py::test_follow_symlinks_to_blob_not_found[tree2] 153s FAILED gitubuntu/git_repository_test.py::test_follow_symlinks_to_blob_not_found[tree3] 153s FAILED gitubuntu/git_repository_test.py::test_git_escape_dir_to_tree - Attrib... 153s FAILED gitubuntu/git_repository_test.py::test_determine_quilt_series_path[tree_data1-debian/patches/series] 153s FAILED gitubuntu/git_repository_test.py::test_determine_quilt_series_path[tree_data2-debian/patches/series] 153s FAILED gitubuntu/git_repository_test.py::test_determine_quilt_series_path[tree_data3-debian/patches/debian.series] 153s FAILED gitubuntu/git_repository_test.py::test_determine_quilt_series_path[tree_data4-debian/patches/debian.series] 153s FAILED gitubuntu/git_repository_test.py::test_quilt_env - AttributeError: mod... 153s FAILED gitubuntu/git_repository_test.py::test_repo_quilt_env - AttributeError... 153s FAILED gitubuntu/git_repository_test.py::test_repo_quilt_env_from_treeish_str 153s 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] 153s 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] 153s 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] 153s FAILED gitubuntu/git_repository_test.py::test_commit_tree - AttributeError: m... 153s FAILED gitubuntu/git_repository_test.py::test_descendant_of[root-root-False] 153s FAILED gitubuntu/git_repository_test.py::test_descendant_of[child1-root-True] 153s FAILED gitubuntu/git_repository_test.py::test_descendant_of[root-child1-False] 153s FAILED gitubuntu/git_repository_test.py::test_descendant_of[grandchild1-root-True] 153s FAILED gitubuntu/git_repository_test.py::test_descendant_of[child1-child2-False] 153s FAILED gitubuntu/git_repository_test.py::test_descendant_of[root-disjoint-False] 153s FAILED gitubuntu/git_repository_test.py::test_create_tag - AttributeError: mo... 153s FAILED gitubuntu/git_repository_test.py::test_get_all_reimport_tags - Attribu... 153s FAILED gitubuntu/git_repository_test.py::test_get_head_info - AttributeError:... 153s 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] 153s 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] 153s 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] 153s 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] 153s 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] 153s 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] 153s 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] 153s 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] 153s FAILED gitubuntu/importer_tag_test.py::test_import_applied_spi_tags[input_repo0-validation_repo_delta0-validation_repo_expected_treewise_refs0-True] 153s FAILED gitubuntu/importer_tag_test.py::test_import_applied_spi_tags[input_repo2-validation_repo_delta2-validation_repo_expected_treewise_refs2-False] 153s FAILED gitubuntu/importer_test.py::test_get_existing_import_tags[input_repo1-PatchState.UNAPPLIED-expected1] 153s FAILED gitubuntu/importer_test.py::test_get_existing_import_tags[input_repo2-PatchState.UNAPPLIED-expected2] 153s FAILED gitubuntu/importer_test.py::test_get_existing_import_tags[input_repo4-PatchState.APPLIED-expected4] 153s FAILED gitubuntu/importer_test.py::test_get_existing_import_tags[input_repo5-PatchState.APPLIED-expected5] 153s FAILED gitubuntu/importer_test.py::test_get_existing_import_tags_ordering - A... 153s FAILED gitubuntu/importer_test.py::test_create_import_tag[input_repo0-validation_repo_delta0-validation_repo_expected_identical_refs0] 153s FAILED gitubuntu/importer_test.py::test_create_import_tag[input_repo1-validation_repo_delta1-validation_repo_expected_identical_refs1] 153s FAILED gitubuntu/importer_test.py::test_create_import_tag[input_repo2-validation_repo_delta2-validation_repo_expected_identical_refs2] 153s FAILED gitubuntu/importer_test.py::test_create_import_tag_hash_stability_on_first_import 153s FAILED gitubuntu/importer_test.py::test_create_import_tag_hash_stability_on_reimport 153s FAILED gitubuntu/importer_test.py::test_create_applied_tag[input_repo0-validation_repo_delta0-validation_repo_expected_identical_refs0] 153s FAILED gitubuntu/importer_test.py::test_create_applied_tag[input_repo1-validation_repo_delta1-validation_repo_expected_identical_refs1] 153s FAILED gitubuntu/importer_test.py::test_create_applied_tag[input_repo2-validation_repo_delta2-validation_repo_expected_identical_refs2] 153s FAILED gitubuntu/importer_test.py::test_get_changelog_parent_commits[input_repo1-parent_overrides1-changelog_versions1-PatchState.UNAPPLIED-expected_refs1] 153s FAILED gitubuntu/importer_test.py::test_get_changelog_parent_commits[input_repo2-parent_overrides2-changelog_versions2-PatchState.UNAPPLIED-expected_refs2] 153s FAILED gitubuntu/importer_test.py::test_get_changelog_parent_commits[input_repo3-parent_overrides3-changelog_versions3-PatchState.UNAPPLIED-expected_refs3] 153s FAILED gitubuntu/importer_test.py::test_get_changelog_parent_commits[input_repo5-parent_overrides5-changelog_versions5-PatchState.APPLIED-expected_refs5] 153s FAILED gitubuntu/importer_test.py::test_get_changelog_parent_commits[input_repo6-parent_overrides6-changelog_versions6-PatchState.APPLIED-expected_refs6] 153s FAILED gitubuntu/importer_test.py::test_get_changelog_parent_commits[input_repo7-parent_overrides7-changelog_versions7-PatchState.APPLIED-expected_refs7] 153s FAILED gitubuntu/importer_test.py::test_validate_rich_history[input_repo0-published_spec0-True] 153s FAILED gitubuntu/importer_test.py::test_validate_rich_history[input_repo1-published_spec1-True] 153s FAILED gitubuntu/importer_test.py::test_validate_rich_history[input_repo2-published_spec2-RichHistoryTreeMismatch] 153s FAILED gitubuntu/importer_test.py::test_validate_rich_history[input_repo3-published_spec3-RichHistoryHasNoChangelogParentAncestor] 153s FAILED gitubuntu/importer_test.py::test_add_changelog_note_to_commit - Attrib... 153s FAILED gitubuntu/importer_test.py::test_add_changelog_note_to_commit_utf8 - A... 153s FAILED gitubuntu/importer_test.py::test_double_changelog_note_add_does_not_fail 153s FAILED gitubuntu/importer_test.py::test_create_import_note - AttributeError: ... 153s FAILED gitubuntu/importer_test.py::test_create_import_note_timestamp - Attrib... 153s FAILED gitubuntu/importer_test.py::test_import_creates_import_note - Attribut... 153s FAILED gitubuntu/importer_test.py::test_import_unapplied_spi_quilt_patches - ... 153s FAILED gitubuntu/importer_test.py::test_import_unapplied_spi_parenting[input_repo0-changelog_versions0-validation_repo_delta0-validation_repo_expected_identical_refs0] 153s FAILED gitubuntu/importer_test.py::test_import_unapplied_spi_parenting[input_repo1-changelog_versions1-validation_repo_delta1-validation_repo_expected_identical_refs1] 153s FAILED gitubuntu/importer_test.py::test_import_unapplied_spi_parenting[input_repo2-changelog_versions2-validation_repo_delta2-validation_repo_expected_identical_refs2] 153s FAILED gitubuntu/importer_test.py::test_import_unapplied_spi_parenting[input_repo3-changelog_versions3-validation_repo_delta3-validation_repo_expected_identical_refs3] 153s FAILED gitubuntu/importer_test.py::test_import_unapplied_spi_parent_override 153s FAILED gitubuntu/importer_test.py::test_import_unapplied_spi_parent_override_failure 153s FAILED gitubuntu/importer_test.py::test_import_applied_spi_parenting[input_repo0-expected_ancestor_commits0-expected_parent_commits0] 153s FAILED gitubuntu/importer_test.py::test_authorship_date[False-Fri, 2 Feb 1971 12:34:56 +0100-expected_result0] 153s FAILED gitubuntu/importer_test.py::test_authorship_date[True-Failday, 30 Feb 1971 99:99:99 +9999-expected_result1] 153s FAILED gitubuntu/importer_test.py::test_fetch_rich_history_from_changes_file 153s FAILED gitubuntu/importer_test.py::test_fetch_rich_history_from_changes_file_fetch_failure_retry 153s FAILED gitubuntu/importer_test.py::test_fetch_rich_history_from_changes_file_missing_ref 153s FAILED gitubuntu/importer_test.py::test_fetch_rich_history_from_changes_file_missing_commit 153s FAILED gitubuntu/importer_test.py::test_fetch_rich_history_from_changes_file_not_a_commit 153s FAILED gitubuntu/integration_test.py::test_reconstruct_changelog - AttributeE... 153s FAILED gitubuntu/repo_builder_test.py::TestObjectCreation::testRepoBranchesTags 153s FAILED gitubuntu/repo_builder_test.py::TestObjectCreation::testRepoTagger - A... 153s FAILED gitubuntu/repo_builder_test.py::test_source_tree - AttributeError: mod... 153s FAILED gitubuntu/rich_history_test.py::test_preservation - AttributeError: mo... 153s FAILED gitubuntu/rich_history_test.py::test_preservation_multiple_parents - A... 153s FAILED gitubuntu/rich_history_test.py::test_preservation_no_parents - Attribu... 153s FAILED gitubuntu/rich_history_test.py::test_input_edge_cases[before_export0-before_import0] 153s FAILED gitubuntu/rich_history_test.py::test_input_edge_cases[before_export1-before_import1] 153s FAILED gitubuntu/rich_history_test.py::test_input_edge_cases[before_export2-before_import2] 153s FAILED gitubuntu/rich_history_test.py::test_preservation_fast_forwards - Attr... 153s FAILED gitubuntu/source_builder_test.py::test_source_create_with_version - At... 153s FAILED gitubuntu/source_builder_test.py::test_source_create_with_versions - A... 153s FAILED gitubuntu/source_builder_test.py::test_source_native_source_format[True-3.0 (native)\n] 153s FAILED gitubuntu/source_builder_test.py::test_source_native_source_format[False-3.0 (quilt)\n] 153s FAILED gitubuntu/source_builder_test.py::test_source_quilt_no_patches - Attri... 153s FAILED gitubuntu/source_builder_test.py::test_source_quilt_with_patches - Att... 153s FAILED gitubuntu/source_builder_test.py::test_source_quilt_with_patches_applied 153s FAILED gitubuntu/source_builder_test.py::test_source_version_native_default 153s FAILED gitubuntu/source_builder_test.py::test_source_version_non_native_default 153s FAILED gitubuntu/source_builder_test.py::test_source_version_native_specific 153s FAILED gitubuntu/source_builder_test.py::test_source_version_non_native_specific 153s = 105 failed, 348 passed, 3 skipped, 3 xfailed, 2 warnings in 62.19s (0:01:02) = 153s pytest failed; self test will fail 153s autopkgtest [09:56:06]: test self-test: -----------------------] 154s self-test FAIL non-zero exit status 1 154s autopkgtest [09:56:07]: test self-test: - - - - - - - - - - results - - - - - - - - - - 155s autopkgtest [09:56:08]: @@@@@@@@@@@@@@@@@@@@ summary 155s self-test FAIL non-zero exit status 1 159s nova [W] Skipping flock for amd64 159s Creating nova instance adt-plucky-i386-git-ubuntu-20241203-093455-juju-7f2275-prod-proposed-migration-environment-15-76e888a3-3f53-4add-bffc-9a13f8a06bd1 from image adt/ubuntu-plucky-amd64-server-20241203.img (UUID 9e8e99d5-3366-42e6-8f42-63b527e5abcc)...