Environment variables when running test suites

0 views
Skip to first unread message

Floris Bruynooghe

unread,
May 19, 2015, 6:37:14 AM5/19/15
to conda
Hi,

I often struggle finding the correct way to run test suites in the
test section of a build recipe. For the standard python package it
seems there are two broad categories:

1) The package installs only python modules and no tests. In this
case I generally want to be able to run the tests in the source
against the installed package in the test environment. This seems
possible using something like "test-tool $SRC_DIR/path/to/tests". So
far so good.

2) The package installs the test together with the python modules. In
this case I'd generally like to run "test-tool $SP_DIR/pkgname/", only
all the variables, like $SP_DIR point to the (now even deleted) build
environment and not the actual test environment. I know it just
inherited this because of the bulid process, but it seems like the
test process should also get a set of environment variables to use.

Would it make sense to add some environment variables to the test
process, or did I miss an obvious feature somewhere?

Thanks,
Floris

Chris Barker

unread,
May 19, 2015, 12:47:39 PM5/19/15
to Floris Bruynooghe, conda
I haven't tried this, but:

2) The package installs the test together with the python modules.  In
this case I'd generally like to run "test-tool $SP_DIR/pkgname/", only
all the variables, like $SP_DIR point to the (now even deleted) build
environment and not the actual test environment.  I know it just
inherited this because of the bulid process, but it seems like the
test process should also get a set of environment variables to use.

if the package installs the tests, then you should be abel to run them with teh python installed in the test environment, yes? something like:

$PYTHON -c "import my_module; my_module.run_tests()"

I don't think there is a standard way to call a package's tests, but if the test are put in the package there usually is a test runner in there somewhere -- that's kind of the point of putting your tests inside the package.

-Chris






 
Would it make sense to add some environment variables to the test
process, or did I miss an obvious feature somewhere?

Thanks,
Floris

--
You received this message because you are subscribed to the Google Groups "conda - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to conda+un...@continuum.io.
To post to this group, send email to co...@continuum.io.
Visit this group at http://groups.google.com/a/continuum.io/group/conda/.



--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris....@noaa.gov
Reply all
Reply to author
Forward
0 new messages