# Native Observability Quality Assurance Add-on

This package contains only additive files.
It is designed to extend the existing testing and CI baseline without altering
runtime code or replacing the files already integrated in the module.

## What is included

### Additional unit test coverage
- `native_observability_execution`
  - `ExecutionSpanStackTest`
  - `GuzzleTraceMiddlewareTest`
- `native_observability_spans`
  - `ActiveSpanContextStackTest`
  - `SpanRecorderTest`
- `native_observability_cache_observer`
  - `CacheSpanEnrichmentProviderTest`
- `native_observability_database_observer`
  - `DatabaseQueryClassifierTest`

### Quality tool configuration
- `phpcs.xml.dist`
- `phpstan.neon.dist`

## Suggested local commands

### PHPUnit
```bash
./vendor/bin/phpunit -c web/core/phpunit.xml.dist \
  web/modules/custom/native_observability/modules/native_observability_execution/tests/src/Unit \
  web/modules/custom/native_observability/modules/native_observability_spans/tests/src/Unit \
  web/modules/custom/native_observability/modules/native_observability_cache_observer/tests/src/Unit \
  web/modules/custom/native_observability/modules/native_observability_database_observer/tests/src/Unit
```

### PHPCS
```bash
./vendor/bin/phpcs --standard=web/modules/custom/native_observability/phpcs.xml.dist web/modules/custom/native_observability
```

### PHPStan
```bash
./vendor/bin/phpstan analyse -c web/modules/custom/native_observability/phpstan.neon.dist web/modules/custom/native_observability
```

## Suggested dev dependencies on the Drupal project root
These remain project-level dependencies and should not be added to the module
composer manifest.

```bash
composer require --dev drupal/coder
composer require --dev phpstan/phpstan mglaman/phpstan-drupal
```
