Skip to content

Commit 6e5273b

Browse files
committed
ci: run e2e tests against node 22 as well
1 parent 8748e1d commit 6e5273b

File tree

4 files changed

+118
-47
lines changed

4 files changed

+118
-47
lines changed

.circleci/config.yml

Lines changed: 112 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,25 @@ executors:
2121
# don't want to use it regardless, for consistency (and because it can cause problems)
2222
SHARP_IGNORE_GLOBAL_LIBVIPS: 1
2323

24-
aliases:
25-
e2e-executor-env: &e2e-executor-env
26-
GATSBY_CPU_COUNT: 2
27-
VERBOSE: 1
24+
e2e18:
25+
docker:
26+
- image: "cypress/browsers:node-18.20.3-chrome-125.0.6422.141-1-ff-126.0.1-edge-125.0.2535.85-1"
27+
environment:
28+
# This is just used to construct unique `CYPRESS_GROUP_NAME`
29+
E2E_NODE_VERSION: 18.6.0
30+
GATSBY_CPU_COUNT: 2
31+
VERBOSE: 1
2832

29-
e2e-executor: &e2e-executor
33+
e2e22:
3034
docker:
31-
- image: cypress/browsers:node18.6.0-chrome105-ff104
35+
- image: "cypress/browsers:node-22.13.1-chrome-133.0.6943.53-1-ff-135.0-edge-132.0.2957.140-1"
3236
environment:
33-
<<: *e2e-executor-env
37+
# This is just used to construct unique `CYPRESS_GROUP_NAME`
38+
E2E_NODE_VERSION: 22.13.1
39+
GATSBY_CPU_COUNT: 2
40+
VERBOSE: 1
3441

42+
aliases:
3543
install_node_modules: &install_node_modules
3644
run:
3745
name: Install node modules
@@ -77,11 +85,6 @@ aliases:
7785
condition: << parameters.npm_rebuild >>
7886
steps:
7987
- run: npm rebuild
80-
- run:
81-
name: Step debug info
82-
command: |
83-
yarn list react
84-
yarn why lmdb-store
8588
- run:
8689
name: Run tests
8790
command: yarn jest --ci --runInBand $(yarn -s jest --listTests | sed 's/\/home\/circleci\/project\///g' | circleci tests split)
@@ -100,8 +103,17 @@ aliases:
100103
ignore:
101104
- master
102105
- /docs.+/
106+
matrix:
107+
parameters:
108+
node_version: ["18.2.0", "22.13"]
109+
e2e_executor_suffix: ["18", "22"]
110+
exclude:
111+
- node_version: "18.2.0"
112+
e2e_executor_suffix: "22"
113+
- node_version: "22.13"
114+
e2e_executor_suffix: "18"
103115
requires:
104-
- bootstrap-18.2.0
116+
- bootstrap-<< matrix.node_version >>
105117

106118
integration-test-workflow: &integration-test-workflow
107119
filters:
@@ -437,16 +449,24 @@ jobs:
437449
test_command: yarn test
438450

439451
e2e_tests_path-prefix:
440-
<<: *e2e-executor
452+
parameters:
453+
node_version:
454+
type: string
455+
e2e_executor_suffix:
456+
type: string
457+
executor: e2e<< parameters.e2e_executor_suffix >>
441458
steps:
442459
- run: echo 'export CYPRESS_RECORD_KEY="${CY_CLOUD_PATH_PREFIX}"' >> "$BASH_ENV"
443460
- e2e-test:
444461
test_path: e2e-tests/path-prefix
445462

446463
e2e_tests_pnp:
447-
executor:
448-
name: node
449-
image: "18.12.0"
464+
parameters:
465+
node_version:
466+
type: string
467+
e2e_executor_suffix:
468+
type: string
469+
executor: e2e<< parameters.e2e_executor_suffix >>
450470
steps:
451471
- checkout
452472
- run: ./scripts/assert-changed-files.sh "packages/*|.circleci/*"
@@ -499,9 +519,12 @@ jobs:
499519
working_directory: /tmp/e2e-tests/gatsby-pnp
500520

