Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix issues testing packages/recipes separately from build stage #3192

Merged
merged 1 commit into from
Oct 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions conda_build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -1706,13 +1706,17 @@ def _construct_metadata_for_test_from_recipe(recipe_dir, config):
config.need_cleanup = False
config.recipe_dir = None
hash_input = {}
metadata = render_recipe(recipe_dir, config=config, reset_build_id=False)[0][0]
metadata = expand_outputs(render_recipe(recipe_dir, config=config, reset_build_id=False))[0][1]
log = utils.get_logger(__name__)
log.warn("Testing based on recipes is deprecated as of conda-build 3.16.0. Please adjust "
"your code to pass your desired conda package to test instead.")

utils.rm_rf(metadata.config.test_dir)

if metadata.meta.get('test', {}).get('source_files'):
if not metadata.source_provided:
try_download(metadata, no_download_source=False)

if not metadata.final:
metadata = finalize_metadata(metadata)
return metadata, hash_input
Expand Down Expand Up @@ -2082,7 +2086,7 @@ def test(recipedir_or_package_or_metadata, config, stats, move_broken=True):
test_stats = {}
utils.check_call_env(cmd, env=env, cwd=metadata.config.test_dir, stats=test_stats)
log_stats(test_stats, "testing {}".format(metadata.name()))
if stats is not None:
if stats is not None and metadata.config.variants:
stats[stats_key(metadata, 'test_{}'.format(metadata.name()))] = test_stats
except subprocess.CalledProcessError:
tests_failed(metadata, move_broken=move_broken, broken_dir=metadata.config.broken_dir,
Expand Down
4 changes: 2 additions & 2 deletions conda_build/variants.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,8 +529,8 @@ def get_vars(variants, loop_only=False):
to the matrix dimensionality"""
special_keys = ('pin_run_as_build', 'zip_keys', 'ignore_version')
loop_vars = [k for k in variants[0] if k not in special_keys and
(not loop_only or
any(variant[k] != variants[0][k] for variant in variants[1:]))]
(not loop_only or
any(variant[k] != variants[0][k] for variant in variants[1:]))]
return loop_vars


Expand Down