Open Benjamin-Loison opened 2 years ago
Note that redefining die
with function
does not work and it does not seem possible to disable die
.
Note that prefer to be independent from other persons who may possibly make the unit test incorrect, but do not use my own channel but can use ad hoc channels that I own.
Also note that the purpose of the unit test is mainly to monitor YouTube UI changes.
Could verify when specific value with another normal one but let us left this for future work. Just returning two different values for each field enables to some extent to verify that we retrieve what we expect. Also reduce as most as possible workload by using id instead of handles and test handles once.
Should verify pagination when there is one.
Let us use multiple
Let us be precise then.part
s to simplify the code but later the code may split on its own (or not for instance with countryChannelId
) for more detailed errors.
['part=shorts&id=UCX6OQ3DkcsbYNE6H8uQQuVA', 'items/0/shorts/0/thumbnails/0/width', 405]
['part=shorts&id=UCX6OQ3DkcsbYNE6H8uQQuVA', 'items/0/shorts/0/thumbnails/0', [
'url' => 'https://i.ytimg.com/vi/AjZDwxt7S8w/oardefault.jpg?sqp=-oaymwEkCJUDENAFSFqQAgHyq4qpAxMIARUAAAAAJQAAyEI9AICiQ3gB&rs=AOn4CLDpFzxLJ-uZqNP4s-y1quvwfNjRJQ',
'width' => 405,
'height' => 720
],
Could as well unit test YouTube Data API v3, as it seems to have some features removal sometimes.
php tests.php 2>&1 | grep -v 'PHP Warning'
Share tests/
maybe as a sub-module.
Currently reviewing videos?part=shorts
.
On fail unit test showing first difference would be nice. This could be done with diff
.
PASS videos part=isOriginal&id=FliCdfxdtTI items/0/isOriginal
PASS videos part=isOriginal&id=iqKdEhx-dD4 items/0/isOriginal 1
false
does not show 0
. Ideally should show true
and false
instead of respectively 1
and 0
.
Make unit tests in other files than production endpoints.
https://github.com/Benjamin-Loison/YouTube-operational-API/issues/300#issuecomment-2359809058
Is there a reason for:
to be after:
?
Note that I strongly believe that there is a good reason maybe when executing those tests for instance.
https://discord.com/channels/933841502155706418/933841503103627316/1288274036471758858 suffered of this issue.
Related to Webscrap_any_website/issues/38.
If exhaustively and regularly tested can quickly jump to the unit test and verify that it still works fine and then can provide the unit test video id and if the person still faces his issue ask for his video id.
https://discord.com/channels/933841502155706418/933841503103627316/1298451409372713004
Don't forget not to make the unit tests based on my personal channels.
Once done remove this comment.
Could run everyday unit test as YouTube UI evolves.
Maybe some manually triggered unit tests for the no-key service would also make sense.
Not to suffer of #11 could run these tests regularly on a private instance and notify me when something goes wrong.
Should verify the whole returned JSON instead of just a subset of entries.
Should also exhaustively but, as a different set if repeatedly, establish Stack Overflow example tests.
+4