]> scripts.mit.edu Git - wizard.git/commitdiff
Make test scripts run from any directory.
authorEdward Z. Yang <ezyang@mit.edu>
Tue, 8 Dec 2009 18:31:29 +0000 (13:31 -0500)
committerEdward Z. Yang <ezyang@mit.edu>
Tue, 8 Dec 2009 18:31:29 +0000 (13:31 -0500)
Updated documentation for setting up Wizard for
testing.  Actual procedures should be much simpler
now.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
18 files changed:
TODO
doc/create.rst
doc/index.rst
doc/setup.rst [new file with mode: 0644]
tests/all.sh
tests/clean.sh
tests/mediawiki-backup-restore-test.sh
tests/mediawiki-continue-upgrade-test.sh
tests/mediawiki-fail-upgrade-test.sh
tests/mediawiki-install-test.sh
tests/mediawiki-restore-upgrade-test.sh
tests/mediawiki-retry-install-test.sh
tests/mediawiki-upgrade-test.sh
tests/mediawiki-webfail-upgrade-test.sh
tests/phpbb-install-test.sh
tests/setup
tests/wordpress-install-test.sh
tests/wordpress-upgrade-test.sh

diff --git a/TODO b/TODO
index 2162d0fefa1995231d080f4ef7a9710e08999831..c7a6ee29c8d8159fc8a3356bd08a56121e7f82d4 100644 (file)
--- a/TODO
+++ b/TODO
@@ -13,7 +13,6 @@ TODO NOW:
   Use system similar to database, with option for explicit override,
   but otherwise attempting to determine from ambient code
 
-- Setting PATH and WIZARD_SRV_PATH from a test script: mention in docs
 - If you try to do an install on scripts w/o sql, it will sign you up but fail to write
   the sql.cnf file. This sucks.
 
index 38d40edda79f42c882e0e17582cea1e0abac4119..8ff20132adf14549d4e8c3bf2833d4b9adf7eade 100644 (file)
@@ -16,6 +16,11 @@ upgrade or backup the installation.
 Here is a tutorial for creating such a repository, using an old version of
 Wordpress as an example.  We will implement only the functions necessary for
 installing an application--upgrades and backups are not described here.
+We assume that you have a working setup of Wizard; consult the
+:doc:`setup documentation <setup>` for more details.
+
+From this point on, we will assume you are doing development from an AFS directory
+named ``$WIZARD``; note that application repositories live in ``$WIZARD/srv``.
 
 .. supplement:: Conversions
 
@@ -30,72 +35,6 @@ installing an application--upgrades and backups are not described here.
     Wizard autoinstall, and you will start you repository with the *earliest*
     version of the application extant on our servers.
 
-Setup
------
-
-Probably the easiest way to do development is entirely on :term:`AFS`, so that if you
-SSH into a scripts server to perform testing, you will be able
-to invoke your tools and read your development repository.  In order
-to be able to run the test scripts in the tests directory, this
-is preferably in :file:`web_scripts`. In that
-case, setup is as simple as::
-
-    git clone /mit/scripts/git/wizard.git /mit/$USER/web_scripts/wizard
-    # for any application you're going to do development on, also:
-    git clone /mit/scripts/git/autoinstalls/$APP.git /mit/$USER/web_scripts/wizard/srv/$APP
-
-From this point on, we will assume you are doing development from an AFS directory
-named ``$WIZARD``; note that application repositories live in ``$WIZARD/srv``.
-
-.. warning::
-
-    Other users will not be able to access your source code.  If you
-    change the access control to allow ``system:anyuser`` to read your
-    source code (in case you want to let other people test your
-    code), do *not* give access to the :file:`tests` directory,
-    which may contain sensitive data.
-
-Advanced setup
-''''''''''''''
-
-These instructions are for if you'd like to be able to develop offline and are
-on ``scripts-root``.  Wizard will mostly work on your local machine, but you
-won't be able to do all development offline; some steps in the development
-process must be performed on scripts servers.  Thus, the difficult part is
-marshalling commits from one repository to another. Git doesn't exactly make
-this easy, but you can follow this recipe::
-
-    git clone ssh://scripts@scripts.mit.edu/mit/scripts/git/wizard.git ~/wizard
-    cd /mit/$USER
-    mkdir wizard.git
-    cd wizard.git
-    git init --bare
-    cd ~/wizard
-    git remote add afs /mit/$USER/wizard.git
-    git push -f afs master
-    git clone /mit/$USER/wizard.git /mit/$USER/wizard
-
-We create a bare repository :file:`/mit/$USER/wizard.git` that you can push and
-pull from, and then setup an alternate remote ``afs`` on your offline copy.
-
-And then you can perform updates from your local copy with::
-
-    git push afs master
-    cd /mit/$USER/wizard
-    git pull
-
-If :file:`/mit/$USER/wizard.git` has write permissions for
-``system:scripts-security-upd``, this is especially useful if you were hacking
-on a copy living on ``not-backward.mit.edu``, and now need to transfer the
-changes back to the canonical repository (please don't give ``not-backward.mit.edu``
-your root tickets!)  You can also setup a wizard directory similar to the
-first set of directions for on-server testing.
-
-.. warning::
-
-    These instructions are not well tested.  Let me know if you run into
-    any difficulties.
-
 Pristine
 --------
 
