Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cockpit-ci: Update container to 2024-04-25 #20372

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .cockpit-ci/container
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ghcr.io/cockpit-project/tasks:2024-04-08
ghcr.io/cockpit-project/tasks:2024-04-25
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
set -eux

IMAGE="$(curl --fail https://raw.githubusercontent.com/${GITHUB_REPOSITORY}/${GITHUB_SHA}/.cockpit-ci/container)"
podman run --network=host --rm --interactive "${IMAGE}" sh -eux <<EOF
podman run --security-opt=seccomp=unconfined --network=host --rm --interactive "${IMAGE}" sh -eux <<EOF
export FORCE_COLOR=1
export TEST_BROWSER=firefox
export CFLAGS=-O2
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ module = [
"machine.*",
"task.*",
"testvm",
"PIL",

# run with bots checked out but its dependencies missing
"libvirt",
Expand Down
3 changes: 2 additions & 1 deletion src/cockpit/transports.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,8 @@ def preexec_fn() -> None:

super().__init__(loop, protocol, in_fd, out_fd)

self._get_watcher(loop).add_child_handler(self._process.pid, self._exited)
# https://github.com/python/typeshed/pull/11548
self._get_watcher(loop).add_child_handler(self._process.pid, self._exited) # type: ignore[arg-type]

def set_window_size(self, size: WindowSize) -> None:
assert self._pty_fd is not None
Expand Down
17 changes: 7 additions & 10 deletions test/common/testlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,7 @@
from lcov import write_lcov
from lib.constants import OSTREE_IMAGES
from machine import testvm

try:
from PIL import Image
except ImportError:
Image = None
from PIL import Image

_T = TypeVar('_T')
_FT = TypeVar("_FT", bound=Callable[..., Any])
Expand Down Expand Up @@ -1203,12 +1199,13 @@ def ignorable_coord(x: int, y: int) -> bool:
def ignorable_change(a: tuple[int, int, int], b: tuple[int, int, int]) -> bool:
return abs(a[0] - b[0]) <= 2 and abs(a[1] - b[1]) <= 2 and abs(a[2] - b[2]) <= 2

def img_eq(ref: Image, now: Image, delta: Image) -> bool:
def img_eq(ref: Image.Image, now: Image.Image, delta: Image.Image) -> bool:
# This is slow but exactly what we want.
# ImageMath might be able to speed this up.
data_ref = ref.load()
data_now = now.load()
data_delta = delta.load()
# no-untyped-call: see https://github.com/python-pillow/Pillow/issues/8029
data_ref = ref.load() # type: ignore[no-untyped-call]
data_now = now.load() # type: ignore[no-untyped-call]
data_delta = delta.load() # type: ignore[no-untyped-call]
result = True
count = 0
width, height = delta.size
Expand All @@ -1233,7 +1230,7 @@ def img_eq(ref: Image, now: Image, delta: Image) -> bool:
# Preserve alpha channel so that the 'now'
# image can be used as the new reference image
# without further changes
img_now.putalpha(img_ref.getchannel("A"))
img_now.putalpha(img_ref.getchannel("A")) # type: ignore[no-untyped-call]
img_now.save(filename)
attach(filename, move=True)
ref_filename_for_attach = base + "-reference.png"
Expand Down
Loading