From 394f50f6842243cdd65f9850fb187653f9d87241 Mon Sep 17 00:00:00 2001 From: grubert Date: Tue, 18 Dec 2012 08:23:00 +0000 Subject: [PATCH] use release-test.sh in release.sh git-svn-id: https://docutils.svn.sourceforge.net/svnroot/docutils/trunk@7576 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- sandbox/infrastructure/README.txt | 25 +++++++------- sandbox/infrastructure/release-test.sh | 25 +++++++++++--- sandbox/infrastructure/release.sh | 62 ++++++---------------------------- 3 files changed, 42 insertions(+), 70 deletions(-) diff --git a/sandbox/infrastructure/README.txt b/sandbox/infrastructure/README.txt index bcbae0525..2cd58d15a 100644 --- a/sandbox/infrastructure/README.txt +++ b/sandbox/infrastructure/README.txt @@ -12,25 +12,24 @@ The `infrastructure <.>`_ sandbox directory stores any scripts that are needed for the development of the Docutils project. -TODOs: +:``_: The script to update the `web site`_ + from a developer machine or on shell.sourceforge. -* subversion is now on sourceforge - - change release and update + If a file ``ON_SOURCEFORGE`` exists in current dorectory, the + script assumes being executed on shell.sourceforge. -* sourceforge does not have cron, but berlios installation - did not work since long time. +:``_: The script to make releases_ of Docutils. + For usage details see ``_ -* clean up. - -Overview: + TODO : less sudo ? must test-directory be installed ?NO? -Everything below this needs rework. +:``_: The script to run tests at release time, extracted + from ``release.sh``. -:``_: The script to update the `web site`_ - from a developer machine. *The* current way to go. +Everything below this line needs rework +--------------------------------------- -:``_: The script to make releases_ of Docutils. - For usage details see ``_ +Overview: :``_: Upload files to http://docutils.sf.net/tmp/ using ``scp``, inserting the current date in the file name. diff --git a/sandbox/infrastructure/release-test.sh b/sandbox/infrastructure/release-test.sh index 8de2d6d63..2d1a4a226 100644 --- a/sandbox/infrastructure/release-test.sh +++ b/sandbox/infrastructure/release-test.sh @@ -54,6 +54,8 @@ echo "Testing the release tarball: docutils-${docutils_ver} under python$py_ver. echo "ATTENTION: some parts must be run as root/sudo to be able to remove/install into site-packages." +START_DIR=`pwd` + test_dir=tarball_test run rm -rf $test_dir run mkdir -p $test_dir @@ -90,15 +92,28 @@ python$py_ver setup.py build sudo python$py_ver setup.py install echo echo "Copying the test suite to the site-packages directory of Python $py_ver (sudo)." -echo "TODO for python3 copy test3" -echo "Press enter." +echo "TODO for python3 copy test3. Ennter.to continue." read sudo cp -rv test "$site_packages/docutils-test" # BUG test-dependecies.py # * breaks on record.txt access if not run as root -# * fails missing dependecies to png. +# * fails missing dependencies to files in docutils/docs. + +echo "run alltests.py" +# run locally so we do not require sudo to create +# site_packages/docutils-test/alltests.out -echo "run alltests. sudo again because alltests.out will be created in $site_packages/docutils-test" -sudo python$py_ver -u $site_packages/docutils-test/alltests.py +# copy to a directory and execute there to avoid usage +# of local docutils source. +test_run_dir=tmp-docutils-test +cp -r test $test_run_dir +mkdir -p $test_run_dir +cd $test_run_dir +python$py_ver -u test/alltests.py + +echo "remove test directory Ctrl C to abort" +read +cd $START_DIR +rm -rfv $test_dir diff --git a/sandbox/infrastructure/release.sh b/sandbox/infrastructure/release.sh index de7d2bf8c..423e4271b 100755 --- a/sandbox/infrastructure/release.sh +++ b/sandbox/infrastructure/release.sh @@ -8,6 +8,9 @@ # USAGE see: docutils/docs/dev/release.txt +# must be run from docutils trunk/docutils, +# because HISTORY and RELEASE_NOTES.txt are modified. + set -e function print_command() @@ -209,59 +212,14 @@ function test_tarball() confirm tar xzvf "../$tarball" echo run cd docutils-"$new_ver" - echo 'Installing the distribution.' - confirm su -c ' - for py_ver in '"$python_versions"'; do - echo "Deleting and installing Docutils on Python $py_ver." - echo "Press enter." - read - site_packages="/usr/local/lib/python$py_ver/site-packages" - echo "BUG prefers /usr/local too /usr" - if test ! -d "$site_packages"; then - site_packages="/usr/lib/python$py_ver/site-packages" - fi - if test ! -d "$site_packages"; then - echo "Error: \"$site_packages\" does not exist." - exit 1 - fi - if test -e "$site_packages/docutils-test"; then - echo "Error: \"$site_packages/docutils-test\" exists." - echo "removing left over from previous release. Ctrl-C to abort." - read - rm -rf $site_packages/docutils-test - fi - echo "TODO for python3 rm local build, but building takes a long time then " - python$py_ver setup.py install - echo - echo "Copying the test suite to the site-packages directory of Python $py_ver." - echo "TODO for python3 copy test3" - echo "Press enter." - read - cp -rv test "$site_packages/docutils-test" - done' - echo - echo 'Running the test suite as root with all Python versions.' - for py_ver in $python_versions; do - site_packages="/usr/local/lib/python$py_ver/site-packages" - if test ! -d "$site_packages"; then - site_packages="/usr/lib/python$py_ver/site-packages" - fi - if test ! -d "$site_packages"; then - echo "Error: \"$site_packages\" does not exist." - exit 1 - fi - # BUG - echo "WARNING shell script exits if any test fails, maybe run in separate shell." - confirm su -c "python$py_ver -u \"$site_packages/docutils-test/alltests.py\"" + echo 'Deleteing old installations. Installing the distribution.' + echo "WARN: might not find installation." + for py_ver in '"$python_versions"'; do + echo "python$py_ver install/update and test." + bash release-test.sh + echo "Enter to test next." + read done - run cd ../.. - echo "Cleaning up..." - confirm su -c "rm -rf tarball_test" - confirm su -c ' - for py_ver in '"$python_versions"'; do - rm -rfv /usr{/local,}/lib/python$py_ver/site-packages/docutils{-test,} - done' - echo } function upload_tarball() -- 2.11.4.GIT