All of lore.kernel.org
 help / color / mirror / Atom feed
* iotests and python dependencies
@ 2022-05-04 19:38 John Snow
  2022-05-05  8:09 ` Daniel P. Berrangé
  2022-05-05  8:51 ` Kevin Wolf
  0 siblings, 2 replies; 17+ messages in thread
From: John Snow @ 2022-05-04 19:38 UTC (permalink / raw)
  To: Qemu-block
  Cc: qemu-devel, Kevin Wolf, Hanna Reitz,
	Vladimir Sementsov-Ogievskiy, Paolo Bonzini, Cleber Rosa

Howdy!

So, I want to finally delete python/qemu/qmp from qemu.git, and this
creates a small problem -- namely, iotests needs access to it in order
to run the python-based tests.

What I think needs to happen is that we create a virtual environment
that installs python/qemu/. The reason this cannot be done with
PYTHONPATH alone anymore is because the qmp package itself won't be
there anymore, we need an installer like `pip` to actually fetch it
for us and put it somewhere. (i.e., we need to process the
dependencies of python/qemu now and can't treat it as a pre-installed
location.)

Avocado tests are already creating a venv for the purposes of
installing and running Avocado. We can amend e.g. "../../python" to
tests/requirements.txt and the Avocado environment is A-OK good-to-go.
The Makefile magic for avocado tests creates a venv-per-build. It
seems to work well enough. One thing to note here is that the
supported invocation for avocado tests is only through the Makefile,
which handles creating and entering the venv to make the command
seamless.

iotests, however, manages its own execution environment with
testenv.py, and we support running iotests from outside of the
Makefile, for example by going to $build/tests/qemu-iotests and
running ./check.

Now ... I could update testenv.py to be smart enough to create and
enter a python venv, and have even prototyped this. It seems to work
pretty well! This approach seemed like the least invasive to how
iotests are expected to be run and used. But a downside with this
approach is that now avocado tests and iotests are each managing their
own python venv. Worse, vm-tests and device-crash-test are still
unhandled entirely.

I'd like to find a solution where I create a unified python testing
venv tied to the build shared by avocado, iotests, vm-tests and
device-crash-test. I'm not completely sure how exactly I'll manage
that right now, but I wanted to throw this out there in case there are
some requirements I might be overlooking.

I think vm-tests and avocado-tests can both have a venv created for
them and activated before the test runs. device-crash-test I believe
will need a script change in the gitlab ci yaml. iotests is somewhat
unique in that it needs to run both by manual invocation and from
makefile invocations. If I want a shared VM between all of these, I'll
need to isolate the create-and-enter-venv logic somewhere where it can
be shared both inside and outside of a Makefile.

I'll see what I can cook up, but if you have any concerns or Cool
Ideas, lemme know. I want to make sure this is as painless as I can
think to make it.

Thanks,
--js



^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2022-05-10 17:44 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-04 19:38 iotests and python dependencies John Snow
2022-05-05  8:09 ` Daniel P. Berrangé
2022-05-05 12:08   ` John Snow
2022-05-05 12:33     ` Daniel P. Berrangé
2022-05-05 13:10       ` John Snow
2022-05-05 13:15         ` Paolo Bonzini
2022-05-05 14:13           ` John Snow
2022-05-05 15:50             ` Paolo Bonzini
2022-05-05 15:57               ` Daniel P. Berrangé
2022-05-08 14:23                 ` Paolo Bonzini
2022-05-05  8:51 ` Kevin Wolf
2022-05-05  9:28   ` Paolo Bonzini
2022-05-05 10:59     ` Kevin Wolf
2022-05-05 12:24       ` Paolo Bonzini
2022-05-05 12:39         ` Kevin Wolf
2022-05-10 17:40     ` John Snow
2022-05-05 11:55   ` John Snow

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.