Skip to content

Commit

Permalink
Setup bindings tester in github actions... first try!...
Browse files Browse the repository at this point in the history
  • Loading branch information
amirouche committed Jul 3, 2024
1 parent 8203309 commit 687b79a
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 73 deletions.
1 change: 1 addition & 0 deletions .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ jobs:
- run: cd found && make init
- run: cd found && poetry run python readme.py
- run: cd found && poetry run make check
- run: cd found && poetry run bash $(pwd)/local/bin/binding-tester.sh $(pwd)/local/bin/binding-tester.py
40 changes: 0 additions & 40 deletions local/bin/binding-tester-run.sh

This file was deleted.

33 changes: 0 additions & 33 deletions local/bin/binding-tester-setup.sh

This file was deleted.

14 changes: 14 additions & 0 deletions local/bin/binding-tester.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env python3
import os
import sys
import asyncio
import found


print("what is not done that is good, needs to be done!")
# print("DEBUG: os.environ: {}".format(os.environ))
print("DEBUG: sys.argv: {}".format(sys.argv))

db = asyncio.run(found.open())
print("DEBUG: db: {}".format(db))

61 changes: 61 additions & 0 deletions local/bin/binding-tester.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/usr/bin/env bash

set -ex;


BINDING_TESTER_MAIN_PY="$1"

# TODO: make those configurable
#
# FDB_VERSION=$2 # 7.1
FDB_API_VERSION_MIN=710
#

pip install --force-reinstall foundationdb==7.1.*
FDB_OPTION_FILEPATH="$(pip show foundationdb | grep Loca | awk '{print $2}')/fdb/fdboptions.py"

## build the python bindings
WORK_DIRECTORY=/tmp/asyncio-foundationdb/$(date --iso=seconds)/
mkdir -p $WORK_DIRECTORY
cd $WORK_DIRECTORY
git clone --branch release-7.1 --depth 1 https://github.com/apple/foundationdb.git
cd foundationdb

# Instead of building fdb-python with ninja/cmake, patching it with pip install
cp $FDB_OPTION_FILEPATH ./bindings/python/fdb/fdboptions.py
echo "LATEST_API_VERSION = 710" >> ./bindings/python/fdb/apiversion.py

# TODO: Tenants are disabled for now.
echo "testers['asyncio'] = Tester('asyncio', '${BINDING_TESTER_MAIN_PY}', 2040, 23, 710, types=ALL_TYPES)" >> ./bindings/bindingtester/known_testers.py

# These are faulty seeds, for now, it is good to check them all the time to avoid regression.
./bindings/bindingtester/bindingtester.py --num-ops 1000 --api-version $FDB_API_VERSION_MIN --test-name api --compare python asyncio --seed 3534790651
./bindings/bindingtester/bindingtester.py --num-ops 1000 --api-version $FDB_API_VERSION_MIN --test-name api --compare python asyncio --seed 3864917676
./bindings/bindingtester/bindingtester.py --num-ops 1000 --api-version $FDB_API_VERSION_MIN --test-name api --concurrency 5 asyncio --seed 3153055325
./bindings/bindingtester/bindingtester.py --num-ops 1000 --api-version $FDB_API_VERSION_MIN --test-name directory --concurrency 1 asyncio --no-directory-snapshot-ops --compare python --seed 2095856910
./bindings/bindingtester/bindingtester.py --num-ops 1000 --api-version $FDB_API_VERSION_MIN --test-name directory --concurrency 1 asyncio --no-directory-snapshot-ops --compare python --seed 2483220251
./bindings/bindingtester/bindingtester.py --num-ops 1000 --api-version $FDB_API_VERSION_MIN --test-name directory --concurrency 1 asyncio --no-directory-snapshot-ops --compare python --seed 241550211
./bindings/bindingtester/bindingtester.py --num-ops 1000 --api-version $FDB_API_VERSION_MIN --test-name directory --concurrency 1 asyncio --no-directory-snapshot-ops --compare python --seed 1508488514
./bindings/bindingtester/bindingtester.py --num-ops 1000 --api-version $FDB_API_VERSION_MIN --test-name directory --concurrency 1 asyncio --no-directory-snapshot-ops --compare python --seed 4203526853

# https://github.com/foundationdb-rs/foundationdb-rs/issues/38
./bindings/bindingtester/bindingtester.py --num-ops 1000 --api-version $FDB_API_VERSION_MIN --test-name directory --concurrency 1 asyncio --no-directory-snapshot-ops --compare python --seed 4142326254
./bindings/bindingtester/bindingtester.py --num-ops 1000 --api-version $FDB_API_VERSION_MIN --test-name directory --concurrency 1 asyncio --no-directory-snapshot-ops --compare python --seed 4275610547
./bindings/bindingtester/bindingtester.py --num-ops 1000 --api-version $FDB_API_VERSION_MIN --test-name directory --concurrency 1 asyncio --no-directory-snapshot-ops --compare python --seed 1951034301
./bindings/bindingtester/bindingtester.py --num-ops 1000 --api-version $FDB_API_VERSION_MIN --test-name directory --concurrency 1 asyncio --no-directory-snapshot-ops --compare python --seed 1700644945

# https://github.com/foundationdb-rs/foundationdb-rs/issues/42
./bindings/bindingtester/bindingtester.py --num-ops 1000 --api-version $FDB_API_VERSION_MIN --test-name directory --concurrency 1 asyncio --no-directory-snapshot-ops --compare python --seed 584458794

START=1
END=${1-1}
for i in $(eval echo "{$START..$END}")
do
echo "Running iteration $i"
./bindings/bindingtester/bindingtester.py --test-name scripted asyncio
./bindings/bindingtester/bindingtester.py --num-ops 1000 --api-version $FDB_API_VERSION_MIN --test-name api --compare python asyncio
./bindings/bindingtester/bindingtester.py --num-ops 1000 --api-version $FDB_API_VERSION_MIN --test-name api --concurrency 5 asyncio
./bindings/bindingtester/bindingtester.py --num-ops 1000 --api-version $FDB_API_VERSION_MIN --test-name directory --concurrency 1 asyncio --no-directory-snapshot-ops --compare python
./bindings/bindingtester/bindingtester.py --num-ops 100 --api-version $FDB_API_VERSION_MIN --test-name directory_hca --concurrency 1 asyncio --no-directory-snapshot-ops
done

0 comments on commit 687b79a

Please sign in to comment.