Hi Jonathan,
   thank you for your interest.
I've written the automatic tests using the assumption that they will be
launched from the project root.
They search for ./script/bump.py and for these commands: ./trash
./trash-empty ./trash-list ./trash-put ./trash-restore ./trash-rm
Can we launch test before the build like I do in the upstream source code?

Regards

Il giorno ven 15 ott 2021 alle ore 17:24 Jonathan Dowland <j...@debian.org>
ha scritto:

> On Wed, Oct 13, 2021 at 10:16:24AM +0100, Jonathan Dowland wrote:
> >Eyeballing the failures again quickly now, I think the majority of the
> >failures will be due to not finding the actual test utilities in an
> >expected place in the chroot, variations on:
> >
> >    python3: can't open file
> >    '/<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/trash-put': [Errno 2]
> >    No such file or directory
>
> Expanding on this a bit, the build phase runs
>
>      /usr/bin/python3 setup.py build
>
> Which outputs the following (elided)
>
> > running build_py
> > creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/trashcli
> > copying trashcli/fstab.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/trashcli
> ...
> > running build_scripts
> > creating build
> > creating build/scripts-3.9
> > copying and adjusting trash -> build/scripts-3.9
> ...
>
> Note: the initial 'copying' lines are to a path
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/trashcli, but the latter
> ones are to just "build/scripts-3.9". And indeed, if I run
>
>      sbuild --build-failed-commands '%SBUILD_SHELL'
>
> I'm dropped into a shell in the build environment after the test
> failure. Right now that's /build/trash-cli-Nkmibk, which has the
> unpacked source at trash-cli-0.21.7.24, which corresponds to the
> <<PKGBUILDDIR>> substitution in the output above.
>
> I see the path
> /build/trash-cli-Nkmibk/trash-cli-0.21.7.24/.pybuild/cpython3_3.9/build,
> corresponding to the first set of "copying" lines above, and containing
> "tests" and "trashcli". And I see
> /build/trash-cli-Nkmibk/trash-cli-0.21.7.24/build/scripts-3.9,
> containing the command-line tools, corresponding to the second set of
> 'copying' lines above.
>
> When the tests are executed, the following is run
>
>      cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build; python3.9 -m pytest
> tests
>
> And so at the time the tests run the command line tools are not in $PWD
> and tests/run_command.py::run_command constructs a path that is not
> valid.
>
> So... the question is, why does the "build_py" phase of
> distutils/setuptools have the correct path, where is that being
> specified? Why doesn't the "build_scripts" phase also have the correct
> path, and where can we specify that?
>
> --
> 👱🏻    Jonathan Dowland
> ✎        j...@debian.org
> 🔗      https://jmtd.net
>


-- 
Andrea Francia http://andreafrancia.it

Reply via email to