Page MenuHomePhabricator

Create tests for UploadFromUrl::isAllowedHost
Closed, ResolvedPublic

Description

Seems worthwhile to have some basic unit tests to test the (sub)domain matching of $wgCopyUploadsDomains and specifically handling of foo.*.domain.tld when *.domain.tld is whitelisted

From the example of T225852 where *.nasa.gov is whitelisted, but svs.gsfc.nasa.gov isn't allowed. As a workaround (or to keep a strict limitation) *.jpl.nasa.gov is explicitly whitelisted

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Hi, I'm working on this but UploadFromUrlTest is marked as @group Broken and it seems like that test will not be run (https://www.mediawiki.org/wiki/Manual:PHP_unit_testing/Writing_unit_tests#Grouping_tests), what should I do?

Good catch, didn't see that, sorry for the confusion! I worked on this change to make the tests working again (and bring them back from the broken group). Is it ok for you to work on top of this change? Then your new tests should work as well :)

Change 565760 had a related patch set uploaded (by Majavah; owner: Majavah):
[mediawiki/core@master] Create tests for UploadFromUrl::isAllowedHost

https://gerrit.wikimedia.org/r/565760

Good catch, didn't see that, sorry for the confusion! I worked on this change to make the tests working again (and bring them back from the broken group). Is it ok for you to work on top of this change? Then your new tests should work as well :)

I didn't see your message before submitting my patch. By "work on top of this change", do you mean this?

@Majavah Yeah, that's what I mean :) Sorry, that I didn't link this in the first place, I didn't think about, that this is probably gerrit-specific and that not everyone might know about this :)

Change 565760 merged by jenkins-bot:
[mediawiki/core@master] Create tests for UploadFromUrl::isAllowedHost

https://gerrit.wikimedia.org/r/565760