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: First Stage of sdbusplus mocks
Date: Tue, 10 Apr 2018 13:12:16 -0700	[thread overview]
Message-ID: <CAO=notzvDXGsri+oCHBWueU4LthtLtFnrhS8U0cdaa_r+An8Vg@mail.gmail.com> (raw)

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-10 20:12 UTC|newest]

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

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=notzvDXGsri+oCHBWueU4LthtLtFnrhS8U0cdaa_r+An8Vg@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.