index bddabda88b8335b1aae872d8a12500ec5f657399..8006b56562080802caf71b68de6c3960f808d928 100644 (file)
@@ -19,7 +19,7 @@ on scripts servers.  As such, the best way to test Wizard is to SSH
 into a scripts server and add Wizard to your path::
 
     ssh scripts.mit.edu
-    export PATH="/mit/scripts/wizard/bin:$PATH"
+    add /mit/scripts/wizard/bin
     wizard help
 
 Individual tools that are not scripts-specific, such as ``wizard upgrade``
@@ -54,6 +54,7 @@ Table of Contents
 .. toctree::
     :maxdepth: 1
 
+    setup
     repo
     create
     upgrade
diff --git a/doc/setup.rst b/doc/setup.rst
new file mode 100644 (file)
index 0000000..f33d583
--- /dev/null
@@ -0,0 +1,109 @@
+Setting up Wizard
+=================
+
+:Author: Edward Z. Yang <ezyang@mit.edu>
+
+.. highlight:: sh
+
+Probably the easiest way to do development is entirely on :term:`AFS`, so that if you
+SSH into a scripts server to perform testing, you will be able
+to invoke your tools and read your development repository.  In order
+to be able to run the test scripts in the tests directory, this
+is preferably in :file:`web_scripts`.  First, you should ensure that you
+are signed up for the Scripts web service as well as the SQL service::
+
+    athrun scripts
+
+.. note::
+
+    If you are running on a operating system that does not have support
+    for AFS and other standard Debathena tools, it is highly recommended
+    that you SSH into a server that does, such as `Linerva <http://linerva.mit.edu/>`_
+    to perform development.  We will now assume all commands are
+    being done on a server similar to Linerva.
+
+In that case, setup is as simple as::
+
+    git clone /mit/scripts/git/wizard.git /mit/$USER/web_scripts/wizard
+
+Other users will not be able to access your source code, which may be
+detrimental if you want to let other people test your code.  If you change the
+access control to allow ``system:anyuser`` to read your source code (in case
+you want to let other people test your code), do *not* give access to the
+:file:`tests` directory, which may contain sensitive data once you start
+running tests.  A set of commands that will let you do this would be::
+
+    athrun consult fsr sa /mit/$USER/web_scripts/wizard system:anyuser read
+    athrun consult fsr sa /mit/$USER/web_scripts/wizard/tests system:anyuser none
+
+To test if your setup is now working, run one of the test scripts::
+
+    /mit/$USER/web_scripts/wizard/tests/mediawiki-install-test.sh
+
+Application development
+-----------------------
+
+By default, Wizard will go and look for Git repositories for our various
+applications in the :file:`/mit/scripts/git/autoinstalls` directory.
+However, if you're developing your own application, you'll probably have
+your own directory (probably living in :file:`/mit/$USER/web_scripts/wizard/srv`)
+and you want Wizard to use those files.  In that case, you can override
+the directory Wizard is looking at with::
+
+    export WIZARD_SRV_PATH=/mit/$USER/web_scripts/wizard/srv
+
+You may call this command a lot, so placing it in a small shell file (e.g. :file:`dev`) that
+you include with::
+
+    . dev
+
+at your prompt may be useful.  This also means that Wizard will think you
+have *no* applications initially; you'll have to clone (or symlink)
+the appropriate repositories manually::
+
+    git clone /mit/scripts/git/autoinstalls/$APP.git /mit/$USER/web_scripts/wizard/srv/$APP
+
+Advanced setup
+--------------
+
+These instructions are for if you'd like to be able to develop offline and are
+on ``scripts-root``.  Wizard will mostly work on your local machine, but you
+won't be able to do all development offline; some steps in the development
+process must be performed on scripts servers.  Thus, the difficult part is
+marshalling commits from one repository to another. Git doesn't exactly make
+this easy, but you can follow this recipe::
+
+    git clone ssh://scripts@scripts.mit.edu/mit/scripts/git/wizard.git ~/wizard
+    cd /mit/$USER
+    mkdir wizard.git
+    cd wizard.git
+    git init --bare
+    cd ~/wizard
+    git remote add afs /mit/$USER/wizard.git
+    git push -f afs master
+    git clone /mit/$USER/wizard.git /mit/$USER/wizard
+
+We create a bare repository :file:`/mit/$USER/wizard.git` that you can push and
+pull from, and then setup an alternate remote ``afs`` on your offline copy.
+
+And then you can perform updates from your local copy with::
+
+    git push afs master
+    cd /mit/$USER/wizard
+    git pull
+
+If :file:`/mit/$USER/wizard.git` has write permissions for
+``system:scripts-security-upd``, this is especially useful if you were hacking
+on a copy living on ``not-backward.mit.edu``, and now need to transfer the
+changes back to the canonical repository (please don't give ``not-backward.mit.edu``
+your root tickets!)  You can also setup a wizard directory similar to the
+first set of directions for on-server testing.
+
+Setting up the tests scripts to work is also slightly involved; more
+instructions can be found on the :doc:`testing documentation <testing>`.
+
+.. warning::
+
+    These instructions are not well tested.  Let me know if you run into
+    any difficulties.
+
index 6f89fed8b15c394c6a12737bdfb298030036577b..964e559e61937605e2cf9388728dc2fa2e4a532b 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/bash
+cd `dirname $0`
 bold="`tput -T${TERM:-dumb} bold`"
 red="`tput -T${TERM:-dumb} setf 4`"
 sgr0="`tput -T${TERM:-dumb} sgr0`"
