Skip to content

Commit

Permalink
ci test
Browse files Browse the repository at this point in the history
  • Loading branch information
lafirest committed Nov 18, 2023
1 parent 98271d8 commit 7f381fc
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 6 deletions.
20 changes: 17 additions & 3 deletions .devcontainer/add_erlang_bindings.patch
Original file line number Diff line number Diff line change
@@ -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),
4 changes: 2 additions & 2 deletions .devcontainer/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -28,4 +28,4 @@ services:
network_mode: service:fdb

fdb:
image: foundationdb/foundationdb:6.3.23
image: foundationdb/foundationdb:7.1.43
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 10 additions & 1 deletion src/erlfdb_util.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit 7f381fc

Please sign in to comment.