Skip to content
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

Node sync test refactor phase 1 #57

Merged
merged 11 commits into from
Feb 3, 2025
Merged

Node sync test refactor phase 1 #57

merged 11 commits into from
Feb 3, 2025

Conversation

mkoura
Copy link
Collaborator

@mkoura mkoura commented Feb 3, 2025

No description provided.

mkoura added 11 commits January 31, 2025 11:21
- Removed `update_config` and `disable_p2p_node_config` functions
- Consolidated node configuration into `configure_node` function
- Updated `get_node_config_files` to call `configure_node`
- Disabled P2P for legacy mainnet topology in `configure_node`
- Removed redundant raw string prefix from RESULTS_FILE_NAME
- Replaced ONE_MINUTE constant with direct value in time.sleep
Replaced all instances of OrderedDict with standard dictionaries in
node_sync_test.py. This simplifies the code and removes unnecessary
imports.
- Replaced `Path` with `pl.Path` alias for consistency
- Simplified imports from `sync_tests.utils` module
- Updated type hints to use `str | None` syntax
- Improved readability by reducing redundant code
The sys.path.append(os.getcwd()) call was removed from
node_sync_test.py as it was redundant and unnecessary.
Removed references to discontinued testnets from node_sync_test.py.
This includes removing conditions for "testnet", "staging", and
"shelley-qa" environments. The code now only handles "mainnet",
"preview", and "preprod" environments.
- Changed return type of `get_epoch_no_d_zero` and `get_start_slot_no_d_zero`
  from `int | None` to `int`, returning `-1` instead of `None`.
- Modified `get_testnet_value` to return an empty string instead of `None`.
- Updated `get_current_tip` to use f-string for command construction.
- Replaced `chdir` calls with `temporary_chdir` context manager
- Updated functions to use `pl.Path` for path manipulations
- Improved readability and maintainability of the code
Replaced all instances of `utils` module with `helpers` module in
`node_sync_test.py`. This change ensures consistency and improves
code readability by using a single module for helper functions.
Refactored node sync test functions to remove the global `args` variable.
Functions now accept environment as a parameter. Added logging for better
debugging and tracking. Updated function names and signatures to improve
clarity and consistency. Adjusted main function to initialize logging and
parse arguments separately.
- Added logging configuration to multiple test files
- Replaced direct logging calls with LOGGER in utility modules
- Ensured consistent logging format across the codebase
@mkoura mkoura requested a review from saratomaz February 3, 2025 15:36
@saratomaz saratomaz merged commit 667ef2e into main Feb 3, 2025
1 of 3 checks passed
@saratomaz saratomaz deleted the node_sync_test_refactor1 branch February 3, 2025 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants