Issue #3414261 by catch: Add authenticated user umami performance tests

merge-requests/4611/merge
Dave Long 2024-01-12 17:51:48 +00:00
parent b1fbff58cc
commit af726dbfa5
No known key found for this signature in database
GPG Key ID: ED52AE211E142771
1 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,45 @@
<?php
declare(strict_types=1);
namespace Drupal\Tests\demo_umami\FunctionalJavascript;
use Drupal\FunctionalJavascriptTests\PerformanceTestBase;
/**
* Tests demo_umami profile performance.
*
* @group OpenTelemetry
* @group #slow
*/
class OpenTelemetryAuthenticatedPerformanceTest extends PerformanceTestBase {
/**
* {@inheritdoc}
*/
protected $profile = 'demo_umami';
protected function setUp(): void {
parent::setUp();
$user = $this->drupalCreateUser();
$this->drupalLogin($user);
}
/**
* Logs front page tracing data with an authenticated user and warm cache.
*/
public function testFrontPageAuthenticatedWarmCache(): void {
$this->drupalGet('<front>');
$this->drupalGet('<front>');
$performance_data = $this->collectPerformanceData(function () {
$this->drupalGet('<front>');
}, 'authenticatedFrontPage');
$this->assertLessThanOrEqual(16, $performance_data->getQueryCount());
$this->assertGreaterThanOrEqual(15, $performance_data->getQueryCount());
$this->assertSame(15, $performance_data->getCacheGetCount());
$this->assertSame(0, $performance_data->getCacheSetCount());
$this->assertSame(0, $performance_data->getCacheDeleteCount());
}
}