MIM-2711 Sync GitHub Actions big test presets with CircleCI#4751
MIM-2711 Sync GitHub Actions big test presets with CircleCI#4751mdbrnowski wants to merge 5 commits into
Conversation
|
CircleCI results for 4717ee6 small_tests_latest / small_tests / 2ae73db small_tests_latest_arm64 / small_tests / 2ae73db small_tests_legacy / small_tests / 2ae73db ldap_mnesia_latest / ldap_mnesia / 2ae73db internal_mnesia_latest / internal_mnesia / 2ae73db dynamic_domains_pgsql_cets_latest / pgsql_cets / 2ae73db elasticsearch_and_cassandra_mnesia_latest / elasticsearch_and_cassandra_mnesia / 2ae73db mongoose_elasticsearch_SUITE:end_per_suite{error,
{{badrpc,
{'EXIT',
{#{what => event_already_registered,
event_name => wpool_global_queue_lengths,
labels => #{pool_tag => default,pool_type => elastic}},
[{mongoose_instrument,set_up,3,
[{file,
"/home/circleci/project/src/instrument/mongoose_instrument.erl"},
{line,114}]},
{lists,foreach_1,2,[{file,"lists.erl"},{line,2641}]},
{mongoose_wpool,start,5,
[{file,
"/home/circleci/project/src/wpool/mongoose_wpool.erl"},
{line,162}]},
{mongoose_wpool,'-start_configured_pools/3-lc$^1/1-1-',1,
[{file,
"/home/circleci/project/src/wpool/mongoose_wpool.erl"},
{line,129}]},
{mongoose_wpool,start_configured_pools,1,[]}]}}},
[{distributed_helper,rpc,
[#{node => mongooseim@localhost},
mongoose_wpool,start_configured_pools,
[[#{scope => global,tag => default,type => elastic,
opts =>
#{strategy => best_worker,workers => 10,
call_timeout => 5000},
conn_opts => #{port => 9200,host => <<"localhost">>}}]]],
[{file,
"/home/circleci/project/big_tests/../test/common/distributed_helper.erl"},
{line,143}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1799}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1396}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1240}]}]}...mysql_cets_latest / mysql_cets / 2ae73db dynamic_domains_pgsql_cets_legacy / pgsql_cets / 2ae73db pgsql_cets_latest / pgsql_cets / 2ae73db pgsql_mnesia_latest / pgsql_mnesia / 2ae73db pgsql_redis_latest / pgsql_redis / 2ae73db cockroachdb_cets_latest / cockroachdb_cets / 2ae73db pgsql_cets_legacy / pgsql_cets / 2ae73db |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4751 +/- ##
==========================================
+ Coverage 86.91% 86.94% +0.02%
==========================================
Files 554 554
Lines 33497 33497
==========================================
+ Hits 29115 29123 +8
+ Misses 4382 4374 -8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| print_circleci(Presets) -> | ||
| maps:foreach( | ||
| fun(Name, Opts) -> | ||
| print_circleci_preset(Name, resolve_include(Opts, Presets)) |
There was a problem hiding this comment.
Would it make sense to move resolve_include into parse_presets/1? This way, the data passed to print_* functions is already fully resolved.
| print_github(Presets, Otp) -> | ||
| Objs = [github_object(Name, resolve_include(maps:get(Name, Presets), Presets), Otp) | ||
| || Name <- lists:sort(maps:keys(Presets))], | ||
| io:format("~s", [["{\"include\":[", lists:join(",", Objs), "]}"]]). | ||
|
|
||
| github_object(Name, #{executor := Executor, preset := Preset} = Opts, Otp) -> | ||
| Fields = [kv("name", Name), kv("preset", Preset), | ||
| kv("otp", otp_version(Executor, Otp)), | ||
| kv("test-spec", maps:get(spec, Opts, "default.spec"))], | ||
| ["{", lists:join(",", Fields), "}"]. | ||
|
|
||
| kv(Key, Value) -> ["\"", Key, "\":\"", to_str(Value), "\""]. | ||
|
|
||
| to_str(A) when is_atom(A) -> atom_to_list(A); | ||
| to_str(L) -> L. |
There was a problem hiding this comment.
Since OTP 27.0, the built-in json module is available, so this code could be simplified by using it:
| print_github(Presets, Otp) -> | |
| Objs = [github_object(Name, resolve_include(maps:get(Name, Presets), Presets), Otp) | |
| || Name <- lists:sort(maps:keys(Presets))], | |
| io:format("~s", [["{\"include\":[", lists:join(",", Objs), "]}"]]). | |
| github_object(Name, #{executor := Executor, preset := Preset} = Opts, Otp) -> | |
| Fields = [kv("name", Name), kv("preset", Preset), | |
| kv("otp", otp_version(Executor, Otp)), | |
| kv("test-spec", maps:get(spec, Opts, "default.spec"))], | |
| ["{", lists:join(",", Fields), "}"]. | |
| kv(Key, Value) -> ["\"", Key, "\":\"", to_str(Value), "\""]. | |
| to_str(A) when is_atom(A) -> atom_to_list(A); | |
| to_str(L) -> L. | |
| print_github(Presets, OTPs) -> | |
| Include = [ | |
| #{ | |
| <<"name">> => Name, | |
| <<"preset">> => list_to_binary(Preset), | |
| <<"otp">> => otp_version(Executor, OTPs), | |
| <<"test-spec">> => list_to_binary(maps:get(spec, Opts, "default.spec")) | |
| } | |
| || {Name, #{executor := Executor, preset := Preset} = Opts} <- maps:to_list(Presets) | |
| ], | |
| io:format("~s~n", [json:encode(#{include => Include})]). |
There was a problem hiding this comment.
Thanks! Though your snippet drops the dynamic_domains_* presets: the generator pattern #{executor := _, preset := _} doesn't match them until their include is resolved.
This PR makes
.circleci/presets.configthe single source of truth for big-test presets on both CIs, so editing that one file updates CircleCI and GitHub Actions together (see: #4692).