All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick Williams <patrick@stwcx.xyz>
To: Johnathan Mantey <johnathanx.mantey@intel.com>
Cc: OpenBMC List <openbmc@lists.ozlabs.org>
Subject: Re: Upcoming enhancements to `run-unit-test-docker`
Date: Fri, 12 Feb 2021 12:21:35 -0600	[thread overview]
Message-ID: <YCbHLxM5XaRcIJ8L@heinlein> (raw)
In-Reply-To: <80c3bd03-7cdf-a22a-b5cb-ee05915ab04c@intel.com>

[-- Attachment #1: Type: text/plain, Size: 3317 bytes --]

On Fri, Feb 12, 2021 at 08:22:02AM -0800, Johnathan Mantey wrote:
> On 2/11/21 4:28 PM, Patrick Williams wrote:
> I tried using this script a day or two ago. I needed to fix some unit 
> tests for a commit I pushed earlier this month. I had used the script in 
> the past and couldn't remember how to use it.
> 
> A year ago I had to fix some unit tests, and I had to get Docker, and 
> this test script configured. I have long since forgotten how I got the 
> system setup, so I went back to try and run the unit tests I had fully 
> configured and running from a year ago. In spite of having a fully 
> configured environment I could not figure out how to run the tests any 
> longer.
> 
> I decided to find the run-unit-test-docker.sh contents on the github 
> repos, to see if I could read prepared content for how to configure, and 
> run the unit test script. The readme.md is one line. The comments in the 
> shell script assume you know what each settable parameter does, and how 
> it is to be assigned.

Andrew Jeffery pointed out this document last night:
    https://github.com/openbmc/docs/blob/master/testing/local-ci-build.md

I have all of my repositories cloned into a single subdirectory, which
makes using this script much easier than if they were spread out.
You'll see the doc above references as `/path/to/ci_test_area` and doing
additional clones / git-worktrees, but if you just keep everything
cloned in one sub-directory that *is* the ci_test_area / WORKSPACE.

I typically run this little helper script from a repo I want to test:

$ which lf-ut
lf-ut () {
	REPO="$(git rev-parse --show-toplevel)"
	UT_PATH="$(wd path obmcsrc)/openbmc-build-scripts"
	UNIT_TEST_PKG="$(basename $REPO)" WORKSPACE="$(dirname $REPO)" "$UT_PATH/run-unit-test-docker.sh"
}
$ EXTRA_UNIT_TEST_ARGS="--noformat" lf-ut

I use zsh, so ... Anyhow, `wd path obmcsrc` is the path to my workspace
where all the code is extracted.

> I'm pretty sure I had 1:1 assistance from someone familiar with the test 
> configuration to get this to work. The effort involved is more than "get 
> docker, run script".
> 
> I request that someone familiar with the configuration and operation of 
> this script please provide information about how to get the environment 
> configured, and some example use cases for running the system. One place 
> in particular that I found difficult/impossible was to run a test on 
> code that required changes in other repositories. For example, if 
> phosphor-network needed changes that are provided by 
> phosphor-dbus-interfaces how would you configure the test run to be 
> successful?

Right now there isn't a way to test two repositories together.  This is
an aspect I mentioned of wanting to improve (at least for Gerrit).  Your
only option right now is:

   1. Push your phosphor-dbus-interfaces change to Gerrit.
   2. Edit `scripts/build-unit-test-docker` and insert a "rev" keyword
      under "phosphor-dbus-interfaces" with your git commit hash from
      step 1 (this should hopefully be obvious when you look at the
      script).
   3. Run something like `lf-ut` above from inside phosphor-network.

** Step #2 assumes you're running my new versions of the script **

Hope this helps!

-- 
Patrick Williams

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2021-02-12 18:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-12  0:28 Upcoming enhancements to `run-unit-test-docker` Patrick Williams
2021-02-12 16:22 ` Johnathan Mantey
2021-02-12 18:21   ` Patrick Williams [this message]
2021-02-16 14:13 ` Andrew Geissler
2021-02-18  6:30 ` [External] " Lei Yu

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=YCbHLxM5XaRcIJ8L@heinlein \
    --to=patrick@stwcx.xyz \
    --cc=johnathanx.mantey@intel.com \
    --cc=openbmc@lists.ozlabs.org \
    /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.