Skip to content

Commit 72c5ec9

Browse files
committed
Integration test complete!
1 parent f0c58cd commit 72c5ec9

8 files changed

Lines changed: 23 additions & 17 deletions

DEVELOPMENT.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ To enable GitHub Pages: go to `Settings -> Pages` in the repository, then select
6060
## Local MediaWiki testing
6161

6262
For end-to-end testing in a real wiki environment, this repo includes a minimal `docker-compose.yml` for MediaWiki plus MariaDB.
63-
The MediaWiki container is built from `test/docker/mediawiki.Dockerfile`, which adds Lua 5.1 for Scribunto's `lua-standalone` engine.
63+
The MediaWiki container is built from `test/docker/mediawiki.Dockerfile`, which adds Lua 5.1 for Scribunto's `luastandalone` engine.
6464

6565
Start it with:
6666

@@ -84,16 +84,22 @@ http://localhost:8080
8484
Recommended workflow:
8585
1. Run `python3 scripts/build_artifacts.py` so the current export file exists in `dist/`.
8686
2. Start the stack with `docker compose up -d`.
87+
* After first startup or after enabling/changing extension config in `LocalSettings.php`, run:
88+
89+
```bash
90+
docker compose exec mediawiki php maintenance/run.php update
91+
```
92+
8793
3. Login with credentials admin / adminpassword. *The config does not expose the container to the internet and you shouldn't use these credentials if you do.*
8894
4. Import the generated export into the running wiki using one of these methods:
89-
* In `Special:Import`, upload the local `dist/mediawiki-export.xml` file from your machine. Use any import prefix (e.g. "imported")
95+
* In `Special:Import`, upload the local `dist/mediawiki-export.xml` file from your machine. Use any import prefix (e.g. "imported") for the edit logs.
9096
* Or import from inside the container with:
9197

9298
```bash
9399
docker compose exec mediawiki php maintenance/run.php importDump /imports/mediawiki-export.xml
94100
```
95101

96-
* Note that these will clobber any existing pages, though undo will be available in the version history.
102+
* Note that these will clobber any existing pages, though undo will be available in the version history. The import will not work correctly until Scribunto's install maintenance has run.
97103

98104
5. Update `MediaWiki:Gadgets-definition` to load `MediaWiki:Gadget-inline-datetime.js` and `MediaWiki:Gadget-inline-datetime.css`.
99105
6. Optionally add `Template:IDT` manually if you want the short alias.
@@ -104,5 +110,5 @@ Notes:
104110
* `test/docker/LocalSettings.php` is committed as a local test-only configuration for this Docker setup. It should not be reused for production or public deployment.
105111
* The generated `dist/` directory is mounted read-only into the MediaWiki container at `/imports`.
106112
* `test/docker/LocalSettings.php` is mounted read-only into the MediaWiki container as `/var/www/html/LocalSettings.php`.
107-
* The MediaWiki image includes `lua5.1` so `wfLoadExtension( 'Scribunto' )` can use the `lua-standalone` engine from the committed test config.
113+
* The `mediawiki:1.43` image doesn't include Scribunto's bundled standalone Lua binary, so we install system lua5.1 and we have `test/docker/LocalSettings.php` explicitly point Scribunto at `/usr/bin/lua5.1`.
108114
* Uploaded wiki files live in a named Docker volume, so restarting the stack does not wipe images.

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,10 @@ This repository's export file includes:
8888
After importing the pages, add an entry to `MediaWiki:Gadgets-definition`. A typical entry looks like:
8989

9090
```mediawiki
91-
* inline-datetime[ResourceLoader|default|type=general]|Gadget-inline-datetime-config.js|Gadget-inline-datetime.js|Gadget-inline-datetime.css
91+
* inline-datetime[ResourceLoader|default|type=general]|inline-datetime-config.js|inline-datetime.js|inline-datetime.css
9292
```
9393

9494
Option notes:
95-
* `ResourceLoader` — registers the gadget as a ResourceLoader module for better performance and dependency support; remove this option if your wiki does not use ResourceLoader
9695
* `default` — enables the gadget for all users automatically; replace with `hidden` if you want it available but opt-in only
9796
* `type=general` — runs scripts in the page scope; required for this gadget to access the page DOM
9897
* The config file **must be listed before** the main JS file so it is executed first

