From: Danilo Krummrich <dakr@kernel.org>
To: "Maíra Canal" <mcanal@igalia.com>
Cc: "Tvrtko Ursulin" <tvrtko.ursulin@igalia.com>,
"Philipp Stanner" <phasta@kernel.org>,
"Matthew Brost" <matthew.brost@intel.com>,
"Christian König" <ckoenig.leichtzumerken@gmail.com>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
"Pierre-Eric Pelloux-Prayer" <pierre-eric.pelloux-prayer@amd.com>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/sched/tests: Make timedout_job callback a better role model
Date: Mon, 16 Jun 2025 15:04:29 +0200 [thread overview]
Message-ID: <aFAWXTjuhYjMlAR9@pollux> (raw)
In-Reply-To: <723c98e2-cf75-4565-b78b-711b3022d44d@igalia.com>
On Mon, Jun 16, 2025 at 09:49:46AM -0300, Maíra Canal wrote:
> Hi Danilo,
>
> On 16/06/25 08:14, Danilo Krummrich wrote:
> > On Mon, Jun 16, 2025 at 11:57:47AM +0100, Tvrtko Ursulin wrote:
> > > Code looks fine, but currently nothing is broken and I disagree with the
> > > goal that the _mock_^1 components should be role models. The idea is to
> > > implement as little in the mock components as it is required to exercise the
> > > tested functionality.
> >
> > No, please consider the following.
> >
> > 1) When we write tests for common infrastructure we should be testing things
> > as close as possible to how we intend real code to use this infrastructure.
> > Relying on internals in creative ways is likely to underrun this testing.
>
> Regarding unit testing (and KUnit is a unit testing framework), the core
> principle is that individual components of the code should be tested in
> isolation to validate that they perform as expected.
>
> The "units" should be tested independently and we use those mocks to
> simulate dependencies, ensuring that the test focuses solely on the unit
> under scrutiny.
>
> If we introduce more things into the mock, we end up losing the
> isolation. The mock scheduler, from what I understand, is not suppose to
> be a reference design or even something close to a driver. It should
> remain just a mock, a minimal interface to test the scheduler's
> internals.
Nothing of what you say seems contradictive to what I say, no?
I'm just saying that while we're doing all this we can (and should) still try
to be as close as possible to how we intend real code to use the corresponding
APIs.
next prev parent reply other threads:[~2025-06-16 13:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-05 13:41 [PATCH] drm/sched/tests: Make timedout_job callback a better role model Philipp Stanner
2025-06-16 10:57 ` Tvrtko Ursulin
2025-06-16 11:14 ` Danilo Krummrich
2025-06-16 12:49 ` Maíra Canal
2025-06-16 12:56 ` Philipp Stanner
2025-06-16 13:04 ` Danilo Krummrich [this message]
2025-06-23 9:00 ` Philipp Stanner
2025-06-30 12:49 ` Danilo Krummrich
2025-07-01 13:37 ` Philipp Stanner
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=aFAWXTjuhYjMlAR9@pollux \
--to=dakr@kernel.org \
--cc=airlied@gmail.com \
--cc=ckoenig.leichtzumerken@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=matthew.brost@intel.com \
--cc=mcanal@igalia.com \
--cc=mripard@kernel.org \
--cc=phasta@kernel.org \
--cc=pierre-eric.pelloux-prayer@amd.com \
--cc=simona@ffwll.ch \
--cc=tvrtko.ursulin@igalia.com \
--cc=tzimmermann@suse.de \
/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