opentelemetry-js-contrib
opentelemetry-js-contrib copied to clipboard
mysql2 - migrate to v3 in tests
renovate opened up #2095 to upgrade mysql2 package to a new version 3.
While we only use it for tests, the security warning is not a concern for us, but the tests are not compiling with the new version as a dev dependency:
> @opentelemetry/[email protected] compile
> tsc -p .
test/mysql.test.ts:145:29 - error TS2769: No overload matches this call.
Overload 1 of 3, '(group: string, connectionUri: string): void', gave the following error.
Argument of type 'PoolClusterOptions' is not assignable to parameter of type 'string'.
Overload 2 of 3, '(group: string, config: PoolOptions): void', gave the following error.
Type 'PoolClusterOptions' has no properties in common with type 'PoolOptions'.
145 poolCluster.add('name', {
~
146 port,
~~~~~~~~~~~
...
150 database,
~~~~~~~~~~~~~~~
151 } as mysqlTypes.PoolClusterOptions);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Found 1 error.
npm ERR! Lifecycle script `compile` failed with error:
npm ERR! Error: command failed
npm ERR! in workspace: @opentelemetry/[email protected]
npm ERR! at location: /Users/amirblum/repos/opentelemetry-js-contrib/plugins/node/opentelemetry-instrumentation-mysql2
Not sure how tav is working properly.
In npm, seems that version 3 is the popular version, and v2 has security issues. So it does make sense to use the new version in instrumentation testing by default.
This issue closes #2095 which cannot merge, to track the task of upgrading the dev dependency to a more relevant version