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

Fix new failures in unit tests #3931

Open
bschmalhofer opened this issue Nov 15, 2024 · 22 comments
Open

Fix new failures in unit tests #3931

bschmalhofer opened this issue Nov 15, 2024 · 22 comments
Labels
unittests Requests wrt unittests
Milestone

Comments

@bschmalhofer
Copy link
Contributor

A couple of new test failures have crept into rel-11_0:

::::::::::::::
RELEASE
::::::::::::::
PRODUCT = OTOBO
VERSION = 11.0.x
::::::::::::::
git-branch.txt
::::::::::::::
rel-11_0
::::::::::::::
git-commit.txt
::::::::::::::
4fa80733f249d49a5239bdf6aaa77590f0f89648
::::::::::::::
git-repo.txt
::::::::::::::
[email protected]:RotherOSS/otobo.git

Test Summary Report
-------------------
/opt/otobo/scripts/test/Compile.t                                                                         (Wstat: 0 Tests: 1763 Failed: 0)
  TODO passed:   714, 844
/opt/otobo/scripts/test/DynamicField/EditFieldRender.t                                                    (Wstat: 256 (exited 1) Tests: 76 Failed: 1)
  Failed test:  76
  Non-zero exit status: 1
/opt/otobo/scripts/test/Layout/HumanReadableDataSize.t                                                    (Wstat: 256 (exited 1) Tests: 20 Failed: 1)
  Failed test:  12
  Non-zero exit status: 1
/opt/otobo/scripts/test/Selenium/Agent/Admin/AdminQueueTemplates.t                                        (Wstat: 512 (exited 2) Tests: 38 Failed: 2)
  Failed tests:  37-38
  Non-zero exit status: 2
/opt/otobo/scripts/test/Selenium/Agent/AgentTicketActionCommon/AgentTicketOwner.t                         (Wstat: 512 (exited 2) Tests: 51 Failed: 2)
  Failed tests:  50-51
  Non-zero exit status: 2
/opt/otobo/scripts/test/Selenium/Agent/AgentTicketZoom.t                                                  (Wstat: 256 (exited 1) Tests: 70 Failed: 1)
  Failed test:  70
  Non-zero exit status: 1
/opt/otobo/scripts/test/Selenium/TestingMethods.t                                                         (Wstat: 0 Tests: 36 Failed: 0)
  TODO passed:   21, 24, 28
Files=974, Tests=81594, 4697 wallclock secs (21.61 usr  2.63 sys + 1110.68 cusr 185.80 csys = 1320.72 CPU)
Result: FAIL
ran tests for product OTOBO 11.0.x on host c49bc65378cc .
@bschmalhofer bschmalhofer added the unittests Requests wrt unittests label Nov 15, 2024
@bschmalhofer bschmalhofer added this to the OTOBO 11.0 milestone Nov 15, 2024
@stefanhaerter
Copy link
Contributor

As far as I'm aware, the new failures are EditFieldRender and AdminQueueTemplates, correct?

@bschmalhofer
Copy link
Contributor Author

I can't really tell. My last run was from 2024-09-30. It had some more failing scripts. But this was before the patches done for #3856. So it might be that the current failures are not actually new.

@bschmalhofer
Copy link
Contributor Author

See also #3980 where a test failure for rel-11_1 was fixed.

@MichaelThumes
Copy link
Contributor

findings re HumanReadableDataSize.t (I was looking at nightly build pipeline errors earlier)

short: looks like fun with Unicode

long: possible Problem with Translation data in Kernel/Language/ar_SA.pm, looks like since rel-10_1 (human readable size translations for 10_0 are empty)

looking at Kernel/Language/ar_SA.pm line 4993ff
https://github.com/RotherOSS/otobo/blob/rel-10_1/Kernel/Language/ar_SA.pm?h=1#L4995
(Beware! GitHub display issues! look at it on cli!)

I see this

        '%s TB' => '<200E>%s تيرابايت (TB)',
        '%s GB' => '<200E>%s غيغابايت (GB)',
        '%s MB' => 'ميغابايت (MB) <200E>%s',
        '%s KB' => '<200E>%s كيلوبايت (KB)',
        '%s B' => '<200E>%s بايت (B)',

