From issues-return-46274-archive-asf-public=cust-asf.ponee.io@mesos.apache.org Tue Jan 30 23:31:06 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id 64A8F18061A for ; Tue, 30 Jan 2018 23:31:06 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 548C7160C54; Tue, 30 Jan 2018 22:31: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 9B81D160C2A for ; Tue, 30 Jan 2018 23:31:05 +0100 (CET) Received: (qmail 18359 invoked by uid 500); 30 Jan 2018 22:31:04 -0000 Mailing-List: contact issues-help@mesos.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@mesos.apache.org Delivered-To: mailing list issues@mesos.apache.org Received: (qmail 18350 invoked by uid 99); 30 Jan 2018 22:31:04 -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; Tue, 30 Jan 2018 22:31:04 +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 399DCD5865 for ; Tue, 30 Jan 2018 22:31:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.511 X-Spam-Level: X-Spam-Status: No, score=-109.511 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, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id Mo2cakz1Sjl2 for ; Tue, 30 Jan 2018 22:31:03 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id DAA195F2C4 for ; Tue, 30 Jan 2018 22:31:02 +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 A3CA0E0217 for ; Tue, 30 Jan 2018 22:31:01 +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 75B4124102 for ; Tue, 30 Jan 2018 22:31:00 +0000 (UTC) Date: Tue, 30 Jan 2018 22:31:00 +0000 (UTC) From: "Benjamin Mahler (JIRA)" To: issues@mesos.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (MESOS-8094) Leverage helper functions to reduce boilerplate code related to v1 API. 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/MESOS-8094?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16345923#comment-16345923 ] Benjamin Mahler commented on MESOS-8094: ---------------------------------------- I would love to see an investment in better abstractions over more helpers, I filed MESOS-8511 for one example of how we could simplify a lot of tests. > Leverage helper functions to reduce boilerplate code related to v1 API. > ----------------------------------------------------------------------- > > Key: MESOS-8094 > URL: https://issues.apache.org/jira/browse/MESOS-8094 > Project: Mesos > Issue Type: Improvement > Components: test > Reporter: Alexander Rukletsov > Priority: Major > Labels: mesosphere, newbie > > https://reviews.apache.org/r/61982/ created an example how test code related to scheduler v1 API can be simplified with appropriate usage of helper function. For example, instead of crafting a subscribe call manually like in > {noformat} > { > v1::scheduler::Call call; > call.set_type(v1::scheduler::Call::SUBSCRIBE); > v1::scheduler::Call::Subscribe* subscribe = call.mutable_subscribe(); > subscribe->mutable_framework_info()->CopyFrom(v1::DEFAULT_FRAMEWORK_INFO); > mesos.send(call); > } > {noformat} > a helper function {{v1::scheduler::SendSubscribe()}} shall be invoked. > To find all occurrences that shall be fixed, one can grep the test codebase for {{call.set_type}}. At the moment I see the following files: > {noformat} > api_tests.cpp > check_tests.cpp > http_fault_tolerant_tests.cpp > master_maintenance_tests.cpp > master_tests.cpp > scheduler_tests.cpp > slave_authorization_tests.cpp > slave_recovery_tests.cpp > slave_tests.cpp > {noformat} > The same applies for sending status update acks; {{v1::scheduler::SendAcknowledge()}} action shall be used instead of manually crafting acks. -- This message was sent by Atlassian JIRA (v7.6.3#76005)