Skip to content

Commit

Permalink
Feature #1610 first round of SonarQube fixes (#2200)
Browse files Browse the repository at this point in the history
  • Loading branch information
georgemccabe committed Jun 6, 2023
1 parent e1585a2 commit 042b394
Show file tree
Hide file tree
Showing 51 changed files with 1,474 additions and 7,654 deletions.
2 changes: 1 addition & 1 deletion .github/actions/run_tests/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ if [[ "$INPUT_CATEGORIES" == pytests* ]]; then
for x in `cat $PYTESTS_GROUPS_FILEPATH`; do
marker="${x//_or_/ or }"
marker="${marker//not_/not }"
command+="/usr/local/conda/envs/${METPLUS_ENV_TAG}/bin/pytest -vv --cov=../../../metplus -m \"$marker\""
command+="/usr/local/conda/envs/${METPLUS_ENV_TAG}/bin/pytest -vv --cov=../../../metplus --cov-append -m \"$marker\""
command+=";if [ \$? != 0 ]; then status=1; fi;"
done
command+="if [ \$status != 0 ]; then echo ERROR: Some pytests failed. Search for FAILED to review; false; fi"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ def test_find_var_indices_fcst(metplus_config,
)
@pytest.mark.util
def test_get_field_search_prefixes(data_type, met_tool, expected_out):
assert(config_metplus.get_field_search_prefixes(data_type,
met_tool) == expected_out)
assert(config_metplus._get_field_search_prefixes(data_type,
met_tool) == expected_out)


# search prefixes are valid prefixes to append to field info variables
Expand Down
12 changes: 12 additions & 0 deletions internal/tests/pytests/util/string_manip/test_util_string_manip.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@
from metplus.util.string_manip import *
from metplus.util.string_manip import _fix_list

@pytest.mark.parametrize(
'template, expected_output', [
('', ''),
('{init?fmt=%Y%m%d}_i{init?fmt=%H%M}_m0_f*',
r'{init?fmt=%Y%m%d}_i{init?fmt=%H%M}_m0_f*'),
('pgbf{lead?fmt=%HHH}.gfs.{init?fmt=%Y%m%d%H}',
r'pgbf.*\.gfs\.{init?fmt=%Y%m%d%H}'),
]
)
@pytest.mark.util
def test_template_to_regex(template, expected_output):
assert template_to_regex(template) == expected_output

@pytest.mark.parametrize(
'subset_definition, expected_result', [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def test_valid_init_env_vars(metplus_config, config_overrides,
runtime_settings_dict_list = wrapper._get_all_runtime_settings(time_input)
assert runtime_settings_dict_list

first_runtime_only = [runtime_settings_dict_list[0]]
first_runtime_only = runtime_settings_dict_list[0]
wrapper._run_stat_analysis_job(first_runtime_only)
all_cmds = wrapper.all_commands

Expand Down
Loading

0 comments on commit 042b394

Please sign in to comment.