All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick Venture <venture@google.com>
To: OpenBMC Maillist <openbmc@lists.ozlabs.org>,
	Brad Bishop <bradleyb@fuzziesquirrel.com>,
	Nancy Yuen <yuenn@google.com>
Cc: Emily Shaffer <emilyshaffer@google.com>
Subject: Re: First Stage of sdbusplus mocks
Date: Wed, 25 Apr 2018 15:12:04 -0700	[thread overview]
Message-ID: <CAO=notwjeWL5arb=j+eudQi9dFrSfyY6Rr1yE_0UeEjHQ3UtXg@mail.gmail.com> (raw)
In-Reply-To: <CAO=notzvDXGsri+oCHBWueU4LthtLtFnrhS8U0cdaa_r+An8Vg@mail.gmail.com>

Hi everyone,

Just about to head on a quick vacation.  Wanted to reach out and see
if I can get some more feedback on the progress made to introduce
testability through interfaces in sdbusplus.  I'd like to start
writing tests that use it, but can't so feedback would be appreciated.
And thanks to Emily and Lei who have been looking at it.

https://gerrit.openbmc-project.xyz/#/q/topic:gtest-gmock-ready-for-review+(status:open+OR+status:merged)

Patrick

On Tue, Apr 10, 2018 at 1:12 PM, Patrick Venture <venture@google.com> wrote:
> Everyone;
>
> Mocks:
> https://gerrit.openbmc-project.xyz/#/c/10046
>
> I've only implemented mocks for sdbusplus::bus::bus and
> sdbusplus::message::message (append() & read()) at this point.  Next
> I'll be tackling other parts of sdbusplus.
>
> Basically you can now verify the calls into sdbusplus, and the
> parameters passed to the messages.  Which is pretty valuable.
> However, nearly all of openbmc was written without unit-testing in
> mind, so few things have easy injection points.  This'll have to
> change over time as unit-tests become prolific inside openbmc.   In a
> previous email I talked about using interfaces in libraries for
> everything so that you could get mocks for free :D  That's the way we
> need to go, and so I'm going to do some basic library implementations
> with mocks and see how people like them (or dislike them).  The idea
> being, anything you're calling should be mocked so you can easily test
> the code. :)  Easily being key.
>
> Examples of usage:
> https://gerrit.openbmc-project.xyz/#/c/10048
>
> Please take a look and provide some feedback.  The sdbuplus mocks
> aren't compiling in the CI, but did compile locally (as obvious by my
> usage of them in a unit-test and a live image).  So I would appreciate
> some insight into what might be going on there.
>
> Next on my plate for attack:
> sdbusplus::server::interface::interface
> sdbusplus::server::manager::manager
> sdbusplus::server::object::details...
> sdbusplus::server::transaction...
>
> and seeing what openbmc daemon is easiest to rip apart into testable
> units, to provide more examples.  phosphor-pid-control doesn't compile
> with upstream, otherwise I'd start there as I'm familiar with the
> daemon and it was written in lots of pieces for testing.
>
> Regards,
> Patrick

      reply	other threads:[~2018-04-25 22:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-10 20:12 First Stage of sdbusplus mocks Patrick Venture
2018-04-25 22:12 ` Patrick Venture [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAO=notwjeWL5arb=j+eudQi9dFrSfyY6Rr1yE_0UeEjHQ3UtXg@mail.gmail.com' \
    --to=venture@google.com \
    --cc=bradleyb@fuzziesquirrel.com \
    --cc=emilyshaffer@google.com \
    --cc=openbmc@lists.ozlabs.org \
    --cc=yuenn@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.