TODO.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44

55
* Improve lua fallback to be closer to the JS?
66
* Include style classes?
7-
* verify usage documentation is aligned (specs, wiki doc page, visual test page)
8-
* Test the export file
9-
* How will MediaWiki handle "duplicate" pages?
10-
* Document easy docker setup for this
7+
* This could interfere with the current no-JS demo
118
* audit code for readability and obviousness
129

1310
## Later

gadget/Template_IDT.wikitext

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
{{InlineDateTime|start={{{start|{{{1|}}}}}}|end={{{end|{{{2|}}}}}}|server={{{server|}}}|raw={{{raw|}}}}}
1+
<includeonly>{{InlineDateTime|start={{{start|{{{1|}}}}}}|end={{{end|{{{2|}}}}}}|server={{{server|}}}|raw={{{raw|}}}}}</includeonly><noinclude>
2+
Short alias for [[Template:InlineDateTime]].
3+
</noinclude>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{#invoke:InlineDateTime|main}}<noinclude>
2-
{{documentation}}
1+
<includeonly>{{#invoke:InlineDateTime|main}}</includeonly><noinclude>
2+
{{/doc}}
33
[[Category:InlineDateTime templates]]
44
</noinclude>

gadget/Template_InlineDateTime_doc.wikitext

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
== Usage ==
22

3-
<code><nowiki>{{InlineDateTime}}</nowiki></code> (or the short alias <code><nowiki>{{IDT}}</nowiki></code>) displays an inline datetime or date range with automatic timezone conversion for the reader. Times are shown with a tooltip providing conversions to the reader's local time and/or server times.
3+
<code><nowiki>{{InlineDateTime}}</nowiki></code> (or the short alias <code><nowiki>{{InlineDateTime}}</nowiki></code>) displays an inline datetime or date range with automatic timezone conversion for the reader. Times are shown with a tooltip providing conversions to the reader's local time and/or server times.
44

55
=== Parameters ===
66

@@ -38,6 +38,7 @@
3838

3939
'''Server time range (most common):'''
4040
<pre>{{InlineDateTime|start=2026-03-12 12:00|end=2026-03-29 12:00}}</pre>
41+
What it looks like: {{InlineDateTime|start=2026-03-12 12:00|end=2026-03-29 12:00}}
4142

4243
'''Absolute time (maintenance window):'''
4344
<pre>{{InlineDateTime|start=2026-03-12 06:00 +8|end=2026-03-12 12:00 +8}}</pre>

test/docker/LocalSettings.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,10 @@
168168
wfLoadExtension( 'SyntaxHighlight_GeSHi' );
169169
wfLoadExtension( 'Scribunto' );
170170
$wgScribuntoDefaultEngine = 'luastandalone';
171-
$wgScribuntoEngineConf['luastandalone']['luaPath'] = '/usr/bin/lua5.1'; // TODO is this needed? If not, we can remove the build step that added it.
171+
// The MediaWiki Docker image used for local testing does not ship Scribunto's
172+
// standalone Lua binary, so this test setup uses system lua5.1 instead.
173+
$wgScribuntoEngineConf['luastandalone']['luaPath'] = '/usr/bin/lua5.1';
172174
$wgScribuntoEngineConf['luastandalone']['errorFile'] = '/tmp/scribunto.log';
173-
// $wgScribuntoEngineConf['lua-standalone']['luaPath'] = "$IP/extensions/Scribunto/includes/engines/LuaStandalone/binaries/lua5.1_linux_64_generic/lua";
174175
wfLoadExtension( 'CategoryTree' );
175176
wfLoadExtension( 'ReplaceText' );
176177

test/docker/mediawiki.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM mediawiki:1.43
22

3-
# Install Lua 5.1 for Scribunto's lua-standalone engine.
3+
# Install Lua 5.1 for Scribunto's luastandalone engine.
44
RUN apt-get update \
55
&& apt-get install -y --no-install-recommends lua5.1 \
66
&& rm -rf /var/lib/apt/lists/*

0 commit comments

Comments
 (0)