Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id B1C5C200B73 for ; Mon, 29 Aug 2016 23:22:58 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id AE880160AB8; Mon, 29 Aug 2016 21:22:58 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C2C89160A89 for ; Mon, 29 Aug 2016 23:22:57 +0200 (CEST) Received: (qmail 65873 invoked by uid 500); 29 Aug 2016 21:22:56 -0000 Mailing-List: contact dev-help@impala.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@impala.incubator.apache.org Delivered-To: mailing list dev@impala.incubator.apache.org Received: (qmail 65862 invoked by uid 99); 29 Aug 2016 21:22:56 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Aug 2016 21:22:56 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id E63DEC24F0 for ; Mon, 29 Aug 2016 21:22:55 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.362 X-Spam-Level: X-Spam-Status: No, score=0.362 tagged_above=-999 required=6.31 tests=[RDNS_DYNAMIC=0.363, SPF_PASS=-0.001] autolearn=disabled Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id n07PW_8md_3x for ; Mon, 29 Aug 2016 21:22:53 +0000 (UTC) Received: from ip-10-146-233-104.ec2.internal (ec2-75-101-130-251.compute-1.amazonaws.com [75.101.130.251]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with ESMTPS id 2C71C5FAE3 for ; Mon, 29 Aug 2016 21:22:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by ip-10-146-233-104.ec2.internal (8.14.4/8.14.4) with ESMTP id u7TLMqID004108; Mon, 29 Aug 2016 21:22:52 GMT Message-Id: <201608292122.u7TLMqID004108@ip-10-146-233-104.ec2.internal> Date: Mon, 29 Aug 2016 21:22:52 +0000 From: "Michael Brown (Code Review)" To: Alex Behm , impala-cr@cloudera.com, dev@impala.incubator.apache.org Reply-To: mikeb@cloudera.com X-Gerrit-MessageType: comment Subject: =?UTF-8?Q?=5BImpala-ASF-CR=5D_IMPALA-3491=3A_Use_unique_database_fixture_in_test_ddl=2Epy=2E=0A?= X-Gerrit-Change-Id: Idf667dd5e960768879c019e2037cf48ad4e4241b X-Gerrit-ChangeURL: X-Gerrit-Commit: 41992b2edad42f7035f5ff9fb68377e54e5a4454 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-Disposition: inline User-Agent: Gerrit/2.12.2 archived-at: Mon, 29 Aug 2016 21:22:58 -0000 Michael Brown has posted comments on this change. Change subject: IMPALA-3491: Use unique database fixture in test_ddl.py. ...................................................................... Patch Set 1: (5 comments) Eyes began to glaze over at last 10% of test_ddl.py. Here's some other comments for now. http://gerrit.cloudera.org:8080/#/c/4155/1/testdata/workloads/functional-query/queries/QueryTest/alter-table.test File testdata/workloads/functional-query/queries/QueryTest/alter-table.test: PS1, Line 263: create external table t_part (i int) partitioned by (j int, s string) : location '$FILESYSTEM_PREFIX/test-warehouse/$DATABASE.db/t_part_tmp'; : alter table t_part add partition (j=cast(2-1 as int), s='2012'); : alter table t_part add if not exists partition (j=1, s='2012'); : alter table t_part add if not exists partition (j=1, s='2012/withslash'); : alter table t_part add partition (j=1, s=substring('foo2013bar', 4, 8)); Will the test framework adequately fail the test if one of these reports an error? It matters here, because unlike in some cases below, there's no SELECT at the end of this to implicitly verify they all worked. http://gerrit.cloudera.org:8080/#/c/4155/1/tests/metadata/test_ddl.py File tests/metadata/test_ddl.py: PS1, Line 234: assert "ddl_test_db" not in self.all_db_names() (I found this by searching for the removed members of TEST_DBS.) assert unique_database not in self.all_db_names() PS1, Line 255: unique_dabatase2 = unique_database + '2' : self._create_db(unique_dabatase2, sync=True) Clever, but it's unfortunate you have to do this. I'm not aware of pytest being able to use the same fixture twice (or more) in a test. Should we parametrize unique_database optionally to return a set of databases instead of just one? It seems like it could use your incrementing numerical suffix scheme and be fine. PS1, Line 328: create_fn_stmt = "create function {0}.f() returns int "\ : "location '{1}/libTestUdfs.so' symbol='NoArgs'"\ : .format(unique_database, WAREHOUSE) Tip for here and elsewhere: You can join strings across lines without \ if they are within parens. create_fn_stmt = ("create function {0}.f() returns int " "location '{1}/libTestUdfs.so' symbol='NoArgs'" .format(unique_database, WAREHOUSE)) http://gerrit.cloudera.org:8080/#/c/4155/1/tests/metadata/test_hms_integration.py File tests/metadata/test_hms_integration.py: Line 55: def test_sanity(self, vector): Not your changes, but in case you want to improve: This test doesn't have many asserts. I think it could be improved by replacing the self.client.execute() statements with self.execute_query_expect_success() statement. L70 for sure is never verified. -- To view, visit http://gerrit.cloudera.org:8080/4155 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idf667dd5e960768879c019e2037cf48ad4e4241b Gerrit-PatchSet: 1 Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-Owner: Alex Behm Gerrit-Reviewer: Michael Brown Gerrit-HasComments: Yes