Skip to content

Commit 4523eb2

Browse files
committed
fix(ci): install open-feature/sdk for Feature flags tests job
test_featureflags fails on CI with "Class OpenFeature\interfaces\provider\Reason not found" and downstream "Class DDTrace\OpenFeature\DataDogProvider not found" because the SDK is never installed. The bridge autoload of _generated_openfeature.php declares DataDogProvider extends AbstractProvider; without the SDK on the autoloader path, the parent lookup fails and the whole bridge file aborts mid-load. - Add tests/OpenFeature/composer.json requiring open-feature/sdk ^2.1 so the existing tests/%/composer.lock-php pattern rule installs it into tests/OpenFeature/vendor/. - Wire test_featureflags to depend on tests/OpenFeature/composer.lock-php$(PHP_MAJOR_MINOR) so the install runs before phpunit is invoked. The bootstrap_common walkup autoloader picks up tests/OpenFeature/vendor/ when loading OpenFeature test files, registering the SDK autoloader before the extension autoloads the adapter bridge.
1 parent ae5e4d4 commit 4523eb2

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1315,7 +1315,7 @@ test_distributed_tracing_coverage:
13151315
test_metrics: global_test_run_dependencies
13161316
$(call run_tests,--testsuite=metrics $(TESTS))
13171317

1318-
test_featureflags: global_test_run_dependencies
1318+
test_featureflags: global_test_run_dependencies tests/OpenFeature/composer.lock-php$(PHP_MAJOR_MINOR)
13191319
$(call run_tests,--testsuite=featureflags $(TESTS))
13201320

13211321
benchmarks_run_dependencies: global_test_run_dependencies tests/Frameworks/Symfony/Version_5_2/composer.lock-php$(PHP_MAJOR_MINOR) tests/Frameworks/Laravel/Version_10_x/composer.lock-php$(PHP_MAJOR_MINOR) tests/Benchmarks/composer.lock-php$(PHP_MAJOR_MINOR)

tests/OpenFeature/composer.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "datadog/dd-trace-tests-openfeature",
3+
"require": {
4+
"open-feature/sdk": "^2.1"
5+
},
6+
"minimum-stability": "stable"
7+
}

0 commit comments

Comments
 (0)