Skip to content

Commit

Permalink
test: change functional application psr-4 namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
gaelreyrol committed Jan 17, 2025
1 parent 376df6b commit 851252a
Show file tree
Hide file tree
Showing 34 changed files with 64 additions and 65 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@
},
"autoload-dev": {
"psr-4": {
"FriendsOfOpenTelemetry\\OpenTelemetryBundle\\Tests\\": "tests/",
"FriendsOfOpenTelemetry\\OpenTelemetryBundle\\Tests\\Functional\\Application\\": "tests/Functional/Application/src",
"FriendsOfOpenTelemetry\\OpenTelemetryBundle\\Tests\\Functional\\Application\\Migrations\\": "tests/Functional/Application/migrations"
"App\\": "tests/Functional/Application/src",
"App\\Migrations\\": "tests/Functional/Application/migrations",
"FriendsOfOpenTelemetry\\OpenTelemetryBundle\\Tests\\": "tests/"
}
},
"config": {
Expand Down
1 change: 0 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
executionOrder="depends,defects"
beStrictAboutOutputDuringTests="true"
failOnRisky="true"
failOnWarning="false"
cacheDirectory=".phpunit.cache"
>

Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/Application/bin/console
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<?php

use FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\Application\Kernel;
use App\Kernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;


Expand Down
6 changes: 3 additions & 3 deletions tests/Functional/Application/config/packages/doctrine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ doctrine:
controller_resolver:
auto_mapping: false
mappings:
FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Application:
App:
type: attribute
is_bundle: false
dir: '%kernel.project_dir%/src/Entity'
prefix: 'FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\Application\Entity'
alias: FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\Application
prefix: 'App\Entity'
alias: App
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
doctrine_migrations:
migrations_paths:
'FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\Application\Migrations': '%kernel.project_dir%/migrations'
'App\Migrations': '%kernel.project_dir%/migrations'
enable_profiler: false
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ framework:
transports:
main: 'trace(in-memory://default)'
routing:
'FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\Application\Message\*': main
'App\Message\*': main
buses:
messenger.bus.default:
middleware:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
open_telemetry:
service:
namespace: 'FriendsOfOpenTelemetry/OpenTelemetry'
name: 'Test'
name: 'App'
version: '0.0.0'
environment: test
instrumentation:
Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/Application/config/routes.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
controllers:
resource:
path: '../src/Controller/'
namespace: FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\Application\Controller
namespace: App\Controller
type: attribute
2 changes: 1 addition & 1 deletion tests/Functional/Application/config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ services:
_defaults:
autowire: true
autoconfigure: true
FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\Application\:
App\:
resource: '../src/'
exclude:
- '../src/Entity/'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\Application\migrations;
namespace App\migrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\Application\Command;
namespace App\Command;

use FriendsOfOpenTelemetry\OpenTelemetryBundle\Instrumentation\Attribute\Traceable;
use Symfony\Component\Console\Attribute\AsCommand;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\Application\Command;
namespace App\Command;

use FriendsOfOpenTelemetry\OpenTelemetryBundle\Instrumentation\Attribute\Traceable;
use Symfony\Component\Console\Attribute\AsCommand;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\Application\Controller;
namespace App\Controller;

use App\Entity\Dummy;
use Doctrine\ORM\EntityManagerInterface;
use FriendsOfOpenTelemetry\OpenTelemetryBundle\Instrumentation\Attribute\Traceable;
use FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\Application\Entity\Dummy;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\Application\Controller;
namespace App\Controller;

use FriendsOfOpenTelemetry\OpenTelemetryBundle\Instrumentation\Attribute\Traceable;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\Application\Controller;
namespace App\Controller;

use FriendsOfOpenTelemetry\OpenTelemetryBundle\Instrumentation\Attribute\Traceable;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\Application\Controller;
namespace App\Controller;

use FriendsOfOpenTelemetry\OpenTelemetryBundle\Instrumentation\Attribute\Traceable;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\Application\Controller;
namespace App\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
Expand Down
4 changes: 2 additions & 2 deletions tests/Functional/Application/src/Entity/Dummy.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

namespace FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\Application\Entity;
namespace App\Entity;

use App\Repository\DummyRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\GeneratedValue;
use Doctrine\ORM\Mapping\Id;
use Doctrine\ORM\Mapping\Table;
use FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\Application\Repository\DummyRepository;

#[Entity(repositoryClass: DummyRepository::class)]
#[Table]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\Application;
namespace App;

use Doctrine\Bundle\DoctrineBundle\DoctrineBundle;
use Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle;
Expand Down Expand Up @@ -29,6 +29,6 @@ public function registerBundles(): iterable

public function getProjectDir(): string
{
return __DIR__;
return __DIR__.'/..';
}
}
2 changes: 1 addition & 1 deletion tests/Functional/Application/src/Message/DummyMessage.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\Application\Message;
namespace App\Message;

