Skip to content
Browse files

Include cookietest.cgi in source distribution

Add a test run to release script to catch mistakes in MANIFEST.in re test files.

Closes #34
  • Loading branch information...
1 parent 7ac89b5 commit 9b19a6fcbbb8e36c043ddbc9ee6dbfcfa240ae87 @jjlee committed
Showing with 31 additions and 4 deletions.
  1. +1 −1 MANIFEST.in
  2. +30 −3 release.py
View
2 MANIFEST.in
@@ -8,5 +8,5 @@ recursive-include examples/forms *.dat *.txt *.html *.cgi *.py
recursive-include test/functional_tests_golden output
recursive-include test/test_form_data *.html
recursive-include test *.py *.doctest *.special_doctest
-recursive-include test-tools *.py
+recursive-include test-tools *.py *.cgi
recursive-include docs *.txt *.html *.css *.js
View
33 release.py
@@ -332,6 +332,12 @@ def __init__(self, env, git_repository_path, release_area, mirror_path,
self._zope_testbrowser_dir = os.path.join(release_dir,
"zope_testbrowser_test")
+ def _mkdtemp(self):
+ temp_dir = tempfile.mkdtemp(prefix="tmp-%s-" % self.__class__.__name__)
+ def tear_down():
+ shutil.rmtree(temp_dir)
+ return temp_dir, tear_down
+
def _get_next_release_version(self):
# --pretend / git not installed
most_recent, next = "dummy version", "dummy version"
@@ -534,6 +540,27 @@ def _make_tarball_easy_install_test_step(self, env, **kwds):
os.path.abspath(os.path.join(self._repo_path, "dist", tarball)),
test_cmd, self._release_version, kwds["python_version"])
+ def _make_unpacked_tarball_test_step(self, env, **kwds):
+ # This catches mistakes in listing test files in MANIFEST.in (the tests
+ # don't get installed, so these don't get caught by testing installed
+ # code).
+ test_cmd = self._make_test_cmd(**kwds)
+ [tarball] = list(d for d in self._source_distributions if
+ d.endswith(".tar.gz"))
+ tarball_path = os.path.abspath(
+ os.path.join(self._repo_path, "dist", tarball))
+ def test_step(log):
+ target_dir, tear_down = self._mkdtemp()
+ try:
+ env.cmd(["tar", "-C", target_dir, "-xf", tarball_path])
+ [source_dir] = glob.glob(
+ os.path.join(target_dir, "mechanize-*"))
+ test_env = clean_environ_env(release.CwdEnv(env, source_dir))
+ test_env.cmd(test_cmd)
+ finally:
+ tear_down()
+ return test_step
+
@action_tree.action_node
def test(self):
r = []
@@ -743,9 +770,7 @@ def _classpath_cmd(self):
return ["env", "CLASSPATH=%s" % path]
def _sanitise_css(self, path):
- temp_dir = tempfile.mkdtemp(prefix="tmp-%s-" % self.__class__.__name__)
- def tear_down():
- shutil.rmtree(temp_dir)
+ temp_dir, tear_down = self._mkdtemp()
temp_path = os.path.join(temp_dir, os.path.basename(path))
temp = open(temp_path, "w")
try:
@@ -971,6 +996,8 @@ def build(self):
# self.make_coverage_html,
self.tag,
self.build_sdist,
+ ("unpacked_tarball_test", self._make_unpacked_tarball_test_step(
+ self._env, python_version=(2,6))),
("easy_install_test", self._make_tarball_easy_install_test_step(
self._in_repo, python_version=(2, 6),
local_server=False, uri=self._test_uri)),

0 comments on commit 9b19a6f

Please sign in to comment.
Something went wrong with that request. Please try again.