Commit Graph

4 Commits

Author SHA1 Message Date
Brett McBride fbdb103590
upgrade to phpunit 11 (#1308)
* run unit tests in random order
running in random order highlights some interference between tests (mostly logging being enabled), and is a requirement for
mutation testing (ie, all tests must pass when executed in a random order).
* adding infection mutation testing
this adds the ability to run infection. It generates a lot of output, which is an exercise for another PR...
* replace assertwell/phpunit-global-state
the package was not compatible with phpunit 11. create out own test Trait, which handles
env vars, as well as general cleanup of the usual suspects of state that our tests mess up
* remove redundant tearDown functions
there's an after annotation on the trait to handle this
* use rector to upgrade tests for phpunit 11
* fixing CoversFunction for namespaced functions
* use FQNs in test attributes
2024-05-16 09:21:28 +10:00
Tobias Bachert a22f9f1077
Cleanup/fix context package (#711)
* Remove `Context::withValue()`

Creates a hidden `Scope` when called without `$parent`.

* Remove `Context::detach(Scope)`

* Remove static `Context::attach()`

* Add missing typehints

* Use loop instead of recursion

* Fix `MultiTextMapPropagator::extract()` clearing context

* Fix `TextMapPropagator::composite()` for named arguments

* Make `Context` constructor non-public

* Make `Context` and `ContextKey` final

* Fix `ArrayAccessGetterSetter`

Resolves inconsistencies in case-insensitive handling.

* Fix psalm

* Fix cannot mock final class `Context`

Revert after introducing ContextInterface?

* Apply feedback and remove obsolete parentheses

* Use psalm-suppress instead of assert
2022-06-16 08:17:59 -04:00
Brett McBride 86ed4cff87
adding covers annotations to all tests (#540)
* adding covers annotations to all tests
* clock tests
* adding unit tests
* feedback
- cleaning up ValueRecorder tests
- ints are floats, so type-hint ValueRecorder::record and remove some checks
2022-01-07 09:33:08 +11:00
Brett McBride 56cf2db141
Separate integration and unit tests (#538)
* reorganise tests
moving tests under tests/Unit and tests/Integration, and updating namespaces
changing 'make test' to just run unit tests, and generate coverage off that
adding a 'make test-integration' to run integration tests (without coverage)
adding test-integration to 'make all'
adding a separate github action to run integration tests

* tidy 'make test'
make test is now a combination of test-unit and test-integration

* fixing 'make all'

* adding unit tests for TraceIdRatioBasedSampler
I grabbed a couple of the more unit-tests tests from the integration tests. Also starting to add some @covers
annotations to start to remove false coverage
2022-01-05 14:22:12 +01:00