-
Notifications
You must be signed in to change notification settings - Fork 431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UCS/CONFIG: Filter out not loaded config tables for unused vars message #8557
Conversation
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
src/ucs/config/parser.h
Outdated
@@ -91,6 +91,7 @@ typedef struct ucs_config_global_list_entry { | |||
ucs_config_field_t *table; /* array of configuration fields */ | |||
size_t size; /* size of config structure */ | |||
ucs_list_link_t list; /* entry in global list */ | |||
int loaded; /* entry was loaded by parser */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Align comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WDYT of making a flags
member instead of dedicating a whole int
to a single bit?
Then can be extended if need extra fields in the future
src/ucs/config/parser.h
Outdated
/** | ||
* Configuration table flags | ||
*/ | ||
enum { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typedef
, ..._flags_t
src/ucs/config/parser.h
Outdated
|
||
typedef struct ucs_config_global_list_entry { | ||
const char *name; /* configuration table name */ | ||
const char *prefix; /* configuration prefix */ | ||
ucs_config_field_t *table; /* array of configuration fields */ | ||
size_t size; /* size of config structure */ | ||
ucs_list_link_t list; /* entry in global list */ | ||
int loaded; /* entry was loaded by parser */ | ||
uint8_t flags; /* config table flags */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Align /*
src/ucs/config/parser.h
Outdated
* Configuration table flags | ||
*/ | ||
typedef enum { | ||
/**< Table was loaded by the system */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
has been already loaded by the config parser
test/gtest/ucs/test_config.cc
Outdated
status = ucs_config_parser_fill_opts(&opts, car_opts_table, | ||
UCS_DEFAULT_ENV_PREFIX, NULL, 0); | ||
|
||
static ucs_config_global_list_entry_t config; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why static
?
test/gtest/ucs/test_config.cc
Outdated
status = ucs_config_parser_fill_opts(&opts, car_opts_table, | ||
UCS_DEFAULT_ENV_PREFIX, NULL, 0); | ||
|
||
ucs_config_global_list_entry_t config; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename "config" to "entry"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unresolved @shasson5
@shasson5 pls squash |
@shasson5 pipeline failure is relevant? |
yes I think so, will try to reproduce it |
test/apps/test_fuzzy_match.py
Outdated
@@ -40,12 +40,23 @@ def __init__(self, ucx_info, verbose): | |||
self.ucx_info = ucx_info | |||
if verbose: | |||
logging.basicConfig(level=logging.DEBUG) | |||
|
|||
def ib_available(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is_ib_available
or has_ib
test/apps/test_fuzzy_match.py
Outdated
{'UCX_SOME_VAR' : [], 'UCX_MOFULE_D' : ['UCX_MODULE_DIR', 'UCX_MODULES'], 'UCX_SOME_VAR2' : [], 'UCX_LOF_LEVEL' : ['UCX_LOG_LEVEL']}, | ||
{'UCX_RC_VERBS_RX_MAX_BUF' : ['UCX_RC_VERBS_TX_MAX_BUFS', 'UCX_RC_VERBS_RX_MAX_BUFS', 'UCX_UD_VERBS_RX_MAX_BUFS']}, | ||
{'UCX_RLS' : ['UCX_TLS']}] | ||
expected_list = [{'results' : {'UCX_LOF_LEVEL' : ['UCX_LOG_LEVEL']}, 'ib_required': False}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WDYT of the following refactoring (simplify).
- Rename
expected_list
to something liketest_cases
orfuzzy_matches
(at least remove_list
). - Revert to the "old" structure of the dicts in the list
- Split to 2 lists, e.g
test_cases
,ib_test_cases
. - Then can have:
def run(self, test_case, needs_ib=False):
...
for test_case in test_cases:
runner.run(test_case)
for test_case in ib_test_cases:
runner.run(test_case, needs_ib=True)
test/apps/test_fuzzy_match.py
Outdated
def run(self, expected): | ||
with Environment(expected.keys()): | ||
if expected['ib_required'] and not self.ib_available(): | ||
# Skip test if IB transport is required but not available. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excessive commenting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you mean it's not needed at all? or it should just be shorter?
runner.run(expected) | ||
ib_test_cases = [{'UCX_RC_VERBS_RX_MAX_BUF' : ['UCX_RC_VERBS_TX_MAX_BUFS', 'UCX_RC_VERBS_RX_MAX_BUFS', 'UCX_UD_VERBS_RX_MAX_BUFS']}] | ||
|
||
for test_case in test_cases: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe smth like this
if self.has_ib()
test_cases += ib_test_cases
and remove "needs_ib" param
What
Filter out not loaded config tables for unused vars message
Why ?
Avoid displaying wrong env var suggestions