Commit 4bfdf830 authored by Christian Kuhn's avatar Christian Kuhn
Browse files

[BUGFIX] Speed up linkvalidator functional tests

The ext:linkvalidator functional tests work with a
fictional domain name to test if the code finds broken
external links.

This can be unfortunate since it triggers DNS lookups
that can be slow - such stuff should be avoided in
functional tests anyway.

Solution is to use localhost as test domain with an
invalid path instead. This is more expressive, too.

The result can be stunning: My DNS resolver for whatever
reason takes ages to (not) resolve that domain using
dockerized runTests.sh. I got a similar result from
another coredev. The linkvalidator tests run nearly
five minutes without the patch and are down to two
seconds with patch.

Resolves: #96087
Releases: master, 11.5
Change-Id: Idbb32ac57925c52d4cef9e8d412d56347f09a04e
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72312

Tested-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 1e0e4f5f
"tx_linkvalidator_link",,,,,,,
,"record_uid","record_pid","field","table_name","link_title","url","link_type"
,1,1,"bodytext","tt_content","link","https://sfsfsfsfdfsfsdfsf/sfdsfsds","external"
,1,1,"bodytext","tt_content","link","http://localhost/iAmInvalid","external"
"tx_linkvalidator_link",,,,,,,
,"record_uid","record_pid","field","table_name","link_title","url","link_type"
,1,1,"bodytext","tt_content","link","https://sfsfsfsfdfsfsdfsf/sfdsfsds","external"
,2,1,"bodytext","tt_content","link","https://sfsfsfsfdfsfsdfsf/sfdsfsds","external"
,1,1,"bodytext","tt_content","link","http://localhost/iAmInvalid","external"
,2,1,"bodytext","tt_content","link","http://localhost/iAmInvalid","external"
,3,1,"bodytext","tt_content","broken link",85,"db"
,4,1,"bodytext","tt_content","broken link",8555555,"db"
,5,1,"bodytext","tt_content","broken link","file:88","file"
......
"tx_linkvalidator_link",,,,,,,
,"record_uid","record_pid","field","table_name","link_title","url","link_type"
,1,1,"bodytext","tt_content","link","https://sfsfsfsfdfsfsdfsf/sfdsfsds","external"
,2,2,"bodytext","tt_content","link","https://sfsfsfsfdfsfsdfsf/sfdsfsds","external"
,1,1,"bodytext","tt_content","link","http://localhost/iAmInvalid","external"
,2,2,"bodytext","tt_content","link","http://localhost/iAmInvalid","external"
,3,1,"bodytext","tt_content","broken link",85,"db"
,4,2,"bodytext","tt_content","broken link",8555555,"db"
,5,1,"bodytext","tt_content","broken link","file:88","file"
......
"tx_linkvalidator_link",,,,,,,
,"record_uid","record_pid","field","table_name","link_title","url","link_type"
,1,0,"canonical_link","pages",,"https://sfsfsfsfdfsfsdfsf/sfdsfsds","external"
,1,0,"canonical_link","pages",,"http://localhost/iAmInvalid","external"
......@@ -7,7 +7,7 @@
<tt_content>
<uid>1</uid>
<pid>1</pid>
<bodytext>&lt;p&gt;&lt;a href=&quot;https://sfsfsfsfdfsfsdfsf/sfdsfsds&quot;&gt;link&lt;/a&gt;&lt;/p&gt;</bodytext>
<bodytext>&lt;p&gt;&lt;a href=&quot;http://localhost/iAmInvalid&quot;&gt;link&lt;/a&gt;&lt;/p&gt;</bodytext>
<CType>textmedia</CType>
</tt_content>
</dataset>
......@@ -8,13 +8,13 @@
<tt_content>
<uid>1</uid>
<pid>1</pid>
<bodytext>&lt;p&gt;&lt;a href=&quot;https://sfsfsfsfdfsfsdfsf/sfdsfsds&quot;&gt;link&lt;/a&gt;&lt;/p&gt;</bodytext>
<bodytext>&lt;p&gt;&lt;a href=&quot;http://localhost/iAmInvalid&quot;&gt;link&lt;/a&gt;&lt;/p&gt;</bodytext>
<CType>textmedia</CType>
</tt_content>
<tt_content>
<uid>2</uid>
<pid>1</pid>
<bodytext>&lt;p&gt;&lt;a href=&quot;https://sfsfsfsfdfsfsdfsf/sfdsfsds&quot;&gt;link&lt;/a&gt;&lt;/p&gt;</bodytext>
<bodytext>&lt;p&gt;&lt;a href=&quot;http://localhost/iAmInvalid&quot;&gt;link&lt;/a&gt;&lt;/p&gt;</bodytext>
<CType>textmedia</CType>
</tt_content>
......
......@@ -12,13 +12,13 @@
<tt_content>
<uid>1</uid>
<pid>1</pid>
<bodytext>&lt;p&gt;&lt;a href=&quot;https://sfsfsfsfdfsfsdfsf/sfdsfsds&quot;&gt;link&lt;/a&gt;&lt;/p&gt;</bodytext>
<bodytext>&lt;p&gt;&lt;a href=&quot;http://localhost/iAmInvalid&quot;&gt;link&lt;/a&gt;&lt;/p&gt;</bodytext>
<CType>textmedia</CType>
</tt_content>
<tt_content>
<uid>2</uid>
<pid>2</pid>
<bodytext>&lt;p&gt;&lt;a href=&quot;https://sfsfsfsfdfsfsdfsf/sfdsfsds&quot;&gt;link&lt;/a&gt;&lt;/p&gt;</bodytext>
<bodytext>&lt;p&gt;&lt;a href=&quot;http://localhost/iAmInvalid&quot;&gt;link&lt;/a&gt;&lt;/p&gt;</bodytext>
<CType>textmedia</CType>
</tt_content>
......
......@@ -3,6 +3,6 @@
<pages>
<uid>1</uid>
<pid>0</pid>
<canonical_link>https://sfsfsfsfdfsfsdfsf/sfdsfsds</canonical_link>
<canonical_link>http://localhost/iAmInvalid</canonical_link>
</pages>
</dataset>
......@@ -376,7 +376,7 @@ class BrokenLinkRepositoryTest extends FunctionalTestCase
'table_name' => 'tt_content',
'element_type' => 'textmedia',
'link_title' => 'link',
'url' => 'https://sfsfsfsfdfsfsdfsf/sfdsfsds',
'url' => 'http://localhost/iAmInvalid',
'link_type' => 'external',
'needs_recheck' => 0,
],
......@@ -389,7 +389,7 @@ class BrokenLinkRepositoryTest extends FunctionalTestCase
'table_name' => 'tt_content',
'element_type' => 'textmedia',
'link_title' => null,
'url' => 'https://sfsfsfsfdfsfsdfsf/sfdsfsds',
'url' => 'http://localhost/iAmInvalid',
'link_type' => 'external',
'needs_recheck' => 0,
],
......@@ -463,7 +463,7 @@ class BrokenLinkRepositoryTest extends FunctionalTestCase
'table_name' => 'tt_content',
'element_type' => 'textmedia',
'link_title' => 'link',
'url' => 'https://sfsfsfsfdfsfsdfsf/sfdsfsds',
'url' => 'http://localhost/iAmInvalid',
'link_type' => 'external',
'needs_recheck' => 0,
],
......@@ -514,7 +514,7 @@ class BrokenLinkRepositoryTest extends FunctionalTestCase
'table_name' => 'tt_content',
'element_type' => 'textmedia',
'link_title' => 'link',
'url' => 'https://sfsfsfsfdfsfsdfsf/sfdsfsds',
'url' => 'http://localhost/iAmInvalid',
'link_type' => 'external',
'needs_recheck' => 0,
],
......@@ -527,7 +527,7 @@ class BrokenLinkRepositoryTest extends FunctionalTestCase
'table_name' => 'tt_content',
'element_type' => 'textmedia',
'link_title' => null,
'url' => 'https://sfsfsfsfdfsfsdfsf/sfdsfsds',
'url' => 'http://localhost/iAmInvalid',
'link_type' => 'external',
'needs_recheck' => 0,
],
......@@ -578,7 +578,7 @@ class BrokenLinkRepositoryTest extends FunctionalTestCase
'table_name' => 'tt_content',
'element_type' => 'textmedia',
'link_title' => 'link',
'url' => 'https://sfsfsfsfdfsfsdfsf/sfdsfsds',
'url' => 'http://localhost/iAmInvalid',
'link_type' => 'external',
'needs_recheck' => 0,
],
......@@ -604,7 +604,7 @@ class BrokenLinkRepositoryTest extends FunctionalTestCase
'table_name' => 'tt_content',
'element_type' => 'textmedia',
'link_title' => 'link',
'url' => 'https://sfsfsfsfdfsfsdfsf/sfdsfsds',
'url' => 'http://localhost/iAmInvalid',
'link_type' => 'external',
'needs_recheck' => 0,
],
......@@ -682,7 +682,7 @@ class BrokenLinkRepositoryTest extends FunctionalTestCase
'table_name' => 'tt_content',
'element_type' => 'textmedia',
'link_title' => 'link',
'url' => 'https://sfsfsfsfdfsfsdfsf/sfdsfsds',
'url' => 'http://localhost/iAmInvalid',
'link_type' => 'external',
],
[
......@@ -694,7 +694,7 @@ class BrokenLinkRepositoryTest extends FunctionalTestCase
'table_name' => 'tt_content',
'element_type' => 'textmedia',
'link_title' => 'link',
'url' => 'https://sfsfsfsfdfsfsdfsf/sfdsfsds',
'url' => 'http://localhost/iAmInvalid',
'link_type' => 'external',
],
[
......@@ -706,7 +706,7 @@ class BrokenLinkRepositoryTest extends FunctionalTestCase
'table_name' => 'tt_content',
'element_type' => 'textmedia',
'link_title' => 'link',
'url' => 'https://sfsfsfsfdfsfsdfsf/sfdsfsds',
'url' => 'http://localhost/iAmInvalid',
'link_type' => 'external',
],
],
......@@ -733,7 +733,7 @@ class BrokenLinkRepositoryTest extends FunctionalTestCase
'table_name' => 'tt_content',
'element_type' => 'textmedia',
'link_title' => 'link',
'url' => 'https://sfsfsfsfdfsfsdfsf/sfdsfsds',
'url' => 'http://localhost/iAmInvalid',
'link_type' => 'external',
],
[
......@@ -745,7 +745,7 @@ class BrokenLinkRepositoryTest extends FunctionalTestCase
'table_name' => 'tt_content',
'element_type' => 'textmedia',
'link_title' => 'link',
'url' => 'https://sfsfsfsfdfsfsdfsf/sfdsfsds',
'url' => 'http://localhost/iAmInvalid',
'link_type' => 'external',
],
],
......
......@@ -8,13 +8,13 @@
<tt_content>
<uid>1</uid>
<pid>1</pid>
<bodytext>&lt;p&gt;&lt;a href=&quot;https://sfsfsfsfdfsfsdfsf/sfdsfsds&quot;&gt;link&lt;/a&gt;&lt;/p&gt;</bodytext>
<bodytext>&lt;p&gt;&lt;a href=&quot;http://localhost/iAmInvalid&quot;&gt;link&lt;/a&gt;&lt;/p&gt;</bodytext>
<CType>textmedia</CType>
</tt_content>
<tt_content>
<uid>2</uid>
<pid>1</pid>
<header_link>https://sfsfsfsfdfsfsdfsf/sfdsfsds</header_link>
<header_link>http://localhost/iAmInvalid</header_link>
<CType>textmedia</CType>
</tt_content>
......
......@@ -22,7 +22,7 @@
<tt_content>
<uid>1</uid>
<pid>1</pid>
<bodytext>&lt;p&gt;&lt;a href=&quot;https://sfsfsfsfdfsfsdfsf/sfdsfsds&quot;&gt;link&lt;/a&gt;&lt;/p&gt;</bodytext>
<bodytext>&lt;p&gt;&lt;a href=&quot;http://localhost/iAmInvalid&quot;&gt;link&lt;/a&gt;&lt;/p&gt;</bodytext>
<CType>textmedia</CType>
<l18n_parent>0</l18n_parent>
<sys_language_uid>0</sys_language_uid>
......@@ -30,7 +30,7 @@
<tt_content>
<uid>2</uid>
<pid>1</pid>
<bodytext>&lt;p&gt;&lt;a href=&quot;https://sfsfsfsfdfsfsdfsf/sfdsfsds&quot;&gt;link&lt;/a&gt;&lt;/p&gt;</bodytext>
<bodytext>&lt;p&gt;&lt;a href=&quot;http://localhost/iAmInvalid&quot;&gt;link&lt;/a&gt;&lt;/p&gt;</bodytext>
<CType>textmedia</CType>
<l18n_parent>1</l18n_parent>
<sys_language_uid>1</sys_language_uid>
......@@ -38,7 +38,7 @@
<tt_content>
<uid>3</uid>
<pid>1</pid>
<bodytext>&lt;p&gt;&lt;a href=&quot;https://sfsfsfsfdfsfsdfsf/sfdsfsds&quot;&gt;link&lt;/a&gt;&lt;/p&gt;</bodytext>
<bodytext>&lt;p&gt;&lt;a href=&quot;http://localhost/iAmInvalid&quot;&gt;link&lt;/a&gt;&lt;/p&gt;</bodytext>
<CType>textmedia</CType>
<l18n_parent>1</l18n_parent>
<sys_language_uid>2</sys_language_uid>
......
......@@ -12,7 +12,7 @@
<tt_content>
<uid>1</uid>
<pid>1</pid>
<bodytext>&lt;p&gt;&lt;a href=&quot;https://sfsfsfsfdfsfsdfsf/sfdsfsds&quot;&gt;link&lt;/a&gt;&lt;/p&gt;</bodytext>
<bodytext>&lt;p&gt;&lt;a href=&quot;http://localhost/iAmInvalid&quot;&gt;link&lt;/a&gt;&lt;/p&gt;</bodytext>
<CType>textmedia</CType>
</tt_content>
......
......@@ -12,7 +12,7 @@
<tt_content>
<uid>1</uid>
<pid>1</pid>
<bodytext>&lt;p&gt;&lt;a href=&quot;https://sfsfsfsfdfsfsdfsf/sfdsfsds&quot;&gt;link&lt;/a&gt;&lt;/p&gt;</bodytext>
<bodytext>&lt;p&gt;&lt;a href=&quot;http://localhost/iAmInvalid&quot;&gt;link&lt;/a&gt;&lt;/p&gt;</bodytext>
<CType>textmedia</CType>
</tt_content>
......
......@@ -12,13 +12,13 @@
<tt_content>
<uid>1</uid>
<pid>1</pid>
<bodytext>&lt;p&gt;&lt;a href=&quot;https://sfsfsfsfdfsfsdfsf/sfdsfsds&quot;&gt;link&lt;/a&gt;&lt;/p&gt;</bodytext>
<bodytext>&lt;p&gt;&lt;a href=&quot;http://localhost/iAmInvalid&quot;&gt;link&lt;/a&gt;&lt;/p&gt;</bodytext>
<CType>textmedia</CType>
</tt_content>
<tt_content>
<uid>2</uid>
<pid>1</pid>
<header_link>https://sfsfsfsfdfsfsdfsf/sfdsfsds</header_link>
<header_link>http://localhost/iAmInvalid</header_link>
<CType>textmedia</CType>
</tt_content>
......
......@@ -12,13 +12,13 @@
<tt_content>
<uid>1</uid>
<pid>1</pid>
<bodytext>&lt;p&gt;&lt;a href=&quot;https://sfsfsfsfdfsfsdfsf/sfdsfsds&quot;&gt;link&lt;/a&gt;&lt;/p&gt;</bodytext>
<bodytext>&lt;p&gt;&lt;a href=&quot;http://localhost/iAmInvalid&quot;&gt;link&lt;/a&gt;&lt;/p&gt;</bodytext>
<CType>textmedia</CType>
</tt_content>
<tt_content>
<uid>2</uid>
<pid>1</pid>
<header_link>https://sfsfsfsfdfsfsdfsf/sfdsfsds</header_link>
<header_link>http://localhost/iAmInvalid</header_link>
<CType>textmedia</CType>
</tt_content>
......
......@@ -12,7 +12,7 @@
<tt_content>
<uid>1</uid>
<pid>1</pid>
<bodytext>&lt;p&gt;&lt;a href=&quot;https://sfsfsfsfdfsfsdfsf/sfdsfsds&quot;&gt;link&lt;/a&gt;&lt;/p&gt;</bodytext>
<bodytext>&lt;p&gt;&lt;a href=&quot;http://localhost/iAmInvalid&quot;&gt;link&lt;/a&gt;&lt;/p&gt;</bodytext>
<CType>textmedia</CType>
<sys_language_uid>0</sys_language_uid>
</tt_content>
......@@ -21,7 +21,7 @@
<tt_content>
<uid>2</uid>
<pid>1</pid>
<header_link>https://sfsfsfsfdfsfsdfsf/sfdsfsds</header_link>
<header_link>http://localhost/iAmInvalid</header_link>
<CType>textmedia</CType>
<sys_language_uid>1</sys_language_uid>
</tt_content>
......
......@@ -12,7 +12,7 @@
<tt_content>
<uid>1</uid>
<pid>1</pid>
<bodytext>&lt;p&gt;&lt;a href=&quot;https://sfsfsfsfdfsfsdfsf/sfdsfsds&quot;&gt;link&lt;/a&gt;&lt;/p&gt;</bodytext>
<bodytext>&lt;p&gt;&lt;a href=&quot;http://localhost/iAmInvalid&quot;&gt;link&lt;/a&gt;&lt;/p&gt;</bodytext>
<CType>textmedia</CType>
</tt_content>
......@@ -20,7 +20,7 @@
<tt_content>
<uid>2</uid>
<pid>1</pid>
<bodytext>&lt;p&gt;&lt;a href=&quot;https://sfsfsfsfdfsfsdfsf/sfdsfsds&quot;&gt;link&lt;/a&gt;&lt;/p&gt;</bodytext>
<bodytext>&lt;p&gt;&lt;a href=&quot;http://localhost/iAmInvalid&quot;&gt;link&lt;/a&gt;&lt;/p&gt;</bodytext>
<CType>textpic</CType>
</tt_content>
</dataset>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment