Skip to content

Commit

Permalink
fix lack of call in bat script exiting early
Browse files Browse the repository at this point in the history
  • Loading branch information
msarahan committed Jul 6, 2016
1 parent d316d97 commit 152888a
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
3 changes: 2 additions & 1 deletion conda_build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,8 @@ def test(m, move_broken=True, activate=True):

with open(test_script, 'w') as tf:
if activate:
tf.write("{source}activate _test\n".format(source="" if on_win else "source "))
tf.write("{source}activate _test\n".format(source="call " if on_win
else "source "))
if py_files:
tf.write("{python} -s {test_file}\n".format(
python=config.test_python,
Expand Down
7 changes: 7 additions & 0 deletions tests/test-recipes/metadata/_test_early_abort/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package:
name: foobar
version: 1.0

test:
commands:
- python --version
1 change: 1 addition & 0 deletions tests/test-recipes/metadata/_test_early_abort/run_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print("Hello World")
13 changes: 13 additions & 0 deletions tests/test_build_recipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,3 +444,16 @@ def test_no_include_recipe_meta_yaml():
'{}/_no_include_recipe').format(metadata_dir)
subprocess.check_call(cmd.split(), cwd=metadata_dir)
assert not package_has_file(output_file, "info/recipe/meta.yaml")


def test_early_abort():
"""There have been some problems with conda-build dropping out early.
Make sure we aren't causing them"""
cmd = 'conda build {}'.format(os.path.join(metadata_dir,
"_test_early_abort"))
process = subprocess.Popen(cmd.split(),
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output, error = process.communicate()
output = output.decode('utf-8')
error = error.decode('utf-8')
assert "Hello World" in output, error

0 comments on commit 152888a

Please sign in to comment.