Skip to content

Commit

Permalink
Merge pull request #941 from Ultimaker/fix_protobuf_and_unit_tests
Browse files Browse the repository at this point in the history
Protobuf version mismatch caused tests,builds to fail. Attempt II.
  • Loading branch information
rburema authored Feb 21, 2024
2 parents 81a655c + cd4eb2c commit dbe2191
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ def requirements(self):
self.requires(req)
self.requires("cpython/3.10.4@ultimaker/stable")
self.requires("openssl/3.2.0")
self.requires("protobuf/3.21.12")

def build_requirements(self):
if self.options.get_safe("enable_i18n", False):
Expand Down
14 changes: 14 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,17 @@ def upgrade_manager(application):
upgrade_manager = VersionUpgradeManager(application)
return upgrade_manager

def pytest_collection_modifyitems(items):
""" Modifies test items in place to ensure test classes run in a given order.
See: https://stackoverflow.com/questions/70738211/run-pytest-classes-in-custom-order/70758938#70758938
"""
CLASS_ORDER = ["TestActiveToolProxy"] # All classes that need to be run in-order, in that order -- all others will run _before_.
class_mapping = {item: (item.cls.__name__ if item.cls else "") for item in items}

sorted_items = items.copy()
# Iteratively move tests of each class to the end of the test queue
for class_ in CLASS_ORDER:
sorted_items = [it for it in sorted_items if class_mapping[it] != class_] + [
it for it in sorted_items if class_mapping[it] == class_
]
items[:] = sorted_items

0 comments on commit dbe2191

Please sign in to comment.