Update test framework: fix run_tests.py to support all test files, add auto-import-check for test files

This commit is contained in:
qiaoxinjiu
2026-05-09 15:11:30 +08:00
parent eb053a347f
commit eaba8328da
21739 changed files with 2236758 additions and 719 deletions

View File

@@ -0,0 +1,3 @@
export { InstrumentationBase } from './instrumentation';
export { normalize } from './noop-normalize';
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,18 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { InstrumentationBase } from './instrumentation';
export { normalize } from './noop-normalize';
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/browser/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { InstrumentationBase } from './instrumentation';\nexport { normalize } from './noop-normalize';\n"]}

View File

@@ -0,0 +1,10 @@
import { InstrumentationAbstract } from '../../instrumentation';
import * as types from '../../types';
import { InstrumentationConfig } from '../../types';
/**
* Base abstract class for instrumenting web plugins
*/
export declare abstract class InstrumentationBase<ConfigType extends InstrumentationConfig = InstrumentationConfig> extends InstrumentationAbstract<ConfigType> implements types.Instrumentation<ConfigType> {
constructor(instrumentationName: string, instrumentationVersion: string, config: ConfigType);
}
//# sourceMappingURL=instrumentation.d.ts.map

View File

@@ -0,0 +1,28 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { InstrumentationAbstract } from '../../instrumentation';
/**
* Base abstract class for instrumenting web plugins
*/
export class InstrumentationBase extends InstrumentationAbstract {
constructor(instrumentationName, instrumentationVersion, config) {
super(instrumentationName, instrumentationVersion, config);
if (this._config.enabled) {
this.enable();
}
}
}
//# sourceMappingURL=instrumentation.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"instrumentation.js","sourceRoot":"","sources":["../../../../src/platform/browser/instrumentation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAIhE;;GAEG;AACH,MAAM,OAAgB,mBAGpB,SAAQ,uBAAmC;IAG3C,YACE,mBAA2B,EAC3B,sBAA8B,EAC9B,MAAkB;QAElB,KAAK,CAAC,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,CAAC,CAAC;QAE3D,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE;YACxB,IAAI,CAAC,MAAM,EAAE,CAAC;SACf;IACH,CAAC;CACF","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { InstrumentationAbstract } from '../../instrumentation';\nimport * as types from '../../types';\nimport { InstrumentationConfig } from '../../types';\n\n/**\n * Base abstract class for instrumenting web plugins\n */\nexport abstract class InstrumentationBase<\n ConfigType extends InstrumentationConfig = InstrumentationConfig,\n >\n extends InstrumentationAbstract<ConfigType>\n implements types.Instrumentation<ConfigType>\n{\n constructor(\n instrumentationName: string,\n instrumentationVersion: string,\n config: ConfigType\n ) {\n super(instrumentationName, instrumentationVersion, config);\n\n if (this._config.enabled) {\n this.enable();\n }\n }\n}\n"]}

View File

@@ -0,0 +1,13 @@
/**
* Placeholder normalize function to replace the node variant in browser runtimes,
* this should never be called and will perform a no-op and warn if it is called regardless.
*
* This is a workaround to fix https://github.com/open-telemetry/opentelemetry-js/issues/4373 until the instrumentation
* package can be made node-only.
*
* @param path input path
* @return unmodified path
* @internal
*/
export declare function normalize(path: string): string;
//# sourceMappingURL=noop-normalize.d.ts.map

View File

@@ -0,0 +1,32 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { diag } from '@opentelemetry/api';
/**
* Placeholder normalize function to replace the node variant in browser runtimes,
* this should never be called and will perform a no-op and warn if it is called regardless.
*
* This is a workaround to fix https://github.com/open-telemetry/opentelemetry-js/issues/4373 until the instrumentation
* package can be made node-only.
*
* @param path input path
* @return unmodified path
* @internal
*/
export function normalize(path) {
diag.warn('Path normalization is not implemented for this platform. To silence this warning, ensure no node-specific instrumentations are loaded, and node-specific types (e.g. InstrumentationNodeModuleFile), are not used in a browser context)');
return path;
}
//# sourceMappingURL=noop-normalize.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"noop-normalize.js","sourceRoot":"","sources":["../../../../src/platform/browser/noop-normalize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C;;;;;;;;;;GAUG;AACH,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,IAAI,CAAC,IAAI,CACP,yOAAyO,CAC1O,CAAC;IACF,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { diag } from '@opentelemetry/api';\n\n/**\n * Placeholder normalize function to replace the node variant in browser runtimes,\n * this should never be called and will perform a no-op and warn if it is called regardless.\n *\n * This is a workaround to fix https://github.com/open-telemetry/opentelemetry-js/issues/4373 until the instrumentation\n * package can be made node-only.\n *\n * @param path input path\n * @return unmodified path\n * @internal\n */\nexport function normalize(path: string): string {\n diag.warn(\n 'Path normalization is not implemented for this platform. To silence this warning, ensure no node-specific instrumentations are loaded, and node-specific types (e.g. InstrumentationNodeModuleFile), are not used in a browser context)'\n );\n return path;\n}\n"]}