Bug 461463 - Tests dependant on locale — fail with de_DE.UTF-8
Summary: Tests dependant on locale — fail with de_DE.UTF-8
Status: REPORTED
Alias: None
Product: frameworks-kunitconversion
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: 5.96.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: John Layt
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-05 16:35 UTC by h.goebel
Modified: 2022-11-05 16:35 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description h.goebel 2022-11-05 16:35:55 UTC
SUMMARY
Depending on the locale set in the testing environment, tests fail.

STEPS TO REPRODUCE
1. Unpack and build kunitconversion
2. Run `make test` with different locale settings:

   These will pass

      LANG=C LANGUAGE=C LC_ALL=C make test
      LANG=C LANGUAGE=C LC_ALL=de.UTF-8 make test
      LANG=C LANGUAGE=C LC_ALL=de_AT.UTF-8 make test

   These will fail

      LANG=C LANGUAGE=C LC_ALL=de_DE.UTF-8 make test
      LANG=C LANGUAGE=C LC_ALL=fr_FR.UTF-8 make test

OBSERVED RESULT
Test failures depend on the locate set in the environment.

EXPECTED RESULT
a) Tests pass independently of environment set.
b) Test suite sets expected locale environment internally

SOFTWARE/OS VERSIONS
KDE Frameworks Version: 5.96.0

ADDITIONAL INFORMATION
Test results (examples, shortened)


$ LANG=C LANGUAGE=C LC_ALL=C make test      
Running tests...
[…]
100% tests passed, 0 tests failed out of 5
[…]

$ LANG=C LANGUAGE=C LC_ALL=de_DE.UTF-8 make test     
Running tests...
Test project /tmp/kunitconversion-5.96.0
    Start 1: appstreamtest
1/5 Test #1: appstreamtest ....................   Passed    0.01 sec
    Start 2: valuetest
2/5 Test #2: valuetest ........................***Failed    0.02 sec
    Start 3: categorytest
3/5 Test #3: categorytest .....................***Failed    0.13 sec
    Start 4: convertertest
4/5 Test #4: convertertest ....................***Failed    0.19 sec
    Start 5: currencytableinittest
5/5 Test #5: currencytableinittest ............   Passed    0.03 sec

40% tests passed, 3 tests failed out of 5

Total Test time (real) =   0.38 sec

The following tests FAILED:
          2 - valuetest (Failed)
          3 - categorytest (Failed)
          4 - convertertest (Failed)
Errors while running CTest
Output from these tests are in: /tmp/kunitconversion-5.96.0/Testing/Temporary/LastTest.log
Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.