diff --git a/.devcontainer/add_erlang_bindings.patch b/.devcontainer/add_erlang_bindings.patch index 519d0f0..52a28d4 100644 --- a/.devcontainer/add_erlang_bindings.patch +++ b/.devcontainer/add_erlang_bindings.patch @@ -1,12 +1,26 @@ +diff --git a/bindings/bindingtester/__init__.py b/bindings/bindingtester/__init__.py +index 17d06cf..1f6e1e3 100644 +--- a/bindings/bindingtester/__init__.py ++++ b/bindings/bindingtester/__init__.py +@@ -22,7 +22,7 @@ import math + import sys + import os + +-sys.path[:0] = [os.path.join(os.path.dirname(__file__), '..', '..', 'bindings', 'python')] ++#sys.path[:0] = [os.path.join(os.path.dirname(__file__), '..', '..', 'bindings', 'python')] + + import util + diff --git a/bindings/bindingtester/known_testers.py b/bindings/bindingtester/known_testers.py -index 70e1f814..85dcde51 100644 +index 70e1f81..85dcde5 100644 --- a/bindings/bindingtester/known_testers.py +++ b/bindings/bindingtester/known_testers.py @@ -58,6 +58,7 @@ _java_cmd = 'java -ea -cp %s:%s com.apple.foundationdb.test.' % ( - + # We could set min_api_version lower on some of these if the testers were updated to support them testers = { + 'erlang': Tester('erlang', '/usr/src/erlfdb/test/tester.es', 2040, 710, MAX_API_VERSION, types=ALL_TYPES, tenants_enabled=True), 'python': Tester('python', 'python ' + _absolute_path('python/tests/tester.py'), 2040, 23, MAX_API_VERSION, types=ALL_TYPES, tenants_enabled=True), 'python3': Tester('python3', 'python3 ' + _absolute_path('python/tests/tester.py'), 2040, 23, MAX_API_VERSION, types=ALL_TYPES, tenants_enabled=True), - 'ruby': Tester('ruby', _absolute_path('ruby/tests/tester.rb'), 2040, 23, MAX_API_VERSION), + + 'ruby': Tester('ruby', _absolute_path('ruby/tests/tester.rb'), 2040, 23, MAX_API_VERSION), \ No newline at end of file diff --git a/.devcontainer/docker-compose.yaml b/.devcontainer/docker-compose.yaml index dceb276..2c6b331 100644 --- a/.devcontainer/docker-compose.yaml +++ b/.devcontainer/docker-compose.yaml @@ -7,7 +7,7 @@ services: ERLANG_VERSION: "24" # This should always match the value in fdb.image - FDB_VERSION: "6.3.23" + FDB_VERSION: "7.1.43" environment: # This needs to match the name of the FoundationDB service below @@ -28,4 +28,4 @@ services: network_mode: service:fdb fdb: - image: foundationdb/foundationdb:6.3.23 + image: foundationdb/foundationdb:7.1.43 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f93f904..4fc8fce 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -106,6 +106,12 @@ jobs: services: foundationdb: image: foundationdb/foundationdb:7.1.43 + env: + REBAR_PROFILE: devcontainer + # Set to 1 for verbose rebar3 logging + DEBUG: 0 + # Set to 1 for even more verbose rebar3 logging + DIAGNOSTIC: 0 steps: - name: Check out repository code uses: actions/checkout@v4 diff --git a/src/erlfdb_util.erl b/src/erlfdb_util.erl index f60e857..5482174 100644 --- a/src/erlfdb_util.erl +++ b/src/erlfdb_util.erl @@ -46,12 +46,16 @@ get_test_db(Options) -> init_test_cluster(Options) -> % Hack to ensure erlfdb app environment is loaded during unit tests ok = application:ensure_started(erlfdb), + ct:print(">>> init_test_cluster,Line:~p~n", [?LINE]), case application:get_env(erlfdb, test_cluster_file) of {ok, system_default} -> + ct:print(">>> init_test_cluster,Line:~p~n", [?LINE]), {ok, <<>>}; {ok, ClusterFile} -> + ct:print(">>> init_test_cluster,Line:~p~n", [?LINE]), {ok, ClusterFile}; undefined -> + ct:print(">>> init_test_cluster,Line:~p~n", [?LINE]), init_test_cluster_int(Options) end. @@ -96,20 +100,25 @@ debug_cluster(Tx, Start, End) -> ). init_test_cluster_int(Options) -> + ct:print(">>> init_test_cluster,Line:~p~n", [?LINE]), {ok, CWD} = file:get_cwd(), DefaultIpAddr = {127, 0, 0, 1}, DefaultPort = get_available_port(), DefaultDir = filename:join(CWD, ".erlfdb"), + ct:print(">>> init_test_cluster,Line:~p~n", [?LINE]), + IpAddr = ?MODULE:get(Options, ip_addr, DefaultIpAddr), Port = ?MODULE:get(Options, port, DefaultPort), Dir = ?MODULE:get(Options, dir, DefaultDir), ClusterName = ?MODULE:get(Options, cluster_name, <<"erlfdbtest">>), ClusterId = ?MODULE:get(Options, cluster_id, <<"erlfdbtest">>), - DefaultClusterFile = <<"/etc/foundationdb/fdb.cluster">>, + DefaultClusterFile = filename:join(Dir, <<"erlfdb.cluster">>), ClusterFile = ?MODULE:get(Options, cluster_file, DefaultClusterFile), + ct:print(">>> init_test_cluster,Line:~p~n", [?LINE]), + write_cluster_file(ClusterFile, ClusterName, ClusterId, IpAddr, Port), FDBServerBin = find_fdbserver_bin(Options),