From 8d2d390d0df062443423ae816274ba7549fe20b8 Mon Sep 17 00:00:00 2001 From: Vitaliy Shcherban Date: Wed, 22 Jun 2022 10:24:39 +0300 Subject: [PATCH 1/7] feat: use ES 8x --- .circleci/config.yml | 1 + jest-es-config.js | 2 +- package.json | 2 +- src/search-by-term.test.js | 3 +-- teardown.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index dfa6db4..96d9c75 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,6 +13,7 @@ commands: use-strict-cache: true steps: - run: yarn install --pure-lockfile --no-progress + - run: sudo apt-get -q update && sudo apt-get -y install openjdk-17-jdk jobs: build: diff --git a/jest-es-config.js b/jest-es-config.js index 9f51ba4..c345c0a 100644 --- a/jest-es-config.js +++ b/jest-es-config.js @@ -2,7 +2,7 @@ const documentsMapping = require('./index-mapping'); module.exports = function getClusterSetting() { return { - esVersion: '7.12.1', + esVersion: '8.2.0', clusterName: 'docs', nodeName: 'docs', port: 9200, diff --git a/package.json b/package.json index 916b01c..c1f841b 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "preset": "./jest-preset.js" }, "dependencies": { - "@shelf/elasticsearch-local": "2.3.0", + "@shelf/elasticsearch-local": "3.0.0", "cwd": "0.10.0" }, "devDependencies": { diff --git a/src/search-by-term.test.js b/src/search-by-term.test.js index 65d400a..578fc44 100644 --- a/src/search-by-term.test.js +++ b/src/search-by-term.test.js @@ -23,8 +23,7 @@ describe('getDocuments', () => { _source: { id: 'some-doc-id-1', name: 'some-name-1' - }, - _type: '_doc' + } } ], totalCount: { diff --git a/teardown.js b/teardown.js index 1e76ce9..d7ad661 100644 --- a/teardown.js +++ b/teardown.js @@ -1,5 +1,5 @@ const {stop} = require('@shelf/elasticsearch-local'); module.exports = async function stopES() { - await stop(); + stop(); }; From 9e93464e45ce0572a5575f3382b9f30c9ad20881 Mon Sep 17 00:00:00 2001 From: Vitaliy Shcherban Date: Wed, 22 Jun 2022 10:30:47 +0300 Subject: [PATCH 2/7] chore: Update circleci orb --- .circleci/config.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 96d9c75..466e511 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,25 +1,24 @@ version: 2.1 orbs: - node: circleci/node@1.1.6 + node: circleci/node@5.0.2 commands: install_deps: steps: - - node/with-cache: + - node/install-packages: + pkg-manager: yarn cache-version: v1-all - cache-key: package.json - dir: ~/repo/node_modules - use-strict-cache: true - steps: - - run: yarn install --pure-lockfile --no-progress + cache-only-lockfile: true + app-dir: ~/repo + override-ci-command: yarn install --pure-lockfile --no-progress - run: sudo apt-get -q update && sudo apt-get -y install openjdk-17-jdk jobs: build: executor: name: node/default - tag: '14-browsers' + tag: << pipeline.parameters.node_version >> steps: - checkout - install_deps From 07f8d9ab0db8b4932225ccbb0ce543f130c66102 Mon Sep 17 00:00:00 2001 From: Vitaliy Shcherban Date: Wed, 22 Jun 2022 10:35:39 +0300 Subject: [PATCH 3/7] chore: update to node 16 --- .circleci/config.yml | 5 +++++ package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 466e511..1301d73 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,6 +3,11 @@ version: 2.1 orbs: node: circleci/node@5.0.2 +parameters: + node_version: + type: string + default: '16.15.0' + commands: install_deps: steps: diff --git a/package.json b/package.json index c1f841b..12f5b39 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "prettier": "2.3.0" }, "engines": { - "node": ">=14" + "node": ">=16" }, "publishConfig": { "access": "public" From ab84f7bbc55c902337b9baea0e85b48764ed612b Mon Sep 17 00:00:00 2001 From: Vitaliy Shcherban Date: Wed, 22 Jun 2022 10:36:16 +0300 Subject: [PATCH 4/7] chore: remove java instalation from ci --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1301d73..17bab56 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,7 +17,7 @@ commands: cache-only-lockfile: true app-dir: ~/repo override-ci-command: yarn install --pure-lockfile --no-progress - - run: sudo apt-get -q update && sudo apt-get -y install openjdk-17-jdk + #- run: sudo apt-get -q update && sudo apt-get -y install openjdk-17-jdk jobs: build: From af630d10ce10e79e9554b8ad8176a4e75824baba Mon Sep 17 00:00:00 2001 From: Vitaliy Shcherban Date: Wed, 22 Jun 2022 10:37:32 +0300 Subject: [PATCH 5/7] chore: add working directory --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 17bab56..34ebc6a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,6 +24,7 @@ jobs: executor: name: node/default tag: << pipeline.parameters.node_version >> + working_directory: ~/repo steps: - checkout - install_deps From 8adacc5c4061e3416ef921dffccd21743e6b2c71 Mon Sep 17 00:00:00 2001 From: Vitaliy Shcherban Date: Wed, 22 Jun 2022 10:39:43 +0300 Subject: [PATCH 6/7] chore: add debug logs to elasticsearch-local in ci --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 34ebc6a..6cafddb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -28,5 +28,5 @@ jobs: steps: - checkout - install_deps - - run: yarn test + - run: DEBUG=elasticsearch-local yarn test - run: yarn lint:ci From 8baf4cf66fe091d377a942dfbf96fed2da9e2ed4 Mon Sep 17 00:00:00 2001 From: Vitaliy Shcherban Date: Wed, 22 Jun 2022 10:43:03 +0300 Subject: [PATCH 7/7] chore: remove debug logs and add java in ci --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6cafddb..5e7ae6e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,7 +17,7 @@ commands: cache-only-lockfile: true app-dir: ~/repo override-ci-command: yarn install --pure-lockfile --no-progress - #- run: sudo apt-get -q update && sudo apt-get -y install openjdk-17-jdk + - run: sudo apt-get -q update && sudo apt-get -y install openjdk-17-jdk jobs: build: @@ -28,5 +28,5 @@ jobs: steps: - checkout - install_deps - - run: DEBUG=elasticsearch-local yarn test + - run: yarn test - run: yarn lint:ci