Hi devs,
Following the numerous database related issues that have/are delayed/ing
the 3.5.1 release and the 4.0 release, and seing how it could be long and
annoying to put multi-database tests in place, and the hard work Sorin has
done in testing these issues again and again, I have taken a couple of hour
to write a decent bash script.
Here is an excerpt of the usage message of my script:
This script can do the following steps easily to help you testing xwiki
distribution:
- Download a distribution package, either release or snapshot (using
mysql/jetty distribution).
- Deploy that package, and configure it for a requested database.
- Create the needed database.
- Import a database dump, previously exported with this same tool.
- Launch the configured XWiki with Jetty.
- Backup the database after XWiki shutdown.
All operations could be done in a multiuser environment, using common
databases, without conflict.
You may start using it as easy as "xwiktest -v 3.5 -d oracle -w" to have a
XWiki release 3.5 downloaded and run with oracle and non-conflicting ports
and database.
Full options are listed at the end of this thread for the interested.
I really hope this script could help in testing more often any changes that
may have consequences between versions, or may cause incompatibilities with
some databases. It would be nice if a well connected VM (the one from Sorin
has all DBs well configured but is badly connected and downloading is
really slow :( ) could be available to all committers, avoiding each one to
have to setup each database locally.
If you find it useful, I will maintain this script as much as possible, and
improve it further. I have already some idea like:
- automatically import a given XAR
- check logs, terminate and report issue automatically (to integrate with
Jenkins?)
- allow starting multiple version one after each others, testing migration
in one run
...
This is already more than a simple script (~500 lines), and well documented.
However, I do not found a good place to put such script in GitHub. IMO,
this script is like release scripts, it will be maintained by the dev team,
and it could became essentiel to the project, and I have conform as much as
a bash script could to our coding practices. Therefore I do not think that
putting it in xwiki-contrib is right. Release scripts should not even be
there, and need a place in a xwiki repositories IMO.
These are scripts that are never released nor compile or what ever. We have
already something similar in xwiki repositories: xwiki-debug-eclipse
I do not think it is nice to multiply repositories in xwiki, but there is a
need for unreleased but maintained codes like these.
I proposed that we create a new repository in XWiki to contains such codes,
and to put/move in it:
- xwiki-debug-eclipse
- xwiki-release-tools (for release scripts)
- xwiki-testing-tools (for the above script)
We may call this repository:
- xwiki-tools
- xwiki-utils
- xwiki-dev-tools
...
WDYT ?
--
Denis Gervalle
SOFTEC sa - CEO
eGuilde sarl - CTO
As promised for the curious, the options of my testing script:
Usage: xwikitest [OPTIONS]
Options:
-b backup.sql Backup database to the given file (or folder for
oracle) after shutdown.
-B backup.sql Backup current database to the given file, same as -b
-z -k -n
-d database Choose a database
(mysql-myisam,mysql-innodb,psql,oracle,hsqldb). Current is mysql-innodb.
-e distribution Choose a distribution (enterprise or manager).
Current is manager.
-i dump.sql Import the given sql dump in the database before
startup.
-I dump.sql Import the given sql dump in the database without
running, same as -i -z -n
-h Display this usage message. At the end, it shows your
current arguments and alone the defaults.
-k Do not clean the database before startup.
-n Do not start XWiki.
-p port Port for Jetty listening. Current is 7581.
-r snapshot Use given snapshot (ie: 20120410.161114-97). Default
to use release.
-s dbsuffix Database suffix for test isolation. Current is DenisG.
-t port Port for Jetty termination. Current is 7501.
-v version Choose a XWiki version. Current is 4.1.
-w Download from
maven.xwiki.org. Default is to search
current folder.
-z Do not redeploy and reconfigure (use with care).