OpenPrinting / ipp-usb

ipp-usb -- HTTP reverse proxy, backed by IPP-over-USB connection to device
BSD 2-Clause "Simplified" License
135 stars 14 forks source link

0.9.11 TestIniReader fails in go test for out-of-tree build #12

Closed OdyX closed 4 years ago

OdyX commented 4 years ago

Debian builds ipp-usb "out-of-tree", and the inifile_test.go now fails:

   dh_auto_test -O--builddirectory=_build -O--buildsystem=golang
        cd _build && go test -vet=off -v -p 8 github.com/OpenPrinting/ipp-usb
=== RUN   TestIniReader
    inifile_test.go:36: open ipp-usb.conf: no such file or directory
alexpevzner commented 4 years ago

This is because it does cd _build before running tests. The inifile_test.go needs ipp-usb.conf to perform testing. Is it possible to copy this file into the _build directory before running tests?

OdyX commented 4 years ago

I did this: https://salsa.debian.org/printing-team/ipp-usb/-/blob/debian/master/debian/rules#L11 it still doesn't work: https://salsa.debian.org/printing-team/ipp-usb/-/jobs/952389

alexpevzner commented 4 years ago

Very hard to guess what dh_auto_test actually does under the hood.

I've added make test target and tagged result with the 0.9.12 label

Could you please add override_dh_auto_test that runs dh_auto_test without options, or simple calls make test?

OdyX commented 4 years ago

That doesn't work, because it then builds the test files outside of the dh_golang-prepared Go workpsace.

From my limited golang-related research, it seems that putting an ipp-usb.conf in a testdata directory will fix this, I've added this as PR #13.