From c892c41e4038a3ab7f7326fc2bba8dc61ad033da Mon Sep 17 00:00:00 2001 From: Ivan Herak Date: Mon, 25 Mar 2024 17:05:35 +0100 Subject: [PATCH] NGSTACK-492 test multiple configured domains --- config/app/app.yaml | 2 ++ deploy/parameters.php | 2 ++ deploy/tasks/test.php | 6 +++++- phpunit.xml.dist | 3 +-- tests/SmokeTests/CrawlerTest.php | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/config/app/app.yaml b/config/app/app.yaml index c0d3daf24..28c57bf4c 100644 --- a/config/app/app.yaml +++ b/config/app/app.yaml @@ -12,3 +12,5 @@ parameters: - file ngsite.default.lazy_loading.enabled: true + + app.testing.site_domain: '%env(TEST_DOMAIN)%' diff --git a/deploy/parameters.php b/deploy/parameters.php index e0e4331fe..88286f657 100644 --- a/deploy/parameters.php +++ b/deploy/parameters.php @@ -36,4 +36,6 @@ set('local_php_path', '/usr/bin/env php8.1'); +set('testing_domains', ['media-site.dev.php81.ez', 'media-site.dev.php81.ez/bold_eng']); + //set('slack_webhook', 'https://hooks.slack.com/services/S0M3/3XAMP7E'); diff --git a/deploy/tasks/test.php b/deploy/tasks/test.php index 90024b01e..b099acc91 100644 --- a/deploy/tasks/test.php +++ b/deploy/tasks/test.php @@ -3,5 +3,9 @@ namespace Deployer; task('app:test:phpunit', function () { - runLocally('{{local_php_path}} vendor/bin/phpunit'); + $domains = get('testing_domains'); + + foreach ($domains as $domain) { + runLocally("TEST_DOMAIN={$domain} {{local_php_path}} vendor/bin/phpunit"); + } }); diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 2f56ea6b8..d18f0e2c4 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -3,10 +3,8 @@ @@ -17,6 +15,7 @@ + diff --git a/tests/SmokeTests/CrawlerTest.php b/tests/SmokeTests/CrawlerTest.php index 822f1f210..65815aeff 100644 --- a/tests/SmokeTests/CrawlerTest.php +++ b/tests/SmokeTests/CrawlerTest.php @@ -16,7 +16,7 @@ public function testFrontpageLinks(): void $frontpageLinks = $crawler->filter('a')->links(); - $selectedLinkIndices = array_rand($frontpageLinks, 5); + $selectedLinkIndices = array_rand($frontpageLinks, 10); $output = new ConsoleOutput();