Repository: conda/conda-build

Issue:
test-environment is removed regardless of the "--dirty" options.
After updating to conda-build 3.0.3 the `conda-build --dirty ...` reports that test environment has been left around, but in reality it is removed:
```sh
$ conda-build --dirty diffpy.utils/conda-recipe
...
Leaving build/test environments:
  Test:	source activate  ../../../../arch/anaconda/conda-bld/diffpy.utils_1499469046695/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh 
  Build:	source activate  ../../../../arch/anaconda/conda-bld/diffpy.utils_1499469046695/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold 
...
```

The build environment is there, but not the test one.  I tried to add the `--keep-old-work` option, but it had no effect.  The removal of the test-environment has started as of f148fdc1a9fb9c72782d7edbd5c6f242450f10b5.

Can you please fix this?

BTW, the reason I need to keep the test environment is to use it in travis script to export and capture a full version of the built package.  With a full version (i.e., including the built tag) I can reliably install that package in other environment for further testing - even if there is a newer version on my conda channel.
https://github.com/diffpy/diffpy.utils/blob/master/.travis.yml#L72-L77

Is there some other way how to obtain a full version specs for the currently built package?


Discussion:
Yep, that's a bug. Thanks for reporting. We'll fix it. For your use case,
it may be less convoluted to instead capture the output of

conda render --output recipe

Which should output the filenames of all packages produced by that recipe.
This d should respect any conda_build_config.yaml files that you have set
up or that you specify.

On Jul 7, 2017 5:32 PM, "Pavol Juhas" <notifications@github.com> wrote:

> After updating to conda-build 3.0.3 the conda-build --dirty ... reports
> that test environment has been left around, but in reality it is removed:
>
> $ conda-build --dirty diffpy.utils/conda-recipe
> ...
> Leaving build/test environments:
>   Test:	source activate  ../../../../arch/anaconda/conda-bld/diffpy.utils_1499469046695/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh
>   Build:	source activate  ../../../../arch/anaconda/conda-bld/diffpy.utils_1499469046695/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold
> ...
>
> The build environment is there, but not the test one. I tried to add the
> --keep-old-work option, but it had no effect. The removal of the
> test-environment has started as of f148fdc
> <https://github.com/conda/conda-build/commit/f148fdc1a9fb9c72782d7edbd5c6f242450f10b5>
> .
>
> Can you please fix this?
>
> BTW, the reason I need to keep the test environment is to use it in travis
> script to export and capture a full version of the built package. With a
> full version (i.e., including the built tag) I can reliably install that
> package in other environment for further testing - even if there is a newer
> version on my conda channel.
> https://github.com/diffpy/diffpy.utils/blob/master/.travis.yml#L72-L77
>
> Is there some other way how to obtain a full version specs for the
> currently built package?
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/conda/conda-build/issues/2166>, or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AACV-TD-5Or5Ay1haC9tTkyknn5t38aFks5sLsAfgaJpZM4ORiwl>
> .
>


Resolving patch:
diff --git a/conda_build/build.py b/conda_build/build.py
--- a/conda_build/build.py
+++ b/conda_build/build.py
@@ -1490,7 +1490,6 @@ def test(recipedir_or_package_or_metadata, config, move_broken=True):
             raise
         if need_cleanup:
             utils.rm_rf(recipe_dir)
-        utils.rm_rf(metadata.config.test_prefix)
         print("TEST END:", test_package_name)
 
     return True


Test patch: