]> git.ipfire.org Git - thirdparty/git.git/commit
remote-mediawiki tests: use CLI installer
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Mon, 21 Sep 2020 10:39:54 +0000 (12:39 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 21 Sep 2020 19:37:38 +0000 (12:37 -0700)
commit1d42b4d01c95cae37e9c0ebe0ed7c9418f2d6c25
tree97b35f9e2f86a11ed3b7ac3bf23b9eb06839e4f1
parent2388541a77540b8e2acfcf77904515ebb65ffcc5
remote-mediawiki tests: use CLI installer

Replace the use of screen-scraping in the test environment
installation with simply invoking MediaWiki's command-line
installer.

The old code being deleted here relied on our own hardcoded POST
parameter names & the precise layout of MediaWiki's GUI installer at a
given version. Somewhere between [1] and now this inevitably broke.

As far as I can tell there was never a reason for this screen-scraping
hack, when [1] was introduced it hardcoded MediaWiki 1.19.0, the CLI
installer was introduced in 1.17.0. Perhaps the authors weren't aware
of it, or this code was written for an older version.

This allows us to simply delete our own template version of
LocalSettings.php, it'll instead be provided by the CLI installer.

While we're at it let's fix a few things, these changes weren't
practical to split up (I'd need to fix code I was about to mostly
delete)

  * Use MediaWiki's own defaults where possible, e.g. before we'd name
    the database "wikidb.sqlite", now we'll simply use whatever name
    MediaWiki prefers (currently my_wiki.sqlite) by only supplying the
    directory name the SQLite file will be dropped into, not the full
    path.

  * Put all of our database & download assets into a new "mediawiki/"
    folder. This makes it easier to reason about as the current &
    template "backup" database the tests keep swapping around live
    next to each other.

    This'll also prevent future potential breakage as there isn't a
    single SQLite database. MediaWiki also creates a job queue
    database and a couple of cache databases. In practice it seems we
    got away with not resetting these when we reset the main database,
    but it's the sort of thing that could break in the future (reset,
    main store doesn't have the article, but the cache does).

  * The "delete" function now only deletes the MediaWiki installation
    & database, not the downloaded .tar.gz file. This makes us
    friendlier to a developer on a slow connection.

1. 5ef6ad1785 ("git-remote-mediawiki: scripts to install, delete and
   clear a MediaWiki", 2012-07-06)

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/mw-to-git/t/.gitignore
contrib/mw-to-git/t/install-wiki/.gitignore [deleted file]
contrib/mw-to-git/t/install-wiki/LocalSettings.php [deleted file]
contrib/mw-to-git/t/install-wiki/db_install.php [deleted file]
contrib/mw-to-git/t/test-gitmw-lib.sh
contrib/mw-to-git/t/test.config