LD4P / sinopia_editor

Sinopia Linked Data Editor
https://sinopia.io/
Apache License 2.0
35 stars 10 forks source link

Update dependencies #3666

Closed dlss-infra-bot closed 1 year ago

ndushay commented 1 year ago

Tests Hang

The tests for this PR are hanging, without information. Running the tests locally, even with test-verbose:

$ npm run test-verbose

> sinopia_editor@3.17.34 test-verbose
> jest --colors --runInBand

Does not show any activity except checkpoints in the docker containers:

...
mongo_1          | {"t":{"$date":"2023-04-12T17:56:44.158+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"WTCheckpointThread","msg":"WiredTiger message","attr":{"message":"[1681322204:158262][1:0x7fbee00e9700], WT_SESSION.checkpoint: [WT_VERB_CHECKPOINT_PROGRESS] saving checkpoint snapshot min: 598, snapshot max: 598 snapshot count: 0, oldest timestamp: (1681322199, 1) , meta checkpoint timestamp: (1681322204, 1) base write gen: 1"}}
mongo_1          | {"t":{"$date":"2023-04-12T17:57:44.168+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"WTCheckpointThread","msg":"WiredTiger message","attr":{"message":"[1681322264:168064][1:0x7fbee00e9700], WT_SESSION.checkpoint: [WT_VERB_CHECKPOINT_PROGRESS] saving checkpoint snapshot min: 613, snapshot max: 613 snapshot count: 0, oldest timestamp: (1681322259, 1) , meta checkpoint timestamp: (1681322264, 1) base write gen: 1"}}
mongo_1          | {"t":{"$date":"2023-04-12T17:58:44.178+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"WTCheckpointThread","msg":"WiredTiger message","attr":{"message":"[1681322324:178139][1:0x7fbee00e9700], WT_SESSION.checkpoint: [WT_VERB_CHECKPOINT_PROGRESS] saving checkpoint snapshot min: 628, snapshot max: 628 snapshot count: 0, oldest timestamp: (1681322319, 1) , meta checkpoint timestamp: (1681322324, 1) base write gen: 1"}}
mongo_1          | {"t":{"$date":"2023-04-12T17:59:44.186+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"WTCheckpointThread","msg":"WiredTiger message","attr":{"message":"[1681322384:186596][1:0x7fbee00e9700], WT_SESSION.checkpoint: [WT_VERB_CHECKPOINT_PROGRESS] saving checkpoint snapshot min: 643, snapshot max: 643 snapshot count: 0, oldest timestamp: (1681322379, 1) , meta checkpoint timestamp: (1681322384, 1) base write gen: 1"}}
mongo_1          | {"t":{"$date":"2023-04-12T18:00:44.196+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"WTCheckpointThread","msg":"WiredTiger message","attr":{"message":"[1681322444:196507][1:0x7fbee00e9700], WT_SESSION.checkpoint: [WT_VERB_CHECKPOINT_PROGRESS] saving checkpoint snapshot min: 658, snapshot max: 658 snapshot count: 0, oldest timestamp: (1681322433, 1) , meta checkpoint timestamp: (1681322438, 1) base write gen: 1"}}
...
ndushay commented 1 year ago

How to override versions on dependencies of your dependencies

See https://docs.npmjs.com/cli/v8/configuring-npm/package-json#overrides.

Note that you will need to:

  1. make the changes in package.json
  2. rm package-lock.json
  3. rm -rf node_modules
  4. AND THEN: npm install

without steps 2 and 3, package-lock.json is not updated.

Note further that I was unable to successfully get anywhere with this approach, partly because more packages got updated since Monday, and those updates didn't magically fix the issues (see PR #3667 where I tried it)

ndushay commented 1 year ago

What packages were updated in this PR?

The diff for package-lock.json is large. I did a slow visual review of that diff and found:

Sourcemap-codec Cli-spinners 2.7.0 to 2.8.0 Core-js 3.29.1 to 3.30.0 Core-js-compact 3.21.1 to 3.30.0

ndushay commented 1 year ago

Should We Pin Packages?

As it stands, we are getting deprecation warnings for a number of npm packages:

$ npm install
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated w3c-hr-time@1.0.2: Use your platform's native performance.now() and performance.timeOrigin.
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
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.
npm WARN deprecated uglify-es@3.3.9: support for ECMAScript is superseded by `uglify-js` as of v3.13.0
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
npm WARN deprecated core-js@1.2.7: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.

added 2448 packages, and audited 2449 packages in 47s

I believe a lot of these are secondary dependencies; maybe we could bump the version of the primary dependency???

ndushay commented 1 year ago

Closing. Declaring bankruptcy on this app's dep update for this week.

ndushay commented 1 year ago

You can run (some?) single tests or groups of them okay:

$ npx jest __tests__/actionCreators/*

Summary reporter output:

Passed suites:
 PASS  /__tests__/actionCreators/history.test.js
 PASS  /__tests__/actionCreators/lookups.test.js
 PASS  /__tests__/actionCreators/languages.test.js
 PASS  /__tests__/actionCreators/authenticate.test.js
 PASS  /__tests__/actionCreators/exports.test.js
 PASS  /__tests__/actionCreators/transfer.test.js
 PASS  /__tests__/actionCreators/relationships.test.js
 PASS  /__tests__/actionCreators/user.test.js
 PASS  /__tests__/actionCreators/templates.test.js
 PASS  /__tests__/actionCreators/search.test.js
 PASS  /__tests__/actionCreators/templateValidationHelpers.test.js
 PASS  /__tests__/actionCreators/resources.newResourceCopy.test.js
 PASS  /__tests__/actionCreators/resources.newResource.test.js
 PASS  /__tests__/actionCreators/resources.test.js
 PASS  /__tests__/actionCreators/resources.loadResource.test.js
 PASS  /__tests__/actionCreators/resources.newResourceFromDataset.test.js

Summary:
Suites: 16/16
Tests:  81/81
Time:   7s 428ms

I then went through the various directories and such.

I was not able to successfully run:

(I tried to be methodical and try each directory, and then, for failures, try each subdirectory or even individual tests, but I don't think I pulled it off)

tests/components/App.test.js

  console.error
    Error: Uncaught [SyntaxError: '.disabled):not(:disabled)' is not a valid selector]
        at reportException (/Users/ndushay/ld4p-github/sinopia_editor/node_modules/jest-environment-jsdom/node_modules/jsdom/lib/jsdom/living/helpers/runtime-script-errors.js:66:24)
        at innerInvokeEventListeners (/Users/ndushay/ld4p-github/sinopia_editor/node_modules/jest-environment-jsdom/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:343:9)
        at invokeEventListeners (/Users/ndushay/ld4p-github/sinopia_editor/node_modules/jest-environment-jsdom/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:276:3)
        at HTMLAnchorElementImpl._dispatch (/Users/ndushay/ld4p-github/sinopia_editor/node_modules/jest-environment-jsdom/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:207:9)
        at HTMLAnchorElementImpl.dispatchEvent (/Users/ndushay/ld4p-github/sinopia_editor/node_modules/jest-environment-jsdom/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:94:17)
        at HTMLAnchorElement.dispatchEvent (/Users/ndushay/ld4p-github/sinopia_editor/node_modules/jest-environment-jsdom/node_modules/jsdom/lib/jsdom/living/generated/EventTarget.js:241:34)
        at /Users/ndushay/ld4p-github/sinopia_editor/node_modules/@testing-library/dom/dist/events.js:19:20
        at /Users/ndushay/ld4p-github/sinopia_editor/node_modules/@testing-library/react/dist/pure.js:66:16
        at batchedUpdates$1 (/Users/ndushay/ld4p-github/sinopia_editor/node_modules/react-dom/cjs/react-dom.development.js:22380:12)
        at act (/Users/ndushay/ld4p-github/sinopia_editor/node_modules/react-dom/cjs/react-dom-test-utils.development.js:1042:14) {
      detail: DOMException {},
      type: 'unhandled exception'
    }

      at console.Object.<anonymous>.console.error (node_modules/jest-prop-type-error/index.js:8:9)

npx jest tests/components/search/*

 ● <Search /> › retains sort order when paging

    SyntaxError: '.disabled):not(:disabled)' is not a valid selector

      at emit (node_modules/nwsapi/src/nwsapi.js:557:17)
      at Object._matches [as match] (node_modules/nwsapi/src/nwsapi.js:1400:9)
      at Array.Resolver (eval at compile (node_modules/nwsapi/src/nwsapi.js:760:17), <anonymous>:3:105)
      at collect (node_modules/nwsapi/src/nwsapi.js:1552:21)
      at Object._querySelectorAll [as select] (node_modules/nwsapi/src/nwsapi.js:1509:36)
      at Document.querySelectorAll (node_modules/bootstrap/js/src/dom/event-handler.js:104:33)

npx jest tests/components/editor/property/PropertyLabelInfo* HANGS!!!

npx jest tests/feature/* HANGS