Skip to content

Commit

Permalink
Merge pull request #2394 from kalefranz/prepare-2.1.x-for-enhanced-pa…
Browse files Browse the repository at this point in the history
…ckage-cache

prepare 2.1.x tests for enhanced package cache structure
  • Loading branch information
msarahan authored Sep 29, 2017
2 parents 0e7d124 + f69a3d8 commit 5ebf736
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 5 deletions.
11 changes: 10 additions & 1 deletion tests/test-recipes/metadata/_legacy_noarch_python/run_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@
import noarch_test_package

pkgs_dir = os.path.abspath(os.path.join(os.environ["ROOT"], 'pkgs'))
pkg_dir = os.path.join(pkgs_dir, 'noarch_test_package-1.0-py_0')
package_dir_name = 'noarch_test_package-1.0-py_0'
pkg_dir = os.path.join(pkgs_dir, package_dir_name)

if not os.path.isdir(pkg_dir):
channel_name = os.path.basename(os.path.dirname(os.path.dirname(os.environ["PREFIX"])))
print("channel_name: %s" % channel_name)
pkg_dir = os.path.join(pkgs_dir, channel_name, 'noarch', package_dir_name)
print(pkg_dir)
if not os.path.isdir(pkg_dir):
raise RuntimeError("No pkg_dir found: %s" % pkg_dir)

assert os.path.isdir(pkg_dir)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@
import noarch_python_test_package

pkgs_dir = os.path.abspath(os.path.join(os.environ["ROOT"], 'pkgs'))
pkg_dir = os.path.join(pkgs_dir, 'noarch_python_test_package-1.0-py_0')
package_dir_name = 'noarch_python_test_package-1.0-py_0'
pkg_dir = os.path.join(pkgs_dir, package_dir_name)

if not os.path.isdir(pkg_dir):
channel_name = os.path.basename(os.path.dirname(os.path.dirname(os.environ["PREFIX"])))
print("channel_name: %s" % channel_name)
pkg_dir = os.path.join(pkgs_dir, channel_name, 'noarch', package_dir_name)
print(pkg_dir)
if not os.path.isdir(pkg_dir):
raise RuntimeError("No pkg_dir found: %s" % pkg_dir)

assert os.path.isdir(pkg_dir)

Expand Down
12 changes: 11 additions & 1 deletion tests/test-recipes/metadata/ignore_prefix_files/run_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
import os

pkgs = os.path.join(os.environ["ROOT"], "pkgs")
info_dir = os.path.join(pkgs, "conda-build-test-ignore-prefix-files-1.0-0", "info")
package_dir_name = "conda-build-test-ignore-prefix-files-1.0-0"
info_dir = os.path.join(pkgs, package_dir_name, "info")

if not os.path.isdir(info_dir):
channel_name = os.path.basename(os.path.dirname(os.path.dirname(os.environ["PREFIX"])))
print("channel_name: %s" % channel_name)
info_dir = os.path.join(pkgs, channel_name, os.environ["SUBDIR"], package_dir_name, "info")
print(info_dir)
if not os.path.isdir(info_dir):
raise RuntimeError("No info_dir found: %s" % info_dir)

assert os.path.isdir(info_dir)
assert not os.path.isfile(os.path.join(info_dir, "has_prefix"))
14 changes: 12 additions & 2 deletions tests/test-recipes/metadata/ignore_some_prefix_files/run_test.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
import os

pkgs = os.path.join(os.environ["ROOT"], "pkgs")
info_dir = os.path.join(pkgs, "conda-build-test-ignore-some-prefix-files-1.0-0", "info")
has_prefix_file = os.path.join(info_dir, "has_prefix")
package_dir_name = "conda-build-test-ignore-some-prefix-files-1.0-0"
info_dir = os.path.join(pkgs, package_dir_name, "info")
print(info_dir)

if not os.path.isdir(info_dir):
channel_name = os.path.basename(os.path.dirname(os.path.dirname(os.environ["PREFIX"])))
print("channel_name: %s" % channel_name)
info_dir = os.path.join(pkgs, channel_name, os.environ["SUBDIR"], package_dir_name, "info")
print(info_dir)
if not os.path.isdir(info_dir):
raise RuntimeError("No info_dir found: %s" % info_dir)

has_prefix_file = os.path.join(info_dir, "has_prefix")
assert os.path.isfile(has_prefix_file)
with open(has_prefix_file) as f:
assert "test2" not in f.read()

0 comments on commit 5ebf736

Please sign in to comment.