Skip to content

Commit

Permalink
test: removed unwanted comments
Browse files Browse the repository at this point in the history
  • Loading branch information
aryamohanan committed Jun 10, 2024
1 parent d803ea8 commit 3b0d714
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
25 changes: 13 additions & 12 deletions packages/collector/test/tracing/database/prisma/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,19 @@ describe('tracing/prisma', function () {
} catch (err) {
// ignore
}
try {
const prismaClientSource = path.resolve(__dirname, './node_modules/.prisma');
const prismaClientDestination = path.resolve(__dirname, '../../../../../../node_modules/.prisma');
const destinationExists = await fs
.access(prismaClientDestination)
.then(() => true)
.catch(() => false);
if (!destinationExists) {
await recursiveCopy(prismaClientSource, prismaClientDestination);
}
} catch (err) {
// ignore

// By default, Prisma Client is generated into the './node_modules/.prisma/client' folder.
// However, In case of ESM apps when loading the module with the IITM hook, it checks for its
// installation in the root 'node_modules' folder. Therefore, if the '.prisma' folder is not found
// in the root directory during module loading, this code copies it from its default location.
// This is beacuse of we are handling prisma tests differently in our code base.
const prismaClientDestination = path.resolve(__dirname, '../../../../../../node_modules/.prisma');
const destinationExists = await fs
.access(prismaClientDestination)
.then(() => true)
.catch(() => false);
if (!destinationExists) {
await recursiveCopy(path.resolve(__dirname, './node_modules/.prisma'), prismaClientDestination);
}
});

Expand Down
2 changes: 0 additions & 2 deletions packages/core/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ function preInit() {
util.hasThePackageBeenInitializedTooLate();
util.requireHook.init(preliminaryConfig);
tracing.preInit(preliminaryConfig);
// util.iitmHook.init();
// Initialize secrets as early as possible, in particular for env var collection in fargate/google-cloud-run when
// the config comes from INSTANA_SECRETS.
secrets.init(/** @type {secrets.SecretOption} */ (preliminaryConfig));
Expand All @@ -73,7 +72,6 @@ function init(config, downstreamConnection, processIdentityProvider) {
secrets.init(/** @type {secrets.SecretOption} */ (config));
util.requireHook.init(config);
tracing.init(config, downstreamConnection, processIdentityProvider);
// util.iitmHook.init();
}

module.exports = {
Expand Down
2 changes: 0 additions & 2 deletions packages/core/src/util/requireHook.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ function patchedModuleLoad(moduleName) {
// However, when an ESM library imports a CommonJS package, our requireHook is triggered.
if (path.isAbsolute(moduleName) && ['.node', '.json', '.ts'].indexOf(path.extname(moduleName)) === -1) {
if (moduleName.indexOf('node_modules/mysql2/promise.js') !== -1) {
// return origLoad.apply(Module, arguments);
// }
moduleName = 'mysql2/promise';
} else {
// e.g. path is node_modules/@elastic/elasicsearch/index.js
Expand Down

0 comments on commit 3b0d714

Please sign in to comment.