-
Notifications
You must be signed in to change notification settings - Fork 587
chore: Add docker compose and test services scripts #2886
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
chore: Add docker compose and test services scripts #2886
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2886 +/- ##
==========================================
+ Coverage 89.77% 89.82% +0.04%
==========================================
Files 187 187
Lines 9147 9147
Branches 1884 1884
==========================================
+ Hits 8212 8216 +4
+ Misses 935 931 -4 🚀 New features to boost your workflow:
|
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. |
@@ -163,8 +163,6 @@ jobs: | |||
- uses: actions/setup-node@v4 | |||
with: | |||
node-version: ${{ matrix.node }} | |||
- name: Set MySQL variables |
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.
note for reviewer: this is required only for testing @opentelemetry/instrumentation-mysql
and can be executed as a query using the client. Hence is removed from there and added in plugins/node/opentelemetry-instrumentation-mysql/test/mysql.test.ts
@@ -176,8 +176,6 @@ jobs: | |||
- uses: actions/setup-node@v4 | |||
with: | |||
node-version: ${{ matrix.node }} | |||
- name: Set MySQL variables |
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.
note for reviewer: same here
const shouldTest = process.env.RUN_MYSQL_TESTS; | ||
|
||
before(async function () { | ||
const connection = createConnection({ |
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.
note for reviewer: enabling here the general_log
setting instead of doing it in the workflows
@@ -64,7 +64,7 @@ const memoryExporter = new InMemorySpanExporter(); | |||
const CONFIG = { | |||
user: process.env.POSTGRES_USER || 'postgres', | |||
password: process.env.POSTGRES_PASSWORD || 'postgres', | |||
database: process.env.POSTGRES_DB || 'postgres', | |||
database: process.env.POSTGRES_DB || 'otel_pg_database', |
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.
note for reviewer: align the value with the one in workflow services
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.
Love this, small nit tho.
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.
Should do the cross-env
thing. Else I just have nits. Thanks for picking this up!
If you only want to test a sigle package (e.g. the `instrumentation-mongodb`) you can `cd` into it and run the tests after you started the services. | ||
|
||
```sh | ||
npm run test-services:start # starts services in Docker |
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.
This could optionally be npm run test-services:start mongodb
but probably don't need to bother mentioning this. Easier to keep it simple.
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 planning to do a follow up PR to add scripts for each package which will use this feature. I'll remember to update this description.
plugins/node/opentelemetry-instrumentation-mysql/test/index.test.ts
Outdated
Show resolved
Hide resolved
…st.ts Co-authored-by: Trent Mick <trentm@gmail.com>
Co-authored-by: Trent Mick <trentm@gmail.com>
Co-authored-by: Trent Mick <trentm@gmail.com>
Co-authored-by: Trent Mick <trentm@gmail.com>
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.
thank you for working on this! 🙂
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
Which problem is this PR solving?
Short description of the changes