From daf7912542ea2c5e33ca2e123de3ff293dae590c Mon Sep 17 00:00:00 2001 From: dfahlander Date: Sun, 18 Jun 2023 22:29:57 +0200 Subject: [PATCH 01/12] Trying to use another pnpm config preserving cache --- .github/workflows/main.yml | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e0cc0d641..06b10f505 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,7 +3,7 @@ name: Build and Test on: [push, workflow_dispatch] env: - #LAMBDATEST: "true" + #LAMBDATEST: "true" # Uncomment this line to run tests on LambdaTest instead of Browserstack GH_ACTIONS: "true" LT_USERNAME: ${{ secrets.LT_USERNAME }} LT_ACCESS_KEY: ${{ secrets.LT_ACCESS_KEY }} @@ -15,19 +15,25 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - TF: [test] + TF: + - test + #- addons/Dexie.Observable/test/unit + #- addons/Dexie.Observable/test/integration + #- addons/Dexie.Syncable/test/unit + #- addons/Dexie.Syncable/test/integration + #- addons/dexie-export-import/test + #- libs/dexie-react-hooks/test + #- test/integrations/test-dexie-relationships steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up Node.js - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 + cache: "pnpm" - name: Install dependencies - run: | - curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm@7 - pnpm config set store-dir ~/.pnpm-store - pnpm install --no-frozen-lockfile + run: pnpm install --no-frozen-lockfile - name: Build run: pnpm run build - name: Test From 09922b7374c42152ff9abd935f19a69de8793e75 Mon Sep 17 00:00:00 2001 From: dfahlander Date: Sun, 18 Jun 2023 22:30:32 +0200 Subject: [PATCH 02/12] Remove test badge for now (as we're changing test service) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 74b863a43..f3264c408 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Dexie.js ======== -[![NPM Version][npm-image]][npm-url] ![Build Status](https://github.com/dexie/Dexie.js/actions/workflows/main.yml/badge.svg)[![Tested with Browserstack](https://dexie.org/assets/images/tested-with-browserstack2.png)](https://www.browserstack.com) +[![NPM Version][npm-image]][npm-url] ![Build Status](https://github.com/dexie/Dexie.js/actions/workflows/main.yml/badge.svg) Dexie.js is a wrapper library for indexedDB - the standard database in the browser. https://dexie.org From ae785321715e70f586a0ddd0c8c9371dbf962e7d Mon Sep 17 00:00:00 2001 From: dfahlander Date: Sun, 18 Jun 2023 22:34:22 +0200 Subject: [PATCH 03/12] Setup pnpm --- .github/workflows/main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 06b10f505..a7610d743 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,6 +27,10 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 + - name: Set up pnpm + uses: pnpm/action-setup@v2 + with: + version: 8 - name: Set up Node.js uses: actions/setup-node@v3 with: From d88ac766ba7e2634e8e4d3553508c0a3edc53b9f Mon Sep 17 00:00:00 2001 From: dfahlander Date: Sun, 18 Jun 2023 22:38:19 +0200 Subject: [PATCH 04/12] Added dexie-observable tests to the matrix --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a7610d743..3c6988975 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,7 +17,7 @@ jobs: matrix: TF: - test - #- addons/Dexie.Observable/test/unit + - addons/Dexie.Observable/test/unit #- addons/Dexie.Observable/test/integration #- addons/Dexie.Syncable/test/unit #- addons/Dexie.Syncable/test/integration From 1bf4cd6f636d9111ee1c40f886d816feff405e24 Mon Sep 17 00:00:00 2001 From: dfahlander Date: Sun, 18 Jun 2023 22:57:44 +0200 Subject: [PATCH 05/12] Full matrix + remove travis.sh + merge unit/int --- .github/workflows/main.yml | 14 ++--- .../test/{unit => }/gh-actions.sh | 1 + .../test/integration/gh-actions.sh | 5 -- .../test/integration/travis.sh | 5 -- addons/Dexie.Observable/test/unit/travis.sh | 6 -- .../test/{unit => }/gh-actions.sh | 3 +- .../test/integration/gh-actions.sh | 13 ---- .../Dexie.Syncable/test/integration/travis.sh | 13 ---- addons/Dexie.Syncable/test/unit/travis.sh | 14 ----- addons/dexie-export-import/test/travis.sh | 13 ---- libs/dexie-react-hooks/test/travis.sh | 6 -- .../test-dexie-relationships/travis.sh | 4 -- test/travis.sh | 3 - tools/travis.sh | 59 ------------------- 14 files changed, 10 insertions(+), 149 deletions(-) rename addons/Dexie.Observable/test/{unit => }/gh-actions.sh (84%) delete mode 100755 addons/Dexie.Observable/test/integration/gh-actions.sh delete mode 100755 addons/Dexie.Observable/test/integration/travis.sh delete mode 100755 addons/Dexie.Observable/test/unit/travis.sh rename addons/Dexie.Syncable/test/{unit => }/gh-actions.sh (85%) delete mode 100755 addons/Dexie.Syncable/test/integration/gh-actions.sh delete mode 100755 addons/Dexie.Syncable/test/integration/travis.sh delete mode 100755 addons/Dexie.Syncable/test/unit/travis.sh delete mode 100755 addons/dexie-export-import/test/travis.sh delete mode 100755 libs/dexie-react-hooks/test/travis.sh delete mode 100755 test/integrations/test-dexie-relationships/travis.sh delete mode 100644 test/travis.sh delete mode 100644 tools/travis.sh diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3c6988975..7c5b7dadd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,13 +17,13 @@ jobs: matrix: TF: - test - - addons/Dexie.Observable/test/unit - #- addons/Dexie.Observable/test/integration - #- addons/Dexie.Syncable/test/unit - #- addons/Dexie.Syncable/test/integration - #- addons/dexie-export-import/test - #- libs/dexie-react-hooks/test - #- test/integrations/test-dexie-relationships + - addons/Dexie.Observable/test + - addons/Dexie.Syncable/test + - addons/dexie-export-import/test + - libs/dexie-react-hooks/test + - test/integrations/test-dexie-relationships + fail-fast: true # If one test fails, abort the rest of the tests + max-parallel: 1 # At least for browserstack, this seems to be needed to avoid timeouts steps: - name: Checkout code uses: actions/checkout@v3 diff --git a/addons/Dexie.Observable/test/unit/gh-actions.sh b/addons/Dexie.Observable/test/gh-actions.sh similarity index 84% rename from addons/Dexie.Observable/test/unit/gh-actions.sh rename to addons/Dexie.Observable/test/gh-actions.sh index c3428d3f3..8ba5139d2 100755 --- a/addons/Dexie.Observable/test/unit/gh-actions.sh +++ b/addons/Dexie.Observable/test/gh-actions.sh @@ -4,3 +4,4 @@ pnpm install >/dev/null pnpm run build pnpm run test:typings pnpm run test:unit +pnpm run test:integration diff --git a/addons/Dexie.Observable/test/integration/gh-actions.sh b/addons/Dexie.Observable/test/integration/gh-actions.sh deleted file mode 100755 index c45a00156..000000000 --- a/addons/Dexie.Observable/test/integration/gh-actions.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -e -echo "Installing dependencies for dexie-observable" -pnpm install >/dev/null -pnpm run build -pnpm run test:integration diff --git a/addons/Dexie.Observable/test/integration/travis.sh b/addons/Dexie.Observable/test/integration/travis.sh deleted file mode 100755 index c45a00156..000000000 --- a/addons/Dexie.Observable/test/integration/travis.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -e -echo "Installing dependencies for dexie-observable" -pnpm install >/dev/null -pnpm run build -pnpm run test:integration diff --git a/addons/Dexie.Observable/test/unit/travis.sh b/addons/Dexie.Observable/test/unit/travis.sh deleted file mode 100755 index c3428d3f3..000000000 --- a/addons/Dexie.Observable/test/unit/travis.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -e -echo "Installing dependencies for dexie-observable" -pnpm install >/dev/null -pnpm run build -pnpm run test:typings -pnpm run test:unit diff --git a/addons/Dexie.Syncable/test/unit/gh-actions.sh b/addons/Dexie.Syncable/test/gh-actions.sh similarity index 85% rename from addons/Dexie.Syncable/test/unit/gh-actions.sh rename to addons/Dexie.Syncable/test/gh-actions.sh index 364567091..6203c6467 100755 --- a/addons/Dexie.Syncable/test/unit/gh-actions.sh +++ b/addons/Dexie.Syncable/test/gh-actions.sh @@ -1,5 +1,5 @@ #!/bin/bash -e -cd ../../../Dexie.Observable +cd ../../Dexie.Observable echo "Installing dependencies for dexie-observable" pnpm install >/dev/null echo "Building dexie-observable" @@ -12,3 +12,4 @@ pnpm run build pnpm run test:typings pnpm run test:unit +pnpm run test:integration diff --git a/addons/Dexie.Syncable/test/integration/gh-actions.sh b/addons/Dexie.Syncable/test/integration/gh-actions.sh deleted file mode 100755 index 73654c5e9..000000000 --- a/addons/Dexie.Syncable/test/integration/gh-actions.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -e -cd ../../../Dexie.Observable -echo "Installing dependencies for dexie-observable" -pnpm install >/dev/null -echo "Building dexie-observable" -pnpm run build -cd - -echo "Installing dependencies for dexie-syncable" -pnpm install >/dev/null -echo "Building dexie-syncable" -pnpm run build - -pnpm run test:integration diff --git a/addons/Dexie.Syncable/test/integration/travis.sh b/addons/Dexie.Syncable/test/integration/travis.sh deleted file mode 100755 index 73654c5e9..000000000 --- a/addons/Dexie.Syncable/test/integration/travis.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -e -cd ../../../Dexie.Observable -echo "Installing dependencies for dexie-observable" -pnpm install >/dev/null -echo "Building dexie-observable" -pnpm run build -cd - -echo "Installing dependencies for dexie-syncable" -pnpm install >/dev/null -echo "Building dexie-syncable" -pnpm run build - -pnpm run test:integration diff --git a/addons/Dexie.Syncable/test/unit/travis.sh b/addons/Dexie.Syncable/test/unit/travis.sh deleted file mode 100755 index 364567091..000000000 --- a/addons/Dexie.Syncable/test/unit/travis.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -e -cd ../../../Dexie.Observable -echo "Installing dependencies for dexie-observable" -pnpm install >/dev/null -echo "Building dexie-observable" -pnpm run build -cd - -echo "Installing dependencies for dexie-syncable" -pnpm install >/dev/null -echo "Building dexie-syncable" -pnpm run build - -pnpm run test:typings -pnpm run test:unit diff --git a/addons/dexie-export-import/test/travis.sh b/addons/dexie-export-import/test/travis.sh deleted file mode 100755 index d154ce27f..000000000 --- a/addons/dexie-export-import/test/travis.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -e -echo "Installing dependencies for dexie-export-import" -pnpm install >/dev/null -pnpm run build -# This test fails sporadically on Safari 12. Needs to retry it if it fails. -n=1 -until [ $n -ge 4 ] -do - echo "Retry $n of 3" - pnpm test && exit 0 - n=$[$n+1] -done -exit 1 diff --git a/libs/dexie-react-hooks/test/travis.sh b/libs/dexie-react-hooks/test/travis.sh deleted file mode 100755 index 8f14d4b1b..000000000 --- a/libs/dexie-react-hooks/test/travis.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -e -echo "Installing dependencies for dexie-react-hooks" -pnpm install >/dev/null -echo "Building and running the tests" -pnpm test - diff --git a/test/integrations/test-dexie-relationships/travis.sh b/test/integrations/test-dexie-relationships/travis.sh deleted file mode 100755 index 4415368fa..000000000 --- a/test/integrations/test-dexie-relationships/travis.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -e -pnpm install -pnpm install webpack # Need to do all the time - bug in pnpm probably. -pnpm test diff --git a/test/travis.sh b/test/travis.sh deleted file mode 100644 index edb22ef55..000000000 --- a/test/travis.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -e -pnpm run test:typings -pnpm run test:unit diff --git a/tools/travis.sh b/tools/travis.sh deleted file mode 100644 index f822bee7d..000000000 --- a/tools/travis.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash -e - -# -# eslint -# -printf "Running eslint Dexie src\n" -$(pnpm bin)/eslint src -printf "eslint ok.\n" - -printf "Running eslint Dexie.Syncable src\n" -$(pnpm bin)/eslint --config "addons/Dexie.Syncable/src/.eslintrc.json" "addons/Dexie.Syncable/src" -printf "eslint ok.\n\n" - -printf "Running eslint Dexie.Observable src\n" -$(pnpm bin)/eslint --config "addons/Dexie.Observable/src/.eslintrc.json" "addons/Dexie.Observable/src" -printf "eslint ok.\n\n" - -# -# Build -# - -printf "Building Dexie\n" -pnpm run build -printf "Dexie building done.\n\n" - -ADDONS_DIR="addons/" -# Use an array to make sure that Observable is built before Syncable -addons=("Dexie.Observable" "Dexie.Syncable") - -# build addons -for addon in "${addons[@]}" -do - dir="${ADDONS_DIR}${addon}" - cd ${dir} - printf "Installing ${addon}\n" - pnpm install - printf "Building ${addon}\n" - pnpm run build - printf "${addon} building done.\n\n" - cd - -done - -# test -printf "Testing Dexie\n" -$(pnpm bin)/karma start test/karma.travis.conf.js --single-run -printf "Dexie tests done.\n\n" - -# Run tests for addons -for addon in "${addons[@]}" -do - dir="${ADDONS_DIR}${addon}" - cd ${dir} - printf "Testing ${addon}\n" - $(pnpm bin)/karma start test/karma.travis.conf.js --single-run - printf "${addon} tests done.\n\n" - cd - -done - -printf "Done.\n" From 1ec31dff569633cf563abc6dc4836deb07c649cf Mon Sep 17 00:00:00 2001 From: dfahlander Date: Sun, 18 Jun 2023 23:16:57 +0200 Subject: [PATCH 06/12] Trying if GH actions can run tests om chrome --- test/karma.browsers.matrix.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/karma.browsers.matrix.js b/test/karma.browsers.matrix.js index 05dd7b62e..40db3e897 100644 --- a/test/karma.browsers.matrix.js +++ b/test/karma.browsers.matrix.js @@ -18,9 +18,10 @@ module.exports = { // - Let firefox represent the standard evergreen browser. // Leaving out Chrome, since local tests have hopefully already run on it. // Chrome will be tested in the pre_npm_publish anyway. - 'bs_firefox_latest_supported', + //'bs_firefox_latest_supported', // Safari. Enforces native Safari support for every PR! - 'bs_safari_latest_supported' + //'bs_safari_latest_supported' + 'Chrome' ], ciLT: [ From 6fb169be939872b89578b79272d0f0a0ff025b36 Mon Sep 17 00:00:00 2001 From: dfahlander Date: Sun, 18 Jun 2023 23:23:45 +0200 Subject: [PATCH 07/12] Trying coactions/setup-xvfb@v1 --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7c5b7dadd..dd3c6e70a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,6 +27,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 + - name: Run headless test + uses: coactions/setup-xvfb@v1 - name: Set up pnpm uses: pnpm/action-setup@v2 with: From f72eabf94702575bc3f4035fb6f8592699ca694d Mon Sep 17 00:00:00 2001 From: dfahlander Date: Sun, 18 Jun 2023 23:26:09 +0200 Subject: [PATCH 08/12] Trying configure "run" --- .github/workflows/main.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dd3c6e70a..e1644f2b7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,8 +27,6 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 - - name: Run headless test - uses: coactions/setup-xvfb@v1 - name: Set up pnpm uses: pnpm/action-setup@v2 with: @@ -42,7 +40,8 @@ jobs: run: pnpm install --no-frozen-lockfile - name: Build run: pnpm run build - - name: Test + - name: Run headless test + uses: coactions/setup-xvfb@v1 run: | cd ${{ matrix.TF }} pwd From 71f76add0ed3ff5df36570b90efd833d09c94031 Mon Sep 17 00:00:00 2001 From: dfahlander Date: Sun, 18 Jun 2023 23:27:59 +0200 Subject: [PATCH 09/12] Trying again --- .github/workflows/main.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e1644f2b7..976fff181 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -42,7 +42,6 @@ jobs: run: pnpm run build - name: Run headless test uses: coactions/setup-xvfb@v1 - run: | - cd ${{ matrix.TF }} - pwd - bash ./gh-actions.sh + with: + run: bash ./gh-actions.sh + working-directory: ${{ matrix.TF }} From 0968018d407208b9c37ef7c71e312a976792497f Mon Sep 17 00:00:00 2001 From: dfahlander Date: Sun, 18 Jun 2023 23:36:39 +0200 Subject: [PATCH 10/12] Testing fully again. Now also with headless local --- test/karma.browsers.matrix.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/test/karma.browsers.matrix.js b/test/karma.browsers.matrix.js index 40db3e897..29ac3bc00 100644 --- a/test/karma.browsers.matrix.js +++ b/test/karma.browsers.matrix.js @@ -11,17 +11,16 @@ module.exports = { //local: ['bs_safari_latest_supported'], // When browserstack cannot be used, use local Firefox. - ciLocal: ['Firefox'], + ciLocal: ['Chrome'], // Continous Integration on every push to master ci: [ // - Let firefox represent the standard evergreen browser. // Leaving out Chrome, since local tests have hopefully already run on it. // Chrome will be tested in the pre_npm_publish anyway. - //'bs_firefox_latest_supported', + 'Firefox', // Safari. Enforces native Safari support for every PR! - //'bs_safari_latest_supported' - 'Chrome' + 'bs_safari_latest_supported' ], ciLT: [ @@ -33,7 +32,7 @@ module.exports = { // Skipping under 4.0 alpha: 'bs_chrome_oldest_supported', // ...because not tested in CI! 'bs_chrome_latest_supported', // ...because not tested in CI! //'Skipping under 4.0 alpha: bs_firefox_oldest_supported', // ...because not tested in CI! - "bs_safari_latest_supported", // ...because not tested in CI! + "bs_firefox_latest_supported", // ...because not tested in CI! ] } From 4bf4179800d9e1f358d6f24487035194dfd06259 Mon Sep 17 00:00:00 2001 From: dfahlander Date: Sun, 18 Jun 2023 23:46:23 +0200 Subject: [PATCH 11/12] Updating browser versions --- test/karma.browserstack.js | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/test/karma.browserstack.js b/test/karma.browserstack.js index 2449d758c..fbf5bc087 100644 --- a/test/karma.browserstack.js +++ b/test/karma.browserstack.js @@ -9,7 +9,7 @@ module.exports = { bs_firefox_latest_supported: { base: 'BrowserStack', browser: 'firefox', - browser_version: '113', + browser_version: '114', os: 'Windows', os_version: 10 }, @@ -20,17 +20,10 @@ module.exports = { os: 'OS X', os_version: 'El Capitan' }, - bs_edge_oldest_supported: { - base: 'BrowserStack', - browser: "Edge", - browser_version: '15', - os: 'Windows', - os_version: '10' - }, bs_edge_latest_supported: { base: 'BrowserStack', browser: 'Edge', - browser_version: '95', + browser_version: '114', os: 'Windows', os_version: '10' }, @@ -44,7 +37,7 @@ module.exports = { bs_chrome_latest_supported: { base: 'BrowserStack', browser: "Chrome", - browser_version: "112", + browser_version: "114", os: 'Windows', os_version: 10 }, @@ -61,13 +54,6 @@ module.exports = { browser_version: "16", os: 'OS X', os_version: 'Ventura' - }, - bs_iphone7: { - base: 'BrowserStack', - browser: "Safari", - browser_version: "10.1", - os: 'iOS', - os_version: "10.3" } } } From 3f3f5e04f6057bb8c463a9ac4ef24848e1da5067 Mon Sep 17 00:00:00 2001 From: dfahlander Date: Sun, 18 Jun 2023 23:50:34 +0200 Subject: [PATCH 12/12] Removing CI of dexie-relationships --- .github/workflows/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 976fff181..5e74da6ae 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,7 +21,6 @@ jobs: - addons/Dexie.Syncable/test - addons/dexie-export-import/test - libs/dexie-react-hooks/test - - test/integrations/test-dexie-relationships fail-fast: true # If one test fails, abort the rest of the tests max-parallel: 1 # At least for browserstack, this seems to be needed to avoid timeouts steps: