栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

在CircleCI上运行pytest-qt

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

在CircleCI上运行pytest-qt

我已经将容器拉到

circleci/python:3.6.8-stretch
本地,克隆了您的存储库并尝试执行测试,但是我可以重现该错误。

首先要做的是为Qt运行时启用调试模式,以便它输出一些有关错误的信息。这可以通过设置环境变量来完成

QT_DEBUG_PLUGINS

$ QT_DEBUG_PLUGINS=1 pytest -sv

现在可以立即清除运行测试的容器中缺少的内容。上面命令输出的摘录:

Got keys from plugin meta data ("xcb")QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/bin/platforms" ...**Cannot load library /home/circleci/.local/lib/python3.6/site-packages/PySide2/Qt/plugins/platforms/libqxcb.so: (libxkbcommon-x11.so.0: cannot open shared object file: No such file or directory)**QLibraryPrivate::loadPlugin failed on "/home/circleci/.local/lib/python3.6/site-packages/PySide2/Qt/plugins/platforms/libqxcb.so" : "Cannot load library /home/circleci/.local/lib/python3.6/site-packages/PySide2/Qt/plugins/platforms/libqxcb.so: (libxkbcommon-x11.so.0: cannot open shared object file: No such file or directory)"qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.Aborted (core dumped)

修复很容易-安装

libxkbcommon-x11-0
软件包:

$ sudo apt update && sudo apt install -y libxkbcommon-x11-0

将此行添加到CircleCI配置中(在测试作业之前的某个位置,例如在安装软件包依赖项的作业中),然后测试应该可以正常运行。

除此之外,

QT_DEBUG_PLUGINS=1
全局设置很有意义,这样您以后就可以对最终的Qt运行时失败做出反应。

找不到xdpyinfo,无法检查X启动!请安装xdpyinfo!

如果要消除该警告,请安装

x11-utils

$ sudo apt install x11-utils


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/625579.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号