On Tue, Jul 19, 2016 at 11:47:31PM +0200, Francesco Poli wrote: > Control: tags -1 + moreinfo > > > On Tue, 19 Jul 2016 09:31:27 -0300 Antonio Terceiro wrote: > > > Sorry, just noted that the control file is actually incomplete. The > > contents you want is the following: > > > > ----------------8<----------------8<----------------8<----------------- > > Test-Command: gem2deb-test-runner --autopkgtest 2>&1 > > Depends: @, gem2deb-test-runner > > ----------------8<----------------8<----------------8<----------------- > > > Hello Antonio! > Thanks a lot for the patch. :-) > > Please let me understand: if I create a debian/tests/control file with > the above quoted couple of lines, what will I get? > My guess is that autopkgtest (and consequentially ci.debian.net) will > run the test suite found in debian/ruby-test-files.yaml ... Is that > correct?
yes > Please note that this test suite assumes to be in the source tree, > rather than in a system with the binary package installed (it runs > test/test_logic.rb, which is not shipped by the binary package). > Will autopkgtest take care of this? the test suite (test/*) can be in the test tree (as is debian/tests/control itself, anyway), it only should not test the code (lib/) that is in the source tree and test the code that is actually installed. for Ruby packages, gem2deb-test-runner manages that for you: when it gets --autopkgtest in the command line, it will move lib/ away in the source tree before running the tests, so that e.g. `require 'aptlistbugs/logic'` will load the code that is installed. see for example the attached log; I also tested on a clean system (with `autopkgtest -B -- lxc --sudo adt-aid-amd64`) and it also works just fine. -- Antonio Terceiro <terce...@debian.org>
$ pwd /tmp/apt-listbugs-0.1.18 $ cat debian/tests/control Test-Command: gem2deb-test-runner --autopkgtest 2>&1 Depends: @, gem2deb-test-runner $ autopkgtest -B -- null autopkgtest [19:07:53]: version 4.0.2 autopkgtest [19:07:53]: host homer; command line: /usr/bin/autopkgtest -B -- null autopkgtest [19:07:53]: testbed dpkg architecture: amd64 autopkgtest [19:07:53]: testbed running kernel: Linux 4.6.0-1-amd64 #1 SMP Debian 4.6.3-1 (2016-07-04) autopkgtest [19:07:53]: @@@@@@@@@@@@@@@@@@@@ unbuilt-tree . autopkgtest [19:07:53]: testing package apt-listbugs version 0.1.18 autopkgtest [19:07:53]: build not needed autopkgtest [19:07:53]: test command1: preparing testbed Starting pkgProblemResolver with broken count: 0 Starting 2 pkgProblemResolver with broken count: 0 Done autopkgtest [19:07:54]: test command1: gem2deb-test-runner --autopkgtest 2>&1 autopkgtest [19:07:54]: test command1: [----------------------- ┌──────────────────────────────────────────────────────────────────────────────┐ │ Run tests for ruby2.3 from debian/ruby-test-files.yaml │ └──────────────────────────────────────────────────────────────────────────────┘ mv lib .gem2deb.lib RUBYLIB=. GEM_PATH= ruby2.3 -ryaml -e YAML.load_file\(\"debian/ruby-test-files.yaml\"\).each\ \{\ \|f\|\ require\ f\ \} Loaded suite -e Started ...... Finished in 0.01101339 seconds. ------ 6 tests, 63 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 100% passed ------ 544.79 tests/s, 5720.31 assertions/s mv .gem2deb.lib lib autopkgtest [19:07:55]: test command1: -----------------------] autopkgtest [19:07:55]: test command1: - - - - - - - - - - results - - - - - - - - - - command1 PASS autopkgtest [19:07:55]: @@@@@@@@@@@@@@@@@@@@ summary command1 PASS
signature.asc
Description: PGP signature