Commit Graph

7495 Commits

Author SHA1 Message Date
Cole Robinson bf1fcdcd12 urldetect: Remove 'content' parsing for opensuse tumbleweed
tumbleweed uses treeinfo now, so this path shouldn't be hit in
the wild anymore

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-18 19:28:04 -04:00
Cole Robinson 25b3113ba9 osdict: Drop post_install driver bits
osinfo library doesn't return data for these with the fedora 32
version, so it's hard to get coverage testing. Since we aren't
even using this code yet anyways, let's remove it until it is needed

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-18 19:28:04 -04:00
Cole Robinson 2170efc9a5 virtinst: Unify test code paths when run as root
CI runs the code as root by default, fix up some of the differences

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-18 19:28:04 -04:00
Cole Robinson aa89a48371 xmlutil: Centralize all 'programming error' exceptions
Raise them directly instead of adding the hard to read conditional
into the function

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-17 19:08:27 -04:00
Cole Robinson 380a44318a virtinst: Centralize in_testsuite checking
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-17 19:08:27 -04:00
Cole Robinson 44aa0b093e tests: cli: Clean up global module data a bit
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-17 16:47:58 -04:00
Cole Robinson ef0c36f0b0 tests: Speed up pytest collection a bit
Point it at tests/ and have it exclude search data/ dirs

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-17 16:47:58 -04:00
Cole Robinson f6c6f033d9 tests: Move checkprops.py magic skipping to pytest
We want to skip these tests if previous tests failed or were skipped,
but current impl depends on unittest specifics. Move it to pytest

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-17 16:47:58 -04:00
Cole Robinson 61a947d667 tests: Rename clistate -> TESTCONFIG
Makes it more clear it's a constant class, and its purpose

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-17 16:38:40 -04:00
Cole Robinson c01fbcc885 Rename pylintrc -> .pylintrc
Plain pylint calls pick that up as well

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-17 16:00:32 -04:00
Cole Robinson 62e7f1c521 spec: Move virt-manager.spec.in -> virt-manager.spec
Drop the VERSION templating. Tools today like packit and tito
work best when a working .spec file exists. The extra burden is
we need to update the version at release time, but that's no
big deal

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-17 16:00:32 -04:00
Cole Robinson b9dfd92bf0 setup: Force 'rpm' to output to the git dir
And modernize it to use subprocess and report error output

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-17 16:00:32 -04:00
Cole Robinson 4226a4c1d5 setup: Kill old test_* command infrastructure
pytest invocations are now preferred. Leave plain `./setup.py test`
as a stub that errors and points to pytest.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-17 16:00:32 -04:00
Cole Robinson ded69ee2ce CONTRIBUTING: Point to new `pytest` test steps
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-17 16:00:32 -04:00
Cole Robinson 92844eb2f8 tests: Wire pytest --log-level=debug to cli tests debug infrastructure
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-17 16:00:06 -04:00
Cole Robinson f086c75560 tests: Add pytest --regenerate-output
Duplicate of ./setup.py test --regenerate-output

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-17 14:57:03 -04:00
Cole Robinson 0aa030245c tests: Move `setup.py test_urls` suboptions to pytest
Adds --urls-skip-libosinfo, --urls-force-libosinfo, --urls-iso-only,
    and --urls-url-only

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-17 14:57:03 -04:00
Cole Robinson b90820c17d setup.cfg: Disable warnings with pytest
dogtail, gtk are quite noisy

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-17 14:57:03 -04:00
Cole Robinson e9b3ed509f tests: Add pytest conftest.py
Makes 'pytest' and 'pytest --cov' work for the standard tests.
uitests run with `pytest --uitests --cov=virtManager`.
test_urls.py, test_dist.py, test_inject.py need to be invoked like

pytest $PATH

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-17 14:57:03 -04:00
Cole Robinson 4f15e2d6eb cli: Fake fdopen to work around argcomplete bug with pytest
argcomplete will uncontionally try to take over fd=9 which causes
problems with pytest capturing

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-17 14:57:03 -04:00
Cole Robinson 247170c066 tests: cli: Make test names easier to match with pytest
pytest doesn't like './' in the name

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-17 13:03:54 -04:00
Petr Benes 2862b68292 cli: Add --graphics websocket= support
Add a --graphics websocket option to configure VNC WebSocket port
as described in https://libvirt.org/formatdomain.html#elementsGraphics