No clue regarding proper Unicode representation for Arabic, but for whatever reason the tranlation line for MB looks way different then all the others. Perhaps a copy/paste error thing?

Technically, it manages to break the string subst (%s) feature of Translate(). Ah, the power of Unicode!. Sigh.

Trying to massage the test data ...

@MichaelThumes
Copy link
Contributor

re HumanReadableDataSize.t

this would apparently fix it (in the sense of making the test green, probably needs proof-reading):

otobo@2c2b8a4a676a:~$ git diff Kernel/Language/ar_SA.pm
diff --git a/Kernel/Language/ar_SA.pm b/Kernel/Language/ar_SA.pm
index b8dad90f8..1fe2050a9 100644
--- a/Kernel/Language/ar_SA.pm
+++ b/Kernel/Language/ar_SA.pm
@@ -4992,7 +4992,7 @@ sub Data {
         'Check to activate this date' => 'حدد لتمكين هذا التاريخ',
         '%s TB' => '‎%s تيرابايت (TB)',
         '%s GB' => '‎%s غيغابايت (GB)',
-        '%s MB' => 'ميغابايت (MB) ‎%s',
+        '%s MB' => '‎%s ميغابايت (MB)',
         '%s KB' => '‎%s كيلوبايت (KB)',
         '%s B' => '‎%s بايت (B)',
         'No Permission!' => 'لا توجد صلاحيات!',

@svenoe
Copy link
Contributor

svenoe commented Dec 12, 2024

findings re HumanReadableDataSize.t (I was looking at nightly build pipeline errors earlier)

short: looks like fun with Unicode

long: possible Problem with Translation data in Kernel/Language/ar_SA.pm, looks like since rel-10_1 (human readable size translations for 10_0 are empty)

looking at Kernel/Language/ar_SA.pm line 4993ff https://github.com/RotherOSS/otobo/blob/rel-10_1/Kernel/Language/ar_SA.pm?h=1#L4995 (Beware! GitHub display issues! look at it on cli!)

I see this

        '%s TB' => '<200E>%s تيرابايت (TB)',
        '%s GB' => '<200E>%s غيغابايت (GB)',
        '%s MB' => 'ميغابايت (MB) <200E>%s',
        '%s KB' => '<200E>%s كيلوبايت (KB)',
        '%s B' => '<200E>%s بايت (B)',

No clue regarding proper Unicode representation for Arabic, but for whatever reason the tranlation line for MB looks way different then all the others. Perhaps a copy/paste error thing?

Technically, it manages to break the string subst (%s) feature of Translate(). Ah, the power of Unicode!. Sigh.

Trying to massage the test data ...

Please talk with @stefanhaerter and @KhalilHamada-OTOBO - this has to do with the translations we automatically deploy via weblate, and there was an issue with exactly that. At least for one branch, I believe they fixed it by Khalil correcting the translation on weblate.

(Edit: maybe for other branches the test was already changed, I'm not sure. They both worked on this, in any case.)

@bschmalhofer
Copy link
Contributor Author

The failure in EditFieldRender.t seems to be related to the sorting of options, that is whether the empty option is added on top or on bottom. However, I can't tell what the correct behavior is.

Here is the unified diff that was generated by hacking Test::Differences into the test script:


    not ok 2 - EditFieldRender() gave the expected field content
    #   Failed test 'EditFieldRender() gave the expected field content'
    #   at scripts/test/DynamicField/EditFieldRender.t line 3804.
    # --- Got
    # +++ Expected
    # @@ -58,12 +58,12 @@
    #  </label>
    #                                  <div class="Field">
    #  <select class="DynamicFieldReference DynamicFieldText Modernize FormUpdate" id="DynamicField_Agent1test1463007607400002_0" name="DynamicField_Agent1test1463007607400002_0">
    # -  <option value="">-</option>
    #    <option value="1">&quot;- -&quot; &lt;root@localhost&gt;</option>
    #    <option value="3">&quot;Andy Admin&quot; &lt;[email protected]&gt;</option>
    #    <option value="42" selected>&quot;Test User1&quot; &lt;[email protected]&gt;</option>
    #    <option value="43">&quot;Test User2&quot; &lt;[email protected]&gt;</option>
    #    <option value="2">&quot;Toni Tester&quot; &lt;[email protected]&gt;</option>
    # +  <option value="">-</option>
    #  </select>
    #                                  </div>
    #                                  <div class="Clear"></div>
    # @@ -76,12 +76,12 @@
    #  </label>
    #                                  <div class="Field">
    #  <select class="DynamicFieldReference DynamicFieldText Modernize FormUpdate" id="DynamicField_Agent2test1463007607400002_0_0" name="DynamicField_Agent2test1463007607400002_0">
    # -  <option value="">-</option>
    #    <option value="1">&quot;- -&quot; &lt;root@localhost&gt;</option>
    #    <option value="3">&quot;Andy Admin&quot; &lt;[email protected]&gt;</option>
    #    <option value="42" selected>&quot;Test User1&quot; &lt;[email protected]&gt;</option>
    #    <option value="43">&quot;Test User2&quot; &lt;[email protected]&gt;</option>
    #    <option value="2">&quot;Toni Tester&quot; &lt;[email protected]&gt;</option>
    # +  <option value="">-</option>
    #  </select>
    #                                  </div>
    #                                  <div class="AddRemoveValueRow">
    # @@ -96,12 +96,12 @@
    #  </label>
    #                                  <div class="Field">
    #  <select class="DynamicFieldReference DynamicFieldText Modernize FormUpdate" id="DynamicField_Agent2test1463007607400002_0_1" name="DynamicField_Agent2test1463007607400002_0">
    # -  <option value="">-</option>
    #    <option value="1">&quot;- -&quot; &lt;root@localhost&gt;</option>
    #    <option value="3">&quot;Andy Admin&quot; &lt;[email protected]&gt;</option>
    #    <option value="42">&quot;Test User1&quot; &lt;[email protected]&gt;</option>
    #    <option value="43" selected>&quot;Test User2&quot; &lt;[email protected]&gt;</option>
    #    <option value="2">&quot;Toni Tester&quot; &lt;[email protected]&gt;</option>
    # +  <option value="">-</option>
    #  </select>
    #                                  </div>
    #                                  <div class="AddRemoveValueRow">
    # @@ -116,12 +116,12 @@
    #  </label>
    #                                  <div class="Field">
    #  <select class="DynamicFieldReference DynamicFieldText Modernize FormUpdate" id="DynamicField_Agent2test1463007607400002_0_Template" name="DynamicField_Agent2test1463007607400002_0">
    # -  <option value="">-</option>
    #    <option value="1">&quot;- -&quot; &lt;root@localhost&gt;</option>
    #    <option value="3">&quot;Andy Admin&quot; &lt;[email protected]&gt;</option>
    #    <option value="42">&quot;Test User1&quot; &lt;[email protected]&gt;</option>
    #    <option value="43">&quot;Test User2&quot; &lt;[email protected]&gt;</option>
    #    <option value="2">&quot;Toni Tester&quot; &lt;[email protected]&gt;</option>
    # +  <option value="">-</option>
    #  </select>
    #                                  </div>
    #                                  <div class="AddRemoveValueRow">
    1..2
    # Looks like you failed 1 test of 2.

@bschmalhofer
Copy link
Contributor Author

The failure in HumanReadableDataSize.t showed up in rel-10_1 as well. I cherry picked the patch.

@bschmalhofer
Copy link
Contributor Author

After converting EditFieldRender.t to using Kernel::System::UnitTest::Diff::TextEqOrDiff() the diagnostics look like:

not ok 76 - Set: Correct Value {
    ok 1 - EditFieldRender() gave the expected structure
    not ok 2 - EditFieldRender() gave the expected content for Field
    # Failed test 'EditFieldRender() gave the expected content for Field'
    # at /opt/otobo/scripts/test/DynamicField/EditFieldRender.t line 3803.
    # @@ -58,12 +58,12 @@
    #  </label>
    #                                  <div class="Field">
    #  <select class="DynamicFieldReference DynamicFieldText Modernize FormUpdate" id="DynamicField_Agent1test4181007208400002_0" name="DynamicField_Agent1test4181007208400002_0">
    # -  <option value="">-</option>
    #    <option value="1">&quot;- -&quot; &lt;root@localhost&gt;</option>
    #    <option value="3">&quot;Andy Admin&quot; &lt;[email protected]&gt;</option>
    #    <option value="28" selected="selected">&quot;Test User1&quot; &lt;[email protected]&gt;</option>
    #    <option value="29">&quot;Test User2&quot; &lt;[email protected]&gt;</option>
    #    <option value="2">&quot;Toni Tester&quot; &lt;[email protected]&gt;</option>
    # +  <option value="">-</option>
    #  </select>
    #                                  </div>
    #                                  <div class="Clear"></div>
    # @@ -76,12 +76,12 @@
    #  </label>
    #                                  <div class="Field">
    #  <select class="DynamicFieldReference DynamicFieldText Modernize FormUpdate" id="DynamicField_Agent2test4181007208400002_0_0" name="DynamicField_Agent2test4181007208400002_0">
    # -  <option value="">-</option>
    #    <option value="1">&quot;- -&quot; &lt;root@localhost&gt;</option>
    #    <option value="3">&quot;Andy Admin&quot; &lt;[email protected]&gt;</option>
    #    <option value="28" selected="selected">&quot;Test User1&quot; &lt;[email protected]&gt;</option>
    #    <option value="29">&quot;Test User2&quot; &lt;[email protected]&gt;</option>
    #    <option value="2">&quot;Toni Tester&quot; &lt;[email protected]&gt;</option>
    # +  <option value="">-</option>
    #  </select>
    #                                  </div>
    #                                  <div class="AddRemoveValueRow">
    # @@ -96,12 +96,12 @@
    #  </label>
    #                                  <div class="Field">
    #  <select class="DynamicFieldReference DynamicFieldText Modernize FormUpdate" id="DynamicField_Agent2test4181007208400002_0_1" name="DynamicField_Agent2test4181007208400002_0">
    # -  <option value="">-</option>
    #    <option value="1">&quot;- -&quot; &lt;root@localhost&gt;</option>
    #    <option value="3">&quot;Andy Admin&quot; &lt;[email protected]&gt;</option>
    #    <option value="28">&quot;Test User1&quot; &lt;[email protected]&gt;</option>
    #    <option value="29" selected="selected">&quot;Test User2&quot; &lt;[email protected]&gt;</option>
    #    <option value="2">&quot;Toni Tester&quot; &lt;[email protected]&gt;</option>
    # +  <option value="">-</option>
    #  </select>
    #                                  </div>
    #                                  <div class="AddRemoveValueRow">
    # @@ -116,12 +116,12 @@
    #  </label>
    #                                  <div class="Field">
    #  <select class="DynamicFieldReference DynamicFieldText Modernize FormUpdate" id="DynamicField_Agent2test4181007208400002_0_Template" name="DynamicField_Agent2test4181007208400002_0">
    # -  <option value="">-</option>
    #    <option value="1">&quot;- -&quot; &lt;root@localhost&gt;</option>
    #    <option value="3">&quot;Andy Admin&quot; &lt;[email protected]&gt;</option>
    #    <option value="28">&quot;Test User1&quot; &lt;[email protected]&gt;</option>
    #    <option value="29">&quot;Test User2&quot; &lt;[email protected]&gt;</option>
    #    <option value="2">&quot;Toni Tester&quot; &lt;[email protected]&gt;</option>
    # +  <option value="">-</option>
    #  </select>
    #                                  </div>
    #                                  <div class="AddRemoveValueRow">
    ok 3 - EditFieldRender() gave the expected content for Label
    1..3
}

# Failed test 'Set: Correct Value'
# at /opt/otobo/scripts/test/DynamicField/EditFieldRender.t line 3811.
1..76
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/76 subtests 

@bschmalhofer
Copy link
Contributor Author

Here is the latest run in rel-11_0. Looks like the failures in AdminQueueTemplates.t are sporadic.

Test Summary Report
-------------------
/opt/otobo/scripts/test/Compile.t                                                                         (Wstat: 0 Tests: 1766 Failed: 0)
  TODO passed:   715, 845
/opt/otobo/scripts/test/DynamicField/EditFieldRender.t                                                    (Wstat: 256 (exited 1) Tests: 76 Failed: 1)
  Failed test:  76
  Non-zero exit status: 1
/opt/otobo/scripts/test/Selenium/Agent/AgentTicketActionCommon/AgentTicketOwner.t                         (Wstat: 512 (exited 2) Tests: 51 Failed: 2)
  Failed tests:  50-51
  Non-zero exit status: 2
/opt/otobo/scripts/test/Selenium/Agent/AgentTicketZoom.t                                                  (Wstat: 256 (exited 1) Tests: 70 Failed: 1)
  Failed test:  70
  Non-zero exit status: 1
/opt/otobo/scripts/test/Selenium/TestingMethods.t                                                         (Wstat: 0 Tests: 36 Failed: 0)
  TODO passed:   21, 24, 28
Files=974, Tests=81619, 3881 wallclock secs (17.35 usr  2.39 sys + 887.50 cusr 153.02 csys = 1060.26 CPU)
Result: FAIL
ran tests for product OTOBO 11.0.x on host 015693f4f430 .

@bschmalhofer
Copy link
Contributor Author

For the failures in AgentTicketOwner.t and AgentTicketZoom.t there already is #3563 .

@MichaelThumes
Copy link
Contributor

Re EditFieldRender.t

possibly related: #3719

@bschmalhofer
Copy link
Contributor Author

New failure in WebserviceTicketInvoker.t in the latest run:

Test Summary Report
-------------------
/opt/otobo/scripts/test/Compile.t                                                                         (Wstat: 0 Tests: 1766 Failed: 0)
  TODO passed:   715, 845
/opt/otobo/scripts/test/GenericInterface/Invoker/Ticket/WebserviceTicketInvoker.t                         (Wstat: 1280 (exited 5) Tests: 5 Failed: 5)
  Failed tests:  1-5
  Non-zero exit status: 5
/opt/otobo/scripts/test/Selenium/Agent/Admin/AdminQueueTemplates.t                                        (Wstat: 512 (exited 2) Tests: 38 Failed: 2)
  Failed tests:  37-38
  Non-zero exit status: 2
/opt/otobo/scripts/test/Selenium/Agent/AgentTicketActionCommon/AgentTicketOwner.t                         (Wstat: 512 (exited 2) Tests: 51 Failed: 2)
  Failed tests:  50-51
  Non-zero exit status: 2
/opt/otobo/scripts/test/Selenium/Agent/AgentTicketZoom.t                                                  (Wstat: 256 (exited 1) Tests: 70 Failed: 1)
  Failed test:  70
  Non-zero exit status: 1
/opt/otobo/scripts/test/Selenium/TestingMethods.t                                                         (Wstat: 0 Tests: 36 Failed: 0)
  TODO passed:   21, 24, 28
Files=974, Tests=81572, 3850 wallclock secs (17.03 usr  2.32 sys + 909.94 cusr 142.10 csys = 1071.39 CPU)
Result: FAIL
ran tests for product OTOBO 11.0.x on host eb20c7b04765 .

@MichaelThumes
Copy link
Contributor

MichaelThumes commented Dec 17, 2024

re WebserviceTicketInvoker.t - possibly related?

there was a change to Kernel/GenericInterface/Invoker/Ticket/Common.pm as of yesterday , see #3987

[update: confirmed locally that commit 4509ec1 is the culprit - reverting makes the test green]

@bschmalhofer
Copy link
Contributor Author

After some fixes the list of failing tests, this time for rel-11_1, is:

Test Summary Report
-------------------
/opt/otobo/scripts/test/Compile.t                                                                         (Wstat: 0 Tests: 1764 Failed: 0)
  TODO passed:   714, 844
/opt/otobo/scripts/test/Selenium/Agent/Admin/AgentTicketEmailPGP.t                                        (Wstat: 512 (exited 2) Tests: 94 Failed: 2)
  Failed tests:  51, 56
  Non-zero exit status: 2
/opt/otobo/scripts/test/Selenium/Agent/AgentTicketActionCommon/AgentTicketOwner.t                         (Wstat: 512 (exited 2) Tests: 51 Failed: 2)
  Failed tests:  50-51
  Non-zero exit status: 2
/opt/otobo/scripts/test/Selenium/Agent/AgentTicketZoom.t                                                  (Wstat: 256 (exited 1) Tests: 70 Failed: 1)
  Failed test:  70
  Non-zero exit status: 1
/opt/otobo/scripts/test/Selenium/TestingMethods.t                                                         (Wstat: 0 Tests: 36 Failed: 0)
  TODO passed:   21, 24, 28
Files=975, Tests=81949, 3813 wallclock secs (17.74 usr  2.43 sys + 870.49 cusr 146.72 csys = 1037.38 CPU)
Result: FAIL
ran tests for product OTOBO 11.1.x on host eb2a3026f3ba .

@stefanhaerter : I recall that you had some more fixes, but I could not find the patch any more.

@bschmalhofer
Copy link
Contributor Author

After a couple of fixes:


Test Summary Report
-------------------
/opt/otobo/scripts/test/Compile.t                                                                         (Wstat: 0 Tests: 1768 Failed: 0)
  TODO passed:   715, 845
/opt/otobo/scripts/test/Selenium/Agent/Admin/AdminGenericInterfaceTransportHTTPREST.t                     (Wstat: 256 (exited 1) Tests: 22 Failed: 1)
  Failed test:  22
  Non-zero exit status: 1
/opt/otobo/scripts/test/Selenium/Agent/Admin/AdminQueueTemplates.t                                        (Wstat: 512 (exited 2) Tests: 38 Failed: 2)
  Failed tests:  37-38
  Non-zero exit status: 2
/opt/otobo/scripts/test/Selenium/TestingMethods.t                                                         (Wstat: 0 Tests: 36 Failed: 0)
  TODO passed:   21, 24, 28
Files=974, Tests=81481, 3885 wallclock secs (17.39 usr  2.22 sys + 891.87 cusr 153.94 csys = 1065.42 CPU)
Result: FAIL
ran tests for product OTOBO 11.0.x on host 022d34b73f6b .

AdminQueueTemplates.t might be sporadic

@bschmalhofer
Copy link
Contributor Author

Running the test suite with rel-11_0 under Docker again and we are down to a single failure:


Test Summary Report
-------------------
/opt/otobo/scripts/test/Compile.t                                                                         (Wstat: 0 Tests: 1768 Failed: 0)
  TODO passed:   715, 845
/opt/otobo/scripts/test/Selenium/Agent/Admin/AdminGenericInterfaceTransportHTTPREST.t                     (Wstat: 256 (exited 1) Tests: 22 Failed: 1)
  Failed test:  22
  Non-zero exit status: 1
/opt/otobo/scripts/test/Selenium/TestingMethods.t                                                         (Wstat: 0 Tests: 36 Failed: 0)
  TODO passed:   21, 24, 28
Files=974, Tests=81531, 3810 wallclock secs (17.50 usr  2.25 sys + 849.47 cusr 148.98 csys = 1018.20 CPU)
Result: FAIL
ran tests for product OTOBO 11.0.x on host 8d6aec67c6b4 .

@stefanhaerter
Copy link
Contributor

stefanhaerter commented Jan 10, 2025

This looks suspiciously related to my work in #3982 - I will try to have a look anytime soon.

@MichaelThumes
Copy link
Contributor

@stefanhaerter
looks like wrong css selector in https://github.com/RotherOSS/otobo/blob/rel-11_0/scripts/test/Selenium/Agent/Admin/AdminGenericInterfaceTransportHTTPREST.t#L122

# Add one additional response header line.
        $Selenium->find_element( "#AddValue", 'css' )->click();

but the DOM looks like:

<a href="#" id="OutboundHeadersAddValue" class="CallForAction AddValue"><span><i class="fa fa-plus-square">&nbsp;</i>Add header</span></a>

Perhaps change find_element( "#AddValue", 'css' ) to find_element( "#OutboundHeadersAddValue", 'css' ) or similar ...

@MichaelThumes
Copy link
Contributor

remaining unittest failure scripts/test/Selenium/Agent/Admin/AgentTicketEmailPGP.t in rel-11_1 (test is green in rel-11_0):

otobo@b3d4b0a8eb28:~$ bin/otobo.Console.pl Dev::UnitTest::Run scripts/test/Selenium/Agent/Admin/AgentTicketEmailPGP.t
[11:27:53] scripts/test/Selenium/Agent/Admin/AgentTicketEmailPGP.t .. 46/? 
# Failed test 'Signing key is selected'
# at scripts/test/Selenium/Agent/Admin/AgentTicketEmailPGP.t line 276.
[11:27:53] scripts/test/Selenium/Agent/Admin/AgentTicketEmailPGP.t .. 51/? 
# Failed test 'Signing key is selected'
# at scripts/test/Selenium/Agent/Admin/AgentTicketEmailPGP.t line 321.
gpg: WARNING: unsafe permissions on homedir '/opt/otobo/var/tmp/pgptest3060000847400000'
[11:27:53] scripts/test/Selenium/Agent/Admin/AgentTicketEmailPGP.t .. 86/? # Seeded srand with seed '20250110' from local date.
# Looks like you failed 2 tests of 92.
[11:27:53] scripts/test/Selenium/Agent/Admin/AgentTicketEmailPGP.t .. Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/92 subtests 
[11:28:12]

Test Summary Report
-------------------
scripts/test/Selenium/Agent/Admin/AgentTicketEmailPGP.t (Wstat: 512 (exited 2) Tests: 92 Failed: 2)
  Failed tests:  50, 55
  Non-zero exit status: 2
Files=1, Tests=92, 19 wallclock secs ( 0.10 usr  0.01 sys +  2.72 cusr  0.59 csys =  3.42 CPU)
Result: FAIL
ran tests for product OTOBO 11.1.x on host b3d4b0a8eb28 .

Steps to reproduce (sigh):

Test Scenario 1 (works):

  • open AgentTicketEmail, set queue to PgpTest and set Email Security to 'PGP sign'
  • notice that the 'Sign' dropdown now gets populate with the two PGP keys from above
  • if you look at the AJAXUpdate request in dev tools, you see a JSON response similar to:
{"NewUserID":[["","-",false,false,false]],"NewResponsibleID":[["","-",false,false,false]],"SignKeyID":[["","-",false,false,false],["PGP::2AD6BAFF","PGP: [good] 2AD6BAFF [never] John Smith (Test PGP never expired) <[email protected]>",true,true,false],["PGP::667B04B9","PGP: [WARNING: EXPIRED KEY] 667B04B9 [2018-12-19] John Smith (Test PGP expired) <pgptest@exampl[...]",false,false,false]],"NextStateID":[["2","closed successful",false,false,false],["3","closed unsuccessful",false,false,false],["4","open",true,true,false],["7","pending auto close+",false,false,false],["8","pending auto close-",false,false,false],["6","pending reminder",false,false,false]],"EmailSecurityOptions":[["","-",false,false,false],["PGP::-::Encrypt","PGP encrypt",false,false,false],["PGP::Sign::-","PGP sign",true,true,false],["PGP::Sign::Encrypt","PGP sign and encrypt",false,false,false]],"TypeID":[["","-",false,false,false],["1","Unclassified",false,false,false]],"Signature":"<br/>Your Ticket-Team<br/><br/> - -<br/><br/>--<br/> Super Support - Waterford Business Park<br/> 5201 Blue Lagoon Drive - 8th Floor &amp; 9th Floor - Miami, 33126 USA<br/> Email: [email protected] - Web: <a href=\"http://www.example.com/\" title=\"http://www.example.com/\">http://www.example.com/</a><br/>--","Dest":[["","-",false,false,false],["3||Junk","Junk",false,false,false],["4||Misc","Misc",false,false,false],["7||PgpTest","PgpTest",true,true,false],["1||Postmaster","Postmaster",false,false,false],["2||Raw","Raw",false,false,false]],"SLAID":[["","-",false,false,false]],"StandardTemplateID":[["","-",false,false,false]],"CryptKeyID":[["","-",false,false,false]],"ServiceID":[["","-",false,false,false]],"PriorityID":[["1","1 very low",false,false,false],["2","2 low",false,false,false],["3","3 normal",true,true,false],["4","4 high",false,false,false],["5","5 very high",false,false,false]]}

Test Scenario 2 - fails as in the unittest:

  • Create a new ticket in queue PgpTest
  • Answer that ticket ( -> AgentTicketCompose)
  • set queue to PgpTest and set Email Security to 'PGP sign'
  • notice that here the dropdown with available sign keys is NOT populated via AJAXUpdate
  • inspecting the AJAXUpdate response yields an empty JSON array :-O
{}

But why?

Looking at AgentTicketCompose in rel-11_1, the JSON for AJAXUpdate is built like this:
https://github.com/RotherOSS/otobo/blob/rel-11_1/Kernel/Modules/AgentTicketCompose.pm#L1618

        my %Diversity = reverse %Uniformity;
        for my $Field ( sort keys %StdFieldValues ) {
            push @StdFieldAJAX, {
                Name       => $Diversity{$Field} || $Field,
                Data       => $StdFieldValues{$Field},
                SelectedID => $GetParam{$Field},
                %{ $Attributes{$Field} },
            };
        }

        my $JSON = $LayoutObject->BuildSelectionJSON(
            [
                @StdFieldAJAX,
                @DynamicFieldAJAX,
            ],
        );

So, the JSON for standard fields comes from the %StdFieldValues hash. It seems that this hash gets declared in https://github.com/RotherOSS/otobo/blob/rel-11_1/Kernel/Modules/AgentTicketCompose.pm#L1353 - and then never gets assigned to before the end of 'AJAXUpdate'.

That would explain the empty JSON array, unless I am overlooking something ... but ...

Hu?

@stefanhaerter
Copy link
Contributor

Most likely related: #3537

@bschmalhofer
Copy link
Contributor Author

Current state of the tests.

Test Summary Report
-------------------
/opt/otobo/scripts/test/Compile.t                                                                         (Wstat: 0 Tests: 1769 Failed: 0)
  TODO passed:   715, 845
/opt/otobo/scripts/test/EmailParser/MultipartMixed.t                                                      (Wstat: 512 (exited 2) Tests: 15 Failed: 2)
  Failed tests:  14-15
  Non-zero exit status: 2
/opt/otobo/scripts/test/Selenium/Agent/Admin/AdminGenericInterfaceTransportHTTPREST.t                     (Wstat: 256 (exited 1) Tests: 22 Failed: 1)
  Failed test:  22
  Non-zero exit status: 1
/opt/otobo/scripts/test/Selenium/TestingMethods.t                                                         (Wstat: 0 Tests: 36 Failed: 0)
  TODO passed:   21, 24, 28
/opt/otobo/scripts/test/TemplateGenerator/AutoResponse.t                                                  (Wstat: 768 (exited 3) Tests: 31 Failed: 3)
  Failed tests:  11, 14, 17
  Non-zero exit status: 3
Files=974, Tests=81547, 3705 wallclock secs (19.41 usr  2.45 sys + 830.03 cusr 144.25 csys = 996.14 CPU)
Result: FAIL
ran tests for product OTOBO 11.0.x on host 55ae3a8367ee .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unittests Requests wrt unittests
Projects
None yet
Development

No branches or pull requests

4 participants