Jump to content

Template:Talk header/testcases4

From Wikipedia, the free encyclopedia

Automatic archive bot parameter detection

[edit]

These tests complement the archival parameters, and supply default values if a validly formatted Miszabot/config exists for the page. It can determine all four values if present in the config, and use them as default values for Talk page header params |bot=, |age=, |units=, and |minthreadsleft= if these params are not passed to the TP header. Misza config values are defaulted individually, or in any combination when one or more of the four TP header archival params are missing.

A. Testing with ExpandTemplates

[edit]
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 using the one-parameter version of the template. For example: set Context title to Talk Algeria and in the main, 'Input wikitext' section, just add:

LIVE

{{Talk header}}
-----
SANDBOX

{{Talk header/sandbox}}

to complete the test. Expected result: The header is displayed, including the right-justified archive notice:

Auto-archiving period: 90 days
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., {{Talk:France}}) and the input field set to two template invocations, one with the live template (i.e., {{Talk header}}) and one with the sandbox version ({{Talk header/sandbox}}).

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 "90 days" in plaintext; the tooltip reads "Lowercase sigmabot III ... 90 days ... more than 4 threads are present"
  • Test A–2: Talk:France – expect 90 days / Lowercase sigmabot III – minthreads = 4
  • Test A–3: Talk:Muammar Gaddafi – expect 60 days / Lowercase sigmabot III – (none)
  • Test A–4: Talk:Physics – expect 100 days / Lowercase sigmabot III – minthreads=4
  • Test A–5: Talk:Noam Chomsky – expect 45 days / Lowercase sigmabot III – minthreads=3
  • Test A–5: Talk:Mustang – expect=61 days / Lowercase sigmabot III – (none)

Tests for pages using User:ClueBot III/ArchiveThis

  • Test A2–1: Talk:COVID-19 pandemic – expect 10 days / Cluebot III – 240 hours – minthreads = 10
  • Test A2–2: Talk:The Exorcist – expect 20 days / Cluebot III – 720 hours – minthreads = 4
  • Test A2–3: Talk:List of colors – expect 7.5 days / Cluebot III – 183 hours – minthreads = 4
  • Test A2–4: Talk:Toronto – expect 60 days / Cluebot III – 1440 hours – (none)
  • Test A2–5: Talk:Website – expect 90 days / Cluebot III – 2160 hours – minthreads = 5
  • Test A2–6: Talk:Switzerland – expect 120 days / Cluebot III – 2880 hours – minthreads = 5
  • Test A2–7: Talk:Fake news – expect 90 days / Cluebot III – 2160 hours – minthreads = 4
  • Test A2–8: Talk:Spotify – expect 90 days / Cluebot III – 2160 hours – minthreads = 4
  • Test A2–9: Talk:2022 – expect 30 days / Cluebot III – 720 hours – minthreads = 10
  • Test A2–10: Talk:Macedonia – expect 90 days / Cluebot III – 2160 hours – minthreads = 4

B. Testing with the subtemplate

[edit]

An alternative, is to test the subtemplate 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

[edit]
Test B–1: Talk:Algeria – expect 90 days, minthreads = 4
Test B–2: Talk:France – expect 90 days, minthreads = 4
Test B–3: Talk:Muammar Gaddafi – expect 60 days
Test B–4: Talk:Physics – expect 100 days, minthreads=4
Test B–5: Talk:Noam Chomsky – expect 45 days, minthreads=3
Test B–5: 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

[edit]

More like these: Advanced search.

Test B2–1: Talk:COVID-19 pandemic – expect 240 hours, minthreads = 10
Test B2–2: Talk:The Exorcist – expect 720 hours, minthreads = 4
Test B2–3: Talk:List of colors – expect 183 hours, minthreads = 4
Test B2–4: Talk:Toronto – expect 1440 hours
Test B2–5: Talk:Website – expect 2160 hours, minthreads = 5
Test B2–6: Talk:Switzerland – expect 2880 hours, minthreads = 5
Test B2–7: Talk:Fake news – expect 2160 hours, minthreads = 4
Test B2–8: Talk:Spotify – expect 2160 hours, minthreads = 4
Test B2–9: Talk:2022 – expect 720 hours, minthreads = 10
Test B2–10: Talk:Macedonia – expect 2160 hours, minthreads = 4

C. Testing in situ

[edit]

An alternative is to test on a live Talk page, either by observation (for pages that already have Talk page header template, with or without archival params) or by adding a {{Talk page header}} to a page that doesn't have one, and testing without archival params.

Expand to view description of how to run these tests – (t.b.a.)

How to:

t.b.a.

Testing upgrade for minimum threads to archive

[edit]

Talk pages that use Miszabot config

[edit]

Find 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=
  1. Talk:Amazon – 0 Green tickY (i.e., the new clause is not shown because < 2)
  2. Talk:Hurricane Dorian – 0 Green tickY (i.e., the new clause is not shown because < 2)
  3. Talk:Evolution – 1 Green tickY (i.e., the new clause is not shown because < 2)
  4. Talk:Dog – 1 Green tickY (i.e., the new clause is not shown because < 2)
  5. Talk:Conspiracy theory – 2 Green tickY
  6. Talk:IPhone – 2 Green tickY
  7. Talk:Information technology – 3 Green tickY
  8. Talk:Christina Aguilera – 3 Green tickY
  9. Talk:Healthy diet – 4 Green tickY
  10. Talk:Operating system – 5 Green tickY
  11. Talk:Hurricane Florence – 7 (not applicable? No archive links because uses date-style archive names)
  12. Talk:Controversy over GNOME 3 – 10 Green tickY

Talk pages that use Cluebot

[edit]