index d0069edd51e50ed8c0602deaa231f784bfc630f7..c1e5c5a728cc6f6bf7fa46d0e7d9bef98c2c2a37 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/sh
+cd `dirname $0`
 for i in testdir*; do
     wizard remove "$i"
 done
index 41da2352f3895319755cc5c833cd120719d9e8b9..e9dc282a65b6559088af43d348ff4d97de94371b 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/bash -e
+cd `dirname $0`
 
 TESTNAME="mediawiki_backup_restore"
 source ./setup
index 4978cbd70f9af8dffc457477350b368355752807..3d37a6a50bf4653324c513966bbaaf365b38c820 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/bash -e
+cd `dirname $0`
 
 TESTNAME="mediawiki_continue_upgrade"
 source ./setup
index 9ae0a6e8386ccca2aa60cd4b27707c040b148937..527ca5432f7e89fc11e5caf3912bd4dc3637a001 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/bash -e
+cd `dirname $0`
 
 TESTNAME="mediawiki_fail_upgrade"
 source ./setup
index 633fbcde9058fb34455db55344bef1fbfece933a..ed09a6143bfe98d448904575723e61c555e8e923 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/bash -e
+cd `dirname $0`
 
 DEFAULT_HEAD=1
 TESTNAME="mediawiki_install"
index 759cd7eaee82100028670028ff2d99d1d281526b..426ea4a88ad68742a6505e4effc363c6432fce68 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/bash -e
+cd `dirname $0`
 
 TESTNAME="mediawiki_restore_upgrade"
 source ./setup
index 42e1bb731dc4d602172be03e9f6a1922bad821be..12c24975b07677b524d6f3fa3085bf28e09a6470 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/bash -e
+cd `dirname $0`
 
 DEFAULT_HEAD=1
 TESTNAME="mediawiki_retry_install"
index 43b77210d447f1e8895ed6a9ef354210b95b36e3..aa3a3e0fb36b0ebb6571bad45fc1f106b38a8b7d 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/bash -e
+cd `dirname $0`
 
 TESTNAME="mediawiki_upgrade"
 source ./setup
index d3f5170a3adfa0d4e2b3356c7e2946daa7f0cecc..a810d70c6e48366d9a0e2aa9b124f87c64e2218a 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/bash -e
+cd `dirname $0`
 
 TESTNAME="mediawiki_webfail_upgrade"
 source ./setup
index 074bca953820af29bc07ac3e7c2a494e65cd0653..ec6af40f7d5f51940874892676dd40d28482fd78 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/bash -e
+cd `dirname $0`
 
 DEFAULT_HEAD=1
 TESTNAME="phpbb_install"
index 9e3d535f4c06b78d0e2e5bf979e7b6718a571524..edf6db9b929d7bf0ab05c11495d659d97486d220 100644 (file)
@@ -4,6 +4,8 @@
 #   TESTNAME = name of the test
 # we produce $TESTDIR and $TESTID for config and test script to use.
 
+export PATH="`pwd`/../bin:$PATH"
+
 VERSION="$1"
 if [ "$VERSION" == "" ]; then
     if [ "$DEFAULT_HEAD" == "1" ]; then
index 17f2f8a4a409bc9ed8ed457c3ee338d821261bdf..250e7ba3a124ff5961934c20184415463318b70d 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/bash -e
+cd `dirname $0`
 
 DEFAULT_HEAD=1
 TESTNAME="wordpress_install"
index 241e383aaec2510c4e8a91891e39379f930db9b5..7c41288334654335211ac1447694a9e389818839 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/bash -e
+cd `dirname $0`
 
 TESTNAME="wordpress_upgrade"
 source ./setup