From: Kevin Wolf <kwolf@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Cc: Richard Henderson <richard.henderson@linaro.org>,
qemu-devel@nongnu.org, qemu-block@nongnu.org,
Fiona Ebner <f.ebner@proxmox.com>,
Hanna Reitz <hreitz@redhat.com>, John Snow <jsnow@redhat.com>
Subject: Re: [PULL 6/6] iotests: add backup-discard-source
Date: Tue, 30 Apr 2024 11:13:42 +0200 [thread overview]
Message-ID: <ZjC2RvxoyYc0KW0p@redhat.com> (raw)
In-Reply-To: <4c7cb398-7fb8-4c78-a9e2-aae46920a8b1@yandex-team.ru>
Am 29.04.2024 um 20:39 hat Vladimir Sementsov-Ogievskiy geschrieben:
> [Add John]
>
> On 29.04.24 17:18, Richard Henderson wrote:
> > On 4/29/24 04:51, Vladimir Sementsov-Ogievskiy wrote:
> > > Add test for a new backup option: discard-source.
> > >
> > > Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
> > > Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>
> > > Tested-by: Fiona Ebner <f.ebner@proxmox.com>
> > > Message-Id: <20240313152822.626493-6-vsementsov@yandex-team.ru>
> > > Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
> > > ---
> > > .../qemu-iotests/tests/backup-discard-source | 152 ++++++++++++++++++
> > > .../tests/backup-discard-source.out | 5 +
> > > 2 files changed, 157 insertions(+)
> > > create mode 100755 tests/qemu-iotests/tests/backup-discard-source
> > > create mode 100644 tests/qemu-iotests/tests/backup-discard-source.out
> >
> > This fails check-python-minreqs
> >
> > https://gitlab.com/qemu-project/qemu/-/jobs/6739551782
> >
> > It appears to be a pylint issue.
> >
> >
>
> tests/export-incoming-iothread:1:0: R0801: Similar lines in 2 files
> ==tests.backup-discard-source:[52:61]
> ==tests.copy-before-write:[54:63]
> 'file': {
> 'driver': iotests.imgfmt,
> 'file': {
> 'driver': 'file',
> 'filename': source_img,
> }
> },
> 'target': {
> 'driver': iotests.imgfmt, (duplicate-code)
>
>
>
> Hmm. I don't think, that something should be changed in code.
> splitting out part of this json object to a function? That's a test
> for QMP command, and it's good that we see the command as is in one
> place. I can swap some lines or rename variables to hack the linter,
> but I'd prefer not doing so:)
>
>
> For me that looks like a false-positive: yes it's a duplication, but
> it should better be duplication, than complicating raw json objects by
> reusing common parts.
>
>
> What to do? As described in 22305c2a081b8b6 "python: Reduce strictness
> of pylint's duplicate-code check", this check could be either be
> disabled completely, or we can increase min-similarity-lines config
> value.
>
> I'd just disable it completely. Any thoughts?
I think it would make sense to treat tests differently from real
production code. In tests/, some duplication is bound to happen and
trying to unify things across test cases (which would mean moving to
iotests.py) often doesn't make sense. On the other hand, in python/ we
would probably want to unify duplicated code.
Kevin
next prev parent reply other threads:[~2024-04-30 9:14 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-29 11:51 [PULL 0/6] Block jobs patches for 2024-04-29 Vladimir Sementsov-Ogievskiy
2024-04-29 11:51 ` [PULL 1/6] blockcommit: Reopen base image as RO after abort Vladimir Sementsov-Ogievskiy
2024-04-29 11:51 ` [PULL 2/6] block/copy-before-write: fix permission Vladimir Sementsov-Ogievskiy
2024-04-29 11:51 ` [PULL 3/6] block/copy-before-write: support unligned snapshot-discard Vladimir Sementsov-Ogievskiy
2024-04-29 11:51 ` [PULL 4/6] block/copy-before-write: create block_copy bitmap in filter node Vladimir Sementsov-Ogievskiy
2024-04-29 11:51 ` [PULL 5/6] qapi: blockdev-backup: add discard-source parameter Vladimir Sementsov-Ogievskiy
2024-04-29 11:51 ` [PULL 6/6] iotests: add backup-discard-source Vladimir Sementsov-Ogievskiy
2024-04-29 14:18 ` Richard Henderson
2024-04-29 18:39 ` Vladimir Sementsov-Ogievskiy
2024-04-30 9:13 ` Kevin Wolf [this message]
2024-04-30 9:22 ` Vladimir Sementsov-Ogievskiy
2024-04-29 11:53 ` [PULL 0/6] Block jobs patches for 2024-04-29 Vladimir Sementsov-Ogievskiy
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=ZjC2RvxoyYc0KW0p@redhat.com \
--to=kwolf@redhat.com \
--cc=f.ebner@proxmox.com \
--cc=hreitz@redhat.com \
--cc=jsnow@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=vsementsov@yandex-team.ru \
/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.