final readonly class DummyMessage
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\Application\Message;
namespace App\Message;

final readonly class ExceptionMessage
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\Application\MessageHandler;
namespace App\MessageHandler;

use FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\Application\Message\DummyMessage;
use App\Message\DummyMessage;
use Symfony\Component\Messenger\Attribute\AsMessageHandler;

#[AsMessageHandler]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\Application\MessageHandler;
namespace App\MessageHandler;

use FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\Application\Message\ExceptionMessage;
use App\Message\ExceptionMessage;
use Symfony\Component\Messenger\Attribute\AsMessageHandler;

#[AsMessageHandler]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\Application\Repository;
namespace App\Repository;

use App\Entity\Dummy;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
use FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\Application\Entity\Dummy;

/**
* @extends ServiceEntityRepository<Dummy>
Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/Application/templates/fragment.html.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h1>fragment</h1>
<p>
{{ render(controller('FriendsOfOpenTelemetry\\OpenTelemetryBundle\\Tests\\Functional\\Application\\Controller\\ActionTraceableController::view')) }}
{{ render(controller('App\\Controller\\ActionTraceableController::view')) }}
</p>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\Instrumentation\Cache;

use FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\Application\Kernel;
use App\Kernel;
use FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\TracingTestCaseTrait;
use OpenTelemetry\SDK\Trace\StatusData;
use Psr\Cache\CacheItemInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\Instrumentation\Cache;

use FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\Application\Kernel;
use App\Kernel;
use FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\TracingTestCaseTrait;
use OpenTelemetry\SDK\Trace\StatusData;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
Expand Down
10 changes: 5 additions & 5 deletions tests/Functional/Instrumentation/ConsoleTracingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\Instrumentation;

use FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\Application\Kernel;
use App\Kernel;
use FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\TracingTestCaseTrait;
use OpenTelemetry\SDK\Trace\SpanExporter\InMemoryExporter;
use OpenTelemetry\SDK\Trace\StatusData;
Expand Down Expand Up @@ -36,7 +36,7 @@ public function testSuccess(): void
self::assertSpanStatus($mainSpan, StatusData::ok());
self::assertSpanAttributes($mainSpan, [
'code.function' => 'execute',
'code.namespace' => 'FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\Application\Command\TraceableCommand',
'code.namespace' => 'App\Command\TraceableCommand',
'symfony.console.exit_code' => 0,
]);
self::assertSpanEventsCount($mainSpan, 0);
Expand Down Expand Up @@ -64,7 +64,7 @@ public function testFailure(): void
self::assertSpanStatus($mainSpan, StatusData::error());
self::assertSpanAttributes($mainSpan, [
'code.function' => 'execute',
'code.namespace' => 'FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\Application\Command\TraceableCommand',
'code.namespace' => 'App\Command\TraceableCommand',
'symfony.console.exit_code' => 1,
]);
self::assertSpanEventsCount($mainSpan, 0);
Expand Down Expand Up @@ -97,7 +97,7 @@ public function testException(): void
self::assertSpanStatus($mainSpan, StatusData::error());
self::assertSpanAttributes($mainSpan, [
'code.function' => 'execute',
'code.namespace' => 'FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\Application\Command\TraceableCommand',
'code.namespace' => 'App\Command\TraceableCommand',
'symfony.console.exit_code' => 1,
]);

Expand Down Expand Up @@ -133,7 +133,7 @@ public function testFallback(): void
self::assertSpanStatus($mainSpan, StatusData::ok());
self::assertSpanAttributes($mainSpan, [
'code.function' => 'execute',
'code.namespace' => 'FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\Application\Command\FallbackCommand',
'code.namespace' => 'App\Command\FallbackCommand',
'symfony.console.exit_code' => 0,
]);
self::assertSpanEventsCount($mainSpan, 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\Instrumentation\Doctrine;

use App\Kernel;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Exception\ConnectionException;
use Doctrine\DBAL\Exception\TableNotFoundException;
use FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\Application\Kernel;
use FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\TracingTestCaseTrait;
use OpenTelemetry\API\Trace\StatusCode;
use OpenTelemetry\SDK\Trace\StatusData;
Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/Instrumentation/HttpClientTracingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\Instrumentation;

use App\Kernel;
use FriendsOfOpenTelemetry\OpenTelemetryBundle\Instrumentation\Symfony\HttpClient\TraceableHttpClient;
use FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\Application\Kernel;
use FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Functional\TracingTestCaseTrait;
use OpenTelemetry\SDK\Trace\StatusData;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
Expand Down
Loading

0 comments on commit 851252a

Please sign in to comment.