Skip to content

Commit

Permalink
Merge pull request #3 from esl/bump-amoc-version
Browse files Browse the repository at this point in the history
Update amoc version to 3.3.0
  • Loading branch information
DenysGonchar authored Aug 22, 2024
2 parents 1922067 + 67ec2f3 commit c4c8016
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 44 deletions.
24 changes: 13 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,36 @@ on:

jobs:
test:
name: OTP ${{matrix.otp}}
name: OTP ${{matrix.otp_vsn}}
strategy:
matrix:
otp: ['26.2', '25.3', '24.3']
runs-on: 'ubuntu-22.04'
otp_vsn: ['27', '26', '25']
rebar_vsn: ['3.23.0']
runs-on: 'ubuntu-24.04'
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
rebar3-version: '3.22.0'
otp-version: ${{ matrix.otp_vsn }}
rebar3-version: ${{ matrix.rebar_vsn }}
- name: Run tests project
run: rebar3 test

integration_test:
name: docker container test with OTP ${{matrix.otp}}
name: docker container test with OTP ${{matrix.otp_vsn}}
strategy:
matrix:
otp: ['26.2', '25.3', '24.3']
runs-on: 'ubuntu-22.04'
otp_vsn: ['27', '26', '25']
rebar_vsn: ['3.23.0']
runs-on: 'ubuntu-24.04'
env:
OTP_RELEASE: ${{ matrix.otp }}
OTP_RELEASE: ${{ matrix.otp_vsn }}
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
rebar3-version: '3.22.0'
otp-version: ${{ matrix.otp_vsn }}
rebar3-version: ${{ matrix.rebar_vsn }}
- run: ./ci/build_docker_image.sh
- run: ./ci/start_demo_cluster.sh
- run: ./ci/test_amoc_cluster.sh
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ARG otp_vsn=25.3
FROM erlang:${otp_vsn}
MAINTAINER Erlang Solutions <[email protected]>
LABEL org.label-schema.name='AMOC Arsenal' \
org.label-schema.vendor='Erlang Solutions'

WORKDIR /amoc_arsenal

