You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/workflows/test-all-versions.yml
-2Lines changed: 0 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -163,8 +163,6 @@ jobs:
163
163
- uses: actions/setup-node@v4
164
164
with:
165
165
node-version: ${{ matrix.node }}
166
-
- name: Set MySQL variables
167
-
run: mysql --user=root --password=${MYSQL_ROOT_PASSWORD} --host=${MYSQL_HOST} --port=${MYSQL_PORT} -e "SET GLOBAL log_output='TABLE'; SET GLOBAL general_log = 1;" mysql
Copy file name to clipboardExpand all lines: .github/workflows/unit-test.yml
-2Lines changed: 0 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -176,8 +176,6 @@ jobs:
176
176
- uses: actions/setup-node@v4
177
177
with:
178
178
node-version: ${{ matrix.node }}
179
-
- name: Set MySQL variables
180
-
run: mysql --user=root --password=${MYSQL_ROOT_PASSWORD} --host=${MYSQL_HOST} --port=${MYSQL_PORT} -e "SET GLOBAL log_output='TABLE'; SET GLOBAL general_log = 1;" mysql
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -135,6 +135,34 @@ The conventional commit type (in PR title) is very important to automatically bu
135
135
136
136
There is no need to update the CHANGELOG in a PR because it will be updated as part of the release process (see [RELEASING.md](RELEASING.md) for more details).
137
137
138
+
### Testing
139
+
140
+
Most unit tests case be run via:
141
+
142
+
```sh
143
+
npm test
144
+
```
145
+
146
+
However, some instrumentations require test-services to be running (e.g. the `instrumentation-mongodb` package requires a MongoDB server). Use the `test-services`-related npm scripts to start all required services in Docker and then run the tests with the appropriate configuration to use those services:
147
+
148
+
```sh
149
+
npm run test-services:start # starts services in Docker
150
+
npm run test:with-services-config # runs 'npm test' with envvars from test/test-services.env
151
+
npm run test-services:stop # stops services in Docker
152
+
```
153
+
154
+
If you only want to test a single package (e.g. the `instrumentation-mongodb`) you can `cd` into it and run the tests after you started the services.
155
+
156
+
```sh
157
+
npm run test-services:start # starts services in Docker
158
+
cd plugins/node/opentelemetry-instrumentation-mongodb # get into the instrumenation folder
159
+
RUN_MONGODB_TESTS=1 npm test# run the test with the proper config (check each package)
160
+
cd ../../.. # go back to root folder
161
+
npm run test-services:stop # stops services in Docker
162
+
```
163
+
164
+
NOTE: scripts for each package will be added to avoid extra consumption of resources and improve the development experience.
165
+
138
166
### Benchmarks
139
167
140
168
When two or more approaches must be compared, please write a benchmark in the benchmark/index.js module so that we can keep track of the most efficient algorithm.
0 commit comments