-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Testing packages just after they're built (#49)
- Loading branch information
Showing
7 changed files
with
197 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,9 +9,18 @@ section: "default" | |
priority: "extra" | ||
|
||
replaces: | ||
- elastic-otel-php | ||
provides: | ||
- elastic-otel-php | ||
- apm-agent-php | ||
|
||
overrides: | ||
rpm: | ||
provides: | ||
- elastic-otel-php | ||
deb: | ||
provides: | ||
- elastic-otel-php | ||
|
||
depends: | ||
- bash | ||
maintainer: "APM Team <[email protected]>" | ||
description: | | ||
Elastic OpenTelemetry PHP distribution | ||
|
@@ -29,7 +38,14 @@ contents: | |
expand: true | ||
- src: /source/prod/php | ||
dst: /opt/elastic/elastic-otel-php/php | ||
expand: true | ||
type: tree | ||
packager: rpm | ||
- src: /source/prod/php | ||
dst: /opt/elastic/elastic-otel-php/php | ||
packager: deb | ||
- src: /source/prod/php | ||
dst: /opt/elastic/elastic-otel-php/php | ||
packager: apk | ||
- src: /source/packaging/configs/elastic-otel-custom-template.ini | ||
dst: /opt/elastic/elastic-otel-php/etc/elastic-otel-custom.ini | ||
type: config | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
const CRED = "\033[31m"; | ||
const CGREEN = "\033[32m"; | ||
const CDEF = "\033[39m"; | ||
|
||
echo CGREEN."Starting package smoke test\n".CDEF; | ||
|
||
echo "Checking if extension is loaded: "; | ||
if (array_search("elastic_otel", get_loaded_extensions()) === false) { | ||
echo CRED."FAILED. Elastic OpenTelemetry extension not found\n".CDEF; | ||
exit(1); | ||
} | ||
echo CGREEN."OK\n".CDEF; | ||
|
||
echo "Looking for internal function 'elastic_otel_is_enabled': "; | ||
if (array_search("elastic_otel_is_enabled", get_extension_funcs("elastic_otel")) === false) { | ||
echo CRED."FAILED. Elastic OpenTelemetry extension function 'elastic_otel_is_enabled' not found\n".CDEF; | ||
exit(1); | ||
} | ||
echo CGREEN."OK\n".CDEF; | ||
|
||
|
||
echo "Checking if extension is enabled: "; | ||
if (elastic_otel_is_enabled() !== true) { | ||
echo CRED."FAILED. Elastic OpenTelemetry extension is not enabled\n".CDEF; | ||
exit(1); | ||
} | ||
echo CGREEN."OK\n".CDEF; | ||
|
||
echo "Looking for PhpPartFacade class: "; | ||
if (array_search("Elastic\OTel\AutoInstrument\PhpPartFacade", get_declared_classes()) === false) { | ||
echo CRED."FAILED. Elastic\OTel\AutoInstrument\PhpPartFacade class not found. Bootstrap failed\n".CDEF; | ||
exit(1); | ||
} | ||
echo CGREEN."OK\n".CDEF; | ||
|
||
echo "Trying to log something to stderr: "; | ||
Elastic\OTel\AutoInstrument\BootstrapStageLogger::logCritical("This is just a message to test logger", __LINE__, __FUNCTION__); | ||
echo CGREEN."OK\n".CDEF; | ||
|
||
echo CGREEN."Smoke test passed\n".CDEF; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
const CRED = "\033[31m"; | ||
const CGREEN = "\033[32m"; | ||
const CDEF = "\033[39m"; | ||
|
||
echo CGREEN."Starting package uninstalled smoke test\n".CDEF; | ||
|
||
echo "Checking if extension is loaded: "; | ||
if (array_search("elastic_otel", get_loaded_extensions()) !== false) { | ||
echo CRED."FAILED. Elastic OpenTelemetry extension found\n".CDEF; | ||
exit(1); | ||
} | ||
echo CGREEN."OK\n".CDEF; | ||
|
||
echo "Looking for internal function 'elastic_otel_is_enabled': "; | ||
if (array_search("elastic_otel_is_enabled", get_defined_functions()["internal"]) !== false) { | ||
echo CRED."FAILED. Elastic OpenTelemetry extension function 'elastic_otel_is_enabled' found\n".CDEF; | ||
exit(1); | ||
} | ||
echo CGREEN."OK\n".CDEF; | ||
|
||
echo "Looking for PhpPartFacade class: "; | ||
if (array_search("Elastic\OTel\AutoInstrument\PhpPartFacade", get_declared_classes()) !== false) { | ||
echo CRED."FAILED. Elastic\OTel\AutoInstrument\PhpPartFacade class not found. Bootstrap failed\n".CDEF; | ||
exit(1); | ||
} | ||
echo CGREEN."OK\n".CDEF; | ||
|
||
echo CGREEN."Smoke test passed\n".CDEF; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters