Procházet zdrojové kódy

chore: Increase default e2e timeout for CI

Makes it more friendly to contributors who otherwise would need ES running in order to pass the pre-push hook.
Michael Bromley před 5 roky
rodič
revize
867fc1ed72

+ 7 - 0
e2e-common/test-config.ts

@@ -33,6 +33,13 @@ if (process.env.E2E_DEBUG) {
     console.log('E2E_DEBUG', process.env.E2E_DEBUG, ' - setting long timeout');
     jest.setTimeout(1800 * 1000);
 }
+/**
+ * Increase default timeout in CI to 10 seconds because occasionally valid tests fail due to
+ * timeouts.
+ */
+if (process.env.CI) {
+    jest.setTimeout(10 * 1000);
+}
 
 export const testConfig = mergeConfig(defaultTestConfig, {
     importExportOptions: {

+ 0 - 15
packages/elasticsearch-plugin/e2e/elasticsearch-plugin.e2e-spec.ts

@@ -66,9 +66,6 @@ import {
     SearchProductsAdmin,
 } from './graphql/generated-e2e-elasticsearch-plugin-types';
 
-console.log('process.argv', process.argv);
-const SKIP_TESTS = process.env.SKIP_ELASTICSEARCH_E2E_TESTS;
-
 describe('Elasticsearch plugin', () => {
     const { server, adminClient, shopClient } = createTestEnvironment(
         mergeConfig(testConfig, {
@@ -91,9 +88,6 @@ describe('Elasticsearch plugin', () => {
     );
 
     beforeAll(async () => {
-        if (SKIP_TESTS) {
-            return;
-        }
         await server.init({
             initialData,
             productsCsvPath: path.join(__dirname, 'fixtures/e2e-products-full.csv'),
@@ -105,18 +99,9 @@ describe('Elasticsearch plugin', () => {
     }, TEST_SETUP_TIMEOUT_MS);
 
     afterAll(async () => {
-        if (SKIP_TESTS) {
-            return;
-        }
         await server.destroy();
     });
 
-    if (SKIP_TESTS) {
-        it.only('skip ElasticsearchPlugin e2e tests', () => {
-            /**/
-        });
-    }
-
     function doAdminSearchQuery(input: SearchInput) {
         return adminClient.query<SearchProductsAdmin.Query, SearchProductsAdmin.Variables>(SEARCH_PRODUCTS, {
             input,