Bug 53428 - ucs-test: TypeError: '<=' not supported between instances of 'float' and 'tuple'
ucs-test: TypeError: '<=' not supported between instances of 'float' and 'tuple'
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: ucs-test
UCS@school 5.0
Other Linux
: P5 normal (vote)
: UCS@school 5.0 v1
Assigned To: Philipp Hahn
Florian Best
: interim-1
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2021-06-09 21:26 CEST by Florian Best
Modified: 2021-11-29 17:20 CET (History)
2 users (show)

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2021-06-09 21:26:04 CEST
09:00:26 [master201-single-s4]   . utils.sh; run_ucsschool_tests "base1"
11:05:13 
11:05:13  stderr: hibit=ucsschool_import4
11:05:13 Traceback (most recent call last):
11:05:13   File "/usr/sbin/ucs-test", line 205, in <module>
11:05:13     sys.exit(main())
11:05:13   File "/usr/sbin/ucs-test", line 198, in main
11:05:13     return test_set.run_tests(options.filter, options.dry, options.hold)
11:05:13   File "/usr/sbin/ucs-test", line 137, in run_tests
11:05:13     check = test_result.check()
11:05:13   File "/usr/lib/python3/dist-packages/univention/testing/data.py", line 850, in check
11:05:13     conditions = self.case.check(self.environment)
11:05:13   File "/usr/lib/python3/dist-packages/univention/testing/data.py", line 577, in check
11:05:13     conditions += list(self.versions.check(environment))
11:05:13   File "/usr/lib/python3/dist-packages/univention/testing/data.py", line 274, in check
11:05:13     if ucs_version <= environment.ucs_version:
11:05:13   File "/usr/lib/python3/dist-packages/univention/testing/internal.py", line 240, in __le__
11:05:13     return self.ver <= other.ver if isinstance(other, UCSVersion) else NotImplemented
11:05:13 TypeError: '<=' not supported between instances of 'float' and 'tuple'
Comment 1 Philipp Hahn univentionstaff 2021-06-10 10:35:05 CEST
ucs-test-ucsschool/90_ucsschool/218_import-users_bad_config.py:
##  4.1: skip
##  4.2: skip

The "##" section parsed as YAML data, where "4.1" is parsed as a float!
`ucs-test` cannot fix it because it already is too late! It only worked by accident with Python 2.7 while "ucs-test" now used Python 3.7, which is more picky about type errors.

You have to either quote the versions with " or ' or write "4.1-0" and "4.2-0", which YAML will handle as str.

Next time please include the full Jenkins URL or at least the .cfg file(s name).

---
For my reference:
git:7cc7ebb557dc32cf914469e6f88adac122073a34
git:0c683bbb969c812a54c92507ee1eed06ea5acb1c
Bug #50631
Comment 3 Philipp Hahn univentionstaff 2021-06-11 11:45:28 CEST
FYI: ucs-lint@5.0-0 will now flag this as an error:
[5.0-0] 79ecaaa0e4 fix[ucs-test]: Detect versions: float
 test/ucs-test/debian/changelog               |   6 +++
 test/ucs-test/univention/testing/internal.py | 123 +++++++++++++++++++++++++++++++----------------
 2 files changed, 87 insertions(+), 42 deletions(-)

Package: ucs-test
Version: 10.0.5-25A~5.0.0.202106111103
Branch: ucs_5.0-0
Scope: errata5.0-0
Comment 4 Florian Best univentionstaff 2021-06-14 17:09:28 CEST
ucs-test-ucsschool (7.0.2)
1c5ff2b3470d | Bug #53428: fix skip tag
Comment 5 Daniel Tröder univentionstaff 2021-06-15 09:15:49 CEST
I have cherry-picked the commit into 4.4:

[4.4] 9242d22ae Bug #53428: fix skip tag

No package build required.
Comment 6 Jürn Brodersen univentionstaff 2021-11-29 17:20:17 CET
UCS@school 5.0 v1 has been released.

https://docs.software-univention.de/release-notes-ucsschool-5.0v1-de.html

If this error occurs again, please clone this bug.