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 7C33A200D29 for ; Thu, 12 Oct 2017 01:03:31 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 7AEE6160BEF; Wed, 11 Oct 2017 23:03:31 +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 BFCC9160BE7 for ; Thu, 12 Oct 2017 01:03:30 +0200 (CEST) Received: (qmail 48969 invoked by uid 500); 11 Oct 2017 23:03:29 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 48868 invoked by uid 99); 11 Oct 2017 23:03:29 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Oct 2017 23:03:29 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 8BE16DFB0E; Wed, 11 Oct 2017 23:03:28 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jaimin@apache.org To: commits@ambari.apache.org Date: Wed, 11 Oct 2017 23:03:31 -0000 Message-Id: <303ef6ae289b47f7b83f535a3c8ac2cc@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [04/50] [abbrv] ambari git commit: AMBARI-22161. Unable to ignore service check failures during Upgrade (alexantonenko) archived-at: Wed, 11 Oct 2017 23:03:31 -0000 AMBARI-22161. Unable to ignore service check failures during Upgrade (alexantonenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a9d26986 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a9d26986 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a9d26986 Branch: refs/heads/branch-feature-AMBARI-14714-ui Commit: a9d26986d615cee43de6bddca12fd0a23b6526b8 Parents: 388cb41 Author: Alex Antonenko Authored: Fri Oct 6 17:10:48 2017 +0300 Committer: Alex Antonenko Committed: Fri Oct 6 17:10:48 2017 +0300 ---------------------------------------------------------------------- .../admin/stack_upgrade/upgrade_wizard_view.js | 2 +- .../stack_upgrade/upgrade_wizard_view_test.js | 28 +++++++++++++++----- 2 files changed, 23 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/a9d26986/ambari-web/app/views/main/admin/stack_upgrade/upgrade_wizard_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_wizard_view.js b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_wizard_view.js index e1689c2..87e2adf 100644 --- a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_wizard_view.js +++ b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_wizard_view.js @@ -126,7 +126,7 @@ App.upgradeWizardView = Em.View.extend({ var associatedVersion = this.get('controller.upgradeData.Upgrade.associated_version'); var version = associatedVersion && App.RepositoryVersion.find().findProperty('repositoryVersion', associatedVersion); var isPatchOrMaint = version && ( version.get('isPatch') || version.get('isMaint') ); - return failedItem && failedItem.get('skippable') && !isPatchOrMaint; + return failedItem && failedItem.get('skippable') && !(this.get('isFinalizeItem') && isPatchOrMaint); }.property('failedItem'), /** http://git-wip-us.apache.org/repos/asf/ambari/blob/a9d26986/ambari-web/test/views/main/admin/stack_upgrade/upgrade_wizard_view_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/views/main/admin/stack_upgrade/upgrade_wizard_view_test.js b/ambari-web/test/views/main/admin/stack_upgrade/upgrade_wizard_view_test.js index 0107975..a739838 100644 --- a/ambari-web/test/views/main/admin/stack_upgrade/upgrade_wizard_view_test.js +++ b/ambari-web/test/views/main/admin/stack_upgrade/upgrade_wizard_view_test.js @@ -919,20 +919,36 @@ describe('App.upgradeWizardView', function () { beforeEach(function () { view.reopen({'failedItem': Em.Object.create({skippable: true}) }); view.set('controller.upgradeData.Upgrade', {associated_version: '2.1.1'}); + var findResult = [Em.Object.create({repositoryVersion: '2.1.1', isPatch: true})]; + sinon.stub(App.RepositoryVersion, 'find', function(){ + return findResult; + }); + }); + + afterEach(function () { + App.RepositoryVersion.find.restore(); }) it("Should return true if can not find upgrade", function () { view.propertyDidChange('canSkipFailedItem'); - expect(view.get('canSkipFailedItem')).to.be.true + expect(view.get('canSkipFailedItem')).to.be.true; }); - it("Should return false if upgrade is patch or maint", function () { - var findResult = [Em.Object.create({repositoryVersion: '2.1.1', isPatch: true})]; - sinon.stub(App.RepositoryVersion, 'find', function(){ - return findResult; + it("Should return false if upgrade is patch or maint and item is final", function () { + view.reopen({ + isFinalizeItem: true }); view.propertyDidChange('canSkipFailedItem'); expect(view.get('canSkipFailedItem')).to.be.false; - App.RepositoryVersion.find.restore(); + }); + + it("Should return true if upgrade is patch or maint and item is not final", function () { + + view.reopen({ + isFinalizeItem: false + }); + view.propertyDidChange('canSkipFailedItem'); + + expect(view.get('canSkipFailedItem')).to.be.true; }); });