<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>469342</bug_id>
          
          <creation_ts>2023-05-04 08:26:13 +0000</creation_ts>
          <short_desc>Set QT_QPA_PLATFORM=offscreen for gui test to pass when packaging it</short_desc>
          <delta_ts>2023-05-04 08:26:13 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>kronometer</product>
          <component>general</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>UNCONFIRMED</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter>andreamtp+bz</reporter>
          <assigned_to name="Elvis Angelaccio">elvis.angelaccio</assigned_to>
          
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2227917</commentid>
    <comment_count>0</comment_count>
    <who name="">andreamtp+bz</who>
    <bug_when>2023-05-04 08:26:13 +0000</bug_when>
    <thetext>While packaging the tool in rpm format - action that happen in a linux namespace - the gui test fails because it cannot connect to a display. 
Setting QT_QPA_PLATFORM=offscreen let the test to pass

STEPS TO REPRODUCE
[interactive into the namespace]
&lt;mock-chroot&gt; bash-5.2$ cd redhat-linux-build/autotests
&lt;mock-chroot&gt; bash-5.2$ make
&lt;mock-chroot&gt; bash-5.2$ ./testtimedisplay
qt.qpa.xcb: could not connect to display 
qt.qpa.plugin: Could not load the Qt platform plugin &quot;xcb&quot; in &quot;&quot; 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, xcb.

OBSERVED RESULT
&lt;mock-chroot&gt; bash-5.2$ ./testtimedisplay
qt.qpa.xcb: could not connect to display 
qt.qpa.plugin: Could not load the Qt platform plugin &quot;xcb&quot; in &quot;&quot; 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, xcb.

EXPECTED RESULT / RESOLUTION
&lt;mock-chroot&gt; bash-5.2$ export QT_QPA_PLATFORM=offscreen
&lt;mock-chroot&gt; bash-5.2$ ./testtimedisplay 
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to &apos;/tmp/runtime-mockbuild&apos;
********* Start testing of TestTimeDisplay *********
Config: Using QtTest library 5.15.9, Qt 5.15.9 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 13.0.1 20230401 (Red Hat 13.0.1-0)), fedora 38
PASS   : TestTimeDisplay::initTestCase()
QWARN  : TestTimeDisplay::testDefaultWidget() kf.i18n: KLocalizedString: Using an empty domain, fix the code. msgid: &quot;Hours&quot; msgid_plural: &quot;&quot; msgctxt: &quot;@title:column&quot;
[...]
Totals: 5 passed, 0 failed, 0 skipped, 0 blacklisted, 5ms
********* Finished testing of TestTimeDisplay *********


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora 38
(available in About System)
KDE Plasma Version: 5.27.4
KDE Frameworks Version: 5.105.0
Qt Version: 5.15.9

ADDITIONAL INFORMATION</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>