* [PATCH/RFC]Test environment for Git-MediaWiki
@ 2012-05-30 16:30 Simon.Cathebras
2012-05-30 17:04 ` [PATCH 1/3] Script to install, delete and clear a MediaWiki Simon Cathebras
` (5 more replies)
0 siblings, 6 replies; 22+ messages in thread
From: Simon.Cathebras @ 2012-05-30 16:30 UTC (permalink / raw)
To: git
Cc: Matthieu Moy, charles.roussel, julien.khayat, Simon PERRAT,
Guillaume Sasdy
Hello all,
We are developing the test environment for the Git-MediaWiki project.
For now, we have focused mainly on the environment with some simple test
cases.
In this version, we have developed a script to install and delete a
MediaWiki wiki easily.
The environment provides shell functions to manage a wiki (fetch,
delete, edit a page, compare the content of a page) and a git-mediawiki
() repository.
There are two simple test cases for git clone.
You can find all the code in our Github:
https://github.com/Fafinou/git/wiki and how to install and run the tests.
We would like you to give us a lot of comments about our code :)
Note
* In this version we have a binary file "wikidb.sqlite" which contains
an empty SQLite3 database. We know this is not a good thing to put a
binary file in a repository so we will change this bad behavior later
(we will generate the "wikidb.sqlite" file with a http request to the
config page of MediaWiki)
* We will add simple test cases for pull and push the soonest
Thanks you in advance for your time ;)
--
CATHEBRAS Simon
2A-ENSIMAG
Filière Ingéniérie des Systèmes d'Information
Membre Bug-Buster
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 1/3] Script to install, delete and clear a MediaWiki
2012-05-30 16:30 [PATCH/RFC]Test environment for Git-MediaWiki Simon.Cathebras
@ 2012-05-30 17:04 ` Simon Cathebras
2012-05-30 17:04 ` [PATCH 2/3] Test environment of git-remote-mw Simon Cathebras
` (2 more replies)
2012-05-31 18:13 ` [PATCH 1/2] FIX: t9360. NEW test t9361 for git pull and git push Guillaume Sasdy
` (4 subsequent siblings)
5 siblings, 3 replies; 22+ messages in thread
From: Simon Cathebras @ 2012-05-30 17:04 UTC (permalink / raw)
To: git
Cc: Matthieu.Moy, simon.cathebras, charles.roussel, Guillaume.Sasdy,
Julien.Khayat, Simon.Perrat, Charles Roussel, Julien Khayat,
Simon Perrat, Guillaume Sasdy
From: Charles Roussel <charles.roussel@ensimag.fr>
install_wiki.sh expects the first argument to be 'install' or 'delete'
'install' installs a MediaWiki on the web's server with SQLite3
'delete' deletes the previously created wiki. Note those
functionnalities are made to be used from the user command line in the
directory /t
install_wiki also defines a function cmd_reset which clear all content
of the previously created wiki. Note this functionnality is made to be
used only by our test function in a subdirectory of t/
Signed-off-by: Simon Cathebras <simon.cathebras@ensimag.imag.fr>
Signed-off-by: Charles Roussel <charles.roussel@ensimag.imag.fr>
Signed-off-by: Julien Khayat <julien.khayat@ensimag.imag.fr>
Signed-off-by: Simon Perrat <simon.perrat@ensimag.imag.fr>
Signed-off-by: Guillaume Sasdy <guillaume.sasdy@gmail.com>
---
t/install-wiki.sh | 38 ++++++++++
t/install-wiki/LocalSettings.php | 129 ++++++++++++++++++++++++++++++++++
t/install-wiki/wikidb.sqlite | Bin 0 -> 210944 bytes
t/test-gitmw-lib.sh | 147 +++++++++++++++++++++++++++++++++++++++
4 files changed, 314 insertions(+)
create mode 100755 t/install-wiki.sh
create mode 100644 t/install-wiki/LocalSettings.php
create mode 100644 t/install-wiki/wikidb.sqlite
create mode 100755 t/test-gitmw-lib.sh
mode change 100644 => 100755 t/test-lib-functions.sh
mode change 100644 => 100755 t/test-lib.sh
diff --git a/t/install-wiki.sh b/t/install-wiki.sh
new file mode 100755
index 0000000..725346e
--- /dev/null
+++ b/t/install-wiki.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+# This script installs or deletes a MediaWiki on your computer.
+# It requires a web server with PHP and SQLite running. In addition, if you
+# do not have MediaWiki sources on your computer, the option 'install'
+# downloads them for you.
+# Please set the CONFIGURATION VARIABLES in ./test-gitmw-lib.sh
+
+. ./test-gitmw-lib.sh
+
+usage () {
+ echo "Usage: "
+ echo " ./install-wiki.sh <install|delete|--help|-h>"
+ echo " install: Install a wiki on your computer."
+ echo " delete: Delete the wiki and all its pages and content"
+}
+
+
+# Argument: install, delete, --help | -h
+case "$1" in
+ "install")
+ cmd_install
+ exit 0
+ ;;
+ "delete")
+ cmd_delete
+ exit 0
+ ;;
+ "--help" | "-h")
+ usage
+ exit 0
+ ;;
+ *)
+ usage
+ exit 0
+ ;;
+esac
+
diff --git a/t/install-wiki/LocalSettings.php b/t/install-wiki/LocalSettings.php
new file mode 100644
index 0000000..c2fe3d5
--- /dev/null
+++ b/t/install-wiki/LocalSettings.php
@@ -0,0 +1,129 @@
+<?php
+# This file was automatically generated by the MediaWiki 1.19.0
+# installer. If you make manual changes, please keep track in case you
+# need to recreate them later.
+#
+# See includes/DefaultSettings.php for all configurable settings
+# and their default values, but don't forget to make changes in _this_
+# file, not there.
+#
+# Further documentation for configuration settings may be found at:
+# http://www.mediawiki.org/wiki/Manual:Configuration_settings
+
+# Protect against web entry
+if ( !defined( 'MEDIAWIKI' ) ) {
+ exit;
+}
+
+## Uncomment this to disable output compression
+# $wgDisableOutputCompression = true;
+
+$wgSitename = "Git-MediaWiki-Test";
+$wgMetaNamespace = "Git-MediaWiki-Test";
+
+## The URL base path to the directory containing the wiki;
+## defaults for all runtime URL paths are based off of this.
+## For more information on customizing the URLs please see:
+## http://www.mediawiki.org/wiki/Manual:Short_URL
+$wgScriptPath = "@WG_SCRIPT_PATH@";
+$wgScriptExtension = ".php";
+
+## The protocol and server name to use in fully-qualified URLs
+$wgServer = "@WG_SERVER@";
+
+## The relative URL path to the skins directory
+$wgStylePath = "$wgScriptPath/skins";
+
+## The relative URL path to the logo. Make sure you change this from the default,
+## or else you'll overwrite your logo when you upgrade!
+$wgLogo = "$wgStylePath/common/images/wiki.png";
+
+## UPO means: this is also a user preference option
+
+$wgEnableEmail = true;
+$wgEnableUserEmail = true; # UPO
+
+$wgEmergencyContact = "apache@localhost";
+$wgPasswordSender = "apache@localhost";
+
+$wgEnotifUserTalk = false; # UPO
+$wgEnotifWatchlist = false; # UPO
+$wgEmailAuthentication = true;
+
+## Database settings
+$wgDBtype = "sqlite";
+$wgDBserver = "";
+$wgDBname = "wikidb";
+$wgDBuser = "";
+$wgDBpassword = "";
+
+# SQLite-specific settings
+$wgSQLiteDataDir = "@WG_SQLITE_DATADIR@";
+
+
+## Shared memory settings
+$wgMainCacheType = CACHE_NONE;
+$wgMemCachedServers = array();
+
+## To enable image uploads, make sure the 'images' directory
+## is writable, then set this to true:
+$wgEnableUploads = false;
+$wgUseImageMagick = true;
+$wgImageMagickConvertCommand ="@CONVERT@";
+
+# InstantCommons allows wiki to use images from http://commons.wikimedia.org
+$wgUseInstantCommons = false;
+
+## If you use ImageMagick (or any other shell command) on a
+## Linux server, this will need to be set to the name of an
+## available UTF-8 locale
+$wgShellLocale = "en_US.utf8";
+
+## If you want to use image uploads under safe mode,
+## create the directories images/archive, images/thumb and
+## images/temp, and make them all writable. Then uncomment
+## this, if it's not already uncommented:
+#$wgHashedUploadDirectory = false;
+
+## Set $wgCacheDirectory to a writable directory on the web server
+## to make your wiki go slightly faster. The directory should not
+## be publically accessible from the web.
+#$wgCacheDirectory = "$IP/cache";
+
+# Site language code, should be one of the list in ./languages/Names.php
+$wgLanguageCode = "en";
+
+$wgSecretKey = "1c912bfe3519fb70f5dc523ecc698111cd43d81a11c585b3eefb28f29c2699b7";
+#$wgSecretKey = "@SECRETKEY@";
+
+
+# Site upgrade key. Must be set to a string (default provided) to turn on the
+# web installer while LocalSettings.php is in place
+$wgUpgradeKey = "ddae7dc87cd0a645";
+
+## Default skin: you can change the default skin. Use the internal symbolic
+## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook', 'vector':
+$wgDefaultSkin = "vector";
+
+## For attaching licensing metadata to pages, and displaying an
+## appropriate copyright notice / icon. GNU Free Documentation
+## License and Creative Commons licenses are supported so far.
+$wgRightsPage = ""; # Set to the title of a wiki page that describes your license/copyright
+$wgRightsUrl = "";
+$wgRightsText = "";
+$wgRightsIcon = "";
+
+# Path to the GNU diff3 utility. Used for conflict resolution.
+$wgDiff3 = "/usr/bin/diff3";
+
+# Query string length limit for ResourceLoader. You should only set this if
+# your web server has a query string length limit (then set it to that limit),
+# or if you have suhosin.get.max_value_length set in php.ini (then set it to
+# that value)
+$wgResourceLoaderMaxQueryLength = -1;
+
+
+
+# End of automatically generated settings.
+# Add more configuration options below.
+
diff --git a/t/install-wiki/wikidb.sqlite b/t/install-wiki/wikidb.sqlite
new file mode 100644
index 0000000000000000000000000000000000000000..809047334bf15891de943b480171beb2558f7cb8
GIT binary patch
literal 210944
zcmeHQ34k0$)$U_=I|m^NAq-(zb~Z~gJIUUg8)D8)SaK(ugd~Kaccyo@voq6^>7MLv
zA_<cKK{4P39w6WWB8ngg3jBh2;EgEyiwgcK9;hIPKOW#O|9e%{J>7HcAu-2nO(wJ5
zRj=Nw_tnu=^<GzP+OS%;G=Ha&jH#BtMJN$OQCRHv3xZ(5|0m$T{rMzZi1tm^wJX?j
zX$f_|t}2C~a@oX)ugP!7f0bX6Uyy$<|5|=lep-G?enS41{5APe`62m!`5yVx^6m0R
z<(uRW$nTM_k*|~w$o({_hcCb32%N+S{8xG!<o>?&Iq-XD`V9E}c=}ZM{YZKg{N9k3
z;rGa8@N+l?KL--<)2qWzyaRqZx4}<GJN)e206$yTz|Z;%;Aizx_*t<CeiqJ$pV>|D
zQ#S*Crkx8v{tEaxYYO~KIvsw-puACK<KS16;{ts7ha<od_>Urx9xsj;D#vN#gkTVx
zZBX2*_vlL^F+ILu>4N#;xh)ZGUdMvQc};UW)mgJ=&zl!%Y?(c`bJncLtmav2OXJ)|
zb-t>pm|$^C)uZ)cBi7v5)Z93`d3MwMmX^j@jg1|hb7s%(P@5W?=QgWabL0Hkv*ylj
zip-j)&1soE-$mU#d!B&pzf^uqfT!{c@I?L*T=EY`fFp3SATY614v0xDti`Qxw;J!#
zO!1TwxdMXr=%#MO#Zj_6S+ul1OB^M^RYL93#8Dz#rA#d;jsZPI`BeeF{KFC82oya6
z<K)WBsDritHw5{OqF0<N$PwTOWDqEkVXcoo|6dg37c&w3iX*@gC_)5IlY^pn?Lfr&
zza;-wkY9rz{^1C41d0!VQzcof5<5~!O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#efOwqyC+{a;WvwR?wj<jO{>Fi|Js``UiyV|Ry_CU-xh!TC+93W
z=apN|x&D{$yyMn~e=kkC_Y-ek65D-#{DJdkf4H`<S&u!j`^N`Xw!Zdo^DTeaa__o*
zKQy0t)OXIE*B+Sh)OX*1<lt9-9ldStmDk_@(jQkC3*P*^F=zkg?<L~n&pP<Cu6@71
zx%{a$6Th?bvWZ)a@BHBU2R>A)fBTkcol_^gVqX5@nvecc{87*Nm+!dj@k`G?>xY5g
zP5kqXH+=5U8@E*m&$f@f=dNvM#dfys{7QK1Red-7cl*t^f2yUe_u;mw2laP+@VBS!
zn|b+ybK>%-ou4_fP<UnUi)${~^IY<(-mV*8z3V~c+xsSN9J{9R3%8g3>2GB>eI|bQ
zy6+oZANb8VRWIE7%cs9ku6<$QUwvcS4qyG^&cA)*$@8MiR_}|yzxL(@r>^|gTxHQ!
z|Fd}g{+6dp{;=+zdMk2kbH&-?uf1gVM}9ct+{B{CCvTs2(^oI6{nX*RFSxMhs<O&$
ly+670rgvOl`@oC;_o}bCv8lOncJrL3`7JGtjkz7${{ubzcYgo?
literal 0
HcmV?d00001
diff --git a/t/test-gitmw-lib.sh b/t/test-gitmw-lib.sh
new file mode 100755
index 0000000..2deead7
--- /dev/null
+++ b/t/test-gitmw-lib.sh
@@ -0,0 +1,147 @@
+#
+# CONFIGURATION VARIABLES
+# You might want to change those ones ...
+#
+WIKI_DIR_NAME="wiki" # Name of the wiki's directory
+WIKI_DIR_INST="/var/www" # Directory of the web server
+TMP="/tmp" # Temporary directory for downloads
+ # Absolute address needed!
+SERVER_ADDR="localhost" # Web server's address
+
+#
+# CONFIGURATION
+# You should not change those ones unless you know what you to
+#
+# Do not change the variables below
+MW_VERSION="mediawiki-1.19.0"
+DB_FILE="wikidb.sqlite"
+FILES_FOLDER="install-wiki"
+WIKI_ADMIN="WikiAdmin"
+WIKI_PASSW="AdminPass"
+
+fail () {
+ echo "$1"
+ exit 1
+}
+
+
+
+# Install a wiki in your web server directory.
+cmd_install () {
+
+ # Copy the generic LocalSettings.php in the web server's directory
+ # And modify parameters according to the ones set at the top
+ # of this script.
+ # Note that LocalSettings.php is never modified.
+ if [ ! -f "$FILES_FOLDER/LocalSettings.php" ] ; then
+ fail "Can't find $FILES_FOLDER/LocalSettings.php " \
+ "in the current folder.
+ Please run the script inside its folder."
+ fi
+ cp "$FILES_FOLDER/LocalSettings.php" \
+ "$FILES_FOLDER/LocalSettings-tmp.php" ||
+ fail "Unable to copy $FILES_FOLDER/LocalSettings.php " \
+ "to $FILES_FOLDER/LocalSettings-tmp.php"
+
+ # Parse and set the LocalSettings file of the user according to the
+ # CONFIGURATION VARIABLES section at the beginning of this script
+ file_swap="$FILES_FOLDER/LocalSettings-swap.php"
+ sed "s,@WG_SCRIPT_PATH@,/$WIKI_DIR_NAME," \
+ "$FILES_FOLDER/LocalSettings-tmp.php" > "$file_swap"
+ mv "$file_swap" "$FILES_FOLDER/LocalSettings-tmp.php"
+ sed "s,@WG_SERVER@,http://$SERVER_ADDR," \
+ "$FILES_FOLDER/LocalSettings-tmp.php" > "$file_swap"
+ mv "$file_swap" "$FILES_FOLDER/LocalSettings-tmp.php"
+ sed "s,@WG_SQLITE_DATADIR@,$TMP," \
+ "$FILES_FOLDER/LocalSettings-tmp.php" > "$file_swap"
+ mv "$file_swap" "$FILES_FOLDER/LocalSettings-tmp.php"
+
+ mkdir -p "$WIKI_DIR_INST/$WIKI_DIR_NAME"
+ if [ ! -d "$WIKI_DIR_INST/$WIKI_DIR_NAME" ] ; then
+ fail "Folder $WIKI_DIR_INST/$WIKI_DIR_NAME doesn't exist. Please create it
+ and launch the script again."
+ fi
+
+ mv "$FILES_FOLDER/LocalSettings-tmp.php" \
+ "$WIKI_DIR_INST/$WIKI_DIR_NAME/LocalSettings.php" ||
+ fail "Unable to move $FILES_FOLDER/LocalSettings-tmp.php" \
+ "in $WIKI_DIR_INST/$WIKI_DIR_NAME"
+ echo "File $FILES_FOLDER/LocalSettings.php is set in $WIKI_DIR_INST/$WIKI_DIR_NAME"
+
+ chmod ugo+w "$FILES_FOLDER/$DB_FILE"
+ reset_db_wiki "."
+
+ # Fetch MediaWiki's archive if not already present in the TMP directory
+ cd "$TMP"
+ if [ ! -f "$MW_VERSION.tar.gz" ] ; then
+ echo "Downloading $MW_VERSION sources ..."
+ wget http://download.wikimedia.org/mediawiki/1.19/mediawiki-1.19.0.tar.gz ||
+ fail "Unable to download" \
+ "http://download.wikimedia.org/mediawiki/1.19/mediawiki-1.19.0.tar.gz.
+ Please fix your connection and launch the script again."
+ fi
+ tar xfz "$MW_VERSION.tar.gz"
+ echo "$MW_VERSION.tar.gz downloaded in `pwd`. You can delete it later if you want."
+
+ # Copy the files of MediaWiki wiki in the web server's directory.
+ cd "$MW_VERSION"
+ cp -Rf * "$WIKI_DIR_INST/$WIKI_DIR_NAME/" ||
+ fail "Unable to copy WikiMedia's files from `pwd` to $WIKI_DIR_INST/$WIKI_DIR_NAME"
+
+ set_admin_wiki
+
+ echo "Your wiki has been installed. You can check it at http://$SERVER_ADDR/$WIKI_DIR_NAME"
+}
+
+# Copy the initial database of the wiki over the actual one.
+# Argument $1 is the relative path to the folder $FILES_FOLDER
+#
+# Warning: This function should be not called by user. This is a private
+# function used by cmd_install and cmd_delete
+reset_db_wiki () {
+
+ # Copy initial database of the wiki
+ if [ ! -f "$1/$FILES_FOLDER/$DB_FILE" ] ; then
+ fail "Can't find $1/$FILES_FOLDER/$DB_FILE in the current folder."
+ fi
+ cp --preserve=mode,ownership "$1/$FILES_FOLDER/$DB_FILE" "$TMP" ||
+ fail "Can't copy $1/$FILES_FOLDER/$DB_FILE in $TMP"
+ echo "File $FILES_FOLDER/$DB_FILE is set in $TMP"
+}
+
+# Set the admin WikiAdmin with password AdminPass in the database.
+#
+# Warning: This function should be not called by user. This is a private
+# function used by cmd_install and cmd_delete
+set_admin_wiki () {
+
+ #Add the admin
+ my_pwd="`pwd`"
+ cd "$WIKI_DIR_INST/$WIKI_DIR_NAME/maintenance/"
+ php changePassword.php --user="$WIKI_ADMIN" --password="$WIKI_PASSW" ||
+ fail "Unable to add an admin with the script $WIKI_DIR_INST/$WIKI_DIR_NAME/maintenance/
+ changePassword.php. Check you have the perms to do it."
+ echo "Admin \"$WIKI_ADMIN\" has password \"$WIKI_PASSW\""
+ cd "$my_pwd"
+}
+
+# Reset the database of the wiki and the password of the admin
+#
+# Warning: This function must be called only in a subdirectory of t/ directory
+cmd_reset () {
+ reset_db_wiki ".."
+ set_admin_wiki
+}
+
+# Delete the wiki created in the web server's directory and all its content
+# saved in the database.
+cmd_delete () {
+ # Delete the wiki's directory.
+ rm -rf "$WIKI_DIR_INST/$WIKI_DIR_NAME" ||
+ fail "Wiki's directory $WIKI_DIR_INST/" \
+ "$WIKI_DIR_NAME could not be deleted"
+
+ # Delete the wiki's SQLite database
+ rm -f "$TMP/$DB_FILE" || fail "Database $TMP/$DB_FILE could not be deleted."
+}
+
diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
old mode 100644
new mode 100755
diff --git a/t/test-lib.sh b/t/test-lib.sh
old mode 100644
new mode 100755
--
1.7.10.2.552.gaa3bb87
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 2/3] Test environment of git-remote-mw
2012-05-30 17:04 ` [PATCH 1/3] Script to install, delete and clear a MediaWiki Simon Cathebras
@ 2012-05-30 17:04 ` Simon Cathebras
2012-05-31 7:17 ` Matthieu Moy
2012-05-30 17:04 ` [PATCH 3/3] Tests file for git-remote-mediawiki Simon Cathebras
2012-05-31 7:19 ` [PATCH 1/3] Script to install, delete and clear a MediaWiki Matthieu Moy
2 siblings, 1 reply; 22+ messages in thread
From: Simon Cathebras @ 2012-05-30 17:04 UTC (permalink / raw)
To: git
Cc: Matthieu.Moy, simon.cathebras, charles.roussel, Guillaume.Sasdy,
Julien.Khayat, Simon.Perrat, Charles Roussel, Julien Khayat,
Simon Perrat, Guillaume Sasdy
From: Charles Roussel <charles.roussel@ensimag.fr>
In order to test git-remote-mediawiki, we need a package of functions
to manage a MediaWiki: edit a page, remove a page, fetch a page,
fetch all pages on a given wiki.
We also need functions to compare the content of directories.
Signed-off-by: Simon Cathebras <simon.cathebras@ensimag.imag.fr>
Signed-off-by: Charles Roussel <charles.roussel@ensimag.imag.fr>
Signed-off-by: Julien Khayat <julien.khayat@ensimag.imag.fr>
Signed-off-by: Simon Perrat <simon.perrat@ensimag.imag.fr>
Signed-off-by: Guillaume Sasdy <guillaume.sasdy@gmail.com>
---
t/test-gitmw-lib.sh | 125 ++++++++++++++++++++++++++++++++++++---
t/test-gitmw.pl | 164 ++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 281 insertions(+), 8 deletions(-)
create mode 100755 t/test-gitmw.pl
diff --git a/t/test-gitmw-lib.sh b/t/test-gitmw-lib.sh
index 2deead7..8698625 100755
--- a/t/test-gitmw-lib.sh
+++ b/t/test-gitmw-lib.sh
@@ -1,27 +1,136 @@
+# Copyright (C) 2012
+# Charles Roussel <charles.roussel@ensimag.imag.fr>
+# Simon Cathebras <simon.cathebras@ensimag.imag.fr>
+# Julien Khayat <julien.khayat@ensimag.imag.fr>
+# Guillaume Sasdy <guillaume.sasdy@ensimag.imag.fr>
+# Simon Perrat <simon.perrat@ensimag.imag.fr>
+# Matthieu Moy <matthieu.moy@imag.fr>
+# License: GPL v2 or later
+
#
# CONFIGURATION VARIABLES
-# You might want to change those ones ...
+# You might want to change these ones
#
WIKI_DIR_NAME="wiki" # Name of the wiki's directory
WIKI_DIR_INST="/var/www" # Directory of the web server
TMP="/tmp" # Temporary directory for downloads
- # Absolute address needed!
+ # Absolute path required!
SERVER_ADDR="localhost" # Web server's address
-#
# CONFIGURATION
-# You should not change those ones unless you know what you to
+# You should not change these ones unless you know what you do
#
-# Do not change the variables below
MW_VERSION="mediawiki-1.19.0"
DB_FILE="wikidb.sqlite"
FILES_FOLDER="install-wiki"
WIKI_ADMIN="WikiAdmin"
WIKI_PASSW="AdminPass"
-fail () {
- echo "$1"
- exit 1
+# wiki_getpage <page_name> <dest_path>
+#
+# Fetch a page <page_name> from the wiki and copy its content
+# into directory <dest_path>.
+wiki_getpage () {
+ ../test-gitmw.pl "get_page" -p "$1" "$2"
+}
+
+# wiki_delete_page <page_name>
+#
+# Delete the page <page_name> on the wiki.
+wiki_delete_page () {
+ ../test-gitmw.pl "delete_page" -p "$1"
+}
+
+# wiki_edit_page <page_name> <page_content> <page_append>
+#
+# Edit a page <wiki_page> on the wiki with content <wiki_content>
+# If <wiki_append> == true the content will be appended
+# If the page doesn't exist, it is created.
+wiki_editpage () {
+ ../test-gitmw.pl "edit_page" -p "$1" "$2" "$3"
+}
+
+# git_content <dir_1> <dir_2>
+#
+# Compare the contents of directories <dir_1> and <dir_2> with diff
+# and exits with error 1 if they do not match. The program will
+# not look into .git in the process.
+git_content () {
+ result=$(diff -r -B -w --exclude=".git" "$1" "$2")
+
+ if echo $result | grep -q ">" ; then
+ echo "test failed: files $1 and $2 do not match"
+ exit 1
+ fi
+}
+
+# git_exist <rep_name> <file_name>
+#
+# Check the existence of <file_name> into the git repository
+# <rep_name> and exits with error 1 if it is absent.
+git_exist () {
+ result=$(find "$1" -type f -name "$2")
+
+ if ! echo $result | grep -q "$2" ; then
+ echo "test failed: file $2 does not exist in $1"
+ exit 1
+ fi
+}
+
+# wiki_page_content <file_name> <page_name>
+#
+# Compares the contents of the file <file_name> and the wiki page
+# <page_name> and exits with error 1 if they do not match.
+wiki_page_content () {
+ wiki_getpage "$2" .
+
+ if test -f "$2".mw ; then
+ git_content "$1" "$2".mw
+ rm "$2".mw
+ else
+ die "ERROR: file $2 not found on wiki"
+ fi
+}
+
+# wiki_page_exist <page_name>
+#
+# Check the existence of the page <page_name> on the wiki and exits
+# with error if it is absent from it.
+wiki_page_exist () {
+ wiki_getpage "$1" .
+
+ if test -f "$1".mw ; then
+ echo "test failed: file $1 not found on wiki"
+ exit 1
+ else
+ rm "$1".mw
+ fi
+}
+
+# wiki_getallpagename
+#
+# Fetch the name of each page on the wiki.
+wiki_getallpagename () {
+ ../test-gitmw.pl "getallpagename" -p
+}
+
+# wiki_getallpage <dest_dir>
+#
+# Fetch all the pages from the wiki and place them in the directory
+# <dest_dir>.
+wiki_getallpage () {
+ wiki_getallpagename
+ mkdir $1
+ while read -r line; do
+ wiki_getpage "$line" $1;
+ done < all.txt
+ #rm all.txt
+}
+
+fail()
+{
+ echo $1
+ exit 1
}
diff --git a/t/test-gitmw.pl b/t/test-gitmw.pl
new file mode 100755
index 0000000..e9c50f9
--- /dev/null
+++ b/t/test-gitmw.pl
@@ -0,0 +1,164 @@
+#!/usr/bin/perl -w
+# Copyright (C) 2012
+# Charles Roussel <charles.roussel@ensimag.imag.fr>
+# Simon Cathebras <simon.cathebras@ensimag.imag.fr>
+# Julien Khayat <julien.khayat@ensimag.imag.fr>
+# Guillaume Sasdy <guillaume.sasdy@ensimag.imag.fr>
+# Simon Perrat <simon.perrat@ensimag.imag.fr>
+# Matthieu Moy <matthieu.moy@imag.fr>
+# License: GPL v2 or later
+
+# Usage:
+# ./test-gitmw.pl <function> [argument]*
+# Execute in terminal using the name of the function to call as first
+# parameter, and the function's arguments as following parameters
+#
+# Example:
+# ./test-gitmw.pl "get_page" foo .
+# will call <wiki_getpage> with arguments <foo> and <.>
+#
+# Available functions are:
+# "get_page"
+# "delete_page"
+# "edit_page"
+# "getallpagename"
+
+use MediaWiki::API;
+use Switch;
+# URL of the wiki used for the tests
+my $wiki_url="http://localhost/wiki/api.php";
+my $wiki_admin='WikiAdmin';
+my $wiki_admin_pass='AdminPass';
+my $mw = MediaWiki::API->new;
+$mw->{config}->{api_url} = $wiki_url;
+
+# wiki_login <name> <password>
+#
+# Logs the user with <name> and <password> in the global variable
+# of the mediawiki $mw
+sub wiki_login {
+ $mw->login( { lgname => "$_[0]",lgpassword => "$_[1]" } )
+ || die "getpage: login failed";
+}
+
+# wiki_getpage <wiki_page> <dest_path>
+#
+# fetch a page <wiki_page> from the wiki referenced in the global variable
+# $mw and copies its content in directory dest_path
+sub wiki_getpage {
+ my $pagename = $_[0];
+ my $destdir = $_[1];
+
+ my $page = $mw->get_page( { title => $pagename } );
+ if (!defined($page)) {
+ die "getpage: wiki does not exist";
+ }
+
+ my $content = $page->{'*'};
+ if (!defined($content)) {
+ die "getpage: page does not exist";
+ }
+
+ # Replace spaces by underscore in the page name
+ $pagename=~s/\ /_/;
+ open(my $file, ">$destdir/$pagename.mw");
+ print $file "$content";
+ close ($file);
+}
+
+# wiki_delete_page <page_name>
+#
+# delete the page with name <page_name> from the wiki referenced
+# in the global variable $mw
+sub wiki_delete_page {
+ my $pagename = $_[0];
+
+ my $exist=$mw->get_page({title => $pagename});
+
+ if (defined($exist->{'*'})){
+ $mw->edit({ action => 'delete',
+ title => $pagename})
+ || die $mw->{error}->{code} . ": " . $mw->{error}->{details};
+ }
+ else{
+ die "no page with such name found: $pagename\n";
+ }
+}
+
+# wiki_editpage <wiki_page> <wiki_content> <wiki_append>
+#
+# Edit a page named <wiki_page> with content <wiki_content> on the wiki
+# referenced with the global variable $mw
+# If <wiki_append> == true : append <wiki_content> at the end of the actual
+# content of the page <wiki_page>
+# If <wik_page> doesn't exist, that page is created with the <wiki_content>
+sub wiki_editpage {
+ my $wiki_page = $_[0];
+ my $wiki_content = $_[1];
+ my $wiki_append = $_[2];
+
+ my $append = 0;
+ if (defined($wiki_append) && $wiki_append eq 'true') {
+ $append=1;
+ }
+
+ my $previous_text ="";
+
+ if ($append) {
+ my $ref = $mw->get_page( { title => $wiki_page } );
+ $previous_text = $ref->{'*'};
+ }
+
+ my $text = $wiki_content;
+ if (defined($previous_text)) {
+ $text="$previous_text\n\n$text";
+ }
+ $mw->edit( { action => 'edit', title => $wiki_page, text => "$text"} );
+}
+
+# wiki_getallpagename
+#
+# Fetch all pages of the wiki referenced by the global variable $mw
+# and print the names of each one in the file all.txt with a new line
+# ("\n") between these.
+sub wiki_getallpagename {
+ # fetch the pages of the wiki
+ $mw->list ( { action => 'query',
+ list => 'allpages',
+ #cmtitle => "Category:Surnames",
+ #cmnamespace => 0,
+ cmlimit=> 500 },
+ { max => 4, hook => \&cat_names } )
+ || die $mw->{error}->{code}.": ".$mw->{error}->{details};
+
+ # print the name of each page
+ sub cat_names {
+ my ($ref) = @_;
+
+ open(my $file, ">all.txt");
+ foreach (@$ref) {
+ print $file "$_->{title}\n";
+ }
+ close ($file);
+ }
+}
+
+# Main part of this script: parse the command line arguments
+# and select which function to execute
+my $fct_to_call = shift;
+my $login = $ARGV[0];
+
+if ($login eq "-p")
+{
+ &wiki_login($wiki_admin,$wiki_admin_pass);
+ shift;
+}
+
+switch ($fct_to_call) {
+ case "get_page" { &wiki_getpage($ARGV[0], $ARGV[1])}
+ case "delete_page" { &wiki_delete_page($ARGV[0])}
+ case "edit_page" { &wiki_editpage($ARGV[0], $ARGV[1], $ARGV[2])}
+ case "getallpagename" { &wiki_getallpagename()}
+ else{ die("test-gitmw.pl ERROR: wrong argument")}
+}
+
--
1.7.10.2.552.gaa3bb87
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 3/3] Tests file for git-remote-mediawiki
2012-05-30 17:04 ` [PATCH 1/3] Script to install, delete and clear a MediaWiki Simon Cathebras
2012-05-30 17:04 ` [PATCH 2/3] Test environment of git-remote-mw Simon Cathebras
@ 2012-05-30 17:04 ` Simon Cathebras
2012-05-31 7:19 ` [PATCH 1/3] Script to install, delete and clear a MediaWiki Matthieu Moy
2 siblings, 0 replies; 22+ messages in thread
From: Simon Cathebras @ 2012-05-30 17:04 UTC (permalink / raw)
To: git
Cc: Matthieu.Moy, simon.cathebras, charles.roussel, Guillaume.Sasdy,
Julien.Khayat, Simon.Perrat, Charles Roussel, Julien Khayat,
Simon Perrat, Guillaume Sasdy
From: Charles Roussel <charles.roussel@ensimag.fr>
This file (will) contains all tests for git-remote-mediawiki.
For now, we have one test of git-clone on a wiki with one page.
Signed-off-by: Simon Cathebras <simon.cathebras@ensimag.imag.fr>
Signed-off-by: Charles Roussel <charles.roussel@ensimag.imag.fr>
Signed-off-by: Julien Khayat <julien.khayat@ensimag.imag.fr>
Signed-off-by: Simon Perrat <simon.perrat@ensimag.imag.fr>
Signed-off-by: Guillaume Sasdy <guillaume.sasdy@gmail.com>
---
t/t9360-git-mediawiki.sh | 49 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)
create mode 100755 t/t9360-git-mediawiki.sh
diff --git a/t/t9360-git-mediawiki.sh b/t/t9360-git-mediawiki.sh
new file mode 100755
index 0000000..8de56c5
--- /dev/null
+++ b/t/t9360-git-mediawiki.sh
@@ -0,0 +1,49 @@
+#!/bin/sh
+#
+# Copyright (C) 2012
+# Charles Roussel <charles.roussel@ensimag.imag.fr>
+# Simon Cathebras <simon.cathebras@ensimag.imag.fr>
+# Julien Khayat <julien.khayat@ensimag.imag.fr>
+# Guillaume Sasdy <guillaume.sasdy@ensimag.imag.fr>
+# Simon Perrat <simon.perrat@ensimag.imag.fr>
+# Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
+#
+# License: GPL v2 or later
+
+# tests for git-remote-mediawiki
+
+test_description='Test the Git Mediawiki remote helper'
+
+. ./test-gitmw-lib.sh
+. ./test-lib.sh
+
+if ! test_have_prereq PERL
+then
+ skip_all='skipping gateway git-mw tests, perl not available'
+ test_done
+fi
+
+if [ ! -f /$GIT_BUILD_DIR/git-remote-mediawiki ];
+then
+ skip_all='skipping gateway git-mw tests, no remote mediawiki for git found'
+ test_done
+fi
+
+if [ ! -d "$WIKI_DIR_INST/$WIKI_DIR_NAME" ] ;
+then
+ skip_all='skipping gateway git-mw tests, no mediawiki found'
+ test_done
+fi
+
+test_expect_success 'git clone works with page added' '
+ cmd_reset &&
+ wiki_editpage foo "hello_world" false &&
+ wiki_editpage bar "hi everybody !" false &&
+ git clone mediawiki::http://localhost/wiki mw_dir &&
+ wiki_getallpage ref_page &&
+ git_content mw_dir ref_page &&
+ wiki_delete_page foo &&
+ wiki_delete_page bar
+'
+
+test_done
--
1.7.10.2.552.gaa3bb87
^ permalink raw reply related [flat|nested] 22+ messages in thread
* Re: [PATCH 2/3] Test environment of git-remote-mw
2012-05-30 17:04 ` [PATCH 2/3] Test environment of git-remote-mw Simon Cathebras
@ 2012-05-31 7:17 ` Matthieu Moy
2012-06-01 8:53 ` Simon.Cathebras
0 siblings, 1 reply; 22+ messages in thread
From: Matthieu Moy @ 2012-05-31 7:17 UTC (permalink / raw)
To: Simon Cathebras
Cc: git, charles.roussel, Guillaume.Sasdy, Julien.Khayat,
Simon.Perrat, Charles Roussel, Guillaume Sasdy
Simon Cathebras <simon.cathebras@ensimag.imag.fr> writes:
> index 2deead7..8698625 100755
> --- a/t/test-gitmw-lib.sh
> +++ b/t/test-gitmw-lib.sh
> @@ -1,27 +1,136 @@
> +# Copyright (C) 2012
> +# Charles Roussel <charles.roussel@ensimag.imag.fr>
> +# Simon Cathebras <simon.cathebras@ensimag.imag.fr>
> +# Julien Khayat <julien.khayat@ensimag.imag.fr>
> +# Guillaume Sasdy <guillaume.sasdy@ensimag.imag.fr>
> +# Simon Perrat <simon.perrat@ensimag.imag.fr>
> +# Matthieu Moy <matthieu.moy@imag.fr>
> +# License: GPL v2 or later
> +
Why is this added by [PATCH 2/3]?
> -# You might want to change those ones ...
> +# You might want to change these ones
> #
> WIKI_DIR_NAME="wiki" # Name of the wiki's directory
> WIKI_DIR_INST="/var/www" # Directory of the web server
> TMP="/tmp" # Temporary directory for downloads
> - # Absolute address needed!
> + # Absolute path required!
> SERVER_ADDR="localhost" # Web server's address
>
> -#
> # CONFIGURATION
> -# You should not change those ones unless you know what you to
> +# You should not change these ones unless you know what you do
These fixups should have been squashed into the previous one. Bad use of
"git rebase -i"?
> + ../test-gitmw.pl "get_page" -p "$1" "$2"
Useless quotes around "get_page".
(but useful ones around $1 and $2 ;-))
> + result=$(diff -r -B -w --exclude=".git" "$1" "$2")
Doesn't seem to be in POSIX:
http://pubs.opengroup.org/onlinepubs/009695399/utilities/diff.html
Will this run on all platforms?
> +# wiki_page_content <file_name> <page_name>
> +#
> +# Compares the contents of the file <file_name> and the wiki page
> +# <page_name> and exits with error 1 if they do not match.
If it does a comparison, why isn't it named "check_content", or
"diff_content"?
> +# Usage:
> +# ./test-gitmw.pl <function> [argument]*
I'd say s/function/command/
> +my $wiki_url="http://localhost/wiki/api.php";
> +my $wiki_admin='WikiAdmin';
> +my $wiki_admin_pass='AdminPass';
It would be nice to allow overriding these from the command-line. But as
you are now writting tests, you may as well apply the YAGNI
principle ;-).
> + # Replace spaces by underscore in the page name
Indent with space.
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 1/3] Script to install, delete and clear a MediaWiki
2012-05-30 17:04 ` [PATCH 1/3] Script to install, delete and clear a MediaWiki Simon Cathebras
2012-05-30 17:04 ` [PATCH 2/3] Test environment of git-remote-mw Simon Cathebras
2012-05-30 17:04 ` [PATCH 3/3] Tests file for git-remote-mediawiki Simon Cathebras
@ 2012-05-31 7:19 ` Matthieu Moy
2 siblings, 0 replies; 22+ messages in thread
From: Matthieu Moy @ 2012-05-31 7:19 UTC (permalink / raw)
To: Simon Cathebras
Cc: git, charles.roussel, Guillaume.Sasdy, Julien.Khayat,
Simon.Perrat, Charles Roussel, Guillaume Sasdy
Simon Cathebras <simon.cathebras@ensimag.imag.fr> writes:
> install_wiki also defines a function cmd_reset
Why the "cmd_reset" name?
Wouldn't wiki_reset be both more descriptive and more consistent?
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 1/2] FIX: t9360. NEW test t9361 for git pull and git push
2012-05-30 16:30 [PATCH/RFC]Test environment for Git-MediaWiki Simon.Cathebras
2012-05-30 17:04 ` [PATCH 1/3] Script to install, delete and clear a MediaWiki Simon Cathebras
@ 2012-05-31 18:13 ` Guillaume Sasdy
2012-05-31 18:13 ` [PATCH 2/2] FIX: Syntax of shell and perl scripts and posix compliant Guillaume Sasdy
2012-05-31 18:16 ` [PATCH] " Guillaume Sasdy
` (3 subsequent siblings)
5 siblings, 1 reply; 22+ messages in thread
From: Guillaume Sasdy @ 2012-05-31 18:13 UTC (permalink / raw)
To: git
Cc: Matthieu.Moy, simon.cathebras, charles.roussel, Julien.Khayat,
Simon.Perrat, Guillaume Sasdy
t9360: change the description of the test. Test git clone
t9361: Test git pull (add page, edit page, delete page) and git push on simple test cases (add file, edit file, delete file).
---
t/t9360-git-mediawiki.sh | 4 +-
t/t9361-git-mediawiki.sh | 156 +++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 158 insertions(+), 2 deletions(-)
create mode 100755 t/t9361-git-mediawiki.sh
diff --git a/t/t9360-git-mediawiki.sh b/t/t9360-git-mediawiki.sh
index 8de56c5..57e05d8 100755
--- a/t/t9360-git-mediawiki.sh
+++ b/t/t9360-git-mediawiki.sh
@@ -12,7 +12,7 @@
# tests for git-remote-mediawiki
-test_description='Test the Git Mediawiki remote helper'
+test_description='Test the Git Mediawiki remote helper: git clone'
. ./test-gitmw-lib.sh
. ./test-lib.sh
@@ -36,7 +36,7 @@ then
fi
test_expect_success 'git clone works with page added' '
- cmd_reset &&
+ wiki_reset &&
wiki_editpage foo "hello_world" false &&
wiki_editpage bar "hi everybody !" false &&
git clone mediawiki::http://localhost/wiki mw_dir &&
diff --git a/t/t9361-git-mediawiki.sh b/t/t9361-git-mediawiki.sh
new file mode 100755
index 0000000..9dd7274
--- /dev/null
+++ b/t/t9361-git-mediawiki.sh
@@ -0,0 +1,156 @@
+#!/bin/sh
+#
+# Copyright (C) 2012
+# Charles Roussel <charles.roussel@ensimag.imag.fr>
+# Simon Cathebras <simon.cathebras@ensimag.imag.fr>
+# Julien Khayat <julien.khayat@ensimag.imag.fr>
+# Guillaume Sasdy <guillaume.sasdy@ensimag.imag.fr>
+# Simon Perrat <simon.perrat@ensimag.imag.fr>
+# Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
+#
+# License: GPL v2 or later
+
+# tests for git-remote-mediawiki
+
+test_description='Test the Git Mediawiki remote helper: git push and git pull simple test cases'
+
+. ./test-gitmw-lib.sh
+. ./test-lib.sh
+
+if ! test_have_prereq PERL
+then
+ skip_all='skipping gateway git-mw tests, perl not available'
+ test_done
+fi
+
+if [ ! -f /$GIT_BUILD_DIR/git-remote-mediawiki ];
+then
+ skip_all='skipping gateway git-mw tests, no remote mediawiki for git found'
+ test_done
+fi
+
+if [ ! -d "$WIKI_DIR_INST/$WIKI_DIR_NAME" ] ;
+then
+ skip_all='skipping gateway git-mw tests, no mediawiki found'
+ test_done
+fi
+
+# Create a new file foo.mw in a freshly cloned wiki. Commit and push
+# this file and then check that all files of the repository are similar to
+# the wiki pages.
+test_expect_success 'git push works after adding a file .mw' "
+ wiki_reset &&
+ git clone mediawiki::http://$SERVER_ADDR/$WIKI_DIR_NAME mw_dir &&
+ wiki_getallpage ref_page &&
+
+ cd mw_dir &&
+ test ! -f foo.mw && # foo.mw should not exist after wiki_reset &&
+ touch foo.mw &&
+ echo \"hello world\" >> foo.mw &&
+ git add foo.mw &&
+ git commit -m \"foo\" &&
+ git push &&
+ cd .. &&
+
+ rm -rf ref_page &&
+ wiki_getallpage ref_page &&
+ git_content mw_dir ref_page &&
+ rm -rf ref_page &&
+ rm -rf mw_dir
+"
+
+# Create a new page Foo in an empty wiki. Clone the wiki and edit
+# the file foo.mw corresponding to the page Foo. Commit and push
+# then check that all files of the repository are similar to the wiki
+# pages.
+test_expect_success 'git push works after editing a file .mw' "
+ # clone an empty wiki and add a Foo page
+ wiki_reset &&
+ wiki_editpage \"foo\" \"page just created before the git clone\" false &&
+ git clone mediawiki::http://$SERVER_ADDR/$WIKI_DIR_NAME mw_dir &&
+
+ cd mw_dir &&
+ echo \"new line added in the file foo.mw\" >> Foo.mw &&
+ git commit -am \"edit file foo.mw\" &&
+ git push &&
+ cd .. &&
+
+ rm -rf ref_page &&
+ wiki_getallpage ref_page &&
+ git_content mw_dir ref_page &&
+ rm -rf ref_page &&
+ rm -rf mw_dir
+"
+
+# Clone a wiki with a page Foo. Remove the corresponding file from the
+# repository. Check that the wiki page has been actually removed.
+test_expect_failure 'git push works after deleting a file' "
+ wiki_reset &&
+ wiki_editpage foo \"wiki page added before git clone\" false &&
+ git clone mediawiki::http://$SERVER_ADDR/$WIKI_DIR_NAME mw_dir &&
+
+ cd mw_dir &&
+ git rm Foo.mw &&
+ git commit -am \"git rm delete the wiki page Foo.mw\" &&
+ git push &&
+ cd .. &&
+
+ rm -rf mw_dir &&
+ test ! wiki_page_exist Foo
+"
+
+# Clone an empty wiki. Add a page on the wiki and pull. Check
+# all files of the repository are similar to the wiki pages.
+test_expect_success 'git pull works after adding a new wiki page' "
+ wiki_reset &&
+ git clone mediawiki::http://$SERVER_ADDR/$WIKI_DIR_NAME mw_dir &&
+ wiki_editpage foo \"page just created after the git clone\" false &&
+
+ cd mw_dir &&
+ git pull &&
+ cd .. &&
+
+ rm -rf ref_page &&
+ wiki_getallpage ref_page &&
+ git_content mw_dir ref_page &&
+ rm -rf ref_page &&
+ rm -rf mw_dir
+"
+
+# Clone a wiki with a page Foo. Edit the page foo on the wiki and pull.
+# Check that all files of the repository are similar to the wiki pages.
+test_expect_success 'git pull works after editing a wiki page' "
+ wiki_reset &&
+ wiki_editpage foo \"page just created before the git clone\" false &&
+ git clone mediawiki::http://$SERVER_ADDR/$WIKI_DIR_NAME mw_dir &&
+ wiki_editpage foo \"new line added on the wiki\" true &&
+
+ cd mw_dir &&
+ git pull &&
+ cd .. &&
+
+ rm -rf ref_page &&
+ wiki_getallpage ref_page &&
+ git_content mw_dir ref_page &&
+ rm -rf ref_page
+ rm -rf mw_dir
+"
+
+# Clone a wiki with a page Foo. Remove the wiki page and pull.
+# Check that the corresponding file in the repository has been actually removed.
+test_expect_failure 'git pull works after deleting a wiki page' "
+ wiki_reset &&
+ wiki_editpage foo \"wiki page added before git clone\" false &&
+ git clone mediawiki::http://$SERVER_ADDR/$WIKI_DIR_NAME mw_dir &&
+
+ cd mw_dir &&
+ wiki_delete_page foo
+ git pull &&
+ test ! -f Foo.mw &&
+ cd .. &&
+
+ rm -rf mw_dir
+"
+
+test_done
+
--
1.7.10.2.568.g4c26a3a
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 2/2] FIX: Syntax of shell and perl scripts and posix compliant
2012-05-31 18:13 ` [PATCH 1/2] FIX: t9360. NEW test t9361 for git pull and git push Guillaume Sasdy
@ 2012-05-31 18:13 ` Guillaume Sasdy
0 siblings, 0 replies; 22+ messages in thread
From: Guillaume Sasdy @ 2012-05-31 18:13 UTC (permalink / raw)
To: git
Cc: Matthieu.Moy, simon.cathebras, charles.roussel, Julien.Khayat,
Simon.Perrat
From: Simon Cathebras <simon.cathebras@ensimag.imag.fr>
t/test-gitmw.pl: no more '\n' in the append of wiki_editpage
t/test-gitmw-lib.sh: grep is now Posix compliant
t/test-gitmw-lib.sh: some " " were misplaced
---
t/test-gitmw-lib.sh | 17 ++++++++---------
t/test-gitmw.pl | 4 ++--
2 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/t/test-gitmw-lib.sh b/t/test-gitmw-lib.sh
index b89b45a..d7c7459 100755
--- a/t/test-gitmw-lib.sh
+++ b/t/test-gitmw-lib.sh
@@ -31,14 +31,14 @@ WIKI_PASSW="AdminPass"
# Fetch a page <page_name> from the wiki and copy its content
# into directory <dest_path>.
wiki_getpage () {
- ../test-gitmw.pl "get_page" -p "$1" "$2"
+ ../test-gitmw.pl get_page -p "$1" "$2"
}
# wiki_delete_page <page_name>
#
# Delete the page <page_name> on the wiki.
wiki_delete_page () {
- ../test-gitmw.pl "delete_page" -p "$1"
+ ../test-gitmw.pl delete_page -p "$1"
}
# wiki_edit_page <page_name> <page_content> <page_append>
@@ -47,7 +47,7 @@ wiki_delete_page () {
# If <wiki_append> == true the content will be appended
# If the page doesn't exist, it is created.
wiki_editpage () {
- ../test-gitmw.pl "edit_page" -p "$1" "$2" "$3"
+ ../test-gitmw.pl edit_page -p "$1" "$2" "$3"
}
# git_content <dir_1> <dir_2>
@@ -56,7 +56,7 @@ wiki_editpage () {
# and exits with error 1 if they do not match. The program will
# not look into .git in the process.
git_content () {
- result=$(diff -r -B -w --exclude=".git" "$1" "$2")
+ result=$(diff -r -b --exclude=".git" "$1" "$2")
if echo $result | grep -q ">" ; then
echo "test failed: files $1 and $2 do not match"
@@ -77,11 +77,11 @@ git_exist () {
fi
}
-# wiki_page_content <file_name> <page_name>
+# wiki_check_content <file_name> <page_name>
#
# Compares the contents of the file <file_name> and the wiki page
# <page_name> and exits with error 1 if they do not match.
-wiki_page_content () {
+wiki_check_content () {
wiki_getpage "$2" .
if test -f "$2".mw ; then
@@ -120,16 +120,15 @@ wiki_getallpagename () {
# <dest_dir>.
wiki_getallpage () {
wiki_getallpagename
- mkdir $1
+ mkdir -p "$1"
while read -r line; do
wiki_getpage "$line" $1;
done < all.txt
- #rm all.txt
}
fail()
{
- echo $1
+ echo "$1"
exit 1
}
diff --git a/t/test-gitmw.pl b/t/test-gitmw.pl
index e9c50f9..bf71485 100755
--- a/t/test-gitmw.pl
+++ b/t/test-gitmw.pl
@@ -9,7 +9,7 @@
# License: GPL v2 or later
# Usage:
-# ./test-gitmw.pl <function> [argument]*
+# ./test-gitmw.pl <command> [argument]*
# Execute in terminal using the name of the function to call as first
# parameter, and the function's arguments as following parameters
#
@@ -111,7 +111,7 @@ sub wiki_editpage {
my $text = $wiki_content;
if (defined($previous_text)) {
- $text="$previous_text\n\n$text";
+ $text="$previous_text$text";
}
$mw->edit( { action => 'edit', title => $wiki_page, text => "$text"} );
}
--
1.7.10.2.568.g4c26a3a
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH] FIX: Syntax of shell and perl scripts and posix compliant
2012-05-30 16:30 [PATCH/RFC]Test environment for Git-MediaWiki Simon.Cathebras
2012-05-30 17:04 ` [PATCH 1/3] Script to install, delete and clear a MediaWiki Simon Cathebras
2012-05-31 18:13 ` [PATCH 1/2] FIX: t9360. NEW test t9361 for git pull and git push Guillaume Sasdy
@ 2012-05-31 18:16 ` Guillaume Sasdy
2012-05-31 18:27 ` Guillaume Sasdy
` (2 subsequent siblings)
5 siblings, 0 replies; 22+ messages in thread
From: Guillaume Sasdy @ 2012-05-31 18:16 UTC (permalink / raw)
To: git
Cc: Matthieu.Moy, simon.cathebras, charles.roussel, Julien.Khayat,
Simon.Perrat
From: Simon Cathebras <simon.cathebras@ensimag.imag.fr>
t/test-gitmw.pl: no more '\n' in the append of wiki_editpage
t/test-gitmw-lib.sh: grep is now Posix compliant
t/test-gitmw-lib.sh: some " " were misplaced
---
t/test-gitmw-lib.sh | 17 ++++++++---------
t/test-gitmw.pl | 4 ++--
2 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/t/test-gitmw-lib.sh b/t/test-gitmw-lib.sh
index b89b45a..d7c7459 100755
--- a/t/test-gitmw-lib.sh
+++ b/t/test-gitmw-lib.sh
@@ -31,14 +31,14 @@ WIKI_PASSW="AdminPass"
# Fetch a page <page_name> from the wiki and copy its content
# into directory <dest_path>.
wiki_getpage () {
- ../test-gitmw.pl "get_page" -p "$1" "$2"
+ ../test-gitmw.pl get_page -p "$1" "$2"
}
# wiki_delete_page <page_name>
#
# Delete the page <page_name> on the wiki.
wiki_delete_page () {
- ../test-gitmw.pl "delete_page" -p "$1"
+ ../test-gitmw.pl delete_page -p "$1"
}
# wiki_edit_page <page_name> <page_content> <page_append>
@@ -47,7 +47,7 @@ wiki_delete_page () {
# If <wiki_append> == true the content will be appended
# If the page doesn't exist, it is created.
wiki_editpage () {
- ../test-gitmw.pl "edit_page" -p "$1" "$2" "$3"
+ ../test-gitmw.pl edit_page -p "$1" "$2" "$3"
}
# git_content <dir_1> <dir_2>
@@ -56,7 +56,7 @@ wiki_editpage () {
# and exits with error 1 if they do not match. The program will
# not look into .git in the process.
git_content () {
- result=$(diff -r -B -w --exclude=".git" "$1" "$2")
+ result=$(diff -r -b --exclude=".git" "$1" "$2")
if echo $result | grep -q ">" ; then
echo "test failed: files $1 and $2 do not match"
@@ -77,11 +77,11 @@ git_exist () {
fi
}
-# wiki_page_content <file_name> <page_name>
+# wiki_check_content <file_name> <page_name>
#
# Compares the contents of the file <file_name> and the wiki page
# <page_name> and exits with error 1 if they do not match.
-wiki_page_content () {
+wiki_check_content () {
wiki_getpage "$2" .
if test -f "$2".mw ; then
@@ -120,16 +120,15 @@ wiki_getallpagename () {
# <dest_dir>.
wiki_getallpage () {
wiki_getallpagename
- mkdir $1
+ mkdir -p "$1"
while read -r line; do
wiki_getpage "$line" $1;
done < all.txt
- #rm all.txt
}
fail()
{
- echo $1
+ echo "$1"
exit 1
}
diff --git a/t/test-gitmw.pl b/t/test-gitmw.pl
index e9c50f9..bf71485 100755
--- a/t/test-gitmw.pl
+++ b/t/test-gitmw.pl
@@ -9,7 +9,7 @@
# License: GPL v2 or later
# Usage:
-# ./test-gitmw.pl <function> [argument]*
+# ./test-gitmw.pl <command> [argument]*
# Execute in terminal using the name of the function to call as first
# parameter, and the function's arguments as following parameters
#
@@ -111,7 +111,7 @@ sub wiki_editpage {
my $text = $wiki_content;
if (defined($previous_text)) {
- $text="$previous_text\n\n$text";
+ $text="$previous_text$text";
}
$mw->edit( { action => 'edit', title => $wiki_page, text => "$text"} );
}
--
1.7.10.2.568.g4c26a3a
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH] FIX: Syntax of shell and perl scripts and posix compliant
2012-05-30 16:30 [PATCH/RFC]Test environment for Git-MediaWiki Simon.Cathebras
` (2 preceding siblings ...)
2012-05-31 18:16 ` [PATCH] " Guillaume Sasdy
@ 2012-05-31 18:27 ` Guillaume Sasdy
2012-05-31 18:31 ` [PATCH 1/3] FIX: cmd_* moved to wiki_* in test-gitmw-lib.sh and other files Guillaume Sasdy
2012-06-01 10:41 ` [PATCH 1/3] Script to install, delete and clear a MediaWiki Guillaume Sasdy
5 siblings, 0 replies; 22+ messages in thread
From: Guillaume Sasdy @ 2012-05-31 18:27 UTC (permalink / raw)
To: git
Cc: Matthieu.Moy, simon.cathebras, charles.roussel, Julien.Khayat,
Simon.Perrat
From: Simon Cathebras <simon.cathebras@ensimag.imag.fr>
t/test-gitmw.pl: no more '\n' in the append of wiki_editpage
t/test-gitmw-lib.sh: grep is now Posix compliant
t/test-gitmw-lib.sh: some " " were misplaced
---
t/test-gitmw-lib.sh | 17 ++++++++---------
t/test-gitmw.pl | 4 ++--
2 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/t/test-gitmw-lib.sh b/t/test-gitmw-lib.sh
index b89b45a..d7c7459 100755
--- a/t/test-gitmw-lib.sh
+++ b/t/test-gitmw-lib.sh
@@ -31,14 +31,14 @@ WIKI_PASSW="AdminPass"
# Fetch a page <page_name> from the wiki and copy its content
# into directory <dest_path>.
wiki_getpage () {
- ../test-gitmw.pl "get_page" -p "$1" "$2"
+ ../test-gitmw.pl get_page -p "$1" "$2"
}
# wiki_delete_page <page_name>
#
# Delete the page <page_name> on the wiki.
wiki_delete_page () {
- ../test-gitmw.pl "delete_page" -p "$1"
+ ../test-gitmw.pl delete_page -p "$1"
}
# wiki_edit_page <page_name> <page_content> <page_append>
@@ -47,7 +47,7 @@ wiki_delete_page () {
# If <wiki_append> == true the content will be appended
# If the page doesn't exist, it is created.
wiki_editpage () {
- ../test-gitmw.pl "edit_page" -p "$1" "$2" "$3"
+ ../test-gitmw.pl edit_page -p "$1" "$2" "$3"
}
# git_content <dir_1> <dir_2>
@@ -56,7 +56,7 @@ wiki_editpage () {
# and exits with error 1 if they do not match. The program will
# not look into .git in the process.
git_content () {
- result=$(diff -r -B -w --exclude=".git" "$1" "$2")
+ result=$(diff -r -b --exclude=".git" "$1" "$2")
if echo $result | grep -q ">" ; then
echo "test failed: files $1 and $2 do not match"
@@ -77,11 +77,11 @@ git_exist () {
fi
}
-# wiki_page_content <file_name> <page_name>
+# wiki_check_content <file_name> <page_name>
#
# Compares the contents of the file <file_name> and the wiki page
# <page_name> and exits with error 1 if they do not match.
-wiki_page_content () {
+wiki_check_content () {
wiki_getpage "$2" .
if test -f "$2".mw ; then
@@ -120,16 +120,15 @@ wiki_getallpagename () {
# <dest_dir>.
wiki_getallpage () {
wiki_getallpagename
- mkdir $1
+ mkdir -p "$1"
while read -r line; do
wiki_getpage "$line" $1;
done < all.txt
- #rm all.txt
}
fail()
{
- echo $1
+ echo "$1"
exit 1
}
diff --git a/t/test-gitmw.pl b/t/test-gitmw.pl
index e9c50f9..bf71485 100755
--- a/t/test-gitmw.pl
+++ b/t/test-gitmw.pl
@@ -9,7 +9,7 @@
# License: GPL v2 or later
# Usage:
-# ./test-gitmw.pl <function> [argument]*
+# ./test-gitmw.pl <command> [argument]*
# Execute in terminal using the name of the function to call as first
# parameter, and the function's arguments as following parameters
#
@@ -111,7 +111,7 @@ sub wiki_editpage {
my $text = $wiki_content;
if (defined($previous_text)) {
- $text="$previous_text\n\n$text";
+ $text="$previous_text$text";
}
$mw->edit( { action => 'edit', title => $wiki_page, text => "$text"} );
}
--
1.7.10.2.568.g4c26a3a
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 1/3] FIX: cmd_* moved to wiki_* in test-gitmw-lib.sh and other files
2012-05-30 16:30 [PATCH/RFC]Test environment for Git-MediaWiki Simon.Cathebras
` (3 preceding siblings ...)
2012-05-31 18:27 ` Guillaume Sasdy
@ 2012-05-31 18:31 ` Guillaume Sasdy
2012-06-01 10:41 ` [PATCH 1/3] Script to install, delete and clear a MediaWiki Guillaume Sasdy
5 siblings, 0 replies; 22+ messages in thread
From: Guillaume Sasdy @ 2012-05-31 18:31 UTC (permalink / raw)
To: git
Cc: Matthieu.Moy, simon.cathebras, charles.roussel, Julien.Khayat,
Simon.Perrat
From: Simon Cathebras <simon.cathebras@ensimag.imag.fr>
Function cmd_* has been renamed in wiki_* in t/install-wiki.sh.
Change the calls in t/test-gitmw-lib.sh
---
t/install-wiki.sh | 4 ++--
t/test-gitmw-lib.sh | 10 +++++-----
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/t/install-wiki.sh b/t/install-wiki.sh
index 725346e..322f46d 100755
--- a/t/install-wiki.sh
+++ b/t/install-wiki.sh
@@ -19,11 +19,11 @@ usage () {
# Argument: install, delete, --help | -h
case "$1" in
"install")
- cmd_install
+ wiki_install
exit 0
;;
"delete")
- cmd_delete
+ wiki_delete
exit 0
;;
"--help" | "-h")
diff --git a/t/test-gitmw-lib.sh b/t/test-gitmw-lib.sh
index 8698625..b89b45a 100755
--- a/t/test-gitmw-lib.sh
+++ b/t/test-gitmw-lib.sh
@@ -136,7 +136,7 @@ fail()
# Install a wiki in your web server directory.
-cmd_install () {
+wiki_install () {
# Copy the generic LocalSettings.php in the web server's directory
# And modify parameters according to the ones set at the top
@@ -206,7 +206,7 @@ cmd_install () {
# Argument $1 is the relative path to the folder $FILES_FOLDER
#
# Warning: This function should be not called by user. This is a private
-# function used by cmd_install and cmd_delete
+# function used by wiki_install and wiki_delete
reset_db_wiki () {
# Copy initial database of the wiki
@@ -221,7 +221,7 @@ reset_db_wiki () {
# Set the admin WikiAdmin with password AdminPass in the database.
#
# Warning: This function should be not called by user. This is a private
-# function used by cmd_install and cmd_delete
+# function used by wiki_install and wiki_delete
set_admin_wiki () {
#Add the admin
@@ -237,14 +237,14 @@ set_admin_wiki () {
# Reset the database of the wiki and the password of the admin
#
# Warning: This function must be called only in a subdirectory of t/ directory
-cmd_reset () {
+wiki_reset () {
reset_db_wiki ".."
set_admin_wiki
}
# Delete the wiki created in the web server's directory and all its content
# saved in the database.
-cmd_delete () {
+wiki_delete () {
# Delete the wiki's directory.
rm -rf "$WIKI_DIR_INST/$WIKI_DIR_NAME" ||
fail "Wiki's directory $WIKI_DIR_INST/" \
--
1.7.10.2.568.g4c26a3a
^ permalink raw reply related [flat|nested] 22+ messages in thread
* Re: [PATCH 2/3] Test environment of git-remote-mw
2012-05-31 7:17 ` Matthieu Moy
@ 2012-06-01 8:53 ` Simon.Cathebras
2012-06-01 9:02 ` Matthieu Moy
0 siblings, 1 reply; 22+ messages in thread
From: Simon.Cathebras @ 2012-06-01 8:53 UTC (permalink / raw)
To: Matthieu Moy
Cc: git, charles.roussel, Guillaume.Sasdy, Julien.Khayat,
Simon.Perrat, Charles Roussel, Guillaume Sasdy
On 31/05/2012 09:17, Matthieu Moy wrote:
>
>> + result=$(diff -r -B -w --exclude=".git" "$1" "$2")
> Doesn't seem to be in POSIX:
>
> http://pubs.opengroup.org/onlinepubs/009695399/utilities/diff.html
>
> Will this run on all platforms?
>
Indeed. According to the POSIX manual, the option -B and -w are merged
in the single option -b.
In addition, -r option still exists (to compare recursively two
directories).
The previous instruction will be write as follow :
diff -r -b "$first_folder" "$second_folder"
With this fix, it will works on all platforms. ;)
>> +my $wiki_url="http://localhost/wiki/api.php";
>> +my $wiki_admin='WikiAdmin';
>> +my $wiki_admin_pass='AdminPass';
> It would be nice to allow overriding these from the command-line. But as
> you are now writting tests, you may as well apply the YAGNI
> principle ;-).
Does it seems important for you to overriding these from CL ?
By default, those settings work fine. You have to edit this only if you
need a special configuration. But it is purely optionnal.
Included in v2 patches:
* Fixing errors pointed above.
* Sqlite file excluded from the patches. Mainly with reviewing the
wiki_install script.
On the other hand, considering the git-mediawiki is curently on contrib
branch, shall we move our test environement from git/t to git/contrib/t ?
SimonC
--
CATHEBRAS Simon
2A-ENSIMAG
Filière Ingéniérie des Systèmes d'Information
Membre Bug-Buster
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 2/3] Test environment of git-remote-mw
2012-06-01 8:53 ` Simon.Cathebras
@ 2012-06-01 9:02 ` Matthieu Moy
2012-06-01 9:21 ` Matthieu Moy
0 siblings, 1 reply; 22+ messages in thread
From: Matthieu Moy @ 2012-06-01 9:02 UTC (permalink / raw)
To: Simon.Cathebras
Cc: git, charles.roussel, Guillaume.Sasdy, Julien.Khayat,
Simon.Perrat, Charles Roussel, Guillaume Sasdy
"Simon.Cathebras" <Simon.Cathebras@ensimag.imag.fr> writes:
> On the other hand, considering the git-mediawiki is curently on
> contrib branch, shall we move our test environement from git/t to
> git/contrib/t ?
If so, that would be to $git/contrib/mw-to-git/t/.
I'm not sur what's best, depending on the future of the tool:
If, once Git-MediaWiki is robust, well-tested, ... and enough people are
interested, it may make sense to move Git-MediaWiki out of the contrib/
directory, and integrate it as an official command (like git-svn for
example). That would make the installation process seamless ("make
install" would install git-remote-mediawiki like other commands, "make
doc" would generate the doc, and so on), which would be nice for the
user.
My feeling is that we're still quite far from this. Although we're in
the process of having a well-tested program, and that new features are
going to come soon, there is still little interest of the community for
it (at least, uncomparable to the one of git-svn for example).
So, I'd say that we should stick to something non-intrusive, within
contrib/, and if more people show interest in the tool and if it becomes
mature enough, we can start trying to push it out of contrib/.
What do other people think?
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 2/3] Test environment of git-remote-mw
2012-06-01 9:02 ` Matthieu Moy
@ 2012-06-01 9:21 ` Matthieu Moy
0 siblings, 0 replies; 22+ messages in thread
From: Matthieu Moy @ 2012-06-01 9:21 UTC (permalink / raw)
To: Simon.Cathebras
Cc: git, charles.roussel, Guillaume.Sasdy, Julien.Khayat,
Simon.Perrat, Charles Roussel, Guillaume Sasdy
Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
> "Simon.Cathebras" <Simon.Cathebras@ensimag.imag.fr> writes:
>
>> On the other hand, considering the git-mediawiki is curently on
>> contrib branch, shall we move our test environement from git/t to
>> git/contrib/t ?
>
> If so, that would be to $git/contrib/mw-to-git/t/.
>
> I'm not sur what's best, depending on the future of the tool:
>
> If, once Git-MediaWiki is robust, well-tested, ... and enough people are
> interested, it may make sense to move Git-MediaWiki out of the contrib/
> directory, and integrate it as an official command (like git-svn for
> example). That would make the installation process seamless ("make
> install" would install git-remote-mediawiki like other commands, "make
> doc" would generate the doc, and so on), which would be nice for the
> user.
Here's another attempt to be nice to the user, without getting out of
the contrib/ directory. I suggest that you include it in your patch
serie, and build your stuff on top of it.
--------------- 8< ----------------- 8< ------------------------
From 25187a652abc0b546be2fb1afb707b32b9f1d4fc Mon Sep 17 00:00:00 2001
From: Matthieu Moy <Matthieu.Moy@imag.fr>
Date: Fri, 1 Jun 2012 11:18:20 +0200
Subject: [PATCH] git-remote-mediawiki: simple Makefile for simple
installation
This allows the user to run "make check" to install the script in Git's
exec path, following the configuration (manual in config.mak, or through
autoconf).
---
contrib/mw-to-git/Makefile | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
create mode 100644 contrib/mw-to-git/Makefile
diff --git a/contrib/mw-to-git/Makefile b/contrib/mw-to-git/Makefile
new file mode 100644
index 0000000..99b7caa
--- /dev/null
+++ b/contrib/mw-to-git/Makefile
@@ -0,0 +1,29 @@
+-include ../../config.mak
+-include ../../config.mak.autogen
+
+ifndef PERL_PATH
+ PERL_PATH = /usr/bin/perl
+endif
+
+PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH))
+gitexecdir_SQ = $(subst ','\'',$(gitexecdir))
+
+SCRIPT=git-remote-mediawiki
+
+.PHONY: install help doc test
+help:
+ @echo 'This is the help target of the Makefile. Current configuration:'
+ @echo ' gitexecdir = $(gitexecdir_SQ)'
+ @echo ' PERL_PATH = $(PERL_PATH_SQ)'
+ @echo 'Run "$(MAKE) install" to install $(SCRIPT) in gitexecdir.'
+
+install:
+ sed -e '1s|#!.*/perl|#!$(PERL_PATH_SQ)|' $(SCRIPT) \
+ > '$(gitexecdir_SQ)/$(SCRIPT)'
+ chmod 755 '$(gitexecdir)/$(SCRIPT)'
+
+doc:
+ @echo 'Sorry, "make doc" is not implemented yet for $(SCRIPT)'
+
+test:
+ @echo 'Sorry, "make test" is not implemented yet for $(SCRIPT)'
--
1.7.10.2.817.g37218b0
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 1/3] Script to install, delete and clear a MediaWiki
2012-05-30 16:30 [PATCH/RFC]Test environment for Git-MediaWiki Simon.Cathebras
` (4 preceding siblings ...)
2012-05-31 18:31 ` [PATCH 1/3] FIX: cmd_* moved to wiki_* in test-gitmw-lib.sh and other files Guillaume Sasdy
@ 2012-06-01 10:41 ` Guillaume Sasdy
2012-06-01 10:41 ` [PATCH 2/3] Test environment of git-remote-mw Guillaume Sasdy
2012-06-01 10:41 ` [PATCH 3/3] Tests file for git-remote-mediawiki Guillaume Sasdy
5 siblings, 2 replies; 22+ messages in thread
From: Guillaume Sasdy @ 2012-06-01 10:41 UTC (permalink / raw)
To: git
Cc: Matthieu.Moy, Charles Roussel, Guillaume Sasdy, Simon Cathebras,
Simon Perrat, Charles Roussel, Julien Khayat
From: Charles Roussel <charles.roussel@ensimag.fr>
install_wiki.sh expects the first argument to be 'install' or 'delete'
'install' installs a MediaWiki on the web's server with SQLite3
'delete' deletes the previously created wiki.
Note those functionnalities are made to be used from the user command line in
the directory t/
install_wiki also defines a function cmd_reset which clear all content
of the previously created wiki. Note this functionnality is made to be
used only by our test function in a subdirectory of t/
Signed-off-by: Guillaume Sasdy <guillaume.sasdy@ensimag.imag.fr>
Signed-off-by: Simon Cathebras <Simon.Cathebras@ensimag.imag.fr>
Signed-off-by: Simon Perrat <Simon.Perrat@ensimag.imag.fr>
Signed-off-by: Charles Roussel <Charles.Roussel@ensimag.imag.fr>
Signed-off-by: Julien Khayat <Julien.Khayat@ensimag.imag.fr>
---
t/install-wiki.sh | 38 ++++++++++
t/install-wiki/LocalSettings.php | 129 ++++++++++++++++++++++++++++++++++
t/install-wiki/wikidb.sqlite | Bin 0 -> 210944 bytes
t/test-gitmw-lib.sh | 147 +++++++++++++++++++++++++++++++++++++++
4 files changed, 314 insertions(+)
create mode 100755 t/install-wiki.sh
create mode 100644 t/install-wiki/LocalSettings.php
create mode 100644 t/install-wiki/wikidb.sqlite
create mode 100755 t/test-gitmw-lib.sh
mode change 100644 => 100755 t/test-lib-functions.sh
mode change 100644 => 100755 t/test-lib.sh
diff --git a/t/install-wiki.sh b/t/install-wiki.sh
new file mode 100755
index 0000000..322f46d
--- /dev/null
+++ b/t/install-wiki.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+# This script installs or deletes a MediaWiki on your computer.
+# It requires a web server with PHP and SQLite running. In addition, if you
+# do not have MediaWiki sources on your computer, the option 'install'
+# downloads them for you.
+# Please set the CONFIGURATION VARIABLES in ./test-gitmw-lib.sh
+
+. ./test-gitmw-lib.sh
+
+usage () {
+ echo "Usage: "
+ echo " ./install-wiki.sh <install|delete|--help|-h>"
+ echo " install: Install a wiki on your computer."
+ echo " delete: Delete the wiki and all its pages and content"
+}
+
+
+# Argument: install, delete, --help | -h
+case "$1" in
+ "install")
+ wiki_install
+ exit 0
+ ;;
+ "delete")
+ wiki_delete
+ exit 0
+ ;;
+ "--help" | "-h")
+ usage
+ exit 0
+ ;;
+ *)
+ usage
+ exit 0
+ ;;
+esac
+
diff --git a/t/install-wiki/LocalSettings.php b/t/install-wiki/LocalSettings.php
new file mode 100644
index 0000000..c2fe3d5
--- /dev/null
+++ b/t/install-wiki/LocalSettings.php
@@ -0,0 +1,129 @@
+<?php
+# This file was automatically generated by the MediaWiki 1.19.0
+# installer. If you make manual changes, please keep track in case you
+# need to recreate them later.
+#
+# See includes/DefaultSettings.php for all configurable settings
+# and their default values, but don't forget to make changes in _this_
+# file, not there.
+#
+# Further documentation for configuration settings may be found at:
+# http://www.mediawiki.org/wiki/Manual:Configuration_settings
+
+# Protect against web entry
+if ( !defined( 'MEDIAWIKI' ) ) {
+ exit;
+}
+
+## Uncomment this to disable output compression
+# $wgDisableOutputCompression = true;
+
+$wgSitename = "Git-MediaWiki-Test";
+$wgMetaNamespace = "Git-MediaWiki-Test";
+
+## The URL base path to the directory containing the wiki;
+## defaults for all runtime URL paths are based off of this.
+## For more information on customizing the URLs please see:
+## http://www.mediawiki.org/wiki/Manual:Short_URL
+$wgScriptPath = "@WG_SCRIPT_PATH@";
+$wgScriptExtension = ".php";
+
+## The protocol and server name to use in fully-qualified URLs
+$wgServer = "@WG_SERVER@";
+
+## The relative URL path to the skins directory
+$wgStylePath = "$wgScriptPath/skins";
+
+## The relative URL path to the logo. Make sure you change this from the default,
+## or else you'll overwrite your logo when you upgrade!
+$wgLogo = "$wgStylePath/common/images/wiki.png";
+
+## UPO means: this is also a user preference option
+
+$wgEnableEmail = true;
+$wgEnableUserEmail = true; # UPO
+
+$wgEmergencyContact = "apache@localhost";
+$wgPasswordSender = "apache@localhost";
+
+$wgEnotifUserTalk = false; # UPO
+$wgEnotifWatchlist = false; # UPO
+$wgEmailAuthentication = true;
+
+## Database settings
+$wgDBtype = "sqlite";
+$wgDBserver = "";
+$wgDBname = "wikidb";
+$wgDBuser = "";
+$wgDBpassword = "";
+
+# SQLite-specific settings
+$wgSQLiteDataDir = "@WG_SQLITE_DATADIR@";
+
+
+## Shared memory settings
+$wgMainCacheType = CACHE_NONE;
+$wgMemCachedServers = array();
+
+## To enable image uploads, make sure the 'images' directory
+## is writable, then set this to true:
+$wgEnableUploads = false;
+$wgUseImageMagick = true;
+$wgImageMagickConvertCommand ="@CONVERT@";
+
+# InstantCommons allows wiki to use images from http://commons.wikimedia.org
+$wgUseInstantCommons = false;
+
+## If you use ImageMagick (or any other shell command) on a
+## Linux server, this will need to be set to the name of an
+## available UTF-8 locale
+$wgShellLocale = "en_US.utf8";
+
+## If you want to use image uploads under safe mode,
+## create the directories images/archive, images/thumb and
+## images/temp, and make them all writable. Then uncomment
+## this, if it's not already uncommented:
+#$wgHashedUploadDirectory = false;
+
+## Set $wgCacheDirectory to a writable directory on the web server
+## to make your wiki go slightly faster. The directory should not
+## be publically accessible from the web.
+#$wgCacheDirectory = "$IP/cache";
+
+# Site language code, should be one of the list in ./languages/Names.php
+$wgLanguageCode = "en";
+
+$wgSecretKey = "1c912bfe3519fb70f5dc523ecc698111cd43d81a11c585b3eefb28f29c2699b7";
+#$wgSecretKey = "@SECRETKEY@";
+
+
+# Site upgrade key. Must be set to a string (default provided) to turn on the
+# web installer while LocalSettings.php is in place
+$wgUpgradeKey = "ddae7dc87cd0a645";
+
+## Default skin: you can change the default skin. Use the internal symbolic
+## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook', 'vector':
+$wgDefaultSkin = "vector";
+
+## For attaching licensing metadata to pages, and displaying an
+## appropriate copyright notice / icon. GNU Free Documentation
+## License and Creative Commons licenses are supported so far.
+$wgRightsPage = ""; # Set to the title of a wiki page that describes your license/copyright
+$wgRightsUrl = "";
+$wgRightsText = "";
+$wgRightsIcon = "";
+
+# Path to the GNU diff3 utility. Used for conflict resolution.
+$wgDiff3 = "/usr/bin/diff3";
+
+# Query string length limit for ResourceLoader. You should only set this if
+# your web server has a query string length limit (then set it to that limit),
+# or if you have suhosin.get.max_value_length set in php.ini (then set it to
+# that value)
+$wgResourceLoaderMaxQueryLength = -1;
+
+
+
+# End of automatically generated settings.
+# Add more configuration options below.
+
diff --git a/t/install-wiki/wikidb.sqlite b/t/install-wiki/wikidb.sqlite
new file mode 100644
index 0000000000000000000000000000000000000000..809047334bf15891de943b480171beb2558f7cb8
GIT binary patch
literal 210944
zcmeHQ34k0$)$U_=I|m^NAq-(zb~Z~gJIUUg8)D8)SaK(ugd~Kaccyo@voq6^>7MLv
zA_<cKK{4P39w6WWB8ngg3jBh2;EgEyiwgcK9;hIPKOW#O|9e%{J>7HcAu-2nO(wJ5
zRj=Nw_tnu=^<GzP+OS%;G=Ha&jH#BtMJN$OQCRHv3xZ(5|0m$T{rMzZi1tm^wJX?j
zX$f_|t}2C~a@oX)ugP!7f0bX6Uyy$<|5|=lep-G?enS41{5APe`62m!`5yVx^6m0R
z<(uRW$nTM_k*|~w$o({_hcCb32%N+S{8xG!<o>?&Iq-XD`V9E}c=}ZM{YZKg{N9k3
z;rGa8@N+l?KL--<)2qWzyaRqZx4}<GJN)e206$yTz|Z;%;Aizx_*t<CeiqJ$pV>|D
zQ#S*Crkx8v{tEaxYYO~KIvsw-puACK<KS16;{ts7ha<od_>Urx9xsj;D#vN#gkTVx
zZBX2*_vlL^F+ILu>4N#;xh)ZGUdMvQc};UW)mgJ=&zl!%Y?(c`bJncLtmav2OXJ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a!od1t^Uwb(E%5NTf
zE&kCvuYdW=?|#SaUrGPtu?O$_##x_#-}uXqtUK>uUDK!5zdWaJ>0|r;?_a0><4B({
z=8^M4S5IC2fzW;X`o@H})b~|<?cy80xa_~re=+dVfy?$a9en9MoiDt8XXjVXt(gAY
zujVbBa^$^NY`Ei|_g$M<vUALrb|p?}xb2bNA1r_Qiban;`N+~|gSUU7dCStR?|E{|
z`!0Dbe*Z^aexmWYzclqPeEE!bZU4$cuc|BeZ`d=da{cZNAN|Ik|L{NS|K2v^i=ukX
zYpFH0dtQ70_qY8#efOwqyC+{a;WvwR?wj<jO{>Fi|Js``UiyV|Ry_CU-xh!TC+93W
z=apN|x&D{$yyMn~e=kkC_Y-ek65D-#{DJdkf4H`<S&u!j`^N`Xw!Zdo^DTeaa__o*
zKQy0t)OXIE*B+Sh)OX*1<lt9-9ldStmDk_@(jQkC3*P*^F=zkg?<L~n&pP<Cu6@71
zx%{a$6Th?bvWZ)a@BHBU2R>A)fBTkcol_^gVqX5@nvecc{87*Nm+!dj@k`G?>xY5g
zP5kqXH+=5U8@E*m&$f@f=dNvM#dfys{7QK1Red-7cl*t^f2yUe_u;mw2laP+@VBS!
zn|b+ybK>%-ou4_fP<UnUi)${~^IY<(-mV*8z3V~c+xsSN9J{9R3%8g3>2GB>eI|bQ
zy6+oZANb8VRWIE7%cs9ku6<$QUwvcS4qyG^&cA)*$@8MiR_}|yzxL(@r>^|gTxHQ!
z|Fd}g{+6dp{;=+zdMk2kbH&-?uf1gVM}9ct+{B{CCvTs2(^oI6{nX*RFSxMhs<O&$
ly+670rgvOl`@oC;_o}bCv8lOncJrL3`7JGtjkz7${{ubzcYgo?
literal 0
HcmV?d00001
diff --git a/t/test-gitmw-lib.sh b/t/test-gitmw-lib.sh
new file mode 100755
index 0000000..b1023d7
--- /dev/null
+++ b/t/test-gitmw-lib.sh
@@ -0,0 +1,147 @@
+#
+# CONFIGURATION VARIABLES
+# You might want to change those ones ...
+#
+WIKI_DIR_NAME="wiki" # Name of the wiki's directory
+WIKI_DIR_INST="/var/www" # Directory of the web server
+TMP="/tmp" # Temporary directory for downloads
+ # Absolute address needed!
+SERVER_ADDR="localhost" # Web server's address
+
+#
+# CONFIGURATION
+# You should not change those ones unless you know what you to
+#
+# Do not change the variables below
+MW_VERSION="mediawiki-1.19.0"
+DB_FILE="wikidb.sqlite"
+FILES_FOLDER="install-wiki"
+WIKI_ADMIN="WikiAdmin"
+WIKI_PASSW="AdminPass"
+
+fail () {
+ echo "$1"
+ exit 1
+}
+
+
+
+# Install a wiki in your web server directory.
+wiki_install () {
+
+ # Copy the generic LocalSettings.php in the web server's directory
+ # And modify parameters according to the ones set at the top
+ # of this script.
+ # Note that LocalSettings.php is never modified.
+ if [ ! -f "$FILES_FOLDER/LocalSettings.php" ] ; then
+ fail "Can't find $FILES_FOLDER/LocalSettings.php " \
+ "in the current folder.
+ Please run the script inside its folder."
+ fi
+ cp "$FILES_FOLDER/LocalSettings.php" \
+ "$FILES_FOLDER/LocalSettings-tmp.php" ||
+ fail "Unable to copy $FILES_FOLDER/LocalSettings.php " \
+ "to $FILES_FOLDER/LocalSettings-tmp.php"
+
+ # Parse and set the LocalSettings file of the user according to the
+ # CONFIGURATION VARIABLES section at the beginning of this script
+ file_swap="$FILES_FOLDER/LocalSettings-swap.php"
+ sed "s,@WG_SCRIPT_PATH@,/$WIKI_DIR_NAME," \
+ "$FILES_FOLDER/LocalSettings-tmp.php" > "$file_swap"
+ mv "$file_swap" "$FILES_FOLDER/LocalSettings-tmp.php"
+ sed "s,@WG_SERVER@,http://$SERVER_ADDR," \
+ "$FILES_FOLDER/LocalSettings-tmp.php" > "$file_swap"
+ mv "$file_swap" "$FILES_FOLDER/LocalSettings-tmp.php"
+ sed "s,@WG_SQLITE_DATADIR@,$TMP," \
+ "$FILES_FOLDER/LocalSettings-tmp.php" > "$file_swap"
+ mv "$file_swap" "$FILES_FOLDER/LocalSettings-tmp.php"
+
+ mkdir -p "$WIKI_DIR_INST/$WIKI_DIR_NAME"
+ if [ ! -d "$WIKI_DIR_INST/$WIKI_DIR_NAME" ] ; then
+ fail "Folder $WIKI_DIR_INST/$WIKI_DIR_NAME doesn't exist. Please create it
+ and launch the script again."
+ fi
+
+ mv "$FILES_FOLDER/LocalSettings-tmp.php" \
+ "$WIKI_DIR_INST/$WIKI_DIR_NAME/LocalSettings.php" ||
+ fail "Unable to move $FILES_FOLDER/LocalSettings-tmp.php" \
+ "in $WIKI_DIR_INST/$WIKI_DIR_NAME"
+ echo "File $FILES_FOLDER/LocalSettings.php is set in $WIKI_DIR_INST/$WIKI_DIR_NAME"
+
+ chmod ugo+w "$FILES_FOLDER/$DB_FILE"
+ reset_db_wiki "."
+
+ # Fetch MediaWiki's archive if not already present in the TMP directory
+ cd "$TMP"
+ if [ ! -f "$MW_VERSION.tar.gz" ] ; then
+ echo "Downloading $MW_VERSION sources ..."
+ wget http://download.wikimedia.org/mediawiki/1.19/mediawiki-1.19.0.tar.gz ||
+ fail "Unable to download" \
+ "http://download.wikimedia.org/mediawiki/1.19/mediawiki-1.19.0.tar.gz.
+ Please fix your connection and launch the script again."
+ fi
+ tar xfz "$MW_VERSION.tar.gz"
+ echo "$MW_VERSION.tar.gz downloaded in `pwd`. You can delete it later if you want."
+
+ # Copy the files of MediaWiki wiki in the web server's directory.
+ cd "$MW_VERSION"
+ cp -Rf * "$WIKI_DIR_INST/$WIKI_DIR_NAME/" ||
+ fail "Unable to copy WikiMedia's files from `pwd` to $WIKI_DIR_INST/$WIKI_DIR_NAME"
+
+ set_admin_wiki
+
+ echo "Your wiki has been installed. You can check it at http://$SERVER_ADDR/$WIKI_DIR_NAME"
+}
+
+# Copy the initial database of the wiki over the actual one.
+# Argument $1 is the relative path to the folder $FILES_FOLDER
+#
+# Warning: This function should be not called by user. This is a private
+# function used by wiki_install and wiki_delete
+reset_db_wiki () {
+
+ # Copy initial database of the wiki
+ if [ ! -f "$1/$FILES_FOLDER/$DB_FILE" ] ; then
+ fail "Can't find $1/$FILES_FOLDER/$DB_FILE in the current folder."
+ fi
+ cp --preserve=mode,ownership "$1/$FILES_FOLDER/$DB_FILE" "$TMP" ||
+ fail "Can't copy $1/$FILES_FOLDER/$DB_FILE in $TMP"
+ echo "File $FILES_FOLDER/$DB_FILE is set in $TMP"
+}
+
+# Set the admin WikiAdmin with password AdminPass in the database.
+#
+# Warning: This function should be not called by user. This is a private
+# function used by wiki_install and wiki_delete
+set_admin_wiki () {
+
+ #Add the admin
+ my_pwd="`pwd`"
+ cd "$WIKI_DIR_INST/$WIKI_DIR_NAME/maintenance/"
+ php changePassword.php --user="$WIKI_ADMIN" --password="$WIKI_PASSW" ||
+ fail "Unable to add an admin with the script $WIKI_DIR_INST/$WIKI_DIR_NAME/maintenance/
+ changePassword.php. Check you have the perms to do it."
+ echo "Admin \"$WIKI_ADMIN\" has password \"$WIKI_PASSW\""
+ cd "$my_pwd"
+}
+
+# Reset the database of the wiki and the password of the admin
+#
+# Warning: This function must be called only in a subdirectory of t/ directory
+wiki_reset () {
+ reset_db_wiki ".."
+ set_admin_wiki
+}
+
+# Delete the wiki created in the web server's directory and all its content
+# saved in the database.
+wiki_delete () {
+ # Delete the wiki's directory.
+ rm -rf "$WIKI_DIR_INST/$WIKI_DIR_NAME" ||
+ fail "Wiki's directory $WIKI_DIR_INST/" \
+ "$WIKI_DIR_NAME could not be deleted"
+
+ # Delete the wiki's SQLite database
+ rm -f "$TMP/$DB_FILE" || fail "Database $TMP/$DB_FILE could not be deleted."
+}
+
diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
old mode 100644
new mode 100755
diff --git a/t/test-lib.sh b/t/test-lib.sh
old mode 100644
new mode 100755
--
1.7.10.2.568.g4c26a3a
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 2/3] Test environment of git-remote-mw
2012-06-01 10:41 ` [PATCH 1/3] Script to install, delete and clear a MediaWiki Guillaume Sasdy
@ 2012-06-01 10:41 ` Guillaume Sasdy
2012-06-01 11:49 ` Matthieu Moy
2012-06-01 10:41 ` [PATCH 3/3] Tests file for git-remote-mediawiki Guillaume Sasdy
1 sibling, 1 reply; 22+ messages in thread
From: Guillaume Sasdy @ 2012-06-01 10:41 UTC (permalink / raw)
To: git
Cc: Matthieu.Moy, Charles Roussel, Guillaume Sasdy, Simon Cathebras,
Simon Perrat, Charles Roussel, Julien Khayat
From: Charles Roussel <charles.roussel@ensimag.fr>
In order to test git-remote-mediawiki, we need a package of functions
to manage a MediaWiki: edit a page, remove a page, fetch a page,
fetch all pages on a given wiki.
We also need functions to compare the content of directories.
Signed-off-by: Guillaume Sasdy <guillaume.sasdy@ensimag.imag.fr>
Signed-off-by: Simon Cathebras <Simon.Cathebras@ensimag.imag.fr>
Signed-off-by: Simon Perrat <Simon.Perrat@ensimag.imag.fr>
Signed-off-by: Charles Roussel <Charles.Roussel@ensimag.imag.fr>
Signed-off-by: Julien Khayat <Julien.Khayat@ensimag.imag.fr>
---
t/test-gitmw-lib.sh | 124 ++++++++++++++++++++++++++++++++++++---
t/test-gitmw.pl | 164 ++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 280 insertions(+), 8 deletions(-)
create mode 100755 t/test-gitmw.pl
diff --git a/t/test-gitmw-lib.sh b/t/test-gitmw-lib.sh
index b1023d7..d7c7459 100755
--- a/t/test-gitmw-lib.sh
+++ b/t/test-gitmw-lib.sh
@@ -1,27 +1,135 @@
+# Copyright (C) 2012
+# Charles Roussel <charles.roussel@ensimag.imag.fr>
+# Simon Cathebras <simon.cathebras@ensimag.imag.fr>
+# Julien Khayat <julien.khayat@ensimag.imag.fr>
+# Guillaume Sasdy <guillaume.sasdy@ensimag.imag.fr>
+# Simon Perrat <simon.perrat@ensimag.imag.fr>
+# Matthieu Moy <matthieu.moy@imag.fr>
+# License: GPL v2 or later
+
#
# CONFIGURATION VARIABLES
-# You might want to change those ones ...
+# You might want to change these ones
#
WIKI_DIR_NAME="wiki" # Name of the wiki's directory
WIKI_DIR_INST="/var/www" # Directory of the web server
TMP="/tmp" # Temporary directory for downloads
- # Absolute address needed!
+ # Absolute path required!
SERVER_ADDR="localhost" # Web server's address
-#
# CONFIGURATION
-# You should not change those ones unless you know what you to
+# You should not change these ones unless you know what you do
#
-# Do not change the variables below
MW_VERSION="mediawiki-1.19.0"
DB_FILE="wikidb.sqlite"
FILES_FOLDER="install-wiki"
WIKI_ADMIN="WikiAdmin"
WIKI_PASSW="AdminPass"
-fail () {
- echo "$1"
- exit 1
+# wiki_getpage <page_name> <dest_path>
+#
+# Fetch a page <page_name> from the wiki and copy its content
+# into directory <dest_path>.
+wiki_getpage () {
+ ../test-gitmw.pl get_page -p "$1" "$2"
+}
+
+# wiki_delete_page <page_name>
+#
+# Delete the page <page_name> on the wiki.
+wiki_delete_page () {
+ ../test-gitmw.pl delete_page -p "$1"
+}
+
+# wiki_edit_page <page_name> <page_content> <page_append>
+#
+# Edit a page <wiki_page> on the wiki with content <wiki_content>
+# If <wiki_append> == true the content will be appended
+# If the page doesn't exist, it is created.
+wiki_editpage () {
+ ../test-gitmw.pl edit_page -p "$1" "$2" "$3"
+}
+
+# git_content <dir_1> <dir_2>
+#
+# Compare the contents of directories <dir_1> and <dir_2> with diff
+# and exits with error 1 if they do not match. The program will
+# not look into .git in the process.
+git_content () {
+ result=$(diff -r -b --exclude=".git" "$1" "$2")
+
+ if echo $result | grep -q ">" ; then
+ echo "test failed: files $1 and $2 do not match"
+ exit 1
+ fi
+}
+
+# git_exist <rep_name> <file_name>
+#
+# Check the existence of <file_name> into the git repository
+# <rep_name> and exits with error 1 if it is absent.
+git_exist () {
+ result=$(find "$1" -type f -name "$2")
+
+ if ! echo $result | grep -q "$2" ; then
+ echo "test failed: file $2 does not exist in $1"
+ exit 1
+ fi
+}
+
+# wiki_check_content <file_name> <page_name>
+#
+# Compares the contents of the file <file_name> and the wiki page
+# <page_name> and exits with error 1 if they do not match.
+wiki_check_content () {
+ wiki_getpage "$2" .
+
+ if test -f "$2".mw ; then
+ git_content "$1" "$2".mw
+ rm "$2".mw
+ else
+ die "ERROR: file $2 not found on wiki"
+ fi
+}
+
+# wiki_page_exist <page_name>
+#
+# Check the existence of the page <page_name> on the wiki and exits
+# with error if it is absent from it.
+wiki_page_exist () {
+ wiki_getpage "$1" .
+
+ if test -f "$1".mw ; then
+ echo "test failed: file $1 not found on wiki"
+ exit 1
+ else
+ rm "$1".mw
+ fi
+}
+
+# wiki_getallpagename
+#
+# Fetch the name of each page on the wiki.
+wiki_getallpagename () {
+ ../test-gitmw.pl "getallpagename" -p
+}
+
+# wiki_getallpage <dest_dir>
+#
+# Fetch all the pages from the wiki and place them in the directory
+# <dest_dir>.
+wiki_getallpage () {
+ wiki_getallpagename
+ mkdir -p "$1"
+ while read -r line; do
+ wiki_getpage "$line" $1;
+ done < all.txt
+}
+
+fail()
+{
+ echo "$1"
+ exit 1
}
diff --git a/t/test-gitmw.pl b/t/test-gitmw.pl
new file mode 100755
index 0000000..bf71485
--- /dev/null
+++ b/t/test-gitmw.pl
@@ -0,0 +1,164 @@
+#!/usr/bin/perl -w
+# Copyright (C) 2012
+# Charles Roussel <charles.roussel@ensimag.imag.fr>
+# Simon Cathebras <simon.cathebras@ensimag.imag.fr>
+# Julien Khayat <julien.khayat@ensimag.imag.fr>
+# Guillaume Sasdy <guillaume.sasdy@ensimag.imag.fr>
+# Simon Perrat <simon.perrat@ensimag.imag.fr>
+# Matthieu Moy <matthieu.moy@imag.fr>
+# License: GPL v2 or later
+
+# Usage:
+# ./test-gitmw.pl <command> [argument]*
+# Execute in terminal using the name of the function to call as first
+# parameter, and the function's arguments as following parameters
+#
+# Example:
+# ./test-gitmw.pl "get_page" foo .
+# will call <wiki_getpage> with arguments <foo> and <.>
+#
+# Available functions are:
+# "get_page"
+# "delete_page"
+# "edit_page"
+# "getallpagename"
+
+use MediaWiki::API;
+use Switch;
+# URL of the wiki used for the tests
+my $wiki_url="http://localhost/wiki/api.php";
+my $wiki_admin='WikiAdmin';
+my $wiki_admin_pass='AdminPass';
+my $mw = MediaWiki::API->new;
+$mw->{config}->{api_url} = $wiki_url;
+
+# wiki_login <name> <password>
+#
+# Logs the user with <name> and <password> in the global variable
+# of the mediawiki $mw
+sub wiki_login {
+ $mw->login( { lgname => "$_[0]",lgpassword => "$_[1]" } )
+ || die "getpage: login failed";
+}
+
+# wiki_getpage <wiki_page> <dest_path>
+#
+# fetch a page <wiki_page> from the wiki referenced in the global variable
+# $mw and copies its content in directory dest_path
+sub wiki_getpage {
+ my $pagename = $_[0];
+ my $destdir = $_[1];
+
+ my $page = $mw->get_page( { title => $pagename } );
+ if (!defined($page)) {
+ die "getpage: wiki does not exist";
+ }
+
+ my $content = $page->{'*'};
+ if (!defined($content)) {
+ die "getpage: page does not exist";
+ }
+
+ # Replace spaces by underscore in the page name
+ $pagename=~s/\ /_/;
+ open(my $file, ">$destdir/$pagename.mw");
+ print $file "$content";
+ close ($file);
+}
+
+# wiki_delete_page <page_name>
+#
+# delete the page with name <page_name> from the wiki referenced
+# in the global variable $mw
+sub wiki_delete_page {
+ my $pagename = $_[0];
+
+ my $exist=$mw->get_page({title => $pagename});
+
+ if (defined($exist->{'*'})){
+ $mw->edit({ action => 'delete',
+ title => $pagename})
+ || die $mw->{error}->{code} . ": " . $mw->{error}->{details};
+ }
+ else{
+ die "no page with such name found: $pagename\n";
+ }
+}
+
+# wiki_editpage <wiki_page> <wiki_content> <wiki_append>
+#
+# Edit a page named <wiki_page> with content <wiki_content> on the wiki
+# referenced with the global variable $mw
+# If <wiki_append> == true : append <wiki_content> at the end of the actual
+# content of the page <wiki_page>
+# If <wik_page> doesn't exist, that page is created with the <wiki_content>
+sub wiki_editpage {
+ my $wiki_page = $_[0];
+ my $wiki_content = $_[1];
+ my $wiki_append = $_[2];
+
+ my $append = 0;
+ if (defined($wiki_append) && $wiki_append eq 'true') {
+ $append=1;
+ }
+
+ my $previous_text ="";
+
+ if ($append) {
+ my $ref = $mw->get_page( { title => $wiki_page } );
+ $previous_text = $ref->{'*'};
+ }
+
+ my $text = $wiki_content;
+ if (defined($previous_text)) {
+ $text="$previous_text$text";
+ }
+ $mw->edit( { action => 'edit', title => $wiki_page, text => "$text"} );
+}
+
+# wiki_getallpagename
+#
+# Fetch all pages of the wiki referenced by the global variable $mw
+# and print the names of each one in the file all.txt with a new line
+# ("\n") between these.
+sub wiki_getallpagename {
+ # fetch the pages of the wiki
+ $mw->list ( { action => 'query',
+ list => 'allpages',
+ #cmtitle => "Category:Surnames",
+ #cmnamespace => 0,
+ cmlimit=> 500 },
+ { max => 4, hook => \&cat_names } )
+ || die $mw->{error}->{code}.": ".$mw->{error}->{details};
+
+ # print the name of each page
+ sub cat_names {
+ my ($ref) = @_;
+
+ open(my $file, ">all.txt");
+ foreach (@$ref) {
+ print $file "$_->{title}\n";
+ }
+ close ($file);
+ }
+}
+
+# Main part of this script: parse the command line arguments
+# and select which function to execute
+my $fct_to_call = shift;
+my $login = $ARGV[0];
+
+if ($login eq "-p")
+{
+ &wiki_login($wiki_admin,$wiki_admin_pass);
+ shift;
+}
+
+switch ($fct_to_call) {
+ case "get_page" { &wiki_getpage($ARGV[0], $ARGV[1])}
+ case "delete_page" { &wiki_delete_page($ARGV[0])}
+ case "edit_page" { &wiki_editpage($ARGV[0], $ARGV[1], $ARGV[2])}
+ case "getallpagename" { &wiki_getallpagename()}
+ else{ die("test-gitmw.pl ERROR: wrong argument")}
+}
+
--
1.7.10.2.568.g4c26a3a
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 3/3] Tests file for git-remote-mediawiki
2012-06-01 10:41 ` [PATCH 1/3] Script to install, delete and clear a MediaWiki Guillaume Sasdy
2012-06-01 10:41 ` [PATCH 2/3] Test environment of git-remote-mw Guillaume Sasdy
@ 2012-06-01 10:41 ` Guillaume Sasdy
1 sibling, 0 replies; 22+ messages in thread
From: Guillaume Sasdy @ 2012-06-01 10:41 UTC (permalink / raw)
To: git
Cc: Matthieu.Moy, Charles Roussel, Guillaume Sasdy, Simon Cathebras,
Simon Perrat, Charles Roussel, Julien Khayat
From: Charles Roussel <charles.roussel@ensimag.fr>
Those scripts test the functions of git-remote-mediawiki.
t9360: simple test case for git clone.
t9361: simple test cases for git pull (add page, edit page, delete page) and git push (add file, edit file, delete file).
Signed-off-by: Guillaume Sasdy <guillaume.sasdy@ensimag.imag.fr>
Signed-off-by: Simon Cathebras <Simon.Cathebras@ensimag.imag.fr>
Signed-off-by: Simon Perrat <Simon.Perrat@ensimag.imag.fr>
Signed-off-by: Charles Roussel <Charles.Roussel@ensimag.imag.fr>
Signed-off-by: Julien Khayat <Julien.Khayat@ensimag.imag.fr>
---
t/t9360-git-mediawiki.sh | 49 +++++++++++++++
t/t9361-git-mediawiki.sh | 156 +++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 205 insertions(+)
create mode 100755 t/t9360-git-mediawiki.sh
create mode 100755 t/t9361-git-mediawiki.sh
diff --git a/t/t9360-git-mediawiki.sh b/t/t9360-git-mediawiki.sh
new file mode 100755
index 0000000..57e05d8
--- /dev/null
+++ b/t/t9360-git-mediawiki.sh
@@ -0,0 +1,49 @@
+#!/bin/sh
+#
+# Copyright (C) 2012
+# Charles Roussel <charles.roussel@ensimag.imag.fr>
+# Simon Cathebras <simon.cathebras@ensimag.imag.fr>
+# Julien Khayat <julien.khayat@ensimag.imag.fr>
+# Guillaume Sasdy <guillaume.sasdy@ensimag.imag.fr>
+# Simon Perrat <simon.perrat@ensimag.imag.fr>
+# Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
+#
+# License: GPL v2 or later
+
+# tests for git-remote-mediawiki
+
+test_description='Test the Git Mediawiki remote helper: git clone'
+
+. ./test-gitmw-lib.sh
+. ./test-lib.sh
+
+if ! test_have_prereq PERL
+then
+ skip_all='skipping gateway git-mw tests, perl not available'
+ test_done
+fi
+
+if [ ! -f /$GIT_BUILD_DIR/git-remote-mediawiki ];
+then
+ skip_all='skipping gateway git-mw tests, no remote mediawiki for git found'
+ test_done
+fi
+
+if [ ! -d "$WIKI_DIR_INST/$WIKI_DIR_NAME" ] ;
+then
+ skip_all='skipping gateway git-mw tests, no mediawiki found'
+ test_done
+fi
+
+test_expect_success 'git clone works with page added' '
+ wiki_reset &&
+ wiki_editpage foo "hello_world" false &&
+ wiki_editpage bar "hi everybody !" false &&
+ git clone mediawiki::http://localhost/wiki mw_dir &&
+ wiki_getallpage ref_page &&
+ git_content mw_dir ref_page &&
+ wiki_delete_page foo &&
+ wiki_delete_page bar
+'
+
+test_done
diff --git a/t/t9361-git-mediawiki.sh b/t/t9361-git-mediawiki.sh
new file mode 100755
index 0000000..9dd7274
--- /dev/null
+++ b/t/t9361-git-mediawiki.sh
@@ -0,0 +1,156 @@
+#!/bin/sh
+#
+# Copyright (C) 2012
+# Charles Roussel <charles.roussel@ensimag.imag.fr>
+# Simon Cathebras <simon.cathebras@ensimag.imag.fr>
+# Julien Khayat <julien.khayat@ensimag.imag.fr>
+# Guillaume Sasdy <guillaume.sasdy@ensimag.imag.fr>
+# Simon Perrat <simon.perrat@ensimag.imag.fr>
+# Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
+#
+# License: GPL v2 or later
+
+# tests for git-remote-mediawiki
+
+test_description='Test the Git Mediawiki remote helper: git push and git pull simple test cases'
+
+. ./test-gitmw-lib.sh
+. ./test-lib.sh
+
+if ! test_have_prereq PERL
+then
+ skip_all='skipping gateway git-mw tests, perl not available'
+ test_done
+fi
+
+if [ ! -f /$GIT_BUILD_DIR/git-remote-mediawiki ];
+then
+ skip_all='skipping gateway git-mw tests, no remote mediawiki for git found'
+ test_done
+fi
+
+if [ ! -d "$WIKI_DIR_INST/$WIKI_DIR_NAME" ] ;
+then
+ skip_all='skipping gateway git-mw tests, no mediawiki found'
+ test_done
+fi
+
+# Create a new file foo.mw in a freshly cloned wiki. Commit and push
+# this file and then check that all files of the repository are similar to
+# the wiki pages.
+test_expect_success 'git push works after adding a file .mw' "
+ wiki_reset &&
+ git clone mediawiki::http://$SERVER_ADDR/$WIKI_DIR_NAME mw_dir &&
+ wiki_getallpage ref_page &&
+
+ cd mw_dir &&
+ test ! -f foo.mw && # foo.mw should not exist after wiki_reset &&
+ touch foo.mw &&
+ echo \"hello world\" >> foo.mw &&
+ git add foo.mw &&
+ git commit -m \"foo\" &&
+ git push &&
+ cd .. &&
+
+ rm -rf ref_page &&
+ wiki_getallpage ref_page &&
+ git_content mw_dir ref_page &&
+ rm -rf ref_page &&
+ rm -rf mw_dir
+"
+
+# Create a new page Foo in an empty wiki. Clone the wiki and edit
+# the file foo.mw corresponding to the page Foo. Commit and push
+# then check that all files of the repository are similar to the wiki
+# pages.
+test_expect_success 'git push works after editing a file .mw' "
+ # clone an empty wiki and add a Foo page
+ wiki_reset &&
+ wiki_editpage \"foo\" \"page just created before the git clone\" false &&
+ git clone mediawiki::http://$SERVER_ADDR/$WIKI_DIR_NAME mw_dir &&
+
+ cd mw_dir &&
+ echo \"new line added in the file foo.mw\" >> Foo.mw &&
+ git commit -am \"edit file foo.mw\" &&
+ git push &&
+ cd .. &&
+
+ rm -rf ref_page &&
+ wiki_getallpage ref_page &&
+ git_content mw_dir ref_page &&
+ rm -rf ref_page &&
+ rm -rf mw_dir
+"
+
+# Clone a wiki with a page Foo. Remove the corresponding file from the
+# repository. Check that the wiki page has been actually removed.
+test_expect_failure 'git push works after deleting a file' "
+ wiki_reset &&
+ wiki_editpage foo \"wiki page added before git clone\" false &&
+ git clone mediawiki::http://$SERVER_ADDR/$WIKI_DIR_NAME mw_dir &&
+
+ cd mw_dir &&
+ git rm Foo.mw &&
+ git commit -am \"git rm delete the wiki page Foo.mw\" &&
+ git push &&
+ cd .. &&
+
+ rm -rf mw_dir &&
+ test ! wiki_page_exist Foo
+"
+
+# Clone an empty wiki. Add a page on the wiki and pull. Check
+# all files of the repository are similar to the wiki pages.
+test_expect_success 'git pull works after adding a new wiki page' "
+ wiki_reset &&
+ git clone mediawiki::http://$SERVER_ADDR/$WIKI_DIR_NAME mw_dir &&
+ wiki_editpage foo \"page just created after the git clone\" false &&
+
+ cd mw_dir &&
+ git pull &&
+ cd .. &&
+
+ rm -rf ref_page &&
+ wiki_getallpage ref_page &&
+ git_content mw_dir ref_page &&
+ rm -rf ref_page &&
+ rm -rf mw_dir
+"
+
+# Clone a wiki with a page Foo. Edit the page foo on the wiki and pull.
+# Check that all files of the repository are similar to the wiki pages.
+test_expect_success 'git pull works after editing a wiki page' "
+ wiki_reset &&
+ wiki_editpage foo \"page just created before the git clone\" false &&
+ git clone mediawiki::http://$SERVER_ADDR/$WIKI_DIR_NAME mw_dir &&
+ wiki_editpage foo \"new line added on the wiki\" true &&
+
+ cd mw_dir &&
+ git pull &&
+ cd .. &&
+
+ rm -rf ref_page &&
+ wiki_getallpage ref_page &&
+ git_content mw_dir ref_page &&
+ rm -rf ref_page
+ rm -rf mw_dir
+"
+
+# Clone a wiki with a page Foo. Remove the wiki page and pull.
+# Check that the corresponding file in the repository has been actually removed.
+test_expect_failure 'git pull works after deleting a wiki page' "
+ wiki_reset &&
+ wiki_editpage foo \"wiki page added before git clone\" false &&
+ git clone mediawiki::http://$SERVER_ADDR/$WIKI_DIR_NAME mw_dir &&
+
+ cd mw_dir &&
+ wiki_delete_page foo
+ git pull &&
+ test ! -f Foo.mw &&
+ cd .. &&
+
+ rm -rf mw_dir
+"
+
+test_done
+
--
1.7.10.2.568.g4c26a3a
^ permalink raw reply related [flat|nested] 22+ messages in thread
* Re: [PATCH 2/3] Test environment of git-remote-mw
2012-06-01 10:41 ` [PATCH 2/3] Test environment of git-remote-mw Guillaume Sasdy
@ 2012-06-01 11:49 ` Matthieu Moy
2012-06-01 14:43 ` Simon.Cathebras
0 siblings, 1 reply; 22+ messages in thread
From: Matthieu Moy @ 2012-06-01 11:49 UTC (permalink / raw)
To: Guillaume Sasdy
Cc: git, Charles Roussel, Simon Cathebras, Simon Perrat,
Charles Roussel, Julien Khayat
Guillaume Sasdy <guillaume.sasdy@ensimag.imag.fr> writes:
> # CONFIGURATION VARIABLES
> -# You might want to change those ones ...
> +# You might want to change these ones
> #
> WIKI_DIR_NAME="wiki" # Name of the wiki's directory
> WIKI_DIR_INST="/var/www" # Directory of the web server
> TMP="/tmp" # Temporary directory for downloads
> - # Absolute address needed!
> + # Absolute path required!
> SERVER_ADDR="localhost" # Web server's address
>
> -#
> # CONFIGURATION
> -# You should not change those ones unless you know what you to
> +# You should not change these ones unless you know what you do
I already mentionned in in your v1, but these fixups do not belong to
PATCH 2/3. You do not want reviewers to see your mistakes in PATCH 1/2
and see the fix in PATCH 2/3.
> +wiki_getpage () {
> + ../test-gitmw.pl get_page -p "$1" "$2"
> +}
Any reason why test-gitmw.pl and wiki_getpage have this slightly
different API? The perl version has a "-p" flag, and the shell command
has only positionnal arguments.
I'd rather have a more uniform way to wrap calls to test-gitmw.pl in
shell, like
wiki_<something> () {
../test-gitmw.pl <something> "$@"
}
Then, you probably want to move the API documentation (i.e. comments you
put before the shell functions) in, or next to the Perl script, and
avoid repeating it in the shell.
> +# git_content <dir_1> <dir_2>
> +#
> +# Compare the contents of directories <dir_1> and <dir_2> with diff
> +# and exits with error 1 if they do not match. The program will
> +# not look into .git in the process.
> +git_content () {
Didn't I already say that the naming was strange? A function that
compares something shouldn't be called just "content".
> + result=$(diff -r -b --exclude=".git" "$1" "$2")
> +
> + if echo $result | grep -q ">" ; then
Why grep, when the exit status of diff tells you about the differences
already?
> +# git_exist <rep_name> <file_name>
> +#
> +# Check the existence of <file_name> into the git repository
> +# <rep_name> and exits with error 1 if it is absent.
> +git_exist () {
> + result=$(find "$1" -type f -name "$2")
> +
> + if ! echo $result | grep -q "$2" ; then
Missing quotes around $result.
Why do you need grep again? You just want to check whether "$result" is
empty (test -z).
> + echo "test failed: file $2 does not exist in $1"
> + exit 1
die
?
> +wiki_page_exist () {
> + wiki_getpage "$1" .
> +
> + if test -f "$1".mw ; then
> + echo "test failed: file $1 not found on wiki"
> + exit 1
likewise.
> +fail()
> +{
Style: fail () {
Plus, didn't we say "die" was already there for this?
> + # Replace spaces by underscore in the page name
> + $pagename=~s/\ /_/;
Indent with space (didn't I already mention that?).
> +my $login = $ARGV[0];
> +
> +if ($login eq "-p")
Feels weird. If you're not sure it's a login, why call the variable
$login?
Any reason not to use Perl's option parsing?
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 2/3] Test environment of git-remote-mw
2012-06-01 11:49 ` Matthieu Moy
@ 2012-06-01 14:43 ` Simon.Cathebras
2012-06-02 10:47 ` Matthieu Moy
0 siblings, 1 reply; 22+ messages in thread
From: Simon.Cathebras @ 2012-06-01 14:43 UTC (permalink / raw)
To: Matthieu Moy
Cc: Guillaume Sasdy, git, Charles Roussel, Simon Perrat,
Charles Roussel, Julien Khayat
On 01/06/2012 13:49, Matthieu Moy wrote:
> Guillaume Sasdy<guillaume.sasdy@ensimag.imag.fr> writes:
>
>> # CONFIGURATION VARIABLES
>> -# You might want to change those ones ...
>> +# You might want to change these ones
>> #
>> WIKI_DIR_NAME="wiki" # Name of the wiki's directory
>> WIKI_DIR_INST="/var/www" # Directory of the web server
>> TMP="/tmp" # Temporary directory for downloads
>> - # Absolute address needed!
>> + # Absolute path required!
>> SERVER_ADDR="localhost" # Web server's address
>>
>> -#
>> # CONFIGURATION
>> -# You should not change those ones unless you know what you to
>> +# You should not change these ones unless you know what you do
> I already mentionned in in your v1, but these fixups do not belong to
> PATCH 2/3. You do not want reviewers to see your mistakes in PATCH 1/2
> and see the fix in PATCH 2/3.
Got it. With the problem experienced yesterday, we had still this issue
this morning. It is now fixed :).
>> +wiki_getpage () {
>> + ../test-gitmw.pl get_page -p "$1" "$2"
>> +}
> Any reason why test-gitmw.pl and wiki_getpage have this slightly
> different API? The perl version has a "-p" flag, and the shell command
> has only positionnal arguments.
The "-p" flag exists to specify if we have to use the admin login on
wiki to do the command. For instance, here we fetch a page from the wiki
with Admin privilege.
Others arguments remains the same.
> I'd rather have a more uniform way to wrap calls to test-gitmw.pl in
> shell, like
>
> wiki_<something> () {
> ../test-gitmw.pl<something> "$@"
> }
Do you suggest we include the "-p" flag in <something> ?
I agree for the use of "$@".
>
> Then, you probably want to move the API documentation (i.e. comments you
> put before the shell functions) in, or next to the Perl script, and
> avoid repeating it in the shell.
>
Ok.
>> +# git_content<dir_1> <dir_2>
>> +#
>> +# Compare the contents of directories<dir_1> and<dir_2> with diff
>> +# and exits with error 1 if they do not match. The program will
>> +# not look into .git in the process.
>> +git_content () {
> Didn't I already say that the naming was strange? A function that
> compares something shouldn't be called just "content".
Sorry, we misunderstood what you mean... Update is coming. What about
git_diff_directories ?
Because this shell function execute a special instance of diff, matching
two directories and ignoring blank character.
>> + result=$(diff -r -b --exclude=".git" "$1" "$2")
>> +
>> + if echo $result | grep -q ">" ; then
> Why grep, when the exit status of diff tells you about the differences
> already?
>
Good idea for the exit status.
>> +# git_exist<rep_name> <file_name>
>> +#
>> +# Check the existence of<file_name> into the git repository
>> +#<rep_name> and exits with error 1 if it is absent.
>> +git_exist () {
>> + result=$(find "$1" -type f -name "$2")
>> +
>> + if ! echo $result | grep -q "$2" ; then
> Missing quotes around $result.
>
> Why do you need grep again? You just want to check whether "$result" is
> empty (test -z).
this function is now erased from our code... Actually, it was really
useless...
>> + echo "test failed: file $2 does not exist in $1"
>> + exit 1
> die
>
> ?
>
>> +wiki_page_exist () {
>> + wiki_getpage "$1" .
>> +
>> + if test -f "$1".mw ; then
>> + echo "test failed: file $1 not found on wiki"
>> + exit 1
> likewise.
We were supposed to do it with the previous version.
But we are facing some difficulties using die function outside the test
harness. We wanted to include the file "test-lib.sh" in our own script
"test-gitmw-lib.sh" to use die. It doesn't work, because the harness
expect the file "test-gitmw-lib.sh" to be a test script. Wich is not the
case.
Do you have any Idea about how to fix this problem ?
>> +fail()
>> +{
> Style: fail () {
>
> Plus, didn't we say "die" was already there for this?
Agree, see above.
>> + # Replace spaces by underscore in the page name
>> + $pagename=~s/\ /_/;
> Indent with space (didn't I already mention that?).
>
>> +my $login = $ARGV[0];
>> +
>> +if ($login eq "-p")
> Feels weird. If you're not sure it's a login, why call the variable
> $login?
Change on the way. renaming this variable "is_login". Is this ok for you ?
> Any reason not to use Perl's option parsing?
Not at all, we juste didn't thought about it.
--
CATHEBRAS Simon
2A-ENSIMAG
Filière Ingéniérie des Systèmes d'Information
Membre Bug-Buster
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 2/3] Test environment of git-remote-mw
2012-06-01 14:43 ` Simon.Cathebras
@ 2012-06-02 10:47 ` Matthieu Moy
2012-06-04 14:13 ` Simon.Cathebras
0 siblings, 1 reply; 22+ messages in thread
From: Matthieu Moy @ 2012-06-02 10:47 UTC (permalink / raw)
To: Simon.Cathebras
Cc: Guillaume Sasdy, git, Charles Roussel, Simon Perrat,
Charles Roussel, Julien Khayat
"Simon.Cathebras" <Simon.Cathebras@ensimag.imag.fr> writes:
>>> +wiki_getpage () {
>>> + ../test-gitmw.pl get_page -p "$1" "$2"
>>> +}
>> Any reason why test-gitmw.pl and wiki_getpage have this slightly
>> different API? The perl version has a "-p" flag, and the shell command
>> has only positionnal arguments.
> The "-p" flag exists to specify if we have to use the admin login on
> wiki to do the command.
(then, maybe --admin would be a better name?)
> For instance, here we fetch a page from the wiki with Admin privilege.
> Others arguments remains the same.
What I don't understand is why you need the flexibility to choose
between admin and non-admin on the Perl side, and you don't need in on
the shell side.
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 2/3] Test environment of git-remote-mw
2012-06-02 10:47 ` Matthieu Moy
@ 2012-06-04 14:13 ` Simon.Cathebras
0 siblings, 0 replies; 22+ messages in thread
From: Simon.Cathebras @ 2012-06-04 14:13 UTC (permalink / raw)
To: Matthieu Moy
Cc: Guillaume Sasdy, git, Charles Roussel, Simon Perrat,
Charles Roussel, Julien Khayat
On 02/06/2012 12:47, Matthieu Moy wrote:
> "Simon.Cathebras"<Simon.Cathebras@ensimag.imag.fr> writes:
>
>>>> +wiki_getpage () {
>>>> + ../test-gitmw.pl get_page -p "$1" "$2"
>>>> +}
>>> Any reason why test-gitmw.pl and wiki_getpage have this slightly
>>> different API? The perl version has a "-p" flag, and the shell command
>>> has only positionnal arguments.
>> The "-p" flag exists to specify if we have to use the admin login on
>> wiki to do the command.
> (then, maybe --admin would be a better name?)
>
I am ok with this... It would be more understandable.
>> For instance, here we fetch a page from the wiki with Admin privilege.
>> Others arguments remains the same.
> What I don't understand is why you need the flexibility to choose
> between admin and non-admin on the Perl side, and you don't need in on
> the shell side.
>
On one hand, we need to be authentificated as an admin to do some wiki's
operations, like deleting a page for instance. It is needed by the Perl.
On the other hand, we don't need it on the shell side because we believe
that we don't have to bother the user with some authentification
consideration.
I mean, if I intend to delete the page <foo> from wiki, it is easier to
call 'wiki_delete_page foo', than 'wiki_delete_page --user=thingumy
--pass=blahblah foo'.
Does it make sense ? If not, what do you think we should do ?
Simon
--
CATHEBRAS Simon
2A-ENSIMAG
Filière Ingéniérie des Systèmes d'Information
Membre Bug-Buster
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 2/3] Test environment of git-remote-mw
2012-06-05 13:25 ` [PATCH 1/3] Script to install, delete and clear a MediaWiki Simon Cathebras
@ 2012-06-05 13:25 ` Simon Cathebras
0 siblings, 0 replies; 22+ messages in thread
From: Simon Cathebras @ 2012-06-05 13:25 UTC (permalink / raw)
To: git
Cc: Matthieu.Moy, simon.cathebras, charles.roussel, Guillaume.Sasdy,
Julien.Khayat, Simon.Perrat, peff, gitster, Guillaume Sasdy,
Julien Khayat, Simon Perrat, Matthieu Moy
From: Guillaume Sasdy <guillaume.sasdy@ensimag.imag.fr>
In order to test git-remote-mediawiki, we need a package of functions
to manage a MediaWiki: edit a page, remove a page, fetch a page,
fetch all pages on a given wiki.
We also need functions to compare the content of directories.
Signed-off-by: Simon Cathebras <simon.cathebras@ensimag.imag.fr>
Signed-off-by: Guillaume Sasdy <guillaume.sasdy@ensimag.imag.fr>
Signed-off-by: Julien Khayat <julien.khayat@ensimag.imag.fr>
Signed-off-by: Simon Perrat <simon.perrat@ensimag.imag.fr>
Signed-off-by: Charles Roussel <charles.roussel@ensimag.imag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@imag.fr>
---
t/test-gitmw-lib.sh | 105 +++++++++++++++++++++++++++++++
t/test-gitmw.pl | 176 ++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 281 insertions(+)
create mode 100755 t/test-gitmw.pl
diff --git a/t/test-gitmw-lib.sh b/t/test-gitmw-lib.sh
index cebef24..cb5ba19 100755
--- a/t/test-gitmw-lib.sh
+++ b/t/test-gitmw-lib.sh
@@ -26,6 +26,111 @@ DB_INSTALL_SCRIPT="db_install.php"
WIKI_ADMIN="WikiAdmin"
WIKI_PASSW="AdminPass"
+wiki_getpage () {
+ $GIT_BUILD_DIR/t/test-gitmw.pl get_page "$@"
+}
+
+wiki_delete_page () {
+ $GIT_BUILD_DIR/t/test-gitmw.pl delete_page "$@"
+}
+
+wiki_editpage () {
+ $GIT_BUILD_DIR/t/test-gitmw.pl edit_page "$@"
+}
+
+die () {
+ die_with_status 1 "$@"
+}
+
+die_with_status () {
+ status=$1
+ shift
+ echo >&2 "$*"
+ exit "$status"
+}
+
+# git_diff_directories <dir_git> <dir_wiki>
+#
+# Compare the contents of directories <dir_git> and <dir_wiki> with diff
+# and dies if they do not match. The program will
+# not look into .git in the process.
+# Warning: the first argument MUST be the directory containing the git data
+git_diff_directories () {
+ mkdir -p "$1_tmp"
+ cp "$1"/*.mw "$1_tmp"
+
+ diff -r -b "$1_tmp" "$2"
+
+ if test $? -ne 0
+ then
+ rm -rf "$1_tmp"
+ die "test failed: directories $1 and $2 do not match"
+ fi
+ rm -rf "$1_tmp"
+}
+
+
+# wiki_check_content <file_name> <page_name>
+#
+# Compares the contents of the file <file_name> and the wiki page
+# <page_name> and exits with error 1 if they do not match.
+wiki_check_content () {
+ mkdir -p wiki_tmp
+ wiki_getpage "$2" wiki_tmp
+ diff -b "$1" wiki_tmp/"$2".mw
+ if test $? -ne 0
+ then
+ rm -rf wiki_tmp
+ die "ERROR: file $2 not found on wiki"
+ fi
+ rm -rf wiki_tmp
+}
+
+# wiki_page_exist <page_name>
+#
+# Check the existence of the page <page_name> on the wiki and exits
+# with error if it is absent from it.
+wiki_page_exist () {
+ wiki_getpage "$1" .
+
+ if test -f "$1".mw ; then
+ rm "$1".mw
+ else
+ die "test failed: file $1 not found on wiki"
+ fi
+}
+
+# wiki_getallpagename
+#
+# Fetch the name of each page on the wiki.
+wiki_getallpagename () {
+ $GIT_BUILD_DIR/t/test-gitmw.pl getallpagename
+}
+
+# wiki_getallpagecategory <category>
+#
+# Fetch the name of each page belonging to <category> on the wiki.
+wiki_getallpagecategory () {
+ $GIT_BUILD_DIR/t/test-gitmw.pl getallpagename "$@"
+}
+
+# wiki_getallpage <dest_dir> [<category>]
+#
+# Fetch all the pages from the wiki and place them in the directory
+# <dest_dir>.
+# If <category> is define, then wiki_getallpage fetch the pages included
+# in <category>.
+wiki_getallpage () {
+ if test -z "$2";
+ then
+ wiki_getallpagename
+ else
+ wiki_getallpagecategory "$2"
+ fi
+ mkdir -p "$1"
+ while read -r line; do
+ wiki_getpage "$line" $1;
+ done < all.txt
}
# Create the SQLite database of the MediaWiki. If the database file already
diff --git a/t/test-gitmw.pl b/t/test-gitmw.pl
new file mode 100755
index 0000000..ff7f63e
--- /dev/null
+++ b/t/test-gitmw.pl
@@ -0,0 +1,176 @@
+#!/usr/bin/perl -w
+# Copyright (C) 2012
+# Charles Roussel <charles.roussel@ensimag.imag.fr>
+# Simon Cathebras <simon.cathebras@ensimag.imag.fr>
+# Julien Khayat <julien.khayat@ensimag.imag.fr>
+# Guillaume Sasdy <guillaume.sasdy@ensimag.imag.fr>
+# Simon Perrat <simon.perrat@ensimag.imag.fr>
+# License: GPL v2 or later
+
+# Usage:
+# ./test-gitmw.pl <command> [argument]*
+# Execute in terminal using the name of the function to call as first
+# parameter, and the function's arguments as following parameters
+#
+# Example:
+# ./test-gitmw.pl "get_page" foo .
+# will call <wiki_getpage> with arguments <foo> and <.>
+#
+# Available functions are:
+# "get_page"
+# "delete_page"
+# "edit_page"
+# "getallpagename"
+
+use MediaWiki::API;
+use Switch;
+# URL of the wiki used for the tests
+my $wiki_url="http://localhost/wiki/api.php";
+my $wiki_admin='WikiAdmin';
+my $wiki_admin_pass='AdminPass';
+my $mw = MediaWiki::API->new;
+$mw->{config}->{api_url} = $wiki_url;
+
+# wiki_login <name> <password>
+#
+# Logs the user with <name> and <password> in the global variable
+# of the mediawiki $mw
+sub wiki_login {
+ $mw->login( { lgname => "$_[0]",lgpassword => "$_[1]" } )
+ || die "getpage: login failed";
+}
+
+# wiki_getpage <wiki_page> <dest_path>
+#
+# fetch a page <wiki_page> from the wiki referenced in the global variable
+# $mw and copies its content in directory dest_path
+sub wiki_getpage {
+ my $pagename = $_[0];
+ my $destdir = $_[1];
+
+ my $page = $mw->get_page( { title => $pagename } );
+ if (!defined($page)) {
+ die "getpage: wiki does not exist";
+ }
+
+ my $content = $page->{'*'};
+ if (!defined($content)) {
+ die "getpage: page does not exist";
+ }
+
+ # Replace spaces by underscore in the page name
+ $pagename=$page->{'title'};
+ $pagename=~s/\ /_/;
+ open(my $file, ">$destdir/$pagename.mw");
+ print $file "$content";
+ close ($file);
+}
+
+# wiki_delete_page <page_name>
+#
+# delete the page with name <page_name> from the wiki referenced
+# in the global variable $mw
+sub wiki_delete_page {
+ my $pagename = $_[0];
+
+ my $exist=$mw->get_page({title => $pagename});
+
+ if (defined($exist->{'*'})){
+ $mw->edit({ action => 'delete',
+ title => $pagename})
+ || die $mw->{error}->{code} . ": " . $mw->{error}->{details};
+ } else {
+ die "no page with such name found: $pagename\n";
+ }
+}
+
+# wiki_editpage <wiki_page> <wiki_content> <wiki_append> [<category>]
+#
+# Edit a page named <wiki_page> with content <wiki_content> on the wiki
+# referenced with the global variable $mw
+# If <wiki_append> == true : append <wiki_content> at the end of the actual
+# content of the page <wiki_page>
+# If <wik_page> doesn't exist, that page is created with the <wiki_content>
+sub wiki_editpage {
+ my $wiki_page = $_[0];
+ my $wiki_content = $_[1];
+ my $wiki_append = $_[2];
+
+
+ my $append = 0;
+ if (defined($wiki_append) && $wiki_append eq 'true') {
+ $append=1;
+ }
+
+ my $previous_text ="";
+
+ if ($append) {
+ my $ref = $mw->get_page( { title => $wiki_page } );
+ $previous_text = $ref->{'*'};
+ }
+
+ my $text = $wiki_content;
+ if (defined($previous_text)) {
+ $text="$previous_text$text";
+ }
+
+ # Eventually, add this page to a category.
+ if (defined($_[3])) {
+ my $category_name="[[Category:$_[3]]]";
+ $text="$text\n $category_name"
+ }
+ $mw->edit( { action => 'edit', title => $wiki_page, text => "$text"} );
+}
+
+
+# wiki_getallpagename [<category>]
+#
+# Fetch all pages of the wiki referenced by the global variable $mw
+# and print the names of each one in the file all.txt with a new line
+# ("\n") between these.
+# If the argument <category> is defined, then this function get only the pages
+# belonging to <category>.
+sub wiki_getallpagename {
+ # fetch the pages of the wiki
+ if (defined($_[0])) {
+ $mw->list ( { action => 'query',
+ list => 'categorymembers',
+ cmtitle => "Category:$_[0]",
+ cmnamespace => 0,
+ cmlimit=> 500 },
+ { max => 4, hook => \&cat_names } )
+ || die $mw->{error}->{code}.": ".$mw->{error}->{details};
+ } else {
+ $mw->list ( { action => 'query',
+ list => 'allpages',
+ #cmnamespace => 0,
+ cmlimit=> 500 },
+ { max => 4, hook => \&cat_names } )
+ || die $mw->{error}->{code}.": ".$mw->{error}->{details};
+ }
+ # print the name of each page
+ sub cat_names {
+ my ($ref) = @_;
+
+ open(my $file, ">all.txt");
+ foreach (@$ref) {
+ print $file "$_->{title}\n";
+ }
+ close ($file);
+ }
+}
+
+# Main part of this script: parse the command line arguments
+# and select which function to execute
+my $fct_to_call = shift;
+
+ &wiki_login($wiki_admin,$wiki_admin_pass);
+
+switch ($fct_to_call) {
+ case "get_page" { &wiki_getpage(@ARGV)}
+ case "delete_page" { &wiki_delete_page(@ARGV)}
+ case "edit_page" { &wiki_editpage(@ARGV)}
+ case "getallpagename" { &wiki_getallpagename(@ARGV)}
+ else { die("test-gitmw.pl ERROR: wrong argument")}
+}
+
--
1.7.10.2.552.gaa3bb87
^ permalink raw reply related [flat|nested] 22+ messages in thread
end of thread, other threads:[~2012-06-05 13:26 UTC | newest]
Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-30 16:30 [PATCH/RFC]Test environment for Git-MediaWiki Simon.Cathebras
2012-05-30 17:04 ` [PATCH 1/3] Script to install, delete and clear a MediaWiki Simon Cathebras
2012-05-30 17:04 ` [PATCH 2/3] Test environment of git-remote-mw Simon Cathebras
2012-05-31 7:17 ` Matthieu Moy
2012-06-01 8:53 ` Simon.Cathebras
2012-06-01 9:02 ` Matthieu Moy
2012-06-01 9:21 ` Matthieu Moy
2012-05-30 17:04 ` [PATCH 3/3] Tests file for git-remote-mediawiki Simon Cathebras
2012-05-31 7:19 ` [PATCH 1/3] Script to install, delete and clear a MediaWiki Matthieu Moy
2012-05-31 18:13 ` [PATCH 1/2] FIX: t9360. NEW test t9361 for git pull and git push Guillaume Sasdy
2012-05-31 18:13 ` [PATCH 2/2] FIX: Syntax of shell and perl scripts and posix compliant Guillaume Sasdy
2012-05-31 18:16 ` [PATCH] " Guillaume Sasdy
2012-05-31 18:27 ` Guillaume Sasdy
2012-05-31 18:31 ` [PATCH 1/3] FIX: cmd_* moved to wiki_* in test-gitmw-lib.sh and other files Guillaume Sasdy
2012-06-01 10:41 ` [PATCH 1/3] Script to install, delete and clear a MediaWiki Guillaume Sasdy
2012-06-01 10:41 ` [PATCH 2/3] Test environment of git-remote-mw Guillaume Sasdy
2012-06-01 11:49 ` Matthieu Moy
2012-06-01 14:43 ` Simon.Cathebras
2012-06-02 10:47 ` Matthieu Moy
2012-06-04 14:13 ` Simon.Cathebras
2012-06-01 10:41 ` [PATCH 3/3] Tests file for git-remote-mediawiki Guillaume Sasdy
-- strict thread matches above, loose matches on Subject: below --
2012-06-05 13:20 [Git-MediaWiki] Test environment for Git-MediaWiki Simon.Cathebras
2012-06-05 13:25 ` [PATCH 1/3] Script to install, delete and clear a MediaWiki Simon Cathebras
2012-06-05 13:25 ` [PATCH 2/3] Test environment of git-remote-mw Simon Cathebras
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).