openbmc.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Sunitha Harish <sunithaharish04@gmail.com>
To: openbmc@lists.ozlabs.org
Cc: deepak.kodihalli.83@gmail.com, edtanous@google.com,
	bradleyb@fuzziesquirrel.com, gmills@us.ibm.com,
	geissonator@yahoo.com, ratagupt@linux.vnet.ibm.com
Subject: UnitTest using the /tmp file system
Date: Sun, 21 Mar 2021 09:30:30 +0530	[thread overview]
Message-ID: <158971a4-119a-eeb4-bf83-72ed17e29d9f@gmail.com> (raw)

Hi,

This is regarding the unit tests in various repos under openbmc like: 
phosphor-bmc-code-management, phosphor-logging, phosphor-networkd, pldm 
etc . I have seen the testcases using the /tmp filesystem to create the 
directories/files when the UT is run.

I followed the similar way of writing the UT in one of my commits 
https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/37352 .  As per 
the review comments in this commit, using the /tmp file system for UT is 
anti-pattern, and this needs to be changed by mocking the same. I agree 
that this is a valid thing to do.

Now this email is to discuss why this was originally done? Can the 
community come-up with a generalized solution for this ?

Thanks & regards,
Sunitha





             reply	other threads:[~2021-03-21  4:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-21  4:00 Sunitha Harish [this message]
2021-03-23  5:44 ` UnitTest using the /tmp file system Sunitha Harish
2021-03-23 15:03   ` Joseph Reynolds
2021-03-24  3:12     ` Lei Yu
2021-03-24  5:07       ` Sunitha Harish
2021-03-27 14:03 ` Patrick Williams
2021-03-29  4:29   ` Sunitha Harish

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=158971a4-119a-eeb4-bf83-72ed17e29d9f@gmail.com \
    --to=sunithaharish04@gmail.com \
    --cc=bradleyb@fuzziesquirrel.com \
    --cc=deepak.kodihalli.83@gmail.com \
    --cc=edtanous@google.com \
    --cc=geissonator@yahoo.com \
    --cc=gmills@us.ibm.com \
    --cc=openbmc@lists.ozlabs.org \
    --cc=ratagupt@linux.vnet.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).