Test environment for Git-MediaWiki
Good afternoon,
This test environment is created to test the previously implemented git-remote-mediawiki, which was developped last year.
We created in this environment some functions to manipulate a MediaWiki. This way, it will be easier to build some tests for the Git-MediaWiki contribution.
This is our third version for this test environment. We have removed several errors in our code since the V1. Plus, we added some tests using our environment. We are now presenting our code for an inclusion into the P.U branch.
If you want to test our code, please have a look in this wiki : https://github.com/Fafinou/git/wiki . And follow the instructions.
If you have any correction(s) proposal, please let us know, and we will fix them as soon as possible. Thank you in advance for your attention ;).
Have a nice day.
Simon C, for the Team
--
CATHEBRAS Simon
2A-ENSIMAG
Filière Ingéniérie des Systèmes d'Information
Membre Bug-Buster
PATCH 1/3 Script to install, delete and clear a MediaWiki
From: Guillaume Sasdy <[email protected]>
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 wiki_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/
--- t/install-wiki.sh | 38 ++++++++++ t/install-wiki/LocalSettings.php | 129 ++++++++++++++++++++++++++++++++ t/install-wiki/db_install.php | 110 ++++++++++++++++++++++++++++ t/test-gitmw-lib.sh | 154 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 431 insertions(+) create mode 100755 t/install-wiki.sh create mode 100644 t/install-wiki/LocalSettings.php create mode 100644 t/install-wiki/db_install.php 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
t/install-wiki.sh new file +38 -0
@@ -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 +
t/install-wiki/LocalSettings.php new file +129 -0
129 lines not on this page · raw message
t/install-wiki/db_install.php new file +110 -0
110 lines not on this page · raw message
t/test-gitmw-lib.sh new file +154 -0
154 lines not on this page · raw message
t/test-lib-functions.sh +0 -0
t/test-lib.sh +0 -0
Signature · 1 line
1.7.10.2.552.gaa3bb87
PATCH 2/3 Test environment of git-remote-mw
From: Guillaume Sasdy <[email protected]>
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.
--- t/test-gitmw-lib.sh | 105 +++++++++++++++++++++++++++++++ t/test-gitmw.pl | 176 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 281 insertions(+) create mode 100755 t/test-gitmw.pl
t/test-gitmw-lib.sh +105 -0
@@ -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
t/test-gitmw.pl new file +176 -0
176 lines not on this page · raw message
Signature · 1 line
1.7.10.2.552.gaa3bb87
PATCH 3/3 Tests file for git-remote-mediawiki
In reply to Simon CathebrasFrom: Charles Roussel <[email protected]>
Those scripts test the functions of git-remote-mediawiki.
t9360: test cases for git clone. Including tests of cloning just a category, just a precise set of page and a classical use of clone on the whole wiki. In addition, this file provide now some fonction du manipulate sections on wiki.
We can now create a page or edit it, to put it in a given category of the wiki.
t9361: test cases for git pull (add page, edit page, delete page) and git push (add file, edit file, delete file).
--- t/t9360-git-mediawiki.sh | 265 +++++++++++++++++++++++++++++++++++++++++++++++ t/t9361-git-mediawiki.sh | 213 +++++++++++++++++++++++++++++++++++++ 2 files changed, 478 insertions(+) create mode 100755 t/t9360-git-mediawiki.sh create mode 100755 t/t9361-git-mediawiki.sh
t/t9360-git-mediawiki.sh new file +265 -0
@@ -0,0 +1,265 @@ +#!/bin/sh +# +# Copyright (C) 2012 +# Charles Roussel <[email protected]> +# Simon Cathebras <[email protected]> +# Julien Khayat <[email protected]> +# Guillaume Sasdy <[email protected]> +# Simon Perrat <[email protected]> +# +# 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 + + +# clone a empty wiki and check that the repository contains only Main_Page.mw +test_expect_success 'git clone only create Main_Page.mw with an empty wiki' ' + wiki_reset && + git clone mediawiki::http://localhost/wiki mw_dir && + test_expect_code 0 ls mw_dir | wc -l | grep 1 && + test_expect_code 0 test -e mw_dir/Main_Page.mw && + rm -rf mw_dir +' + +# clone a wiki where a page has been added and then deleted +# check that the page no longer exists +test_expect_success 'git clone only create Main_Page.mw with a wiki with no other pages ' ' + wiki_reset && + wiki_editpage foo "this page must be delete before the clone" false && + wiki_delete_page foo && + git clone mediawiki::http://localhost/wiki mw_dir && + test `ls mw_dir | wc -l` -eq 1 && + test -e mw_dir/Main_Page.mw && + test ! -e mw_dir/Foo.mw && + rm -rf mw_dir +' + +# clone a wiki with a new page on it +# check that the file corresponding to the page is in the repository +test_expect_success 'git clone works with page added' ' + wiki_reset && + wiki_editpage foo " I will be cloned" false && + wiki_editpage bar "I will be cloned" false && + git clone mediawiki::http://localhost/wiki mw_dir && + wiki_getallpage ref_page && + git_diff_directories mw_dir ref_page && + wiki_delete_page foo && + rm -rf mw_dir && + rm -rf ref_page && + wiki_delete_page bar +' + + +# clone a wiki after a page has been added then edited once +# check that the content is correct +test_expect_success 'git clone works with an edited page ' ' + wiki_reset && + wiki_editpage foo "this page will be edited" false && + wiki_editpage foo "this page has been edited and must be on the clone " false && + git clone mediawiki::http://localhost/wiki mw_dir && + test -e mw_dir/Foo.mw && + test -e mw_dir/Main_Page.mw && + wiki_getallpage mw_dir/page_ref && + git_diff_directories mw_dir mw_dir/page_ref && + rm -rf mw_dir +' + +# clone a wiki with several pages where some were delete +test_expect_success 'git clone works with several pages and some deleted ' ' + wiki_reset && + wiki_editpage foo "this page will not be deleted" false && + wiki_editpage bar "I must not be erased" false && + wiki_editpage namnam "I will not be there at the end" false && + wiki_editpage nyancat "nyan nyan nyan delete me" false && + wiki_delete_page namnam && + wiki_delete_page nyancat && + git clone mediawiki::http://localhost/wiki mw_dir && + test -e mw_dir/Foo.mw && + test -e mw_dir/Bar.mw && + test ! -e mw_dir/Namnam.mw && + test ! -e mw_dir/Nyancat.mw && + wiki_getallpage mw_dir/page_ref && + git_diff_directories mw_dir mw_dir/page_ref && + rm -rf mw_dir +' + + + + +# clone only one page of the wiki +# check that it is the only page cloned +# check that the page and the clone a identical +test_expect_success 'git clone works one specific page cloned ' ' + wiki_reset && + wiki_editpage foo "I will not be cloned" false && + wiki_editpage bar "Do not clone me" false && + wiki_editpage namnam "I will be cloned :)" false && + wiki_editpage nyancat "nyan nyan nyan you cant clone me" false && + git clone -c remote.origin.pages=namnam mediawiki::http://localhost/wiki mw_dir && + test `ls mw_dir | wc -l` -eq 1 && + test -e mw_dir/Namnam.mw && + test ! -e mw_dir/Main_Page.mw && + wiki_check_content mw_dir/Namnam.mw Namnam && + rm -rf mw_dir +' + + +# clone multiple specific pages of the wiki +# check that there are the only page cloned +# check that the pages and the clone a identical +test_expect_success 'git clone works multiple specific page cloned ' ' + wiki_reset && + wiki_editpage foo "I will be there" false && + wiki_editpage bar "I will not disapear" false && + wiki_editpage namnam "I be erased" false && + wiki_editpage nyancat "nyan nyan nyan you will not erase me" false && + wiki_delete_page namnam && + git clone -c remote.origin.pages='"'foo bar nyancat namnam'"' mediawiki::http://localhost/wiki mw_dir && + test `ls mw_dir | wc -l` -eq 3 && + test ! -e mw_dir/Namnam.mw && + test -e mw_dir/Foo.mw && + test -e mw_dir/Nyancat.mw && + test -e mw_dir/Bar.mw && + wiki_check_content mw_dir/Foo.mw Foo && + wiki_check_content mw_dir/Bar.mw Bar && + wiki_check_content mw_dir/Nyancat.mw Nyancat && + rm -rf mw_dir +' + +# Tests that cloning some specific pages from a larger wiki works properly +test_expect_success 'mediawiki-clone of several specific pages on wiki' ' + wiki_reset && + wiki_editpage foo "foo 1" false && + wiki_editpage bar "bar 1" false && + wiki_editpage dummy "dummy 1" false && + wiki_editpage cloned_1 "cloned_1 1" false && + wiki_editpage cloned_2 "cloned_2 2" false && + wiki_editpage cloned_3 "cloned_3 3" false && + mkdir -p ref_page && + wiki_getpage cloned_1 ref_page && + wiki_getpage cloned_2 ref_page && + wiki_getpage cloned_3 ref_page && + git clone -c remote.origin.pages="cloned_1 cloned_2 cloned_3" mediawiki::http://localhost/wiki mw_dir_spage && + git_diff_directories mw_dir_spage ref_page && + rm -rf mw_dir_spage && + rm -rf ref_page +' + + +# use git clone with the shallow option +# check that only the last revisions are cloned +# i.e the log only contains 1 commit per page +test_expect_success 'git clone works with the shallow option' ' + wiki_reset && + wiki_editpage foo "1st revision, should be cloned" && + wiki_editpage bar "1st revision, should be cloned" && + wiki_editpage nyan "1st revision, should not be cloned" && + wiki_editpage nyan "2nd revision, should be cloned" && + git -c remote.origin.shallow=true clone mediawiki::http://localhost/wiki/ mw_dir && + test `ls mw_dir | wc -l` -eq 4 && + test -e mw_dir/Nyan.mw && + test -e mw_dir/Foo.mw && + test -e mw_dir/Bar.mw && + test -e mw_dir/Main_Page.mw && + cd mw_dir && + test `git log --oneline Nyan.mw | wc -l` -eq 1 && + test `git log --oneline Foo.mw | wc -l` -eq 1 && + test `git log --oneline Bar.mw | wc -l` -eq 1 && + test `git log --oneline Main_Page.mw | wc -l ` -eq 1 && + cd .. && + wiki_check_content mw_dir/Nyan.mw Nyan && + wiki_check_content mw_dir/Foo.mw Foo && + wiki_check_content mw_dir/Bar.mw Bar && + wiki_check_content mw_dir/Main_Page.mw Main_Page && + rm -rf mw_dir +' + +# use git clone with the shallow option +# check that only the last revisions are cloned +# i.e the log only contains 1 commit per page +# in this case we have a delete page +test_expect_success 'git clone works with the shallow option with a delete page' ' + wiki_reset && + wiki_editpage foo "1st revision, will be deleted" && + wiki_editpage bar "1st revision, should be cloned" && + wiki_editpage nyan "1st revision, should not be cloned" && + wiki_editpage nyan "2nd revision, should be cloned" && + wiki_delete_page foo && + git -c remote.origin.shallow=true clone mediawiki::http://localhost/wiki/ mw_dir && + test `ls mw_dir | wc -l` -eq 3 && + test -e mw_dir/Nyan.mw && + test ! -e mw_dir/Foo.mw && + test -e mw_dir/Bar.mw && + test -e mw_dir/Main_Page.mw && + cd mw_dir && + test `git log --oneline Nyan.mw | wc -l` -eq 1 && + test `git log --oneline Bar.mw | wc -l` -eq 1 && + test `git log --oneline Main_Page.mw | wc -l ` -eq 1 && + cd .. && + wiki_check_content mw_dir/Nyan.mw Nyan && + wiki_check_content mw_dir/Bar.mw Bar && + wiki_check_content mw_dir/Main_Page.mw Main_Page && + rm -rf mw_dir +' + + +# clone a category +# check that only this category has been cloned +test_expect_success 'test of fetching a category' ' + wiki_reset && + wiki_editpage Foo "I will be cloned" false Category && + wiki_editpage Bar "Meet me on the repository" false Category && + wiki_editpage Dummy "I will not come" false && + wiki_editpage BarWrong "I will stay online only" false NotCategory && + git clone -c remote.origin.categories="Category" mediawiki::http://localhost/wiki mw_dir && + wiki_getallpage ref_page Category && + git_diff_directories mw_dir ref_page + rm -rf mw_dir && + rm -rf ref_page +' + +# Test of cloning a category on wiki. +# This category has been previously edited in some ways +# like edition of a given page and deletion of another. +test_expect_success 'test of resistance to modification of category on wiki for clone' ' + wiki_reset && + wiki_editpage Tobedeleted "this page will be deleted" false Catone && + wiki_editpage Tobeedited "this page will be modified" false Catone && + wiki_editpage Normalone "this page wont be modified and will be on git" false Catone && + wiki_editpage Notconsidered "this page will not appears on local" false && + wiki_editpage Othercategory "this page will not appears on local" false Cattwo && + wiki_editpage Tobeedited "this page have been modified" true Catone && + wiki_delete_page Tobedeleted + git clone -c remote.origin.categories="Catone" mediawiki::http://localhost/wiki mw_dir && + wiki_getallpage ref_page Catone && + git_diff_directories mw_dir ref_page && + rm -rf mw_dir && + rm -rf ref_page +' + +test_done
t/t9361-git-mediawiki.sh new file +213 -0
213 lines not on this page · raw message
Signature · 1 line
1.7.10.2.552.gaa3bb87
Re: [PATCH 3/3] Tests file for git-remote-mediawiki
Quoted 4 lines · Simon Cathebras
From: Charles Roussel <[email protected]>
Those scripts test the functions of git-remote-mediawiki.
t9360: test cases for git clone. Including tests of cloning just a category, just a precise set of page and a classical use of clone on the whole wiki.
Avoid long lines in code and commit messages (80 columns max)
Quoted 1 line
In addition, this file provide now some fonction du manipulate sections on wiki.
s/du/to/
Quoted 1 line
t9361: test cases for git pull (add page, edit page, delete page) and git push (add file, edit file, delete file).
When commis messages start looking like an enumeration, it usually means that either you read the GNU recommandation for ChangeLogs too much, or that you should split your commit (not mandatory here I think, but short patches are easier to review).
t/t9360-git-mediawiki.sh line 14
Quoted 3 lines
t/t9360-git-mediawiki.sh new file +3
-0+# tests for git-remote-mediawiki + +test_description='Test the Git Mediawiki remote helper: git clone'
Why do you need a comment if you have the test_description right below?
Quoted 1 line
+if [ ! -f /$GIT_BUILD_DIR/git-remote-mediawiki ];
Why / in front of $GIT_BUILD_DIR/ ?
t/t9360-git-mediawiki.sh line 45
Quoted 2 lines
t/t9360-git-mediawiki.sh new file +2
-0+ test_expect_code 0 ls mw_dir | wc -l | grep 1 && + test_expect_code 0 test -e mw_dir/Main_Page.mw &&
Why "test_expect_code 0"? You already have && right?
Doesn't a directory containing 10 files pass the tests?
You probably want a helper function test_contains_N_files <dir> <N> that does test ls mw_dir | wc -l -eq 1 as you did below, but may give a diagnosis when the test fails.
t/t9360-git-mediawiki.sh line 53
Quoted 3 lines
t/t9360-git-mediawiki.sh new file +3
-0+test_expect_success 'git clone only create Main_Page.mw with a wiki with no other pages ' ' + wiki_reset && + wiki_editpage foo "this page must be delete before the clone" false &&
s/delete/deleted/
Review
Quoted 1 line
(quoted diff) +1
-0+ git_diff_directories mw_dir ref_page &&
functions in tests are usually prefixed with test_ instead.
t/t9360-git-mediawiki.sh line 79
Quoted 2 lines
t/t9360-git-mediawiki.sh new file +2
-0+# clone a wiki after a page has been added then edited once +# check that the content is correct
It's not sufficient. You should check also that the history is correct.
Signature · 2 lines
Matthieu Moy http://www-verimag.imag.fr/~moy/
Re: [PATCH 3/3] Tests file for git-remote-mediawiki
Quoted 7 lines · Matthieu Moy
Quoted 4 lines · Simon Cathebras
From: Charles Roussel<[email protected]>
Those scripts test the functions of git-remote-mediawiki.
t9360: test cases for git clone. Including tests of cloning just a category, just a precise set of page and a classical use of clone on the whole wiki.Avoid long lines in code and commit messages (80 columns max)
Understood, it will be corrected in the next patch.
Quoted 9 lines
Quoted 2 lines
In addition, this file provide now some fonction du manipulate sections on wiki.
s/du/to/
Quoted 1 line
t9361: test cases for git pull (add page, edit page, delete page) and git push (add file, edit file, delete file).
When commis messages start looking like an enumeration, it usually means that either you read the GNU recommandation for ChangeLogs too much, or that you should split your commit (not mandatory here I think, but short patches are easier to review).
Do you mean that we should split the third patch into two patches ? For instance::
Patch 3/4: tests for git pull
Patch 4/4: tests for git push
Quoted 5 lines
t/t9360-git-mediawiki.sh line 14
Quoted 4 lines
t/t9360-git-mediawiki.sh new file +3
-0+# tests for git-remote-mediawiki + +test_description='Test the Git Mediawiki remote helper: git clone'Why do you need a comment if you have the
test_descriptionright below?
Deleted.
Quoted 3 lines
Quoted 2 lines
+if [ ! -f /$GIT_BUILD_DIR/git-remote-mediawiki ];
Why / in front of $GIT_BUILD_DIR/ ?
Good point, we didn't noticed it ...
Quoted 3 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+ test_expect_code 0 ls mw_dir | wc -l | grep 1&& + test_expect_code 0 test -e mw_dir/Main_Page.mw&&Why "
test_expect_code0"? You already have&& right?
Yes, we haven't realised it wasn't necessary.
We have corrected other errors like this one in our tests.
Quoted 5 lines
Doesn't a directory containing 10 files pass the tests?
You probably want a helper function test_contains_N_files<dir> <N> that does test
ls mw_dir | wc -l-eq 1 as you did below, but may give a diagnosis when the test fails.
Done, and replace within the existing code.
Quoted 6 lines
Review
Quoted 3 lines
(quoted diff) +3
-0+test_expect_success 'git clone only create Main_Page.mw with a wiki with no other pages ' ' + wiki_reset&& + wiki_editpage foo "this page must be delete before the clone" false&&s/delete/deleted/
Review
Quoted 1 line
(quoted diff) +1
-0+ git_diff_directories mw_dir ref_page&&functions in tests are usually prefixed with
test_instead.
Fair enough. We have changed the function's name. Should we add such prefix on functions like wiki_reset or wiki_delete page ?
Quoted 4 lines
t/t9360-git-mediawiki.sh line 79
Quoted 2 lines
t/t9360-git-mediawiki.sh new file +2
-0+# clone a wiki after a page has been added then edited once +# check that the content is correctIt's not sufficient. You should check also that the history is correct.
Test is now correct.
Thanks for the advices ;).
Signature · 6 lines
CATHEBRAS Simon 2A-ENSIMAG Filière Ingéniérie des Systèmes d'Information Membre Bug-Buster
Re: [PATCH 3/3] Tests file for git-remote-mediawiki
Quoted 9 lines · Simon.Cathebras
Quoted 7 lines · Matthieu Moy
Quoted 4 lines · Simon Cathebras
From: Charles Roussel<[email protected]>
Those scripts test the functions of git-remote-mediawiki.
t9360: test cases for git clone. Including tests of cloning just a category, just a precise set of page and a classical use of clone on the whole wiki.Avoid long lines in code and commit messages (80 columns max)
Understood, it will be corrected in the next patch.
Detail: in emails, people generally leave blank lines to separate paragraphs, and in particular to separate one's own text from citation. Compare my response
http://thread.gmane.org/gmane.comp.version-control.git/199238/focus=199349
to yours to see what I mean
http://thread.gmane.org/gmane.comp.version-control.git/199238/focus=199468
Quoted 4 lines
Do you mean that we should split the third patch into two patches ? For instance::
Patch 3/4: tests for git pull
Patch 4/4: tests for git push
Yes, except the title should mention git-remote-mediawiki, of course.
Quoted 8 lines
Quoted 6 lines
Review
Quoted 3 lines
(quoted diff) +3
-0+test_expect_success 'git clone only create Main_Page.mw with a wiki with no other pages ' ' + wiki_reset&& + wiki_editpage foo "this page must be delete before the clone" false&&s/delete/deleted/
Review
Quoted 1 line
(quoted diff) +1
-0+ git_diff_directories mw_dir ref_page&&functions in tests are usually prefixed with
test_instead.Fair enough. We have changed the function's name. Should we add such prefix on functions like
wiki_resetorwiki_deletepage ?
I don't think so. They're not very specific to testing indeed, and really are specific to the wiki OTOH.
Signature · 2 lines
Matthieu Moy http://www-verimag.imag.fr/~moy/
Re: [PATCH 3/3] Tests file for git-remote-mediawiki
2012/6/8 Matthieu Moy <[email protected]>
Quoted 9 lines
Quoted 4 lines · Simon.Cathebras
Do you mean that we should split the third patch into two patches ? For instance::
Patch 3/4: tests for git pull
Patch 4/4: tests for git pushYes, except the title should mention git-remote-mediawiki, of course.
Should we split our test file in two then ? Currently they're all in t9361.
Re: [PATCH 3/3] Tests file for git-remote-mediawiki
Quoted 8 lines · Simon Perrat
2012/6/8 Matthieu Moy <[email protected]>
Quoted 7 lines
Quoted 4 lines · Simon.Cathebras
Do you mean that we should split the third patch into two patches ? For instance::
Patch 3/4: tests for git pull
Patch 4/4: tests for git push
Quoted 4 lines
Quoted 2 lines
Yes, except the title should mention git-remote-mediawiki, of course.
Should we split our test file in two then ? Currently they're all in t9361.
The patch I was commenting does
t/t9360-git-mediawiki.sh | 265 +++++++++++++++++++++++++++++++++++++++++++++++ t/t9361-git-mediawiki.sh | 213 +++++++++++++++++++++++++++++++++++++
(BTW, you can find a better naming for the files, if one tests clone, then clone should appear in the title, same for push/pull).
There's nothing wrong with touching several files in the same commit, but when your commit messages looks like
- first file: does this
- second file: does that
and there's no dependencies, it's usually better to split the commit.
Signature · 2 lines
Matthieu Moy http://www-verimag.imag.fr/~moy/
Re: [PATCH 1/3] Script to install, delete and clear a MediaWiki
In reply to Simon CathebrasQuoted 18 lines · Simon Cathebras
From: Guillaume Sasdy <[email protected]>
install_wiki.shexpects 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_wikialso defines a functionwiki_resetwhich 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 <[email protected]>Signed-off-by Guillaume Sasdy <[email protected]>Signed-off-by Julien Khayat <[email protected]>Signed-off-by Simon Perrat <[email protected]>Signed-off-by Charles Roussel <[email protected]>Signed-off-by Matthieu Moy <[email protected]>
Quoted 5 lines
--- t/install-wiki.sh | 38 ++++++++++ t/install-wiki/LocalSettings.php | 129 ++++++++++++++++++++++++++++++++ t/install-wiki/db_install.php | 110 ++++++++++++++++++++++++++++ t/test-gitmw-lib.sh | 154 +++++++++++++++++++++++++++++++++++++++
Hrm, I see my name on the Cc: list, but is this meant to go into my tree?
The t/ directory is a very strange place to put an installation procedure for anything. Is this because later test scripts that test mw-to-git gateway need to have a mediawiki instance that runs locally?
I am wondering why it is not sufficient to structure the MediaWiki related tests more like existing tests that require a running HTTP server, namely, t/lib-httpd.sh that allows such tests to proceed only if a suitable server is available, but we do not ship a script to install Apache for that.
Quoted 2 lines
mode change 100644 => 100755 t/test-lib-functions.sh mode change 100644 => 100755 t/test-lib.sh
Why?
Re: [PATCH 1/3] Script to install, delete and clear a MediaWiki
Quoted 25 lines · Junio C Hamano
Quoted 18 lines · Simon Cathebras
From: Guillaume Sasdy<[email protected]>
install_wiki.shexpects 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_wikialso defines a functionwiki_resetwhich 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<[email protected]>Signed-off-by Guillaume Sasdy<[email protected]>Signed-off-by Julien Khayat<[email protected]>Signed-off-by Simon Perrat<[email protected]>Signed-off-by Charles Roussel<[email protected]>Signed-off-by Matthieu Moy<[email protected]>Quoted 5 lines
--- t/install-wiki.sh | 38 ++++++++++ t/install-wiki/LocalSettings.php | 129 ++++++++++++++++++++++++++++++++ t/install-wiki/db_install.php | 110 ++++++++++++++++++++++++++++ t/test-gitmw-lib.sh | 154 +++++++++++++++++++++++++++++++++++++++
Quoted 1 line
Hrm, I see my name on the Cc: list, but is this meant to go into my tree?
Yes, but we would like to apologize for the poor choice of word. It would be more correct to say that we are proposing to you an improvement for git-remote-mediawiki, currently in git/contrib/mw-to-git/t. This improvement is actually a test environment for git-remote-mediawiki.
Quoted 2 lines
The t/ directory is a very strange place to put an installation procedure for anything.
Sorry again, we intended to move our test environment from t/ to *PATH*. Unfortunately, we made a wrong manipulation and we couldn't solve this issue. But it will be fixed in the next patch.
Quoted 3 lines
Is this because later test scripts that
test mw-to-git gateway need to have a mediawiki instance that runs locally?
Exactly.
Quoted 6 lines
I am wondering why it is not sufficient to structure the MediaWiki related tests more like existing tests that require a running HTTP server, namely,
t/lib-httpd.shthat allows such tests to proceed only if a suitable server is available, but we do not ship a script to install Apache for that.
Actually, we are providing an install script for a MediaWiki, because we
need some specific configurations on it to run all the tests correctly. Without forget to mention that our test are creating several page on the wiki used for the tests, and reset it several times... It wouldn't be realy smart to use a real and realy used wiki to test git-mw. As a matter of fact, it is easier to create a script than providing a complex
documentation on "how to install our specific mediawiki" for the user.
In addition, we are providing function of reset and deletion on the
mediawiki, for purpose of tests. And it is impossible to do if we do not
install it ourselves.
Anyway, it is possible to skip those tests if a wiki is not intalled.
For all those reason, we believe that we must keep this script to install a wiki in our code.
Quoted 3 lines
Quoted 2 lines
mode change 100644 => 100755
t/test-lib-functions.shmode change 100644 => 100755t/test-lib.shWhy?
A wrong manipulation during the development: chmod +x on those file... We have forgotten to correct it. Correction in the next patch.
Signature · 6 lines
CATHEBRAS Simon 2A-ENSIMAG Filière Ingéniérie des Systèmes d'Information Membre Bug-Buster