зеркало из https://github.com/mozilla/fxa.git
task(ci): Enable tracing in CI
Because: - We want to exercise tracing code paths in CI to spot potential errors This Commit: - Configures CI to turn basic tracing - Configures a sample rate of 0, so as not execute code paths but not output traces - Fixes a bug found in the suppress tracing code in fxa shared. Not all arguments were getting propagated.
This commit is contained in:
Родитель
651792a59a
Коммит
a955b5a213
|
@ -21,6 +21,8 @@ executors:
|
||||||
FXA_EMAIL_LOG_LEVEL: debug
|
FXA_EMAIL_LOG_LEVEL: debug
|
||||||
RUST_BACKTRACE: 1
|
RUST_BACKTRACE: 1
|
||||||
AUTH_FIRESTORE_EMULATOR_HOST: localhost:9090
|
AUTH_FIRESTORE_EMULATOR_HOST: localhost:9090
|
||||||
|
TRACING_SERVICE_NAME: ci-content-server-executor
|
||||||
|
TRACING_CONSOLE_EXPORTER_ENABLED: true
|
||||||
environment:
|
environment:
|
||||||
FXA_MX_RECORD_EXCLUSIONS: restmail.dev.lcip.org
|
FXA_MX_RECORD_EXCLUSIONS: restmail.dev.lcip.org
|
||||||
|
|
||||||
|
@ -103,6 +105,8 @@ jobs:
|
||||||
environment:
|
environment:
|
||||||
NODE_ENV: dev
|
NODE_ENV: dev
|
||||||
FIRESTORE_EMULATOR_HOST: localhost:9090
|
FIRESTORE_EMULATOR_HOST: localhost:9090
|
||||||
|
TRACING_SERVICE_NAME: ci-test-package
|
||||||
|
TRACING_CONSOLE_EXPORTER_ENABLED: true
|
||||||
parameters:
|
parameters:
|
||||||
package:
|
package:
|
||||||
type: string
|
type: string
|
||||||
|
@ -126,6 +130,9 @@ jobs:
|
||||||
- image: jdlk7/firestore-emulator
|
- image: jdlk7/firestore-emulator
|
||||||
- image: memcached
|
- image: memcached
|
||||||
- image: redis
|
- image: redis
|
||||||
|
environment:
|
||||||
|
TRACING_SERVICE_NAME: ci-test-many
|
||||||
|
TRACING_CONSOLE_EXPORTER_ENABLED: true
|
||||||
steps:
|
steps:
|
||||||
- base-install
|
- base-install
|
||||||
- run:
|
- run:
|
||||||
|
@ -268,6 +275,8 @@ jobs:
|
||||||
- image: jdlk7/firestore-emulator
|
- image: jdlk7/firestore-emulator
|
||||||
environment:
|
environment:
|
||||||
NODE_ENV: dev
|
NODE_ENV: dev
|
||||||
|
TRACING_SERVICE_NAME: ci-playwright-functional-tests
|
||||||
|
TRACING_CONSOLE_EXPORTER_ENABLED: true
|
||||||
steps:
|
steps:
|
||||||
# needed by check-mysql.sh
|
# needed by check-mysql.sh
|
||||||
- run: apt-get update && apt-get install -y netcat
|
- run: apt-get update && apt-get install -y netcat
|
||||||
|
|
|
@ -8,6 +8,10 @@ if grep -e "$MODULE" -e 'all' "$DIR/../packages/test.list" > /dev/null; then
|
||||||
echo -e "\n###################################"
|
echo -e "\n###################################"
|
||||||
echo "# testing $MODULE"
|
echo "# testing $MODULE"
|
||||||
echo -e "###################################\n"
|
echo -e "###################################\n"
|
||||||
|
|
||||||
|
echo -e "TRACING_SERVICE_NAME=$TRACING_SERVICE_NAME"
|
||||||
|
echo -e "TRACING_CONSOLE_EXPORTER_ENABLED=$TRACING_CONSOLE_EXPORTER_ENABLED"
|
||||||
|
|
||||||
if [[ -x scripts/test-ci.sh ]]; then
|
if [[ -x scripts/test-ci.sh ]]; then
|
||||||
time ./scripts/test-ci.sh
|
time ./scripts/test-ci.sh
|
||||||
else
|
else
|
||||||
|
|
|
@ -203,7 +203,7 @@ module.exports = function (
|
||||||
);
|
);
|
||||||
|
|
||||||
function optionallyIgnoreTrace(fn) {
|
function optionallyIgnoreTrace(fn) {
|
||||||
return async function (request) {
|
return async function (request, ...args) {
|
||||||
// Only authenticated routes or routes that specify an uid/email
|
// Only authenticated routes or routes that specify an uid/email
|
||||||
// can be traced because those routes can look a user up
|
// can be traced because those routes can look a user up
|
||||||
const canOptOut =
|
const canOptOut =
|
||||||
|
@ -219,11 +219,11 @@ module.exports = function (
|
||||||
// will get this.
|
// will get this.
|
||||||
|
|
||||||
return tracing.suppressTrace(() => {
|
return tracing.suppressTrace(() => {
|
||||||
return fn(request);
|
return fn(request, ...args);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return fn(request);
|
return fn(request, ...args);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче