If this page has been recently modified, it may not reflect the most recent changes. Please purge this page to view the most recent changes. |
Automatic archive bot parameter detection with human readable durations
editThese tests verify that correct value are supplied when a validly formatted Miszabot/config exists for the page. The template can determine all four values if present in the config, and uses them to automatically populate information about automatic archiving. Durations are displayed in a human-readable format in the direct text of the page, and the actual value set in the config is displayed in a tooltip (e.g. "3 years" in the text, "26000 hours" in the tooltip).
Expand to view description of how to run these tests
|
---|
How to test In the normal case, archiving is detected based on the presence or absence of an archive bot config (MiszaBot, Cluebot) on the page where the Talk header template is located, but since there is no archive bot config (and no Talk header template) on this page, automatic detection will not work here. To run these tests, we use Special:ExpandTemplates with field Context title set to any of several test pages, and then apply the tests. For example: set Context title to LIVE {{Talk header}} ----- SANDBOX {{Talk header/sandbox}} to complete the test. Expected result: The header is displayed, including the right-justified archive notice:
Examples
To test the subtemplate directly, using only one param in the context of FULLPAGENAME, use Special:ExpandTemplates with ContextTitle set to the Talk page name (e.g., We can code tests in ExpandTemplates, and link them url-encoded here, which will provide a testcase embedded in the link and executed at ExpandTemplates, not here: Test Template:Talk header in the context of the following Talk pages which use MiszaBot/config:
|
Alternatively, run the following tests setting the Context title to each Talk page in turn in the numbered tests below, after having pasted the following code (once) into the Input field at Special:ExpandTemplates:
Test code for ExpandTemplates
|
---|
LIVE {{Talk header}} ----- SANDBOX {{Talk header/sandbox}} |
Tests for pages using Miszabot config:
- Test A–1: Talk:Algeria – expect "3 months" in-text; the tooltip reads "Lowercase sigmabot III ... 90 days ... more than 4 threads are present"
- Test A–2: Talk:France – expect 3 months / Lowercase sigmabot III – 90 days – minthreads = 4
- Test A–3: Talk:Muammar Gaddafi – expect 2 months / Lowercase sigmabot III – 60 days
- Test A–4: Talk:Physics – expect 3 months / Lowercase sigmabot III – 100 days – minthreads=4
- Test A–5: Talk:Noam Chomsky – expect 45 days / Lowercase sigmabot III – minthreads=3
- Test A–5: Talk:Mustang – expect 2 months / Lowercase sigmabot III – 61 days
- Test A–6: Talk:-ism – expect 3 years / Lowercase sigmabot III – 1095 days – minthreads=1
Tests for pages using User:ClueBot III/ArchiveThis
- Test B–2: Talk:The Exorcist – expect 30 days / Cluebot III – 720 hours – minthreads = 4
- Test B–3: Talk:List of colors – expect 7.5 days / Cluebot III – 183 hours – minthreads = 4
- Test B–4: Talk:Toronto – expect 2 months / Cluebot III – 1440 hours
- Test B–5: Talk:Website – expect 3 months / Cluebot III – 2160 hours – minthreads = 5
- Test B–6: Talk:Switzerland – expect 4 months / Cluebot III – 2880 hours – minthreads = 5
- Test B–7: Talk:Fake news – expect 3 months / Cluebot III – 2160 hours – minthreads = 4
- Test B–8: Talk:Spotify – expect 3 months / Cluebot III – 2160 hours – minthreads = 4
- Test B–9: Talk:2022 – expect 30 days / Cluebot III – 720 hours – minthreads = 10
- Test B–10: Talk:Macedonia – expect 3 months / Cluebot III – 2160 hours – minthreads = 4
Direct testing of Template:Talk header/archivebotparse
editThe subtemplate Template:Talk header/archivebotparse can be tested directly, using the two-param method, passing the name of the Talk page in param 2. These tests follow:
Tests for Talk pages that use User:MiszaBot/config
editTest A–1: Talk:Algeria – expect 90 days, minthreads = 4
|
---|
|
Test A–2: Talk:France – expect 90 days, minthreads = 4
|
---|
|
Test A–3: Talk:Muammar Gaddafi – expect 60 days
|
---|
|
Test A–4: Talk:Physics – expect 100 days, minthreads=4
|
---|
|
Test A–5: Talk:Noam Chomsky – expect 45 days, minthreads=3
|
---|
|
Test A–6: Talk:Mustang – expect=61 days here, '2 months' in the Talk header from param override
|
---|
|
Tests for Talk pages that use User:ClueBot III/ArchiveThis
editMore like these: Advanced search.
Test B–2: Talk:The Exorcist – expect 720 hours, minthreads = 4
|
---|
|
Test B–3: Talk:List of colors – expect 183 hours, minthreads = 4
|
---|
|
Test B–4: Talk:Toronto – expect 1440 hours
|
---|
|
Test B–5: Talk:Website – expect 2160 hours, minthreads = 5
|
---|
|
Test B–6: Talk:Switzerland – expect 2880 hours, minthreads = 5
|
---|
|
Test B–7: Talk:Fake news – expect 2160 hours, minthreads = 4
|
---|
|
Test B–8: Talk:Spotify – expect 2160 hours, minthreads = 4
|
---|
|
Test B–9: Talk:2022 – expect 720 hours, minthreads = 10
|
---|
|
Test B–10: Talk:Macedonia – expect 2160 hours, minthreads = 4
|
---|
|
Testing upgrade for minimum threads to archive
editTalk pages that use Miszabot config
editFind MiszaBot-config archiving test cases:
hastemplate:"talk header" hastemplate:"User:MiszaBot/config" insource:"minthreadstoarchive=" -insource:"archive_age=" -insource:"bot="
Test set 2-A: Talk pages using User:MiszaBot/config with the indicated number of param
|minthreadstoarchive= |
---|
|
Talk pages that use Cluebot
editFind Cluebot archiving test cases:
hastemplate:"talk header" hastemplate:"User:ClueBot III/ArchiveThis" insource:"minarchthreads=" -insource:"archive_age=" -insource:"bot="
Test set 2-B: Talk pages using User:ClueBot III/ArchiveThis with the indicated number of param
|minarchthreads= |
---|
|
These can be tested using Special:ExpandTemplates as explained in section 1. A. How to test above. Another way, is to click the top link in the 1.A § Examples section (Test 1. Talk:France), and then replace the context title at the top with the Talk pages listed in the test set above, and re-execute the test for each one.
Testing human readable time units
editThis section is about testing the display of time units in the archiving bot notice. This notice appears just above the 'Search archives' input box, and may read something like, Auto-archiving period: 30 days. The value '30 days'k ultimately comes from the archiving bot configuration on the Talk page, however, users have a choice of what units they wish to use, such as, 1 month, 30 days, 4 weeks, or even .0833 year.
Template {{human readable duration}} is responsible for generating the appropriate display value, and details of its functionality can be viewed there. The first step in testing this feature here, is to review the test cases there. Assuming they all pass, then spot-check a few cases here.
In situ test – find a test case from the search links or the lists, and do a pair of tests, comparing live and sandbox:
- live: check the value given for the archiving period in the Talk header template, and compare to the expected value (if from the lists below) or compare to the expected value (as calculated at {{human readable duration}}).
- sandbox: edit the talk page, append
/sandbox
after the{{Talk header
invocation, and click the Show preview button. Then check the value as for the live example. Test passes, if the sandbox value = live value (except for initial version, when sandbox value will be accurate, and live will have the unfriendly value straight out of the config).
Miszabot configs with a 'days' period of 3 digits or more
editTo find Miszabot configs with a 'days' period of 3 digits or more on pages having a Talk header, use this search. Examples:
- Talk:Avicenna = 900d ⟶ 2.5 years
- Talk:Cascadia movement = 1826d ⟶ 5 years
- Talk:Criticism of the BBC = 100d ⟶ 3 months
- Talk:David (Michelangelo) = 3650d
- Talk:Grey's Anatomy = 730d ⟶ 2 years
- Talk:Iraq War = 183d ⟶ 6 months
- Talk:Kim Kardashian = 1031d ⟶ 3 years
- Talk:Liberty University = 365d
- Talk:Ronda Rousey = 9000d ⟶ 24.5 years
- Talk:Secondary school = 1095d ⟶ 3 years
- Talk:T-34 = 5090d ⟶ 14 years
- Talk:Shrek the Third = 5110d ⟶ 14 years
- Talk:The Lost Tomb of Jesus = 36502d (no human readable given; no archives present; archiving text detail appears in plain view instead of in hover text)
- Miszabot config only uses days; other values are invalid, but this search will find them (
17, as of Nov. 2024) all fixed.
Cluebot III configs
editCluebot uses the age parameter, which is denominated in hours. Here are some handy conversions to hours, for use in searching for Talk pages with a specified range:
- 7d=168h; 30d=5040h; 120d=20160h; 122d=20496h; 180d=30240h; 183d=31744h; 365d=61320h; 730d=122640; 3y=183960; 5y=306600; 10y=613200
Searches for Talk pages having Cluebot archive configs with param |age=
in selected ranges (denominated here in days for convenience; bot config is in hours only):
- <= 7d (5 pages in the range 1–168 hours); e.g., Talk:Amritpal Singh=48; Talk:Murder of Laci Peterson=90; Talk:2023 Monterey Park shooting=168
- 8–30d (173) Talk:2018 Pakistani general election=720; Talk:Hot air balloon=2160 (almost all of them are 2160)
- 32–120d (10) Talk:Hyperlink=8760; Talk:Separated brethren=17520; Talk:Starfleet=8760
- 122-365d (1) e.g., Talk:Unisys=26297
Run in situ tests for Talk pages with Cluebot configs the same way as for Miszabot configs.
Examples:
- Talk:Amritpal Singh 48/2 days/2 days
- Talk:Murder of Laci Peterson 90/4/4
- Talk:2023 Monterey Park shooting 168/7/7
- Talk:2018 Pakistani general election 720/30/30
- Talk:Hot air balloon 2160/90/3 months
Testing categorization of pages using deprecated archiving parameters
editThe update to the template to automate detection of archive bot parameters (see tests for #Automatic archive bot parameter detection above) opened the possibility of removing the bot display parameters |age=
, |units=
, |bot=
, and |minthreadsleft=
, which were formerly used for this purpose, and were deprecated in rev. 1223139724 of 10 May 2024.
Background
editGeneral introduction to deprecating and removing parameters from templates
|
---|
In order to be able to more easily remove deprecated parameters from the Template code (manually or via bot) it is useful to categorize pages which call the template with deprecated parameters with a tracking category. Templates which do not validate the passed parameter list do not need to go through a period where the parameters are first dperecated, and then removed; they can simply be removed from the code. Pages that transclude them may see changed behavior, but the templates will not cause an error because they use a parameter unused by the template. Pages that call the template with the now absent parameter can be updated at leisure, or not at all; it will not affect the performance of the template if the missing parameters continue to be passed; they will simply be ignored. However, for templates like {{Talk header}} which do vaidate the full parameter list, a parameter cannot simply be removed, because it will cause pages with template calls that use a deprecated parameter to fail. In these cases, removing a parameter takes place in three stages:
Parameters are only deprecated during the interval starting with the edit disabling the effect of a given parameter in the code, and the edit where the parameter is removed from the param validation list in the template, meaning it will throw an error if anyone attempts to add the deprecated parameter after that point. This is the case, for example, in the deprecation of the bot display parameters |
Testing
editThe deprecated parameters which should cause categorization are: archive_age
, archive_bot
, archive_units
, minthreadsleft
, age
, bot
, and units
.
Tests may be run either Special:ExpandTemplates, or in situ.
Testing involves checking whether talk header templates using any of the four deprecated archive bot parameters cause the page to be categorized properly into the category Category:Pages using Talk header with deprecated parameters. Categories are not displayed on this page, so testing cannot not take place here; rather, it can be done in situ or via Special:ExpandTemplates. For general considerations about this type of testing, please see section § Automatic archive bot parameter detection above, subsections § A. Testing with ExpandTemplates, and § C. Testing in situ.
Via Special:ExpandTemplates
editInstructions for running categorization tests using Special:ExpandTemplates:
|
---|
We can develop these tests for use in Special:ExpandTemplates. Each test has two parts, the Live, and the Sandbox test, which must each be pasted individually to Special:ExpandTemplates and run separately. (If they are both run at once, it will be impossible to determine whether the live, or the sandbox version of the template is responsible for categorization.) In the initial release, only the sandbox test will cause categorization. In subsequent releases, both the Live and the Sandbox tests should cause categorization. Here is one example: copy each half of the pair to ExpandTemplates individually, and run it alone: LIVE * {{tlg|talk header|archive_age{{=}}90|code=y|_show_result=y}} SANDBOX * {{tlg|talk header/sandbox|archive_age{{=}}90|code=y|_show_result=y}} A successful test is one which shows the following at the bottom of the page, always for the Sandbox test, and also for the Live test in subsequent releases: Hidden category: Pages using Talk header with deprecated parameters.
Note: For the purposes of these tests, you do not have to enter a talk pagename into the Context title field of ExpandTemplates. As this test is only about categorization and not about Talk header format, it doesn't matter what namespace or page this test is run as. That said, the Talk header may look odd if you don't provide a Context title, so the recommendation is to fill out Context title with the name of any talk page; |
Tests D-1 through D-8
| ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Here are eight tests which can be run via ExpandTemplates as described in this section:
|
In situ tests
editInstructions for running categorization tests in situ
|
---|
While the ExpandTemplates test cases test basic functionality, they are artificial, as the archive params rarely come singly like that. The in situ tests are performed directly at an article Talk page, in unpublished, page preview mode. Once the test result is noted, the page is abandoned, unpublished. The basic idea, is to find pages that already contain a Talk page header with one or more deprecated bot archive parameters, and watch the hidden category behavior of the page in Preview mode, when substituting the sandbox template for the live template on the page; that is, by altering The first step is to find article talk pages that have the deprecated parameters. These two search links may help:
|
Test set E for testing categorizaiton for deprecated parameters in situ
|
---|
Here is a test set of Talk pages having {{Talk header}} templates that use deprecated bot parameters, as follows:
For each test, append |
A successful in situ test is one which shows the following at the bottom of the page in Preview mode, always for the Sandbox test, and also for the Live test in subsequent releases:
If you see the above message, the test has passed.
Detection of deprecated parameters removed from valid param check
edit{{Talk header|archive_age=12}}
{{Talk header}} | {{Talk header/sandbox}} | ||||
---|---|---|---|---|---|
|
|