-
Notifications
You must be signed in to change notification settings - Fork 534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test(instrumentation-mysql2): Add test for mysql2/promise #2525
base: main
Are you sure you want to change the base?
Conversation
c848eb5
to
4b73476
Compare
4b73476
to
67004ba
Compare
67004ba
to
104161c
Compare
104161c
to
d42bfc2
Compare
This package does not have an assigned component owner and is considered unmaintained. As such this package is in feature-freeze and this PR will be closed with 14 days unless a new owner or a sponsor (a member of @open-telemetry/javascript-approvers) for the feature is found. It is the responsibility of the author to find a sponsor for this feature. |
This issue was closed because no owner or sponsor has been found after 14 days |
I'll sponsor. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
One nit for a possible simplification.
if (isPoolClusterEndIgnoreCallback()) { | ||
await poolCluster.end(); | ||
} else { | ||
await poolCluster.end(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm am guessing you could drop function isPoolClusterEndIgnoreCallback()
below and simplify this block to:
if (isPoolClusterEndIgnoreCallback()) { | |
await poolCluster.end(); | |
} else { | |
await poolCluster.end(); | |
} | |
await poolCluster.end(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in the following commit. In addition, the ESLint error is also fixed.
ef5d5a6
const port = Number(process.env.MYSQL_PORT) || 33306; | ||
const database = process.env.MYSQL_DATABASE || 'test_db'; | ||
const host = process.env.MYSQL_HOST || '127.0.0.1'; | ||
const user = process.env.MYSQL_USER || 'otel'; |
Check failure
Code scanning / CodeQL
Hard-coded credentials
provider.addSpanProcessor(new SimpleSpanProcessor(memoryExporter)); | ||
rootConnection = await mysqlTypes.createConnection({ | ||
port, | ||
user: 'root', |
Check failure
Code scanning / CodeQL
Hard-coded credentials
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2525 +/- ##
=======================================
Coverage 90.75% 90.75%
=======================================
Files 169 169
Lines 8018 8018
Branches 1632 1632
=======================================
Hits 7277 7277
Misses 741 741 |
@Karibash You'll need to run 'npm run lint:fix' to fix a style error in your added file. |
@Karibash Then some of the "TAV" checks are failing. TAV stands for "test-all-versions". The TAV tests effectively run Looking at some of the TAV test runs above, it looks like:
Do you know what Some mysql2 release dates:
Perhaps [email protected] added promises support, or changed how its promises support works, such that this instrumentation works with it? You should be able to test locally by running: cd .../plugins/node/opentelemetry-instrumentation-mysql2
npm install --no-save [email protected] # or some other version
RUN_MYSQL_TESTS=1 npm test |
@trentm |
8877f75
to
c68038c
Compare
close #650
Which problem is this PR solving?
Add test for mysql2/promise.
Short description of the changes
I added a test to confirm that
@opentelemetry/instrumentation-mysql2
works withmysql2/promise
.