EBSECan / donatemask

Donate A Mask Project Repository
GNU Lesser General Public License v2.1
10 stars 7 forks source link

Unit Tests Fails Looking for Providers #117

Closed mekkim closed 2 years ago

mekkim commented 2 years ago

I'm not exactly sure how the Actions and unit tests work. My latest push to Main fails unit tests at the npm install phase with an error that it can't find ./providers

Raw logs of first error (it repeats with each entry, always failing to find ./providers

2022-05-24T17:55:34.8235783Z ##[group]Run npm install
2022-05-24T17:55:34.8236209Z npm install
2022-05-24T17:55:34.8236504Z npm test
2022-05-24T17:55:34.8293841Z shell: /usr/bin/bash -e {0}
2022-05-24T17:55:34.8294290Z ##[endgroup]
2022-05-24T17:56:32.7825534Z npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
2022-05-24T17:56:32.9661608Z npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
2022-05-24T17:56:32.9774122Z npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
2022-05-24T17:56:33.0060408Z npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
2022-05-24T17:56:33.2762225Z npm WARN deprecated har-validator@5.1.5: this library is no longer supported
2022-05-24T17:56:41.9888977Z npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
2022-05-24T17:56:43.9948444Z npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
2022-05-24T17:56:44.5574335Z npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
2022-05-24T17:56:48.3070728Z npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
2022-05-24T17:56:50.6921547Z npm WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
2022-05-24T17:57:04.6159989Z 
2022-05-24T17:57:04.6162570Z added 1943 packages, and audited 1944 packages in 1m
2022-05-24T17:57:04.6163065Z 
2022-05-24T17:57:04.6164575Z 204 packages are looking for funding
2022-05-24T17:57:04.6164988Z   run `npm fund` for details
2022-05-24T17:57:04.6184988Z 
2022-05-24T17:57:04.6185445Z found 0 vulnerabilities
2022-05-24T17:57:04.9648544Z 
2022-05-24T17:57:04.9649679Z > donate-a-mask@1.1.0 test
2022-05-24T17:57:04.9650475Z > jest -c jest.config.json --runInBand --
2022-05-24T17:57:04.9650949Z 
2022-05-24T17:57:05.7457681Z Starting in-memory mongodb server for testing...
2022-05-24T17:57:06.3920229Z FAIL test/server/routes/dbapi.test.js
2022-05-24T17:57:06.3921794Z   ● Test suite failed to run
2022-05-24T17:57:06.3922355Z 
2022-05-24T17:57:06.3923011Z     Cannot find module './providers' from 'server/node_modules/mongodb/lib/cmap/auth/mongo_credentials.js'
2022-05-24T17:57:06.3923258Z 
2022-05-24T17:57:06.3923349Z     Require stack:
2022-05-24T17:57:06.3923651Z       server/node_modules/mongodb/lib/cmap/auth/mongo_credentials.js
2022-05-24T17:57:06.3923973Z       server/node_modules/mongodb/lib/connection_string.js
2022-05-24T17:57:06.3924280Z       server/node_modules/mongodb/lib/mongo_client.js
2022-05-24T17:57:06.3924609Z       server/node_modules/mongodb/lib/change_stream.js
2022-05-24T17:57:06.3924910Z       server/node_modules/mongodb/lib/collection.js
2022-05-24T17:57:06.3925182Z       server/node_modules/mongodb/lib/index.js
2022-05-24T17:57:06.3925399Z       server/db/conn.js
2022-05-24T17:57:06.3925633Z       test/server/routes/dbapi.test.js
2022-05-24T17:57:06.3925771Z 
2022-05-24T17:57:06.3926103Z       at Resolver._throwModNotFoundError (node_modules/jest-resolve/build/resolver.js:491:11)
2022-05-24T17:57:06.3926557Z       at Object.<anonymous> (server/node_modules/mongodb/src/cmap/auth/mongo_credentials.ts:6:1)
humphd commented 2 years ago

Did you npm install in server/ too, or only the root?

mekkim commented 2 years ago

Did you npm install in server/ too, or only the root?

I did both.

mekkim commented 2 years ago

My best guess is that the npm audit fix in server/ changed something that has a missing dependency?

mekkim commented 2 years ago

This is the relevant diff from the npm audit fix after npm install in server/

https://github.com/EBSECan/donatemask/commit/2685ab08a8074c2e75beac48abed1a23b66dc4e5

humphd commented 2 years ago

Ah, there wasn't a PR, so I didn't see this go in. Let me pull it and see locally...

mekkim commented 2 years ago

My bad. Sorry. I pushed directly.

humphd commented 2 years ago

I've made a PR to try and fix. We really need to get node_modules out of git and finish #88. Then this won't matter.

humphd commented 2 years ago

PR at https://github.com/EBSECan/donatemask/pull/118