Skip to content

Commit

Permalink
feat: upgrade to fdb 7.1.43
Browse files Browse the repository at this point in the history
  • Loading branch information
lafirest committed Nov 17, 2023
1 parent 1f93752 commit bc07fef
Show file tree
Hide file tree
Showing 39 changed files with 5,145 additions and 125 deletions.
Binary file added .ci/bindingtester/.known_testers.py.swp
Binary file not shown.
118 changes: 118 additions & 0 deletions .ci/bindingtester/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
#
# __init__.py
#
# This source file is part of the FoundationDB open source project
#
# Copyright 2013-2018 Apple Inc. and the FoundationDB project authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

import math
import sys
import os

#sys.path[:0] = [os.path.join(os.path.dirname(__file__), '..', '..', 'bindings', 'python')]

import util

FDB_API_VERSION = 710

LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'simple': {
'format': '%(message)s'
}
},
'handlers': {
'console': {
'level': 'NOTSET',
'class': 'logging.StreamHandler',
'stream': sys.stdout,
'formatter': 'simple'
}
},
'loggers': {
'foundationdb.bindingtester': {
'level': 'INFO',
'handlers': ['console']
}
}
}


class Result:
def __init__(self, subspace, key, values):
self.subspace_tuple = util.subspace_to_tuple(subspace)
self.key_tuple = subspace.unpack(key)
self.values = values

def key(self, specification):
return self.key_tuple[specification.key_start_index:]

@staticmethod
def elements_equal(el1, el2):
if type(el1) != type(el2):
return False

if isinstance(el1, tuple):
return Result.tuples_match(el1, el2)

if isinstance(el1, float) and math.isnan(el1):
return math.isnan(el2)

return el1 == el2

@staticmethod
def tuples_match(t1, t2):
if len(t1) != len(t2):
return False

return all([Result.elements_equal(x,y) for x,y in zip(t1, t2)])

def matches_key(self, rhs, specification):
if not isinstance(rhs, Result):
return False

return Result.tuples_match(self.key(specification), rhs.key(specification))

def matches(self, rhs, specification):
if not self.matches_key(rhs, specification):
return False

for value in self.values:
for rValue in rhs.values:
if value == rValue:
return True

return False

def matches_global_error_filter(self, specification):
return any([specification.matches_global_error_filter(v) for v in self.values])

# A non-unique sequence of numbers used to align results from different testers
def sequence_num(self, specification):
if specification.ordering_index is not None:
return self.key_tuple[specification.ordering_index]

return None

def __str__(self):
if len(self.values) == 1:
value_str = repr(self.values[0])
else:
value_str = repr(self.values)

return '%s = %s' % (repr(self.subspace_tuple + self.key_tuple), value_str)
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit bc07fef

Please sign in to comment.