From commits-return-19246-archive-asf-public=cust-asf.ponee.io@airflow.incubator.apache.org Mon Aug 27 17:33:04 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 66F8D180674 for ; Mon, 27 Aug 2018 17:33:04 +0200 (CEST) Received: (qmail 54401 invoked by uid 500); 27 Aug 2018 15:33:03 -0000 Mailing-List: contact commits-help@airflow.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airflow.incubator.apache.org Delivered-To: mailing list commits@airflow.incubator.apache.org Received: (qmail 54392 invoked by uid 99); 27 Aug 2018 15:33:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Aug 2018 15:33:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 2470A1800C5 for ; Mon, 27 Aug 2018 15:33:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.501 X-Spam-Level: X-Spam-Status: No, score=-109.501 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id TTJo225CbVKp for ; Mon, 27 Aug 2018 15:33:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 3A5E65F473 for ; Mon, 27 Aug 2018 15:33:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 6821EE0234 for ; Mon, 27 Aug 2018 15:33:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 219A423F98 for ; Mon, 27 Aug 2018 15:33:00 +0000 (UTC) Date: Mon, 27 Aug 2018 15:33:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: commits@airflow.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (AIRFLOW-2961) Speed up test_backfill_examples test MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/AIRFLOW-2961?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16593828#comment-16593828 ] ASF GitHub Bot commented on AIRFLOW-2961: ----------------------------------------- kaxil closed pull request #3811: [AIRFLOW-2961] Refactor tests.BackfillJobTest.test_backfill_examples test URL: https://github.com/apache/incubator-airflow/pull/3811 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/tests/jobs.py b/tests/jobs.py index fd3a96a4d8..f9c07b96c9 100644 --- a/tests/jobs.py +++ b/tests/jobs.py @@ -61,6 +61,7 @@ from airflow import configuration configuration.load_test_config() +logger = logging.getLogger(__name__) try: from unittest import mock @@ -194,23 +195,21 @@ def test_backfill_multi_dates(self): def test_backfill_examples(self): """ Test backfilling example dags - """ - # some DAGs really are just examples... but try to make them work! - skip_dags = [ - 'example_http_operator', - 'example_twitter_dag', - 'example_trigger_target_dag', - 'example_trigger_controller_dag', # tested above - 'test_utils', # sleeps forever - 'example_kubernetes_executor', # requires kubernetes cluster - 'example_kubernetes_operator' # requires kubernetes cluster - ] + Try to backfill some of the example dags. Be carefull, not all dags are suitable + for doing this. For example, a dag that sleeps forever, or does not have a + schedule won't work here since you simply can't backfill them. + """ + include_dags = { + 'example_branch_operator', + 'example_bash_operator', + 'example_skip_dag', + 'latest_only' + } - logger = logging.getLogger('BackfillJobTest.test_backfill_examples') dags = [ dag for dag in self.dagbag.dags.values() - if 'example_dags' in dag.full_filepath and dag.dag_id not in skip_dags + if 'example_dags' in dag.full_filepath and dag.dag_id in include_dags ] for dag in dags: @@ -218,6 +217,11 @@ def test_backfill_examples(self): start_date=DEFAULT_DATE, end_date=DEFAULT_DATE) + # Make sure that we have the dags that we want to test available + # in the example_dags folder, if this assertion fails, one of the + # dags in the include_dags array isn't available anymore + self.assertEqual(len(include_dags), len(dags)) + for i, dag in enumerate(sorted(dags, key=lambda d: d.dag_id)): logger.info('*** Running example DAG #{}: {}'.format(i, dag.dag_id)) job = BackfillJob( ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org > Speed up test_backfill_examples test > ------------------------------------ > > Key: AIRFLOW-2961 > URL: https://issues.apache.org/jira/browse/AIRFLOW-2961 > Project: Apache Airflow > Issue Type: Bug > Reporter: Fokko Driesprong > Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)