Expand Down
2 changes: 1 addition & 1 deletion doc/http-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ With default options API will be running on port 4000. You can set other port by
In Amoc we use Swagger UI so if you want the current documentation in a nice format you can find it under `/api-docs/` path.
Just open it in your browser (e.g. http://localhost:4000/api-docs/)

You can also find the current documentation [here](https://esl.github.io/amoc_rest/?v=1.1.1)
You can also find the current documentation [here](https://esl.github.io/amoc_rest/?v=1.1.2)
(without possibility to execute requests)
4 changes: 2 additions & 2 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
{alias, [{test, [compile, ct, xref, dialyzer]}]}.

{deps, [
{amoc, "3.0.0"},
{amoc, "3.3.0"},
{telemetry, "1.2.1"},
{exometer_core, {git, "https://github.com/esl/exometer_core.git", {branch, "master"}}},
{exometer_report_graphite,
{git, "https://github.com/esl/exometer_report_graphite.git", {branch, "master"}}},
%% when updating amoc_rest version, don't forget to update it at ./doc/http-api.md as well.
{amoc_rest, {git, "https://github.com/esl/amoc_rest.git", {tag, "1.1.1"}}},
{amoc_rest, {git, "https://github.com/esl/amoc_rest.git", {tag, "1.1.2"}}},
{docsh, "0.7.2"}
]}.

Expand Down
34 changes: 17 additions & 17 deletions rebar.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{"1.2.0",
[{<<"amoc">>,{pkg,<<"amoc">>,<<"3.0.0">>},0},
[{<<"amoc">>,{pkg,<<"amoc">>,<<"3.3.0">>},0},
{<<"amoc_rest">>,
{git,"https://github.com/esl/amoc_rest.git",
{ref,"103c3123a8cf0464b9c3f9392af6a396673f67bd"}},
{ref,"1e41be5b6b332a827d125380fa4f7ea23a00748e"}},
0},
{<<"bear">>,{pkg,<<"bear">>,<<"1.0.0">>},1},
{<<"cowboy">>,{pkg,<<"cowboy">>,<<"2.9.0">>},1},
{<<"cowlib">>,{pkg,<<"cowlib">>,<<"2.11.0">>},2},
{<<"cowboy">>,{pkg,<<"cowboy">>,<<"2.12.0">>},1},
{<<"cowlib">>,{pkg,<<"cowlib">>,<<"2.13.0">>},2},
{<<"docsh">>,{pkg,<<"docsh">>,<<"0.7.2">>},0},
{<<"exometer_core">>,
{git,"https://github.com/esl/exometer_core.git",
Expand All @@ -17,40 +17,40 @@
{ref,"59e475a094818294443de9dc68e08ee0116a5626"}},
0},
{<<"getopt">>,{pkg,<<"getopt">>,<<"1.0.1">>},2},
{<<"jesse">>,{pkg,<<"jesse">>,<<"1.5.6">>},1},
{<<"jesse">>,{pkg,<<"jesse">>,<<"1.8.0">>},1},
{<<"jsx">>,{pkg,<<"jsx">>,<<"3.1.0">>},1},
{<<"parse_trans">>,{pkg,<<"parse_trans">>,<<"3.4.0">>},1},
{<<"providers">>,{pkg,<<"providers">>,<<"1.8.1">>},1},
{<<"ranch">>,{pkg,<<"ranch">>,<<"1.8.0">>},2},
{<<"rfc3339">>,{pkg,<<"rfc3339">>,<<"0.9.0">>},1},
{<<"ranch">>,{pkg,<<"ranch">>,<<"2.1.0">>},1},
{<<"rfc3339">>,{pkg,<<"rfc3339">>,<<"0.9.0">>},2},
{<<"telemetry">>,{pkg,<<"telemetry">>,<<"1.2.1">>},0}]}.
[
{pkg_hash,[
{<<"amoc">>, <<"DFBE52A36237EE7659D9E691F392E16DC5634346800CBB4A1F971143984C1DC1">>},
{<<"amoc">>, <<"531B7E8CE39D40B4BF5A819868091C4451DC3D3FDAE753E3E3B1D0E5E8E81CDD">>},
{<<"bear">>, <<"430419C1126B477686CDE843E88BA0F2C7DC5CDF0881C677500074F704339A99">>},
{<<"cowboy">>, <<"865DD8B6607E14CF03282E10E934023A1BD8BE6F6BACF921A7E2A96D800CD452">>},
{<<"cowlib">>, <<"0B9FF9C346629256C42EBE1EEB769A83C6CB771A6EE5960BD110AB0B9B872063">>},
{<<"cowboy">>, <<"F276D521A1FF88B2B9B4C54D0E753DA6C66DD7BE6C9FCA3D9418B561828A3731">>},
{<<"cowlib">>, <<"DB8F7505D8332D98EF50A3EF34B34C1AFDDEC7506E4EE4DD4A3A266285D282CA">>},
{<<"docsh">>, <<"F893D5317A0E14269DD7FE79CF95FB6B9BA23513DA0480EC6E77C73221CAE4F2">>},
{<<"getopt">>, <<"C73A9FA687B217F2FF79F68A3B637711BB1936E712B521D8CE466B29CBF7808A">>},
{<<"jesse">>, <<"593B8CAD26AF3CC0E44C727BD8CBDE56E2B0DE4C8D2738B1C258B6936A40A6A3">>},
{<<"jesse">>, <<"CF7615C3F2BE892F77BCCF736F23B4BD54A0FC686C7040431AEBA5EF7932CC4D">>},
{<<"jsx">>, <<"D12516BAA0BB23A59BB35DCCAF02A1BD08243FCBB9EFE24F2D9D056CCFF71268">>},
{<<"parse_trans">>, <<"BB87AC362A03CA674EBB7D9D498F45C03256ADED7214C9101F7035EF44B798C7">>},
{<<"providers">>, <<"70B4197869514344A8A60E2B2A4EF41CA03DEF43CFB1712ECF076A0F3C62F083">>},
{<<"ranch">>, <<"8C7A100A139FD57F17327B6413E4167AC559FBC04CA7448E9BE9057311597A1D">>},
{<<"ranch">>, <<"2261F9ED9574DCFCC444106B9F6DA155E6E540B2F82BA3D42B339B93673B72A3">>},
{<<"rfc3339">>, <<"2075653DC9407541C84B1E15F8BDA2ABE95FB17C9694025E079583F2D19C1060">>},
{<<"telemetry">>, <<"68FDFE8D8F05A8428483A97D7AAB2F268AAFF24B49E0F599FAA091F1D4E7F61C">>}]},
{pkg_hash_ext,[
{<<"amoc">>, <<"66A377798F9F4F6361C223A586FEB32CA6B3401FA106850C9D9682FEB3BBD5B9">>},
{<<"amoc">>, <<"B8DD4F77BB94716ABC64E863158EEF8E1375CECB2F69E57DC4A293B0949D4985">>},
{<<"bear">>, <<"157B67901ADF84FF0DA6EAE035CA1292A0AC18AA55148154D8C582B2C68959DB">>},
{<<"cowboy">>, <<"2C729F934B4E1AA149AFF882F57C6372C15399A20D54F65C8D67BEF583021BDE">>},
{<<"cowlib">>, <<"2B3E9DA0B21C4565751A6D4901C20D1B4CC25CBB7FD50D91D2AB6DD287BC86A9">>},
{<<"cowboy">>, <<"8A7ABE6D183372CEB21CAA2709BEC928AB2B72E18A3911AA1771639BEF82651E">>},
{<<"cowlib">>, <<"E1E1284DC3FC030A64B1AD0D8382AE7E99DA46C3246B815318A4B848873800A4">>},
{<<"docsh">>, <<"4E7DB461BB07540D2BC3D366B8513F0197712D0495BB85744F367D3815076134">>},
{<<"getopt">>, <<"53E1AB83B9CEB65C9672D3E7A35B8092E9BDC9B3EE80721471A161C10C59959C">>},
{<<"jesse">>, <<"3F9475B0C5B242E09592604AABB03328501D7E3D8A528173B5A75396EEDB0060">>},
{<<"jesse">>, <<"860EF4621DDBFB72792668929BE127E45E8B07CF19EEA264B0A9D48D36CCA41B">>},
{<<"jsx">>, <<"0C5CC8FDC11B53CC25CF65AC6705AD39E54ECC56D1C22E4ADB8F5A53FB9427F3">>},
{<<"parse_trans">>, <<"F99E368830BEA44552224E37E04943A54874F08B8590485DE8D13832B63A2DC3">>},
{<<"providers">>, <<"E45745ADE9C476A9A469EA0840E418AB19360DC44F01A233304E118A44486BA0">>},
{<<"ranch">>, <<"49FBCFD3682FAB1F5D109351B61257676DA1A2FDBE295904176D5E521A2DDFE5">>},
{<<"ranch">>, <<"244EE3FA2A6175270D8E1FC59024FD9DBC76294A321057DE8F803B1479E76916">>},
{<<"rfc3339">>, <<"182314DE35C9F4180B22EB5F22916D8D7A799C1109A060C752970273A9332AD6">>},
{<<"telemetry">>, <<"DAD9CE9D8EFFC621708F99EAC538EF1CBE05D6A874DD741DE2E689C47FEAFED5">>}]}
].
2 changes: 1 addition & 1 deletion src/rest_api/amoc_api_helpers_status.erl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ get_controller_status() ->
{finished, Scenario} ->
#{status => <<"finished">>,
scenario => atom_to_binary(Scenario, utf8)};
{running, Scenario, NoOfUsers, _} ->
{running, #{scenario := Scenario, currently_running_users := NoOfUsers}} ->
#{status => <<"running">>,
scenario => atom_to_binary(Scenario, utf8),
number_of_users => NoOfUsers}
Expand Down
14 changes: 4 additions & 10 deletions test/amoc_api_scenarios_handler_SUITE.erl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
-module(amoc_api_scenarios_handler_SUITE).

-include_lib("common_test/include/ct.hrl").
-include_lib("eunit/include/eunit.hrl").
-include("scenario_template.hrl").

Expand All @@ -13,6 +12,9 @@
-define(SAMPLE_SCENARIO_DECLARATION,
"-module(" ++ atom_to_list(?SAMPLE_SCENARIO) ++ ").").

-define(PARSE_ERROR,
<<"\n [{{2,1},erl_parse,[\"syntax error before: \",[]]}]}]\n">>).

-export([all/0, groups/0, init_per_testcase/2, end_per_testcase/2]).

-export([
Expand Down Expand Up @@ -80,14 +82,6 @@ put_scenarios_returns_400_and_error_when_scenario_is_not_valid(_Config) ->
?assertEqual(400, CodeHttp),
?assertEqual(#{<<"error">> => <<"invalid module">>}, Body).

-if(?OTP_RELEASE >= 24).
-define(PARSE_ERROR,
<<"\n [{{2,1},erl_parse,[\"syntax error before: \",[]]}]}]\n">>).
-else.
-define(PARSE_ERROR,
<<"\n [{2,erl_parse,[\"syntax error before: \",[]]}]}]\n">>).
-endif.

put_scenarios_returns_200_and_compile_error_when_scenario_source_not_valid(_Config) ->
%% given
ScenarioContent = ?SAMPLE_SCENARIO_DECLARATION ++ "\ninvalid_source",
Expand Down Expand Up @@ -141,7 +135,7 @@ get_scenario_info_returns_200_when_scenario_exists(Config) ->
<<"update_fn">> =>
<<"fun amoc_controller:maybe_update_interarrival_timer/2">>,
<<"verification_fn">> =>
<<"fun amoc_controller:positive_integer/1">>},
<<"fun amoc_controller:non_neg_integer/1">>},
<<"some_parameter">> =>
#{<<"default_value">> => <<"undefined">>,
<<"description">> => <<"\"some parameter\"">>,
Expand Down
4 changes: 3 additions & 1 deletion test/amoc_api_status_handler_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,9 @@ given_amoc_controller_is_mocked(error) ->
meck:expect(amoc_controller, get_status, fun() -> {error, mocked} end),
#{<<"status">> => <<"error">>, <<"error">> => <<"mocked">>};
given_amoc_controller_is_mocked(running) ->
Status = {running, test_scenario, 10, 10},
Status = {running, #{scenario => test_scenario,
currently_running_users => 10,
highest_user_id => 10}},
meck:expect(amoc_controller, get_status, fun() -> Status end),
#{<<"status">> => <<"running">>, <<"scenario">> => <<"test_scenario">>,
<<"number_of_users">> => 10};
Expand Down

0 comments on commit c4c8016

Please sign in to comment.