Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ HyperBEAM supports several optional build profiles that enable additional featur

- `genesis_wasm`: Enables Genesis WebAssembly support
- `rocksdb`: Enables RocksDB storage backend (adds RocksDB v1.8.0 dependency)
- `s3`: Enables S3 storage backend
- `http3`: Enables HTTP/3 support via QUIC protocol


Expand Down
14 changes: 14 additions & 0 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@
{d, 'ENABLE_ROCKSDB', true}
]}
]},
{s3, [
{deps, [
{erlcloud, {git, "https://github.com/erlcloud/erlcloud.git",
{ref, "fe58402b40b93a20176d12b4bc211ea6a5b0d915"}}
}
]},
{erl_opts, [
{d, 'ENABLE_S3', true}
]},
{relx, [{release, {'hb', "0.0.1"}, [hb, b64fast, cowboy, gun, luerl, prometheus, prometheus_cowboy, elmdb, erlcloud]}]}
]},
{http3, [
{deps, [
{quicer, {git, "https://github.com/emqx/quic.git",
Expand All @@ -56,6 +67,9 @@
{add, cowboy, [{erl_opts, [{d, 'COWBOY_QUICER', 1}]}]},
{add, gun, [{erl_opts, [{d, 'GUN_QUICER', 1}]}]}
]}
]},
{test, [
{deps, [{meck, "1.1.0"}]}
]}
]}.

Expand Down
16 changes: 13 additions & 3 deletions src/hb_store.erl
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ test_stores() ->
}
]
}
] ++ rocks_stores().
] ++ rocks_stores() ++ s3_stores().

-ifdef(ENABLE_ROCKSDB).
rocks_stores() ->
Expand All @@ -453,16 +453,26 @@ rocks_stores() ->
-else.
rocks_stores() -> [].
-endif.

-ifdef(ENABLE_S3).
s3_stores() ->
[(hb_store_s3:default_test_opts())#{
<<"benchmark-scale">> => 0.01
}].
-else.
s3_stores() -> [].
-endif.
generate_test_suite(Suite) ->
generate_test_suite(Suite, test_stores()).
generate_test_suite(Suite, Stores) ->
hb:init(),
application:ensure_all_started(hb),
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is necessary to use hb_http_client in hb_store_s3 requests.

lists:map(
fun(Store = #{<<"store-module">> := Mod}) ->
{foreach,
fun() ->
hb_store:start(Store)
hb_store:start(Store),
% If the test fails, the store isn't cleared.
hb_store:reset(Store)
end,
fun(_) ->
hb_store:reset(Store)
Expand Down
Loading