501521
e2e_tests_pnpm:
502-
executor:
503-
name: node
504-
image: "18.12.0"
522+
parameters:
523+
node_version:
524+
type: string
525+
e2e_executor_suffix:
526+
type: string
527+
executor: e2e<< parameters.e2e_executor_suffix >>
505528
steps:
506529
- checkout
507530
- run: ./scripts/assert-changed-files.sh "packages/*|.circleci/*"
@@ -538,14 +561,26 @@ jobs:
538561
working_directory: /tmp/e2e-tests/gatsby-pnpm
539562

540563
e2e_tests_development_runtime_with_react_18:
541-
<<: *e2e-executor
564+
parameters:
565+
node_version:
566+
type: string
567+
e2e_executor_suffix:
568+
type: string
569+
executor: e2e<< parameters.e2e_executor_suffix >>
542570
steps:
543571
- run: echo 'export CYPRESS_RECORD_KEY="${CY_CLOUD_DEV_RUNTIME_REACT_18}"' >> "$BASH_ENV"
572+
# We use curl in this test suite but it isn't available in all images we use
573+
- run: sudo apt-get update && sudo apt-get install -y curl
544574
- e2e-test:
545575
test_path: e2e-tests/development-runtime
546576

547577
e2e_tests_production_runtime_with_react_18:
548-
<<: *e2e-executor
578+
parameters:
579+
node_version:
580+
type: string
581+
e2e_executor_suffix:
582+
type: string
583+
executor: e2e<< parameters.e2e_executor_suffix >>
549584
steps:
550585
- run: echo 'export CY_CLOUD_PROD_RUNTIME_OFFLINE_REACT_18="${CY_CLOUD_PROD_RUNTIME_OFFLINE_REACT_18}"' >> "$BASH_ENV"
551586
- run: echo 'export CY_CLOUD_PROD_RUNTIME_REACT_18="${CY_CLOUD_PROD_RUNTIME_REACT_18}"' >> "$BASH_ENV"
@@ -554,41 +589,66 @@ jobs:
554589
test_command: CYPRESS_PROJECT_ID=5k8zbj CYPRESS_RECORD_KEY=${CY_CLOUD_PROD_RUNTIME_REACT_18} yarn test && CYPRESS_PROJECT_ID=yvdct2 CYPRESS_RECORD_KEY=${CY_CLOUD_PROD_RUNTIME_OFFLINE_REACT_18} yarn test:offline
555590

556591
themes_e2e_tests_development_runtime:
557-
<<: *e2e-executor
592+
parameters:
593+
node_version:
594+
type: string
595+
e2e_executor_suffix:
596+
type: string
597+
executor: e2e<< parameters.e2e_executor_suffix >>
558598
steps:
559599
- run: echo 'export CYPRESS_RECORD_KEY="${CY_CLOUD_THEMES_DEV_RUNTIME}"' >> "$BASH_ENV"
560600
- e2e-test:
561601
test_path: e2e-tests/themes
562602
test_command: cd development-runtime; gatsby-dev --force-install --scan-once; yarn test
563603

564604
themes_e2e_tests_production_runtime:
565-
<<: *e2e-executor
605+
parameters:
606+
node_version:
607+
type: string
608+
e2e_executor_suffix:
609+
type: string
610+
executor: e2e<< parameters.e2e_executor_suffix >>
566611
steps:
567612
- run: echo 'export CYPRESS_RECORD_KEY="${CY_CLOUD_THEMES_PROD_RUNTIME}"' >> "$BASH_ENV"
568613
- e2e-test:
569614
test_path: e2e-tests/themes
570615
test_command: cd production-runtime; gatsby-dev --force-install --scan-once; yarn test
571616

