Project

General

Profile

Feature #10065

Make test suite work once copied out of the build tree

Added by intrigeri about 4 years ago. Updated almost 4 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Test suite
Target version:
-
Start date:
11/15/2015
Due date:
% Done:

100%

QA Check:
Dev Needed
Feature Branch:
Starter:

Description

Debian now has autopkgtest (http://dep.debian.net/deps/dep8/), that are very useful to detect e.g. when a dependency update breaks a package, or when runtime dependencies are missing. Ideally one would write real integration tests meant to be run against the installed package, but a first step when adding autopkgtests for a given package is often to simply run the existing upstream test suite against the installed package.

I've tried copying the test directory out of the source tree and to run test.py, but in the current state of things it doesn't work: the test suite hardcodes things like ../mat and ../mat.desktop. Would it be possible to fall back to the location where these files are installed, whenever the test suite detects it is not running from inside the source tree?


Subtasks

Bug #10551: README has outdated instructions for running the test suiteResolvedjvoisin

History

#1 Updated by jvoisin about 4 years ago

Just to be sure, you want the testsuite to run against the current, system-wide, installed version of MAT?

#2 Updated by intrigeri about 4 years ago

Just to be sure, you want the testsuite to run against the current, system-wide, installed version of MAT?

Exactly. DEP-8's abstract reads: "Establish a standard interface to define and run "as-installed" tests of packages, i.e. the testing of packages in a context as close as possible to a Debian system where the packages subject to testing are properly installed."

#3 Updated by jvoisin about 4 years ago

I just pushed some changes to allows that.
Please test :)

#4 Updated by intrigeri almost 4 years ago

  • QA Check set to Dev Needed

I just pushed some changes to allows that.

Thanks!

Please test :)

The way it's implemented in test/libtest.py works for me, but the way it's implemented in test/clitest.py keeps failing.

This fixes it for me:

--- a/test/clitest.py
+++ b/test/clitest.py
@@ -16,7 +16,6 @@ MAT_PATH = 'mat'
if test.IS_LOCAL is True:
 # Are we testing the _local_ version of MAT?
sys.path.insert(0, '..')
-    MAT_PATH = '../mat'
 # else it will be in the path

from libmat import mat

FYI you can test it the same as I do with cp -a test /tmp/bla && cd /tmp/bla && python test.py --system :)

Also see the subtask I've created about missing doc updates.

Cheers!

#5 Updated by intrigeri almost 4 years ago

  • Status changed from New to In Progress

#6 Updated by intrigeri almost 4 years ago

intrigeri wrote:

This fixes it for me:

Well, no: it fixes the --system use case for wrong reasons (if test.IS_LOCAL is True is always verified, even when passing --system), and it breaks the --local use case. So I guess you'll need to find a better way to pass the --local vs. --system info from test.py to clitest.py and libtest.py.

#7 Updated by jvoisin almost 4 years ago

  • Status changed from In Progress to Fix committed

#8 Updated by jvoisin almost 4 years ago

  • Status changed from Fix committed to Resolved

#9 Updated by intrigeri almost 4 years ago

I confirm it works in 0.6. Thanks!

Also available in: Atom PDF