From 4a0869484b3bb6104a39eb1f40a5d714f6d7f624 Mon Sep 17 00:00:00 2001 From: Michal Piechowiak Date: Fri, 13 Nov 2020 12:50:50 +0100 Subject: [PATCH] add query on demand variant for e2e dev tests --- .circleci/config.yml | 10 ++++++++++ packages/gatsby/src/services/initialize.ts | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5cc28f2f5c0f9..5bda06b13d5bf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -337,6 +337,14 @@ jobs: CYPRESS_PROJECT_ID: 917bea CYPRESS_RECORD_KEY: 4750fb36-4576-4638-a617-d243a381acef + e2e_tests_development_runtime_query_on_demand: + <<: *e2e_tests_development_runtime_alias + environment: + GATSBY_EXPERIMENTAL_QUERY_ON_DEMAND: true + CYPRESS_QUERY_ON_DEMAND: true + CYPRESS_PROJECT_ID: konj5u + CYPRESS_RECORD_KEY: e38d5b36-5188-4e26-88c1-7c0f9e283fdb + e2e_tests_development_runtime_with_experimental_react: <<: *e2e_tests_development_runtime_alias @@ -624,6 +632,8 @@ workflows: <<: *e2e-test-workflow - e2e_tests_development_runtime_fast_refresh: <<: *e2e-test-workflow + - e2e_tests_development_runtime_query_on_demand: + <<: *e2e-test-workflow - e2e_tests_production_runtime: <<: *e2e-test-workflow - themes_e2e_tests_production_runtime: diff --git a/packages/gatsby/src/services/initialize.ts b/packages/gatsby/src/services/initialize.ts index 8fb051de241de..d32244c83a58f 100644 --- a/packages/gatsby/src/services/initialize.ts +++ b/packages/gatsby/src/services/initialize.ts @@ -280,7 +280,7 @@ export async function initialize({ // we don't want to ever have this flag enabled for anything than develop // in case someone have this env var globally set delete process.env.GATSBY_EXPERIMENTAL_QUERY_ON_DEMAND - } else if (isCI()) { + } else if (isCI() && !process.env.CYPRESS_SUPPORT) { delete process.env.GATSBY_EXPERIMENTAL_QUERY_ON_DEMAND reporter.warn( `Experimental Query on Demand feature is not available in CI environment. Continuing with regular mode.`