572617
e2e_tests_mdx:
573-
<<: *e2e-executor
618+
parameters:
619+
node_version:
620+
type: string
621+
e2e_executor_suffix:
622+
type: string
623+
executor: e2e<< parameters.e2e_executor_suffix >>
574624
steps:
575625
- run: echo 'export CYPRESS_RECORD_KEY="${CY_CLOUD_MDX}"' >> "$BASH_ENV"
576626
- e2e-test:
577627
test_path: e2e-tests/mdx
578628

579629
e2e_tests_visual-regression:
580-
<<: *e2e-executor
630+
parameters:
631+
node_version:
632+
type: string
633+
e2e_executor_suffix:
634+
type: string
635+
executor: e2e<< parameters.e2e_executor_suffix >>
581636
steps:
582637
- run: echo 'export CYPRESS_RECORD_KEY="${CY_CLOUD_VISUAL_REGRESSION}"' >> "$BASH_ENV"
583638
- e2e-test:
584639
test_path: e2e-tests/visual-regression
585640
- store_artifacts:
586-
path: e2e-tests/visual-regression/__diff_output__
641+
path: e2e-tests/visual-regression/<< parameters.e2e_executor_suffix >>/__diff_output__
587642
- store_test_results:
588-
path: e2e-tests/visual-regression/cypress/results
643+
path: e2e-tests/visual-regression/cypress/<< parameters.e2e_executor_suffix >>/results
589644

590645
e2e_tests_contentful:
591-
<<: *e2e-executor
646+
parameters:
647+
node_version:
648+
type: string
649+
e2e_executor_suffix:
650+
type: string
651+
executor: e2e<< parameters.e2e_executor_suffix >>
592652
steps:
593653
- run: echo 'export CYPRESS_RECORD_KEY="${CY_CLOUD_CONTENTFUL}"' >> "$BASH_ENV"
594654
- e2e-test:
@@ -598,42 +658,53 @@ jobs:
598658
test_path: e2e-tests/contentful
599659
test_command: yarn build
600660
- store_artifacts:
601-
path: e2e-tests/contentful/__diff_output__
661+
path: e2e-tests/contentful/<< parameters.e2e_executor_suffix >>/__diff_output__
602662
- store_test_results:
603-
path: e2e-tests/contentful/cypress/results
663+
path: e2e-tests/contentful/cypress/<< parameters.e2e_executor_suffix >>/results
604664

605665
e2e_tests_trailing-slash:
606-
<<: *e2e-executor
666+
parameters:
667+
node_version:
668+
type: string
669+
e2e_executor_suffix:
670+
type: string
671+
executor: e2e<< parameters.e2e_executor_suffix >>
607672
steps:
608673
- run: echo 'export CYPRESS_RECORD_KEY="${CY_CLOUD_TRAILING_SLASH}"' >> "$BASH_ENV"
609674
- e2e-test:
610675
test_path: e2e-tests/trailing-slash
611676
- store_test_results:
612-
path: e2e-tests/trailing-slash/cypress/results
677+
path: e2e-tests/trailing-slash/cypress/<< parameters.e2e_executor_suffix >>/results
613678

614679
e2e_tests_adapters:
615-
<<: *e2e-executor
616-
docker:
617-
- image: cypress/browsers:node-18.20.3-chrome-125.0.6422.141-1-ff-126.0.1-edge-125.0.2535.85-1
680+
parameters:
681+
node_version:
682+
type: string
683+
e2e_executor_suffix:
684+
type: string
685+
executor: e2e<< parameters.e2e_executor_suffix >>
618686
steps:
619687
- run: echo 'export CYPRESS_RECORD_KEY="${CY_CLOUD_ADAPTERS}"' >> "$BASH_ENV"
620688
- e2e-test:
621689
test_path: e2e-tests/adapters
622690
- store_test_results:
623-
path: e2e-tests/adapters/cypress/results
691+
path: e2e-tests/adapters/cypress/<< parameters.e2e_executor_suffix >>/results
624692

625693
e2e_tests_adapters_monorepo:
626-
<<: *e2e-executor
627-
docker:
628-
- image: cypress/browsers:node-18.20.3-chrome-125.0.6422.141-1-ff-126.0.1-edge-125.0.2535.85-1
694+
parameters:
695+
node_version:
696+
type: string
697+
e2e_executor_suffix:
698+
type: string
699+
executor: e2e<< parameters.e2e_executor_suffix >>
629700
steps:
630701
- run: echo 'export CYPRESS_RECORD_KEY="${CY_CLOUD_ADAPTERS}"' >> "$BASH_ENV"
631702
- e2e-test:
632703
test_path: e2e-tests/adapters
633704
test_command: cd workspace; gatsby-dev --force-install --scan-once; cd ..; yarn test
634705
pre_gatsby_dev_command: ./make-monorepo.sh
635706
- store_test_results:
636-
path: e2e-tests/adapters/cypress/results
707+
path: e2e-tests/adapters/cypress/<< parameters.e2e_executor_suffix >>/results
637708

638709
starters_validate:
639710
executor: node

e2e-tests/adapters/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
"cy:open": "cypress open --browser chrome --e2e",
1414
"develop:debug": "start-server-and-test develop http://localhost:8000 'npm run cy:open -- --config baseUrl=http://localhost:8000'",
1515
"ssat:debug": "start-server-and-test serve http://localhost:9000 cy:open",
16-
"test:template": "cross-env-shell CYPRESS_GROUP_NAME=\"adapter:$ADAPTER / trailingSlash:${TRAILING_SLASH:-always} / pathPrefix:${PATH_PREFIX:--} / excludeDatastoreFromBundle:${GATSBY_EXCLUDE_DATASTORE_FROM_BUNDLE:-false} / monorepo:${E2E_MONOREPO:-false}\" TRAILING_SLASH=$TRAILING_SLASH PATH_PREFIX=$PATH_PREFIX node ../../scripts/cypress-run-with-conditional-record-flag.js --browser chrome --e2e --config-file \"cypress/configs/$ADAPTER.ts\" --env TRAILING_SLASH=$TRAILING_SLASH,PATH_PREFIX=$PATH_PREFIX",
17-
"test:template:debug": "cross-env-shell CYPRESS_GROUP_NAME=\"adapter:$ADAPTER / trailingSlash:${TRAILING_SLASH:-always} / pathPrefix:${PATH_PREFIX:--} / excludeDatastoreFromBundle:${GATSBY_EXCLUDE_DATASTORE_FROM_BUNDLE:-false} / monorepo:${E2E_MONOREPO:-false}\" TRAILING_SLASH=$TRAILING_SLASH PATH_PREFIX=$PATH_PREFIX npm run cy:open -- --config-file \"cypress/configs/$ADAPTER.ts\" --env TRAILING_SLASH=$TRAILING_SLASH,PATH_PREFIX=$PATH_PREFIX",
16+
"test:template": "cross-env-shell CYPRESS_GROUP_NAME=\"adapter:$ADAPTER nodejs:$E2E_NODE_VERSION / trailingSlash:${TRAILING_SLASH:-always} / pathPrefix:${PATH_PREFIX:--} / excludeDatastoreFromBundle:${GATSBY_EXCLUDE_DATASTORE_FROM_BUNDLE:-false} / monorepo:${E2E_MONOREPO:-false}\" TRAILING_SLASH=$TRAILING_SLASH PATH_PREFIX=$PATH_PREFIX node ../../scripts/cypress-run-with-conditional-record-flag.js --browser chrome --e2e --config-file \"cypress/configs/$ADAPTER.ts\" --env TRAILING_SLASH=$TRAILING_SLASH,PATH_PREFIX=$PATH_PREFIX",
17+
"test:template:debug": "cross-env-shell CYPRESS_GROUP_NAME=\"adapter:$ADAPTER nodejs:$E2E_NODE_VERSION / trailingSlash:${TRAILING_SLASH:-always} / pathPrefix:${PATH_PREFIX:--} / excludeDatastoreFromBundle:${GATSBY_EXCLUDE_DATASTORE_FROM_BUNDLE:-false} / monorepo:${E2E_MONOREPO:-false}\" TRAILING_SLASH=$TRAILING_SLASH PATH_PREFIX=$PATH_PREFIX npm run cy:open -- --config-file \"cypress/configs/$ADAPTER.ts\" --env TRAILING_SLASH=$TRAILING_SLASH,PATH_PREFIX=$PATH_PREFIX",
1818
"test:debug": "npm-run-all -s build:debug ssat:debug",
1919
"test:netlify": "cross-env TRAILING_SLASH=always node scripts/deploy-and-run/netlify.mjs test:template",
2020
"test:smoke": "node smoke-test.mjs",

e2e-tests/mdx/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
"serve": "gatsby serve",
3939
"cy:open:develop": "cypress open --browser chrome --e2e --config-file cypress/configs/develop.ts",
4040
"cy:open:build": "cypress open --browser chrome --e2e --config-file cypress/configs/build.ts",
41-
"cy:run:build": "CYPRESS_GROUP_NAME=production node ../../scripts/cypress-run-with-conditional-record-flag.js --browser chrome --e2e --config-file cypress/configs/build.ts",
42-
"cy:run:develop": "CYPRESS_GROUP_NAME=development node ../../scripts/cypress-run-with-conditional-record-flag.js --browser chrome --e2e --config-file cypress/configs/develop.ts",
41+
"cy:run:build": "CYPRESS_GROUP_NAME=production:$E2E_NODE_VERSION node ../../scripts/cypress-run-with-conditional-record-flag.js --browser chrome --e2e --config-file cypress/configs/build.ts",
42+
"cy:run:develop": "CYPRESS_GROUP_NAME=development:$E2E_NODE_VERSION node ../../scripts/cypress-run-with-conditional-record-flag.js --browser chrome --e2e --config-file cypress/configs/develop.ts",
4343
"reset": "node scripts/reset.js",
4444
"update": "node scripts/update.js"
4545
},

e2e-tests/trailing-slash/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
"cy:open:build": "cypress open --browser chrome --e2e --config baseUrl=http://localhost:9000 --env IS_BUILD=y",
2121
"debug:develop": "start-server-and-test develop http://localhost:8000 cy:open:develop",
2222
"debug:build": "start-server-and-test serve http://localhost:9000 cy:open:build",
23-
"cy:develop:option": "cross-env-shell CYPRESS_GROUP_NAME=develop-$OPTION node ../../scripts/cypress-run-with-conditional-record-flag.js --browser chrome --e2e --config-file \"cypress/configs/$OPTION.ts\" --config baseUrl=http://localhost:8000",
24-
"cy:build:option": "cross-env-shell CYPRESS_GROUP_NAME=build-$OPTION node ../../scripts/cypress-run-with-conditional-record-flag.js --browser chrome --e2e --config-file \"cypress/configs/$OPTION.ts\" --config baseUrl=http://localhost:9000 --env IS_BUILD=y",
23+
"cy:develop:option": "cross-env-shell CYPRESS_GROUP_NAME=develop-$OPTION-$E2E_NODE_VERSION node ../../scripts/cypress-run-with-conditional-record-flag.js --browser chrome --e2e --config-file \"cypress/configs/$OPTION.ts\" --config baseUrl=http://localhost:8000",
24+
"cy:build:option": "cross-env-shell CYPRESS_GROUP_NAME=build-$OPTION-$E2E_NODE_VERSION node ../../scripts/cypress-run-with-conditional-record-flag.js --browser chrome --e2e --config-file \"cypress/configs/$OPTION.ts\" --config baseUrl=http://localhost:9000 --env IS_BUILD=y",
2525
"develop:option": "cross-env-shell CYPRESS_SUPPORT=y TRAILING_SLASH=$OPTION gatsby develop",
2626
"build:option": "cross-env-shell CYPRESS_SUPPORT=y TRAILING_SLASH=$OPTION gatsby build",
2727
"t:opt:develop": "cross-env-shell OPTION=$OPTION start-server-and-test develop:option http://localhost:8000 cy:develop:option",

0 commit comments

Comments
 (0)