Reviewed-by: Cole Robinson <crobinso@redhat.com>
2020-07-16 14:52:03 -04:00
Pino Toscano 8a085bfea1 i18n: translate UI string
A visible UI string must be translatable.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-15 10:22:26 -04:00
Pino Toscano 2760b20c84 i18n: create single strings for texts/messages
Use single strings with proper placeholders for texts, so there is no
need to join together bits of translated texts.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-15 10:22:26 -04:00
Pino Toscano 392caac8b4 i18n: add missing placeholder name in string
Fixes commit 71f034d6b6.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-15 10:22:26 -04:00
Cole Robinson 49cf5256d7 pylint: Ignore ngettext builtin
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-14 12:06:20 -04:00
Cole Robinson 3a6ec2fe09 CI: Add note that translations.yml runs on default branch
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-14 11:58:41 -04:00
Cole Robinson b1f6f64e54 CI: Rename ci.yml -> translations.yml
If we add CI it will be in a different workflow

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-14 11:58:41 -04:00
Pino Toscano 971dbaead0 ci: extract messages periodically
Switch the updates of the translation catalog from after every push to
every 2 days at 6am UTC.

Considering that the update-translation-pot will commit the catalog only
if changed, and that there are usually not that many changes upstream,
it is simpler to update the translation catalog only every couple of
days.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-14 11:58:41 -04:00
Pino Toscano 8ec6ccbddb ci: commit the catalog only if changed
Compare the newly generated catalog with the old one: if it actually
changed (i.e. there are changes beside the creation date), then push it
to the 'translations' branch.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-14 11:58:41 -04:00
Pino Toscano 22fe62be34 i18n: fold placeholder into string
There is not really anything to leave out of the string, simply
translate it as a whole.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-14 11:24:14 -04:00
Pino Toscano 494a453ee8 i18n: use single string for error/warning
Avoids few string puzzles.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-14 11:24:14 -04:00
Pino Toscano 6f30ab2437 i18n: use plural forms where needed
Use plural forms for strings that depend on a runtime value, like a
count. This way they will get the proper string for the actual value.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-14 11:24:14 -04:00
Pino Toscano cd15c72dfb i18n: fix string puzzle in waiting time string
Use two different strings in case there is a timeout and there is none.

Also add a "the" article to make it slightly better.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-14 11:24:14 -04:00
Pino Toscano 6a28de0f22 i18n: globally install also the ngettext function
It will be used to translate strings with plural forms.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-14 11:24:14 -04:00
Pino Toscano 8872e1e962 i18n: show localized accelerators in Send key menu
Turn the menu labels into GTK accelerator strings, so we can parse them
to convert them into a proper user representation.

There is a small behaviour change: the menu items do not have mnemonics
anymore by default.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-14 11:24:14 -04:00
Pino Toscano 353351458a i18n: fix Python format string
Fixes commit fec9f0b136.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-14 11:24:14 -04:00
Pino Toscano 36b3f9bee1 i18n: further improve label for controller
It seems that the index is optional, so use a proper string for this
case.

Fixes commit 00fa636682 in this file.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-14 11:24:14 -04:00
Pino Toscano bceeb23967 i18n: do not translate regexp
There is no point to translate an internal regular expression; worse,
a wrong translation can break the regular expression.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-14 11:23:57 -04:00
Pino Toscano 15a2354559 i18n: use single strings for connection/uri
Create single strings for connection/uri hints & tooltips, so it is
easier to translate them, and there are not glued like puzzles.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-14 11:23:57 -04:00
Pino Toscano 6a39f2bb8b i18n: use single strings for network list in clone dialog
Create single strings for the networks in the clone dialog, including
all the available information at once instead of join pieces together.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-14 11:23:57 -04:00
Pino Toscano 71f034d6b6 i18n: fix string puzzles in error messages
Do not split the error messages and the error details, but rather use a
single string with proper placeholders. This avoids string puzzles.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-14 11:23:57 -04:00
Pino Toscano ed836c7138 i18n: avoid string puzzle
Create the complete sentence as single message, instead of joining an
existing message with few words more.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-14 11:23:57 -04:00
Pino Toscano 523497085a i18n: fully translate "running console" messages
Create and pass the whole strings to the internal _run_console()
function: this way there is no need to second guess what the
%(console_type) placeholder is, and the types are actually translatable.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-14 11:23:57 -04:00
Pino Toscano e300dd5da8 i18n: improve labels for disk
Use whole strings for the labels of disks, including the bus (if
available), and the index.

There are still generic fallbacks for the disk types not explicitly
handled.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-14 11:23:57 -04:00
Pino Toscano 9c7df6a7cd i18n: translate "device on address" string
Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-14 11:23:57 -04:00
Cole Robinson 00fa636682 tests: uitests: Fix after string changes
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-13 15:37:00 -04:00
Pino Toscano 7b46ee1947 i18n: improve label for floppy
Shortcut all the checks, and directly return the whole string (index
included) to show for floppies.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-13 15:37:00 -04:00
Pino Toscano 664197bcc7 i18n: improve label for filesystem
Use a single string with a placeholder for the path to avoid a string
puzzle.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-13 15:37:00 -04:00
Pino Toscano 5609a7f083 i18n: improve vmmAddHardware.disk_pretty_bus
Use a static mapping of translated strings, instead of manipulating the
string.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-13 15:37:00 -04:00