feat(mix ct): add support for specifying group paths

This commit is contained in:
Thales Macedo Garitezi 2024-07-11 15:08:45 -03:00
parent 39c82fbe89
commit bbd51bdf18
1 changed files with 7 additions and 4 deletions

View File

@ -48,6 +48,7 @@ defmodule Mix.Tasks.Emqx.Ct do
abort_if_missing_suites: true, abort_if_missing_suites: true,
auto_compile: false, auto_compile: false,
suite: opts |> Map.fetch!(:suites) |> Enum.map(&to_charlist/1), suite: opts |> Map.fetch!(:suites) |> Enum.map(&to_charlist/1),
group: opts |> Map.fetch!(:group_paths) |> Enum.map(fn gp -> Enum.map(gp, &String.to_atom/1) end),
testcase: opts |> Map.fetch!(:cases) |> Enum.map(&to_charlist/1), testcase: opts |> Map.fetch!(:cases) |> Enum.map(&to_charlist/1),
readable: 'true', readable: 'true',
name: node_name, name: node_name,
@ -198,11 +199,13 @@ defmodule Mix.Tasks.Emqx.Ct do
args, args,
strict: [ strict: [
suites: :string, suites: :string,
groups: :string, group_paths: :string,
cases: :string]) cases: :string])
|> IO.inspect(label: :opts)
suites = get_name_list(opts, :suites) suites = get_name_list(opts, :suites)
groups = get_name_list(opts, :groups) group_paths =
opts
|> get_name_list(:group_paths)
|> Enum.map(& String.split(&1, ".", trim: true))
cases = get_name_list(opts, :cases) cases = get_name_list(opts, :cases)
if suites == [] do if suites == [] do
@ -211,7 +214,7 @@ defmodule Mix.Tasks.Emqx.Ct do
%{ %{
suites: suites, suites: suites,
groups: groups, group_paths: group_paths,
cases: cases cases: cases
} }
end end