Find 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=
  1. Talk:The Exorcist – 0 Green tickY (i.e., the new clause is not shown because < 2)
  2. Talk:COVID-19 pandemic – 0 Green tickY (i.e., the new clause is not shown because < 2)
  3. Talk:Alexandria Ocasio-Cortez – 1 Green tickY (i.e., the new clause is not shown because < 2)
  4. Talk:Switzerland – 1 Green tickY (i.e., the new clause is not shown because < 2)
  5. Talk:Stefan Molyneux – 2 Green tickY
  6. Talk:Website – 2 Green tickY
  7. Talk:Johannes Brahms – 3 Green tickY
  8. Talk:Disneyland – 3 Green tickY
  9. Talk:Oliver Stone – 4 Green tickY
  10. Talk:Google Search – 5 Green tickY (archive message suppressed entirely due to |noarchive=yes)
  11. Talk:COVID-19 pandemic in Ontario – 10 Green tickY
  12. Talk:Toronto – 10 Green tickY

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 categorization of pages using deprecated archiving parameters

[edit]

The 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

[edit]
General 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:

  1. disable the parameter – the template makes no more use of the parameter; whether it is passed or not, given a value or not, has no effect on the output of the template. The validation list is left in place, so that use of the parameter will not throw an error. This initiates the deprecation period.
  2. remove the parameter from pages that use it – this could be a manual or bot operation, and involves finding all the pages that use the template with the deprecated parameter, and updating the page to remove the parameter from the template call. A tracking category may be helpful for facilitating removal. When there are no more pages that use the deprecated parameter, we can go to step three.
  3. remove the parameter from the validation list in the template – Once there are no more uses of the deprecated parameter, the parameter may be removed from the validation list in the template, without causing any page to throw an error. When this is done, the process of removing the deprecated parameters is complete.

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 |age=, |units=, |bot=, and |minthreadsleft=, which were deprecated in rev. 1223139724 of 10 May 2024.

Testing

[edit]

The deprecated parameters which should cause categorization are: archive_age, archive_bot, archive_units, minthreadstoarchive, 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

[edit]

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:

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; Talk:France is as good as any for this purpose.

Here are eight tests which can be run via ExpandTemplates as described in this section:

Test D-1. param archive_age
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}}
Test D-2. param archive_bot
LIVE
* {{tlg|talk header|archive_bot{{=}}ClueBot III|code=y|_show_result=y}}
SANDBOX
* {{tlg|talk header/sandbox|archive_bot{{=}}ClueBot III|code=y|_show_result=y}}
Test D-3. param archive_units
LIVE
* {{tlg|talk header|archive_units{{=}}days|code=y|_show_result=y}}
SANDBOX
* {{tlg|talk header/sandbox|archive_units{{=}}days|code=y|_show_result=y}}
Test D-4. param minthreadstoarchive
LIVE
* {{tlg|talk header|minthreadstoarchive{{=}}1|code=y|_show_result=y}}
SANDBOX
* {{tlg|talk header/sandbox|minthreadstoarchive{{=}}1|code=y|_show_result=y}}
Test D-5. param age
LIVE
* {{tlg|talk header|age{{=}}90|code=y|_show_result=y}}
SANDBOX
* {{tlg|talk header/sandbox|age{{=}}90|code=y|_show_result=y}}
Test D-6. param bot
LIVE
* {{tlg|talk header|bot{{=}}ClueBot III|code=y|_show_result=y}}
SANDBOX
* {{tlg|talk header/sandbox|bot{{=}}ClueBot III|code=y|_show_result=y}}
Test D-7. param archive_units
LIVE
* {{tlg|talk header|archive_units{{=}}days|code=y|_show_result=y}}
SANDBOX
* {{tlg|talk header/sandbox|archive_units{{=}}days|code=y|_show_result=y}}
Test D-8. param minthreadsleft
LIVE
* {{tlg|talk header|minthreadsleft{{=}}4|code=y|_show_result=y}}
SANDBOX
* {{tlg|talk header/sandbox|minthreadsleft{{=}}4|code=y|_show_result=y}}

In situ tests

[edit]

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 {{Talk header | ...}} to {{Talk header/sandbox | ...}} and previewing the result.

The first step is to find article talk pages that have the deprecated parameters. These two search links may help:

  • about 200 articles use the Talk header template with the parameter |age=
  • about 6 articles use the Talk header template with the parameter |bot= first

Here is a test set of ten Talk pages having {{Talk header}} templates that use deprecated bot parameters, as follows:

  1. . Talk:Ringette{{talk header|age=90|bot=ClueBot III}}
  2. . Talk:Hunting dog{{talk header|age=360}}
  3. . Talk:Rap rock{{talk header|age=90|bot=ClueBot III}}
  4. . Talk:Miss Universe 2010{{talk header|age=3|units=years}}
  5. . Talk:List of governors of Florida{{talk header|age=90|units=days|minthreadsleft=2|bot=Lowercase sigmabot III}}
  6. . Talk:Angus Young{{talk header|age= 30|bot=lowercase sigmabot III|units=days|minthreadsleft=2}}
  7. . Talk:Demographics of Turkey{{talk header|age=1|units=years|minthreadsleft=2}}
  8. . Talk:Henry Morton Stanley{{talk header|age=1|units=year|bot=lowercase sigmabot III}}
  9. . Talk:Design by contract{{talk header|age=90|bot=Lowercase sigmabot III|units=days|minthreadsleft=5}}
  10. . Talk:Murdaugh family{{talk header|age=180|bot=ClueBot III|units=days|minthreadsleft=4}}
  11. . Talk:William D. Boyce{{talk header|age=2|bot=Lowercase sigmabot III|units=years}}

For each test, append /sandbox so the call reads {{tl|Talk header/sandbox |..., and Preview the page, checking for the category.

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: