From c9f9a3807f50fff23eb1f241a55a44ef9f75df9f Mon Sep 17 00:00:00 2001 From: Alireza Date: Mon, 25 Sep 2023 12:13:39 -0400 Subject: [PATCH 01/23] chore(build): try to publish to npm --- package.json | 2 +- .../docs/docs/platform/services/data/DisplaySetService.md | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index a2825756035..136b8edeeb3 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,7 @@ "eslint-plugin-react-hooks": "^4.4.0", "eslint-plugin-tsdoc": "^0.2.11", "eslint-webpack-plugin": "^2.5.3", - "execa": "^7.1.1", + "execa": "^8.0.1", "extract-css-chunks-webpack-plugin": "^4.5.4", "html-webpack-plugin": "^5.3.2", "husky": "^3.0.0", diff --git a/platform/docs/docs/platform/services/data/DisplaySetService.md b/platform/docs/docs/platform/services/data/DisplaySetService.md index 898ad138837..8b8bcae671d 100644 --- a/platform/docs/docs/platform/services/data/DisplaySetService.md +++ b/platform/docs/docs/platform/services/data/DisplaySetService.md @@ -8,6 +8,14 @@ sidebar_label: DisplaySet Service ## Overview `DisplaySetService` handles converting the `instanceMetadata` into `DisplaySet` that `OHIF` uses for the visualization. `DisplaySetService` gets initialized at service startup time, but is then cleared in the `Mode.jsx`. During the initialization `SOPClassHandlerIds` of the `modes` gets registered with the `DisplaySetService`. +:::tip + +DisplaySet is a general set of entities and contains links to bunch of displayable objects (images, etc.) Some series might get split up into different displaySets e.g., MG might have mixed views in a single series, but users might want to have separate LCC, RCC, etc. for hanging protocol usage. A viewport renders a display set into a displayable object. + +imageSet is a particular implementation of image displays. +::: + + > Based on the instanceMetadata's `SOPClassHandlerId`, the correct module from the registered extensions is found by `OHIF` and its `getDisplaySetsFromSeries` runs to create a DisplaySet for the Series. Note that this is an ordered operation, and consumes the instances as it proceeds, with the first registered handlers being able to consume instances first. From 6d86c87de65aa59e70219b57c9eb700bb2e57658 Mon Sep 17 00:00:00 2001 From: Alireza Date: Mon, 25 Sep 2023 12:31:49 -0400 Subject: [PATCH 02/23] update yarn lock --- yarn.lock | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/yarn.lock b/yarn.lock index 87e4da2dcb6..a4dee08357a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10036,6 +10036,21 @@ execa@^7.1.1: signal-exit "^3.0.7" strip-final-newline "^3.0.0" +execa@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/execa/-/execa-8.0.1.tgz#51f6a5943b580f963c3ca9c6321796db8cc39b8c" + integrity sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg== + dependencies: + cross-spawn "^7.0.3" + get-stream "^8.0.1" + human-signals "^5.0.0" + is-stream "^3.0.0" + merge-stream "^2.0.0" + npm-run-path "^5.1.0" + onetime "^6.0.0" + signal-exit "^4.1.0" + strip-final-newline "^3.0.0" + executable@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/executable/-/executable-4.1.1.tgz#41532bff361d3e57af4d763b70582db18f5d133c" @@ -10878,6 +10893,11 @@ get-stream@^6.0.0, get-stream@^6.0.1: resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== +get-stream@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-8.0.1.tgz#def9dfd71742cd7754a7761ed43749a27d02eca2" + integrity sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA== + get-symbol-description@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.0.0.tgz#7fdb81c900101fbd564dd5f1a30af5aadc1e58d6" @@ -11668,6 +11688,11 @@ human-signals@^4.3.0: resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-4.3.1.tgz#ab7f811e851fca97ffbd2c1fe9a958964de321b2" integrity sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ== +human-signals@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-5.0.0.tgz#42665a284f9ae0dade3ba41ebc37eb4b852f3a28" + integrity sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ== + humanize-ms@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/humanize-ms/-/humanize-ms-1.2.1.tgz#c46e3159a293f6b896da29316d8b6fe8bb79bbed" @@ -18694,6 +18719,11 @@ signal-exit@^4.0.1: resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.0.2.tgz#ff55bb1d9ff2114c13b400688fa544ac63c36967" integrity sha512-MY2/qGx4enyjprQnFaZsHib3Yadh3IXyV2C321GY0pjGfVBu4un0uDJkwgdxqO+Rdx8JMT8IfJIRwbYVz3Ob3Q== +signal-exit@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04" + integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== + sigstore@^1.3.0, sigstore@^1.4.0: version "1.8.0" resolved "https://registry.yarnpkg.com/sigstore/-/sigstore-1.8.0.tgz#f790120697fa7c89f4418598ce59e638ff680aa5" From 8d0a2f48cbba317bfb475632db4b32a99a40424c Mon Sep 17 00:00:00 2001 From: Alireza Date: Mon, 25 Sep 2023 13:22:47 -0400 Subject: [PATCH 03/23] update node to 18 --- .circleci/config.yml | 21 +++++-------------- Dockerfile | 4 ++-- .../OpenResty-Orthanc-Keycloak/dockerfile | 2 +- .../app/.recipes/OpenResty-Orthanc/dockerfile | 2 +- 4 files changed, 9 insertions(+), 20 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3130f457e45..c939701d6b3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,21 +14,10 @@ version: 2.1 orbs: codecov: codecov/codecov@1.0.5 cypress: cypress-io/cypress@3 -# executors: -# # Custom executor to override Cypress config -# deploy-to-prod-executor: -# docker: -# - image: cimg/node:16.14 -# environment: -# CYPRESS_BASE_URL: https://ohif-staging.netlify.com/ -# chrome-and-pacs: -# docker: -# # Primary container image where all steps run. -# - image: 'cypress/browsers:node18.12.0-chrome106-ff106' defaults: &defaults docker: - - image: cimg/node:16.14-browsers + - image: cimg/node:18.18-browsers environment: TERM: xterm # Enable colors in term QUICK_BUILD: true @@ -179,7 +168,7 @@ jobs: # DEPLOY_TO_DEV: # docker: - # - image: circleci/node:16.14.0 + # - image: circleci/node:18.18.0 # environment: # TERM: xterm # NETLIFY_SITE_ID: 32708787-c9b0-4634-b50f-7ca41952da77 @@ -193,7 +182,7 @@ jobs: # DEPLOY_TO_STAGING: # docker: - # - image: circleci/node:16.14.0 + # - image: circleci/node:18.18.0 # environment: # TERM: xterm # NETLIFY_SITE_ID: c7502ae3-b150-493c-8422-05701e44a969 @@ -207,7 +196,7 @@ jobs: # DEPLOY_TO_PRODUCTION: # docker: - # - image: circleci/node:16.14.0 + # - image: circleci/node:18.18.0 # environment: # TERM: xterm # NETLIFY_SITE_ID: 79c4a5da-5c95-4dc9-84f7-45fd9dfe21b0 @@ -221,7 +210,7 @@ jobs: # DEPLOY_TO_RELEASE_DEV: # docker: - # - image: circleci/node:16.14.0 + # - image: circleci/node:18.18.0 # environment: # TERM: xterm # NETLIFY_SITE_ID: 3270878-22 diff --git a/Dockerfile b/Dockerfile index 10a9f4ac589..807bed68619 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,7 +21,7 @@ # Stage 1: Build the application # docker build -t ohif/viewer:latest . -FROM node:16.15.0-slim as json-copier +FROM node:18.18.0-slim as json-copier RUN mkdir /usr/src/app WORKDIR /usr/src/app @@ -37,7 +37,7 @@ COPY platform /usr/src/app/platform #RUN find platform \! -name "package.json" -mindepth 2 -maxdepth 2 -print | xargs rm -rf # Copy Files -FROM node:16.15.0-slim as builder +FROM node:18.18.0-slim as builder RUN apt-get update && apt-get install -y build-essential python3 RUN mkdir /usr/src/app WORKDIR /usr/src/app diff --git a/platform/app/.recipes/OpenResty-Orthanc-Keycloak/dockerfile b/platform/app/.recipes/OpenResty-Orthanc-Keycloak/dockerfile index f150a82f492..ac8ff6f4cf7 100644 --- a/platform/app/.recipes/OpenResty-Orthanc-Keycloak/dockerfile +++ b/platform/app/.recipes/OpenResty-Orthanc-Keycloak/dockerfile @@ -23,7 +23,7 @@ # Stage 1: Build the application -FROM node:16.15.0-slim as builder +FROM node:18.18.0-slim as builder RUN mkdir /usr/src/app WORKDIR /usr/src/app diff --git a/platform/app/.recipes/OpenResty-Orthanc/dockerfile b/platform/app/.recipes/OpenResty-Orthanc/dockerfile index 8764705dab6..8a7ab3abda9 100644 --- a/platform/app/.recipes/OpenResty-Orthanc/dockerfile +++ b/platform/app/.recipes/OpenResty-Orthanc/dockerfile @@ -23,7 +23,7 @@ # Stage 1: Build the application -FROM node:16.15.0-slim as builder +FROM node:18.18.0-slim as builder RUN mkdir /usr/src/app WORKDIR /usr/src/app From a3656df974abab0f900cf60cc2cfefe33b878a9f Mon Sep 17 00:00:00 2001 From: Alireza Date: Mon, 25 Sep 2023 13:25:03 -0400 Subject: [PATCH 04/23] edit package json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 136b8edeeb3..910a4582111 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ ] }, "engines": { - "node": ">=14", + "node": ">=16", "npm": ">=6", "yarn": ">=1.16.0" }, From 2bcd6acf87ab3790b1b1ec83f978a22c64ba707d Mon Sep 17 00:00:00 2001 From: Alireza Date: Mon, 25 Sep 2023 13:37:03 -0400 Subject: [PATCH 05/23] update node to 18 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 910a4582111..49a8c45b1da 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ ] }, "engines": { - "node": ">=16", + "node": ">=18", "npm": ">=6", "yarn": ">=1.16.0" }, From 81bb3340d068ccc1069dc4f2d46ef349bc18f182 Mon Sep 17 00:00:00 2001 From: Alireza Date: Mon, 25 Sep 2023 13:55:50 -0400 Subject: [PATCH 06/23] update node to 18 --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c939701d6b3..b2f15448f65 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,7 +17,7 @@ orbs: defaults: &defaults docker: - - image: cimg/node:18.18-browsers + - image: cimg/node:18.18 environment: TERM: xterm # Enable colors in term QUICK_BUILD: true From 22f3494e550a98008946fb6585508057808859ca Mon Sep 17 00:00:00 2001 From: Alireza Date: Mon, 25 Sep 2023 14:07:15 -0400 Subject: [PATCH 07/23] try to fix node --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index b2f15448f65..8c66dc1fa06 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -32,6 +32,7 @@ jobs: steps: # Update yarn - run: yarn -v + - run: node --version # Checkout code and ALL Git Tags - checkout - restore_cache: From de7494aa95063cf1e7ca9ca99eccc0ae57e60c39 Mon Sep 17 00:00:00 2001 From: Alireza Date: Mon, 25 Sep 2023 14:15:17 -0400 Subject: [PATCH 08/23] try to fix e2e --- .circleci/config.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8c66dc1fa06..ae8c4f4badd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,6 +15,12 @@ orbs: codecov: codecov/codecov@1.0.5 cypress: cypress-io/cypress@3 +executors: + cypress-node: + docker: + # Primary container image where all steps run. + - image: 'node-18.15.0-chrome-106.0.5249.61-1-ff-99.0.1-edge-114.0.1823.51-1' + defaults: &defaults docker: - image: cimg/node:18.18 @@ -359,6 +365,7 @@ workflows: - cypress/run: name: 'E2E: PWA' + executor: cypress-node start-command: yarn run test:data && yarn run test:e2e:serve install-browsers: true cypress-command: From eaa3afafceb46493ad25998438b962872103eba4 Mon Sep 17 00:00:00 2001 From: Alireza Date: Mon, 25 Sep 2023 14:46:29 -0400 Subject: [PATCH 09/23] fix cypress --- .circleci/config.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ae8c4f4badd..2bf653da4fd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,13 +13,11 @@ version: 2.1 ## orbs: codecov: codecov/codecov@1.0.5 - cypress: cypress-io/cypress@3 - -executors: - cypress-node: - docker: - # Primary container image where all steps run. - - image: 'node-18.15.0-chrome-106.0.5249.61-1-ff-99.0.1-edge-114.0.1823.51-1' + cypress: cypress-io/cypress@3.1.4 +executor: + docker: + # Primary container image where all steps run. + - image: 'node-18.15.0-chrome-106.0.5249.61-1-ff-99.0.1-edge-114.0.1823.51-1' defaults: &defaults docker: @@ -365,7 +363,6 @@ workflows: - cypress/run: name: 'E2E: PWA' - executor: cypress-node start-command: yarn run test:data && yarn run test:e2e:serve install-browsers: true cypress-command: From 7553189ed07f7a08c191536e2d446a512c99cf20 Mon Sep 17 00:00:00 2001 From: Alireza Date: Mon, 25 Sep 2023 14:52:44 -0400 Subject: [PATCH 10/23] fix node --- .circleci/config.yml | 10 +++++----- .github/ISSUE_TEMPLATE/bug-report.yml | 2 +- .github/pull_request_template.md | 2 +- .node-version | 2 +- Dockerfile | 4 ++-- .../app/.recipes/OpenResty-Orthanc-Keycloak/dockerfile | 2 +- platform/app/.recipes/OpenResty-Orthanc/dockerfile | 2 +- platform/app/netlify.toml | 2 +- platform/docs/netlify.toml | 2 +- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2bf653da4fd..521fe4c1702 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -21,7 +21,7 @@ executor: defaults: &defaults docker: - - image: cimg/node:18.18 + - image: cimg/node:18.16.1 environment: TERM: xterm # Enable colors in term QUICK_BUILD: true @@ -173,7 +173,7 @@ jobs: # DEPLOY_TO_DEV: # docker: - # - image: circleci/node:18.18.0 + # - image: circleci/node:18.16.1 # environment: # TERM: xterm # NETLIFY_SITE_ID: 32708787-c9b0-4634-b50f-7ca41952da77 @@ -187,7 +187,7 @@ jobs: # DEPLOY_TO_STAGING: # docker: - # - image: circleci/node:18.18.0 + # - image: circleci/node:18.16.1 # environment: # TERM: xterm # NETLIFY_SITE_ID: c7502ae3-b150-493c-8422-05701e44a969 @@ -201,7 +201,7 @@ jobs: # DEPLOY_TO_PRODUCTION: # docker: - # - image: circleci/node:18.18.0 + # - image: circleci/node:18.16.1 # environment: # TERM: xterm # NETLIFY_SITE_ID: 79c4a5da-5c95-4dc9-84f7-45fd9dfe21b0 @@ -215,7 +215,7 @@ jobs: # DEPLOY_TO_RELEASE_DEV: # docker: - # - image: circleci/node:18.18.0 + # - image: circleci/node:18.16.1 # environment: # TERM: xterm # NETLIFY_SITE_ID: 3270878-22 diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 847fc6cdff9..83577dd7c13 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -64,7 +64,7 @@ body: attributes: label: 'Node version' description: 'Your Node.js version.' - placeholder: 'e.g., 16.14.0' + placeholder: 'e.g., 18.16.1' validations: required: true - type: input diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index cc3752267f1..6a1753d87d8 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -83,7 +83,7 @@ after the commits are squashed. #### Tested Environment - [] OS: -- [] Node version: +- [] Node version: - [] Browser: diff --git a/.node-version b/.node-version index 832d3850644..3876fd49864 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -16.14.0 +18.16.1 diff --git a/Dockerfile b/Dockerfile index 807bed68619..e6310c3ba34 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,7 +21,7 @@ # Stage 1: Build the application # docker build -t ohif/viewer:latest . -FROM node:18.18.0-slim as json-copier +FROM node:18.16.1-slim as json-copier RUN mkdir /usr/src/app WORKDIR /usr/src/app @@ -37,7 +37,7 @@ COPY platform /usr/src/app/platform #RUN find platform \! -name "package.json" -mindepth 2 -maxdepth 2 -print | xargs rm -rf # Copy Files -FROM node:18.18.0-slim as builder +FROM node:18.16.1-slim as builder RUN apt-get update && apt-get install -y build-essential python3 RUN mkdir /usr/src/app WORKDIR /usr/src/app diff --git a/platform/app/.recipes/OpenResty-Orthanc-Keycloak/dockerfile b/platform/app/.recipes/OpenResty-Orthanc-Keycloak/dockerfile index ac8ff6f4cf7..fa066291e3d 100644 --- a/platform/app/.recipes/OpenResty-Orthanc-Keycloak/dockerfile +++ b/platform/app/.recipes/OpenResty-Orthanc-Keycloak/dockerfile @@ -23,7 +23,7 @@ # Stage 1: Build the application -FROM node:18.18.0-slim as builder +FROM node:18.16.1-slim as builder RUN mkdir /usr/src/app WORKDIR /usr/src/app diff --git a/platform/app/.recipes/OpenResty-Orthanc/dockerfile b/platform/app/.recipes/OpenResty-Orthanc/dockerfile index 8a7ab3abda9..643c52a57d5 100644 --- a/platform/app/.recipes/OpenResty-Orthanc/dockerfile +++ b/platform/app/.recipes/OpenResty-Orthanc/dockerfile @@ -23,7 +23,7 @@ # Stage 1: Build the application -FROM node:18.18.0-slim as builder +FROM node:18.16.1-slim as builder RUN mkdir /usr/src/app WORKDIR /usr/src/app diff --git a/platform/app/netlify.toml b/platform/app/netlify.toml index 5942b9a58b7..bc07d914e5f 100644 --- a/platform/app/netlify.toml +++ b/platform/app/netlify.toml @@ -19,7 +19,7 @@ [build.environment] # If 'production', `yarn install` does not install devDependencies NODE_ENV = "development" - NODE_VERSION = "16.14.0" + NODE_VERSION = "18.16.1" YARN_VERSION = "1.22.5" RUBY_VERSION = "2.6.2" YARN_FLAGS = "--no-ignore-optional --pure-lockfile" diff --git a/platform/docs/netlify.toml b/platform/docs/netlify.toml index e83629343b0..ff82abc6677 100644 --- a/platform/docs/netlify.toml +++ b/platform/docs/netlify.toml @@ -16,7 +16,7 @@ [build.environment] # If 'production', `yarn install` does not install devDependencies NODE_ENV = "development" - NODE_VERSION = "16.14.0" + NODE_VERSION = "18.16.1" YARN_VERSION = "1.22.5" RUBY_VERSION = "2.6.2" YARN_FLAGS = "--no-ignore-optional --pure-lockfile" From cbb92dc27e76ff95cf2ad289609f5f36a53a319f Mon Sep 17 00:00:00 2001 From: Alireza Date: Mon, 25 Sep 2023 15:59:38 -0400 Subject: [PATCH 11/23] to see if cypress runs on 18 --- .circleci/config.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 521fe4c1702..1263f42d56a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,7 +12,6 @@ version: 2.1 ## https://github.com/cypress-io/circleci-orb ## orbs: - codecov: codecov/codecov@1.0.5 cypress: cypress-io/cypress@3.1.4 executor: docker: @@ -67,9 +66,9 @@ jobs: echo "\<<\<<\<< EOF" >> "${viewerCov}/reports" cat "${viewerCov}/lcov.info" >>"${viewerCov}/reports" echo "\<<\<<\<< EOF" >> "${viewerCov}/reports" - - codecov/upload: - file: '/home/circleci/repo/platform/app/coverage/reports' - flags: 'viewer' + # - codecov/upload: + # file: '/home/circleci/repo/platform/app/coverage/reports' + # flags: 'viewer' # PLATFORM/CORE - run: name: 'CORE: Combine report output' @@ -80,9 +79,9 @@ jobs: echo "\<<\<<\<< EOF" >> "${coreCov}/reports" cat "${coreCov}/lcov.info" >> "${coreCov}/reports" echo "\<<\<<\<< EOF" >> "${coreCov}/reports" - - codecov/upload: - file: '/home/circleci/repo/platform/core/coverage/reports' - flags: 'core' + # - codecov/upload: + # file: '/home/circleci/repo/platform/core/coverage/reports' + # flags: 'core' ### # Workflow: PR_OPTIONAL_DOCKER_PUBLISH From 377b3119a80e8c9e45c41d6bedfd0d8c441dc1db Mon Sep 17 00:00:00 2001 From: Alireza Date: Mon, 25 Sep 2023 16:18:37 -0400 Subject: [PATCH 12/23] try to fix --- .circleci/config.yml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1263f42d56a..7ecf12c6ca2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,6 +12,7 @@ version: 2.1 ## https://github.com/cypress-io/circleci-orb ## orbs: + codecov: codecov/codecov@1.0.5 cypress: cypress-io/cypress@3.1.4 executor: docker: @@ -20,7 +21,7 @@ executor: defaults: &defaults docker: - - image: cimg/node:18.16.1 + - image: cimg/node:18.16.1-browsers environment: TERM: xterm # Enable colors in term QUICK_BUILD: true @@ -66,9 +67,9 @@ jobs: echo "\<<\<<\<< EOF" >> "${viewerCov}/reports" cat "${viewerCov}/lcov.info" >>"${viewerCov}/reports" echo "\<<\<<\<< EOF" >> "${viewerCov}/reports" - # - codecov/upload: - # file: '/home/circleci/repo/platform/app/coverage/reports' - # flags: 'viewer' + - codecov/upload: + file: '/home/circleci/repo/platform/app/coverage/reports' + flags: 'viewer' # PLATFORM/CORE - run: name: 'CORE: Combine report output' @@ -79,9 +80,9 @@ jobs: echo "\<<\<<\<< EOF" >> "${coreCov}/reports" cat "${coreCov}/lcov.info" >> "${coreCov}/reports" echo "\<<\<<\<< EOF" >> "${coreCov}/reports" - # - codecov/upload: - # file: '/home/circleci/repo/platform/core/coverage/reports' - # flags: 'core' + - codecov/upload: + file: '/home/circleci/repo/platform/core/coverage/reports' + flags: 'core' ### # Workflow: PR_OPTIONAL_DOCKER_PUBLISH @@ -172,7 +173,7 @@ jobs: # DEPLOY_TO_DEV: # docker: - # - image: circleci/node:18.16.1 + # - image: circleci/node:18.18.0 # environment: # TERM: xterm # NETLIFY_SITE_ID: 32708787-c9b0-4634-b50f-7ca41952da77 @@ -186,7 +187,7 @@ jobs: # DEPLOY_TO_STAGING: # docker: - # - image: circleci/node:18.16.1 + # - image: circleci/node:18.18.0 # environment: # TERM: xterm # NETLIFY_SITE_ID: c7502ae3-b150-493c-8422-05701e44a969 @@ -200,7 +201,7 @@ jobs: # DEPLOY_TO_PRODUCTION: # docker: - # - image: circleci/node:18.16.1 + # - image: circleci/node:18.18.0 # environment: # TERM: xterm # NETLIFY_SITE_ID: 79c4a5da-5c95-4dc9-84f7-45fd9dfe21b0 @@ -214,7 +215,7 @@ jobs: # DEPLOY_TO_RELEASE_DEV: # docker: - # - image: circleci/node:18.16.1 + # - image: circleci/node:18.18.0 # environment: # TERM: xterm # NETLIFY_SITE_ID: 3270878-22 From 6290635e140dfe3fa175f822e1802fc394c60aae Mon Sep 17 00:00:00 2001 From: Alireza Date: Mon, 25 Sep 2023 16:33:30 -0400 Subject: [PATCH 13/23] try to fix e2e --- .circleci/config.yml | 100 ++++++++++--------------------------------- 1 file changed, 22 insertions(+), 78 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7ecf12c6ca2..d420e848468 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,10 +14,6 @@ version: 2.1 orbs: codecov: codecov/codecov@1.0.5 cypress: cypress-io/cypress@3.1.4 -executor: - docker: - # Primary container image where all steps run. - - image: 'node-18.15.0-chrome-106.0.5249.61-1-ff-99.0.1-edge-114.0.1823.51-1' defaults: &defaults docker: @@ -171,62 +167,24 @@ jobs: - commit.txt - version.json - # DEPLOY_TO_DEV: - # docker: - # - image: circleci/node:18.18.0 - # environment: - # TERM: xterm - # NETLIFY_SITE_ID: 32708787-c9b0-4634-b50f-7ca41952da77 - # working_directory: ~/repo - # steps: - # - attach_workspace: - # at: ~/repo - # - run: cd .netlify && npm install - # - run: cp .netlify/deploy-workflow/_redirects platform/app/dist/_redirects - # - run: cd .netlify && npm run deploy - - # DEPLOY_TO_STAGING: - # docker: - # - image: circleci/node:18.18.0 - # environment: - # TERM: xterm - # NETLIFY_SITE_ID: c7502ae3-b150-493c-8422-05701e44a969 - # working_directory: ~/repo - # steps: - # - attach_workspace: - # at: ~/repo - # - run: cd .netlify && npm install - # - run: cp .netlify/deploy-workflow/_redirects platform/app/dist/_redirects - # - run: cd .netlify && npm run deploy - - # DEPLOY_TO_PRODUCTION: - # docker: - # - image: circleci/node:18.18.0 - # environment: - # TERM: xterm - # NETLIFY_SITE_ID: 79c4a5da-5c95-4dc9-84f7-45fd9dfe21b0 - # working_directory: ~/repo - # steps: - # - attach_workspace: - # at: ~/repo - # - run: cd .netlify && npm install - # - run: cp .netlify/deploy-workflow/_redirects platform/app/dist/_redirects - # - run: cd .netlify && npm run deploy - - # DEPLOY_TO_RELEASE_DEV: - # docker: - # - image: circleci/node:18.18.0 - # environment: - # TERM: xterm - # NETLIFY_SITE_ID: 3270878-22 - # working_directory: ~/repo - # steps: - # - attach_workspace: - # at: ~/repo - # - run: cd .netlify && npm install - # - run: - # cp .netlify/deploy-workflow/_redirects platform/app/dist/_redirects - # - run: cd .netlify && npm run deploy + CYPRESS_INSTALL: + executor: cypress/default + steps: + - cypress/install: + install-browsers: true + - persist_to_workspace: + root: ~/repo + paths: + - platform/app/cypress + CYPRESS_RUN: + executor: cypress/default + # parallelism: 4 + steps: + - cypress/run-tests: + start-command: yarn run test:data && yarn run test:e2e:serve + cypress-command: + 'npx wait-on@latest http://localhost:3000 && cd platform/app && npx cypress run + --record --browser chrome --parallel' ### # Workflow: RELEASE @@ -360,26 +318,12 @@ workflows: PR_CHECKS: jobs: - UNIT_TESTS - - - cypress/run: - name: 'E2E: PWA' - start-command: yarn run test:data && yarn run test:e2e:serve - install-browsers: true - cypress-command: - 'npx wait-on@latest http://localhost:3000 && cd platform/app && npx cypress run - --record --browser chrome --parallel' - package-manager: 'yarn' - cypress-cache-key: 'yarn-packages-{{ checksum "yarn.lock" }}' - cypress-cache-path: '~/.cache/Cypress' - post-steps: - - store_artifacts: - path: platform/app/cypress/screenshots - - store_artifacts: - path: platform/app/cypress/videos - - store_test_results: - path: platform/app/cypress/results + - CYPRESS_INSTALL: requires: - UNIT_TESTS + - CYPRESS_RUN: + requires: + - CYPRESS_INSTALL # PR_OPTIONAL_VISUAL_TESTS: # jobs: From 5fc0154b1e2f19e610857ad0ff56f7bc3d496fff Mon Sep 17 00:00:00 2001 From: Alireza Date: Mon, 25 Sep 2023 16:43:22 -0400 Subject: [PATCH 14/23] fixing e2e --- .circleci/config.yml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d420e848468..be31affc85d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -172,6 +172,9 @@ jobs: steps: - cypress/install: install-browsers: true + package-manager: 'yarn' + cypress-cache-key: 'yarn-packages-{{ checksum "yarn.lock" }}' + cypress-cache-path: '~/.cache/Cypress' - persist_to_workspace: root: ~/repo paths: @@ -181,10 +184,11 @@ jobs: # parallelism: 4 steps: - cypress/run-tests: + working-directory: platform/app start-command: yarn run test:data && yarn run test:e2e:serve cypress-command: - 'npx wait-on@latest http://localhost:3000 && cd platform/app && npx cypress run - --record --browser chrome --parallel' + 'npx wait-on@latest http://localhost:3000 && npx cypress run --record --browser chrome + --parallel' ### # Workflow: RELEASE @@ -317,13 +321,13 @@ jobs: workflows: PR_CHECKS: jobs: - - UNIT_TESTS - - CYPRESS_INSTALL: - requires: - - UNIT_TESTS - - CYPRESS_RUN: - requires: - - CYPRESS_INSTALL + # - UNIT_TESTS + - CYPRESS_INSTALL + # requires: + # - UNIT_TESTS + - CYPRESS_RUN + # requires: + # - CYPRESS_INSTALL # PR_OPTIONAL_VISUAL_TESTS: # jobs: From d714adcf96da6b2975558afc7dd1f7ae4447cac2 Mon Sep 17 00:00:00 2001 From: Alireza Date: Mon, 25 Sep 2023 16:53:08 -0400 Subject: [PATCH 15/23] fixing e2e 2 --- .circleci/config.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index be31affc85d..d0af504bd52 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,6 +14,10 @@ version: 2.1 orbs: codecov: codecov/codecov@1.0.5 cypress: cypress-io/cypress@3.1.4 +executors: + with-chrome-and-firefox: + docker: + - image: 'cypress/browsers:node-18.15.0-chrome-106.0.5249.61-1-ff-99.0.1-edge-114.0.1823.51-1' defaults: &defaults docker: @@ -325,9 +329,9 @@ workflows: - CYPRESS_INSTALL # requires: # - UNIT_TESTS - - CYPRESS_RUN - # requires: - # - CYPRESS_INSTALL + # - CYPRESS_RUN: + # requires: + # - CYPRESS_INSTALL # PR_OPTIONAL_VISUAL_TESTS: # jobs: From fcb6c47708d07d9edf4f8f141795be4cfe6e5fb7 Mon Sep 17 00:00:00 2001 From: Alireza Date: Mon, 25 Sep 2023 17:03:43 -0400 Subject: [PATCH 16/23] fixing e2e 33 --- .circleci/config.yml | 137 +++++++++++++++++++++++-------------------- 1 file changed, 75 insertions(+), 62 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d0af504bd52..b822d03c823 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,13 +15,14 @@ orbs: codecov: codecov/codecov@1.0.5 cypress: cypress-io/cypress@3.1.4 executors: - with-chrome-and-firefox: + cypress-node: docker: - - image: 'cypress/browsers:node-18.15.0-chrome-106.0.5249.61-1-ff-99.0.1-edge-114.0.1823.51-1' + # Primary container image where all steps run. + - image: 'node-18.15.0-chrome-106.0.5249.61-1-ff-99.0.1-edge-114.0.1823.51-1' defaults: &defaults docker: - - image: cimg/node:18.16.1-browsers + - image: cimg/node:18.18 environment: TERM: xterm # Enable colors in term QUICK_BUILD: true @@ -87,39 +88,39 @@ jobs: ### # Workflow: PR_OPTIONAL_DOCKER_PUBLISH ### - DOCKER_PR_PUBLISH: - <<: *defaults - steps: - # Enable yarn workspaces - - run: yarn config set workspaces-experimental true + # DOCKER_PR_PUBLISH: + # <<: *defaults + # steps: + # # Enable yarn workspaces + # - run: yarn config set workspaces-experimental true - # Checkout code and ALL Git Tags - - checkout - - restore_cache: - name: Restore Yarn and Cypress Package Cache - keys: - # when lock file changes, use increasingly general patterns to restore cache - - yarn-packages-{{ checksum "yarn.lock" }} - - yarn-packages- + # # Checkout code and ALL Git Tags + # - checkout + # - restore_cache: + # name: Restore Yarn and Cypress Package Cache + # keys: + # # when lock file changes, use increasingly general patterns to restore cache + # - yarn-packages-{{ checksum "yarn.lock" }} + # - yarn-packages- - - run: - name: Install Dependencies - command: yarn install --frozen-lockfile + # - run: + # name: Install Dependencies + # command: yarn install --frozen-lockfile - - setup_remote_docker: - docker_layer_caching: false + # - setup_remote_docker: + # docker_layer_caching: false - - run: - name: Build and push Docker image - command: | - # Remove npm config - rm -f ./.npmrc - # Set our version number using vars - echo $CIRCLE_BUILD_NUM - # Build our image, auth, and push - docker build --tag ohif/app:PR_BUILD-$CIRCLE_BUILD_NUM . - echo $DOCKER_PWD | docker login -u $DOCKER_LOGIN --password-stdin - docker push ohif/app:PR_BUILD-$CIRCLE_BUILD_NUM + # - run: + # name: Build and push Docker image + # command: | + # # Remove npm config + # rm -f ./.npmrc + # # Set our version number using vars + # echo $CIRCLE_BUILD_NUM + # # Build our image, auth, and push + # docker build --tag ohif/app:PR_BUILD-$CIRCLE_BUILD_NUM . + # echo $DOCKER_PWD | docker login -u $DOCKER_LOGIN --password-stdin + # docker push ohif/app:PR_BUILD-$CIRCLE_BUILD_NUM ### # Workflow: DEPLOY @@ -171,29 +172,6 @@ jobs: - commit.txt - version.json - CYPRESS_INSTALL: - executor: cypress/default - steps: - - cypress/install: - install-browsers: true - package-manager: 'yarn' - cypress-cache-key: 'yarn-packages-{{ checksum "yarn.lock" }}' - cypress-cache-path: '~/.cache/Cypress' - - persist_to_workspace: - root: ~/repo - paths: - - platform/app/cypress - CYPRESS_RUN: - executor: cypress/default - # parallelism: 4 - steps: - - cypress/run-tests: - working-directory: platform/app - start-command: yarn run test:data && yarn run test:e2e:serve - cypress-command: - 'npx wait-on@latest http://localhost:3000 && npx cypress run --record --browser chrome - --parallel' - ### # Workflow: RELEASE ### @@ -322,16 +300,51 @@ jobs: docker push ohif/app:$IMAGE_VERSION_FULL fi + HANDLE_NODE_SWAP: + executor: cypress/default + steps: + - run: + name: + Swap node versions for E2E tests since there is some issue with the default version of + cypress + command: | + set +e + wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash + export NVM_DIR="$HOME/.nvm" + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" + [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" + nvm install v18 + nvm alias default 18.16.1 + + echo 'export NVM_DIR="$HOME/.nvm"' >> $BASH_ENV + echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV + workflows: PR_CHECKS: jobs: - # - UNIT_TESTS - - CYPRESS_INSTALL - # requires: - # - UNIT_TESTS - # - CYPRESS_RUN: - # requires: - # - CYPRESS_INSTALL + - UNIT_TESTS + - HANDLE_NODE_SWAP + + - cypress/run: + name: 'E2E: PWA' + + start-command: yarn run test:data && yarn run test:e2e:serve + install-browsers: true + cypress-command: + 'npx wait-on@latest http://localhost:3000 && cd platform/app && npx cypress run + --record --browser chrome --parallel' + package-manager: 'yarn' + cypress-cache-key: 'yarn-packages-{{ checksum "yarn.lock" }}' + cypress-cache-path: '~/.cache/Cypress' + post-steps: + - store_artifacts: + path: platform/app/cypress/screenshots + - store_artifacts: + path: platform/app/cypress/videos + - store_test_results: + path: platform/app/cypress/results + requires: + - HANDLE_NODE_SWAP # PR_OPTIONAL_VISUAL_TESTS: # jobs: From 7b6a179fadef8410ec5d1fa988288cefe76eded5 Mon Sep 17 00:00:00 2001 From: Alireza Date: Mon, 25 Sep 2023 17:23:33 -0400 Subject: [PATCH 17/23] node fix --- .circleci/config.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b822d03c823..cf7fe07a913 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -314,7 +314,7 @@ jobs: [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" nvm install v18 - nvm alias default 18.16.1 + nvm alias default 18.18.0 echo 'export NVM_DIR="$HOME/.nvm"' >> $BASH_ENV echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV @@ -327,7 +327,6 @@ workflows: - cypress/run: name: 'E2E: PWA' - start-command: yarn run test:data && yarn run test:e2e:serve install-browsers: true cypress-command: From 485255bb7006fda472246813b2afc6f02c6da16a Mon Sep 17 00:00:00 2001 From: Alireza Date: Mon, 25 Sep 2023 20:46:06 -0400 Subject: [PATCH 18/23] node fix sh --- .circleci/config.yml | 29 ++++------------------------- swap-node-cypress.sh | 10 ++++++++++ 2 files changed, 14 insertions(+), 25 deletions(-) create mode 100644 swap-node-cypress.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index cf7fe07a913..1a7babdaa74 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -300,34 +300,13 @@ jobs: docker push ohif/app:$IMAGE_VERSION_FULL fi - HANDLE_NODE_SWAP: - executor: cypress/default - steps: - - run: - name: - Swap node versions for E2E tests since there is some issue with the default version of - cypress - command: | - set +e - wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash - export NVM_DIR="$HOME/.nvm" - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" - [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" - nvm install v18 - nvm alias default 18.18.0 - - echo 'export NVM_DIR="$HOME/.nvm"' >> $BASH_ENV - echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV - workflows: PR_CHECKS: jobs: - - UNIT_TESTS - - HANDLE_NODE_SWAP - + # - UNIT_TESTS - cypress/run: name: 'E2E: PWA' - start-command: yarn run test:data && yarn run test:e2e:serve + start-command: sh swap-node-cypress.sh && yarn run test:data && yarn run test:e2e:serve install-browsers: true cypress-command: 'npx wait-on@latest http://localhost:3000 && cd platform/app && npx cypress run @@ -342,8 +321,8 @@ workflows: path: platform/app/cypress/videos - store_test_results: path: platform/app/cypress/results - requires: - - HANDLE_NODE_SWAP + # requires: + # - HANDLE_NODE_SWAP # PR_OPTIONAL_VISUAL_TESTS: # jobs: diff --git a/swap-node-cypress.sh b/swap-node-cypress.sh new file mode 100644 index 00000000000..2b5938f13c7 --- /dev/null +++ b/swap-node-cypress.sh @@ -0,0 +1,10 @@ +set +e +wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" +[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" +nvm install v18 +nvm alias default 18.18.0 + +echo 'export NVM_DIR="$HOME/.nvm"' >>$BASH_ENV +echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >>$BASH_ENV From 151ee2c84d220fce8a10d1b450d4ebf50122301d Mon Sep 17 00:00:00 2001 From: Alireza Date: Mon, 25 Sep 2023 21:36:37 -0400 Subject: [PATCH 19/23] custom cypress command --- .circleci/config.yml | 154 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 131 insertions(+), 23 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1a7babdaa74..6882daca06d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,11 +14,24 @@ version: 2.1 orbs: codecov: codecov/codecov@1.0.5 cypress: cypress-io/cypress@3.1.4 + +references: + node_supported_lts_versions: &node_supported_lts_versions + - &node_min_supported_version '18.12' + - '18.16.1' + executors: - cypress-node: + cypress-custom: + description: | + Single Docker container used to run Cypress Tests docker: - # Primary container image where all steps run. - - image: 'node-18.15.0-chrome-106.0.5249.61-1-ff-99.0.1-edge-114.0.1823.51-1' + - image: cimg/node:<< parameters.node-version >>-browsers + parameters: + node-version: + default: '18.16.1' + description: | + The version of Node to run your tests with. + type: string defaults: &defaults docker: @@ -300,29 +313,124 @@ jobs: docker push ohif/app:$IMAGE_VERSION_FULL fi + CYPRESS_CUSTOM_RUN: + description: | + A single, complete job to run Cypress end-to-end tests in your application. + executor: cypress-custom + parallelism: << parameters.parallelism >> + parameters: + cypress-cache-key: + default: cypress-cache-{{ arch }}-{{ checksum "package.json" }} + description: Cache key used to cache the Cypress binary. + type: string + cypress-cache-path: + default: ~/.cache/Cypress + description: | + By default, this will cache the '~/.cache/Cypress' directory so that the Cypress binary is cached. You can override this by providing your own cache path. + type: string + cypress-command: + default: npx cypress run + description: Command used to run your Cypress tests + type: string + include-branch-in-node-cache-key: + default: false + description: | + If true, this cache will only apply to runs within the same branch. (Adds -{{ .Branch }}- to the node cache key) + type: boolean + install-browsers: + default: false + description: | + Cypress runs by default in the Electron browser. Use this flag to install additional browsers to run your tests in. + This is only needed if you are passing the `--browser` flag in your `cypress-command`. + This parameter leverages the `circleci/browser-tools` orb and includes Chrome and FireFox. + If you need additional browser support you can set this to false and use an executor with a docker image + that includes the browsers of your choosing. See https://hub.docker.com/r/cypress/browsers/tags + type: boolean + install-command: + default: '' + description: Overrides the default NPM command (npm ci) + type: string + node-cache-version: + default: v1 + description: + Change the default node cache version if you need to clear the cache for any reason. + type: string + package-manager: + default: npm + description: Select the default node package manager to use. NPM v5+ Required. + enum: + - npm + - yarn + - yarn-berry + type: enum + parallelism: + default: 1 + description: | + Number of Circle machines to use for load balancing, min 1 + (requires `parallel` and `record` flags in your `cypress-command`) + type: integer + post-install: + default: '' + description: | + Additional commands to run after running install but before verifying Cypress and saving cache. + type: string + start-command: + default: '' + description: Command used to start your local dev server for Cypress to tests against + type: string + working-directory: + default: '' + description: Directory containing package.json + type: string + steps: + - cypress/install: + cypress-cache-key: << parameters.cypress-cache-key >> + cypress-cache-path: << parameters.cypress-cache-path >> + include-branch-in-node-cache-key: << parameters.include-branch-in-node-cache-key >> + install-browsers: << parameters.install-browsers >> + install-command: << parameters.install-command >> + node-cache-version: << parameters.node-cache-version >> + package-manager: << parameters.package-manager >> + post-install: << parameters.post-install >> + working-directory: << parameters.working-directory >> + - cypress/run-tests: + cypress-command: << parameters.cypress-command >> + start-command: << parameters.start-command >> + working-directory: << parameters.working-directory >> + workflows: PR_CHECKS: jobs: - # - UNIT_TESTS - - cypress/run: - name: 'E2E: PWA' - start-command: sh swap-node-cypress.sh && yarn run test:data && yarn run test:e2e:serve - install-browsers: true - cypress-command: - 'npx wait-on@latest http://localhost:3000 && cd platform/app && npx cypress run - --record --browser chrome --parallel' - package-manager: 'yarn' - cypress-cache-key: 'yarn-packages-{{ checksum "yarn.lock" }}' - cypress-cache-path: '~/.cache/Cypress' - post-steps: - - store_artifacts: - path: platform/app/cypress/screenshots - - store_artifacts: - path: platform/app/cypress/videos - - store_test_results: - path: platform/app/cypress/results - # requires: - # - HANDLE_NODE_SWAP + - UNIT_TESTS + + - CYPRESS_CUSTOM_RUN: + name: 'Cypress Tests' + context: cypress + matrix: + parameters: + start-command: + - yarn run test:data && yarn run test:e2e:serve + install-browsers: + - true + cypress-command: + - 'npx wait-on@latest http://localhost:3000 && cd platform/app && npx cypress run + --record --browser chrome --parallel' + package-manager: + - 'yarn' + cypress-cache-key: + - 'yarn-packages-{{ checksum "yarn.lock" }}' + cypress-cache-path: + - '~/.cache/Cypress' + # post-steps: + # - store_artifacts: + # path: platform/app/cypress/screenshots + # - store_artifacts: + # path: platform/app/cypress/videos + # - store_test_results: + # path: platform/app/cypress/results + + # requires: + # - HANDLE_NODE_SWAP # PR_OPTIONAL_VISUAL_TESTS: # jobs: From 6b35f29879f0f4aa9e57393cf65a19ccdf015ce7 Mon Sep 17 00:00:00 2001 From: Alireza Date: Mon, 25 Sep 2023 21:47:45 -0400 Subject: [PATCH 20/23] fix final --- .circleci/config.yml | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6882daca06d..e2971b7318a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,11 +15,6 @@ orbs: codecov: codecov/codecov@1.0.5 cypress: cypress-io/cypress@3.1.4 -references: - node_supported_lts_versions: &node_supported_lts_versions - - &node_min_supported_version '18.12' - - '18.16.1' - executors: cypress-custom: description: | @@ -313,6 +308,8 @@ jobs: docker push ohif/app:$IMAGE_VERSION_FULL fi + # This is copied from the Cypress orb since the default for cypress/run is node 16 and + # we migrated to 18 CYPRESS_CUSTOM_RUN: description: | A single, complete job to run Cypress end-to-end tests in your application. @@ -421,16 +418,8 @@ workflows: - 'yarn-packages-{{ checksum "yarn.lock" }}' cypress-cache-path: - '~/.cache/Cypress' - # post-steps: - # - store_artifacts: - # path: platform/app/cypress/screenshots - # - store_artifacts: - # path: platform/app/cypress/videos - # - store_test_results: - # path: platform/app/cypress/results - - # requires: - # - HANDLE_NODE_SWAP + requires: + - UNIT_TESTS # PR_OPTIONAL_VISUAL_TESTS: # jobs: From 90d15be2d2c09e398d1be616688c4511ba777bd5 Mon Sep 17 00:00:00 2001 From: Alireza Date: Mon, 25 Sep 2023 22:26:49 -0400 Subject: [PATCH 21/23] fix a lot of things --- package.json | 2 +- .../OHIFContextMenuCustomization.spec.js | 2 +- .../OHIFCornerstoneToolbar.spec.js | 2 +- .../OHIFMeasurementPanel.spec.js | 5 ++--- platform/app/cypress/support/commands.js | 2 +- platform/docs/docs/platform/services/data/index.md | 4 ++-- platform/docs/docusaurus.config.js | 13 +++++++++++++ 7 files changed, 21 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 49a8c45b1da..910a4582111 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ ] }, "engines": { - "node": ">=18", + "node": ">=16", "npm": ">=6", "yarn": ">=1.16.0" }, diff --git a/platform/app/cypress/integration/measurement-tracking/OHIFContextMenuCustomization.spec.js b/platform/app/cypress/integration/measurement-tracking/OHIFContextMenuCustomization.spec.js index 5f2ba6f5a2b..f4c044d08f2 100644 --- a/platform/app/cypress/integration/measurement-tracking/OHIFContextMenuCustomization.spec.js +++ b/platform/app/cypress/integration/measurement-tracking/OHIFContextMenuCustomization.spec.js @@ -11,7 +11,7 @@ describe('OHIF Context Menu', function () { it('checks context menu customization', function () { // Add length measurement cy.addLengthMeasurement(); - cy.get('[data-cy="prompt-begin-tracking-yes-btn"]').click(); + cy.get('[data-cy="prompt-begin-tracking-yes-btn"]').as('yesBtn').click(); cy.get('[data-cy="measurement-item"]').click(); const [x1, y1] = [150, 100]; diff --git a/platform/app/cypress/integration/measurement-tracking/OHIFCornerstoneToolbar.spec.js b/platform/app/cypress/integration/measurement-tracking/OHIFCornerstoneToolbar.spec.js index 15fe14babc1..23d060c611e 100644 --- a/platform/app/cypress/integration/measurement-tracking/OHIFCornerstoneToolbar.spec.js +++ b/platform/app/cypress/integration/measurement-tracking/OHIFCornerstoneToolbar.spec.js @@ -111,7 +111,7 @@ describe('OHIF Cornerstone Toolbar', () => { cy.addLengthMeasurement(); cy.get('[data-cy="viewport-notification"]').should('exist'); cy.get('[data-cy="viewport-notification"]').should('be.visible'); - cy.get('[data-cy="prompt-begin-tracking-yes-btn"]').click(); + cy.get('[data-cy="prompt-begin-tracking-yes-btn"]').as('yesBtn').click(); //Verify the measurement exists in the table cy.get('@measurementsPanel').should('be.visible'); diff --git a/platform/app/cypress/integration/measurement-tracking/OHIFMeasurementPanel.spec.js b/platform/app/cypress/integration/measurement-tracking/OHIFMeasurementPanel.spec.js index 74b172f32db..1cfb1cede4b 100644 --- a/platform/app/cypress/integration/measurement-tracking/OHIFMeasurementPanel.spec.js +++ b/platform/app/cypress/integration/measurement-tracking/OHIFMeasurementPanel.spec.js @@ -26,7 +26,7 @@ describe('OHIF Measurement Panel', function () { cy.get('[data-cy="viewport-notification"]').as('viewportNotification').should('exist'); cy.get('[data-cy="viewport-notification"]').as('viewportNotification').should('be.visible'); - cy.get('[data-cy="prompt-begin-tracking-yes-btn"]').as('promptBeginTrackingYesBtn').click(); + cy.get('[data-cy="prompt-begin-tracking-yes-btn"]').as('yesBtn').click(); cy.get('[data-cy="measurement-item"]').as('measurementItem').click(); @@ -43,8 +43,7 @@ describe('OHIF Measurement Panel', function () { it('checks if image would jump when clicked on a measurement item', function () { // Add length measurement cy.addLengthMeasurement(); - cy.get('[data-cy="prompt-begin-tracking-yes-btn"]').as('promptBeginTrackingYesBtn'); - cy.get('@promptBeginTrackingYesBtn').click(); + cy.get('[data-cy="prompt-begin-tracking-yes-btn"]').as('yesBtn').click(); cy.scrollToIndex(13); diff --git a/platform/app/cypress/support/commands.js b/platform/app/cypress/support/commands.js index 948df1a2799..f3f31500180 100644 --- a/platform/app/cypress/support/commands.js +++ b/platform/app/cypress/support/commands.js @@ -145,7 +145,7 @@ Cypress.Commands.add('drag', { prevSubject: 'element' }, (...args) => */ Cypress.Commands.add('addLine', (viewport, firstClick, secondClick) => { const performClick = (alias, x, y) => { - cy.get(alias).click(x, y, { force: true, multiple: true }).wait(250); + cy.get(alias).as(`axu-${alias}`).click(x, y, { force: true, multiple: true }).wait(250); }; cy.get(viewport).as('viewportAlias'); diff --git a/platform/docs/docs/platform/services/data/index.md b/platform/docs/docs/platform/services/data/index.md index cdeb44c7730..6b92fdde1dd 100644 --- a/platform/docs/docs/platform/services/data/index.md +++ b/platform/docs/docs/platform/services/data/index.md @@ -17,9 +17,9 @@ We maintain the following non-ui Services: - [DicomMetadata Store](./../data/DicomMetadataStore.md) - [DisplaySet Service](./../data/DisplaySetService.md) - [Hanging Protocol Service](../data/HangingProtocolService.md) -- [Toolbar Service](../data/ToolBarService.md) +- [Toolbar Service](./ToolbarService.md) - [Measurement Service](../data/MeasurementService.md) -- [Customization Service](../data/customization-service.md) +- [Customization Service](./../ui/customization-service.md) - [State Sync Service](../data/StateSyncService.md) - [Panel Service](../data/PanelService.md) diff --git a/platform/docs/docusaurus.config.js b/platform/docs/docusaurus.config.js index 4dfa38548aa..bdcaa205b19 100644 --- a/platform/docs/docusaurus.config.js +++ b/platform/docs/docusaurus.config.js @@ -74,6 +74,19 @@ module.exports = { // }, themes: ['@docusaurus/theme-live-codeblock'], plugins: [ + () => ({ + name: 'resolve-react', + configureWebpack() { + return { + resolve: { + alias: { + // assuming root node_modules is up from "./packages/ + react: path.resolve('../../node_modules/react'), + }, + }, + }; + }, + }), path.resolve(__dirname, './pluginOHIFWebpackConfig.js'), 'plugin-image-zoom', // 3rd party plugin for image click to pop [ From 5c26b9584693fe33d48748f1ee4f687acfc3d2c3 Mon Sep 17 00:00:00 2001 From: Alireza Date: Mon, 25 Sep 2023 22:42:01 -0400 Subject: [PATCH 22/23] fix test --- .../measurement-tracking/OHIFCornerstoneToolbar.spec.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/app/cypress/integration/measurement-tracking/OHIFCornerstoneToolbar.spec.js b/platform/app/cypress/integration/measurement-tracking/OHIFCornerstoneToolbar.spec.js index 23d060c611e..117bdea3882 100644 --- a/platform/app/cypress/integration/measurement-tracking/OHIFCornerstoneToolbar.spec.js +++ b/platform/app/cypress/integration/measurement-tracking/OHIFCornerstoneToolbar.spec.js @@ -109,14 +109,14 @@ describe('OHIF Cornerstone Toolbar', () => { it('checks if Length annotation can be added to viewport and shows up in the measurements panel', () => { //Click on button and verify if icon is active on toolbar cy.addLengthMeasurement(); - cy.get('[data-cy="viewport-notification"]').should('exist'); - cy.get('[data-cy="viewport-notification"]').should('be.visible'); + cy.get('[data-cy="viewport-notification"]').as('notif').should('exist'); + cy.get('[data-cy="viewport-notification"]').as('notif').should('be.visible'); cy.get('[data-cy="prompt-begin-tracking-yes-btn"]').as('yesBtn').click(); //Verify the measurement exists in the table cy.get('@measurementsPanel').should('be.visible'); - cy.get('[data-cy="measurement-item"]').its('length').should('be.at.least', 1); + cy.get('[data-cy="measurement-item"]').as('measure').its('length').should('be.at.least', 1); }); /*it('checks if angle annotation can be added on viewport without causing any errors', () => { From accedcd4b6959ce79d0e0b33dcfc0ac6cc24a1c8 Mon Sep 17 00:00:00 2001 From: Alireza Date: Mon, 25 Sep 2023 22:57:59 -0400 Subject: [PATCH 23/23] fix e2e --- platform/app/cypress/support/commands.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/platform/app/cypress/support/commands.js b/platform/app/cypress/support/commands.js index f3f31500180..33a791fa599 100644 --- a/platform/app/cypress/support/commands.js +++ b/platform/app/cypress/support/commands.js @@ -187,11 +187,10 @@ Cypress.Commands.add('addAngle', (viewport, firstClick, secondClick, thirdClick) }); Cypress.Commands.add('expectMinimumThumbnails', (seriesToWait = 1) => { - cy.get('[data-cy="study-browser-thumbnail"]', { timeout: 50000 }).as('thumbnails'); - - cy.get('@thumbnails').should($itemList => { - expect($itemList.length).to.be.gte(seriesToWait); - }); + cy.get('[data-cy="study-browser-thumbnail"]', { timeout: 50000 }).should( + 'have.length.gte', + seriesToWait + ); }); //Command to wait DICOM image to load into the viewport