Skip to content

Commit

Permalink
NGSTACK-492 test multiple configured domains
Browse files Browse the repository at this point in the history
  • Loading branch information
iherak committed Mar 25, 2024
1 parent 25ea341 commit c892c41
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
2 changes: 2 additions & 0 deletions config/app/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ parameters:
- file

ngsite.default.lazy_loading.enabled: true

app.testing.site_domain: '%env(TEST_DOMAIN)%'
2 changes: 2 additions & 0 deletions deploy/parameters.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
6 changes: 5 additions & 1 deletion deploy/tasks/test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
});
3 changes: 1 addition & 2 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
<!-- https://phpunit.readthedocs.io/en/latest/configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="tests/bootstrap.php"
convertDeprecationsToExceptions="false"
>
<php>
<ini name="display_errors" value="1" />
Expand All @@ -17,6 +15,7 @@
<server name="SYMFONY_PHPUNIT_REMOVE" value="" />
<server name="SYMFONY_PHPUNIT_VERSION" value="9.6" />
<env name="SYMFONY_DEPRECATIONS_HELPER" value="weak" />
<env name="TEST_DOMAIN" value="localhost" />
</php>

<testsuites>
Expand Down
2 changes: 1 addition & 1 deletion tests/SmokeTests/CrawlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit c892c41

Please sign in to comment.