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 EFC27200D0F for ; Fri, 29 Sep 2017 22:55:06 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id EE60B1609D1; Fri, 29 Sep 2017 20:55:06 +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 405E91609BC for ; Fri, 29 Sep 2017 22:55:06 +0200 (CEST) Received: (qmail 43802 invoked by uid 500); 29 Sep 2017 20:55:03 -0000 Mailing-List: contact common-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-dev@hadoop.apache.org Received: (qmail 43729 invoked by uid 99); 29 Sep 2017 20:55:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Sep 2017 20:55:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 1252A1A4318 for ; Fri, 29 Sep 2017 20:55:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.379 X-Spam-Level: ** X-Spam-Status: No, score=2.379 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=cloudera.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 4izvH_2npzhP for ; Fri, 29 Sep 2017 20:55:01 +0000 (UTC) Received: from mail-wm0-f45.google.com (mail-wm0-f45.google.com [74.125.82.45]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 072415F295 for ; Fri, 29 Sep 2017 20:55:01 +0000 (UTC) Received: by mail-wm0-f45.google.com with SMTP id u138so1564365wmu.4 for ; Fri, 29 Sep 2017 13:55:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudera.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=6l081jex+UhLTVpUVWZrXljaNbYQRq4NP49SG9gP4pA=; b=G0tL0Y6ptLTVnwWYK6Z1y8/GeD1Z6X4fJQouQ/SiHrPUcXolAhz1JWXZw98VtJNZ9Q lbUB7CC5fL094G53ar/yLV3tSk4kFA+T/dWb+PiznJwNLXw+Yb5XFTCHJ2CltHlnyf/l cqghzPUMGG0UarLnLq4vtwc0FilBMfhJ3X1+tafsmN3z5QF0N+RIX3T25A7Y+8Em+lMD Ulc8oXTFiSGD0lkEXU5FhJcgiA1cxDjcUOmHdBwwILUHkAdmFfQWycs/JyWm5ZmqQ49b W13ihK8Rfwxi3jizfoS8Gnv3rhjb+GREjg0x+uyNTgI1XOF5zi1omuk9FQWJSplPBySu f50A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=6l081jex+UhLTVpUVWZrXljaNbYQRq4NP49SG9gP4pA=; b=cnEUzWT69n+HlgXqhV/75FbUOkOcZlfmnL/rIA7/HFnYr0ofNkCEdOY14R/Ps4Jdpf /AIneZIxVpRDScc4f2l8kI5USDKL8UBCWpLkPTkgHIPigy56pXOaf+ixtQV2V6GHZTmy CCpuDprPlMQEGKRYFNpAKVWdHXxxGVXqszaQs6FqtLAwHesE5xcpJwMoFAkRwkQrFj70 5gh2e8DZe9kDWZ2rwddvIjdnMfKFjlnhcepwYNW0DprYggvjxarxvbboxAB4CkW+0+VR rtZsPw+IqnedgTVZwfUdmw33EE0cwSQM8PPb0F8qiwqHLLpSQCBn7PNgsn/Q2GaDOPHm hNCg== X-Gm-Message-State: AHPjjUhIuxiHCzpVy371urJHQpMAptMnckig6m5/lE0GfwdxR4xHcAcP W3Vz7uc4dfJLxg+ZhNO68ehMhbAHEgKnvA1/lNm64A== X-Google-Smtp-Source: AOwi7QCvE/0PrIcZwXF1QADc12qSCBfbazvRWmLo6nJwdJqiHw36MsEe39V4lJnOFIxmwsPcOK8e3rtHHNWzmuLJAdo= X-Received: by 10.80.177.249 with SMTP id n54mr11187402edd.247.1506718500575; Fri, 29 Sep 2017 13:55:00 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.240.196 with HTTP; Fri, 29 Sep 2017 13:54:39 -0700 (PDT) In-Reply-To: References: From: Andrew Wang Date: Fri, 29 Sep 2017 13:54:39 -0700 Message-ID: Subject: Re: [DISCUSS] HADOOP-9122 Add power mock library for writing better unit tests To: Chris Douglas Cc: Eric Yang , "common-dev@hadoop.apache.org" Content-Type: multipart/alternative; boundary="f403045c40a0010873055a5a3d0b" archived-at: Fri, 29 Sep 2017 20:55:07 -0000 --f403045c40a0010873055a5a3d0b Content-Type: text/plain; charset="UTF-8" Making code testable is about a lot more than your mocking library. In HDFS, the NameNode is very monolithic, so it's hard to instantiate little pieces of functionality in isolation and mock things out. I have my doubts that Powermock will help with this unless someone's willing to invest in significant refactoring effort of our existing code and unit test suites. I could see an argument of this being useful for new code being developed, but like Chris, I'd like to see an example of where Mockito falls short, and what additional capabilities Powermock brings to the table. Best, Andrew On Fri, Sep 29, 2017 at 10:38 AM, Chris Douglas wrote: > Eric- > > Can you explain how Powermock differs from/augments Mockito, why we > should adopt it, and maybe an example of an existing test that could > be improved using this library? -C > > On Fri, Sep 29, 2017 at 10:12 AM, Eric Yang wrote: > > Hi Hadoop-dev, > > > > Long time ago, Hadoop community decided to put Powermock on hold for > unit tests. Both mockito and powermock has evolved a lot in the past 5 > years. There are mature versions of both software, and there are > compatibility charts to indicate which versions can work together. Hadoop > has grown a lot in the last 5 years. It becomes apparent that without > ability to instrument lower level classes to contain unit test scope. Many > tests are written to simulate integration test in order to perform unit > tests. The result is slow performance on unit tests, and some parts are > not testable strictly in unit test case. This discussion is to revisit the > decision, and see if we would embrace Powermock and allow HADOOP-9122 to be > implemented. Feel free to comment on HADOOP-9122 and this thread to > revisit this issue. > > > > Thank you for your time. > > > > Regards, > > Eric > > --------------------------------------------------------------------- > To unsubscribe, e-mail: common-dev-unsubscribe@hadoop.apache.org > For additional commands, e-mail: common-dev-help@hadoop.apache.org > > --f403045c40a0010873055a5a3d0b--