* Manual MaxPatchPublishDate selection through date versioning
* Mitigation mode
* Enhanced mitigation mode
* Additional test coverage
* Modified check flow
* One additional line of code coverage
* Comments for code readability
* Different data validation method
* Additional error condition check
* Force codecov run
* Codecov reset
* Soft reset over master
* Test merge
* Additional asserts
* add ut for add_error_to_status
* add test_start_reboot()
* add logic to rset sys.stdout and add dummy test in rebootmanager.py
* modify start_reboot for testing
* use import six, StringIO works in py2 py3
* add ut for start_reboot raise exception
* create a new method to preserve start_reboot
* restore the sys.__stdout
* revert import to use io instead of six
* add ut for rebootifrequired
* test stringIO import
* restore configurepatchingprocessor and maintenancewindow tests as master
* refactor the test assessor throws exception
* Remove external dependencies from coverage
* Retry path specification
* Update ci.yml
Reviewing what happens with dependencies
* Update codecov.yml
Experimenting
* Including contributing.md
* Trying exclusion per docs
* Trying this another way
* add logic to skip security plugin for rhel8+ images
* add log and ut for disable security plug for rhel8+
* refactor and remove prints and extra lines
* remove semicolon and reformat ut test_yumpkgmanager
* modify the log output
* refactor code
* add raise exception utest in maintenance windows file
* add ut for log_to_stdout to true
* add test code to assert log output
* add raise exception test in Test_ConfigurePatchingProcessor.py
* add unit test for raise exception on auto assessment systemd
* refactor python file
* Increasing batch size from 3 to 6
* Added function signatures and callers from the code
* Some indentation changes
* Incorporate PR comments
* Implemented the function get_max_batch_size
fixed some issues in code after manual testing.
Updated the average time to install package in different package managers based on update in kusto query to get average time.
* Addressing some comments in the PR. The comments addressed are:
(a) There should be two new lines at the end of file
(b) Extract some code of install_updates to another function as install_updates was getting longer.
* Added test case for get_max_batch_size
* Addressed PR comments
* added package_manager in the callers for the method is_package_install_time_available in test code
* Removed mentioning specific package manager in test_get_max_batch_size
* Add runtime.stop() at the end of the test test_get_max_batch_size
* Addressing PR comments and one fix.
The fix is in the function get_max_batch_size, there is difference in behaviour in python2 and python3. In python2, int/int is int but in python3 int/int is float
Addressed PR comment by adding the class PackageBatchConfig for batch patching constants
* Update unit tests to increase code coverage
* Update test cases as per the product code changes done.
* update test case to increase % coverage
---------
Co-authored-by: Koshy John <kjohn@microsoft.com>
* add more unit test in status handler to increase code coverage
* pull master changes and add sequence numb termination utest to status_handler
* ignore scratch folder/content
* remove duplicate assertion
* rename Test sequence number change for installation ut
* remove scratch from gitignore
---------
Co-authored-by: Koshy John <kjohn@microsoft.com>
* Fixes two issues:
(a) If there are two conflicting packages in install command then installation of all the packages in the command fails. Added --skip-broken to ignore one of the conflicting packages and install rest of the packages.
(b) Install packages fails due to conflicting request in yum when there are two packages with same name but different arch and different versions.
* Fixed test failures
* initial commit
* add test comment to remove changes in truncation pr
* reset Test_statushandler.py
* add public getter methods for truncated removed patches and update __expected_truncated_patch_count
* change test_truncation_method_time_performance max to 35 sec
* comment out the test_truncation_method_time_performance ut
* change time performance to 70 sec
* add assertion for error message
* add error assertion
* comment out the installation debug to see if tests are failing or not
* revert changes add debug for pipeline
* change time performance to 90 sec
* change time performance to 30 sec
* use github env instead of github output
* add unit test ouput to github env
* combine Read test output and check if all tests passed and use bash shell
* remove print
* remove expected_truncated_count, and update uttest assertion for expected count
* add tombstone logic
* reduce iteration to 30 in performance test
* remove pacakge setup to outside for loop, it is not suppose to be inside
* update the method description
* uncomment the debug in set_install_packages
* add tombstone logic and ut
* add assertion for tombstone
* reduce performance time from n2 to n
* add one more ut for keep 5 assessment
* cm1 add condition logic set up code
* add condition tracker and fix ut
* add logic to reset is_status_file_truncated
* change logic for force_truncation_on
* add log for IsTruncationAllowed and IsForceTruncation
* add new time performance config file and add logic for not modifying status during transitioning
* refactor assessment tombstone method
* remove enum object and add space to eof
* add space to eof
* fix the logic to ensure trucation is applied all time when file > 126kb
* remove unused log_verbose
* cm2 add logic to check status for transitioning and not to update status and error msg
* modify code to add log and check for terminal state
* add logic for adding error msg and status change
* reformat the logic for recompose message errors json
* add test for informational message
* refactor test_packages to test_patches
* cm1 remove unnecessary log and change test_packages to test_patches
* add tombstone description to information ut
* refactor set_errors_msg to compose_errors_msg
* refactor errors_message to error_detail
* split set_status_file into assessment and instllation
* refactor assessment tombstone methods
* remove todo for installation tombstone
* refactor write_assessment/installation_status_file and use orderdict instead of map to kep order of tombstone for py27
* reduce patch_count size
* refactor _set_force_truncation_on_terminal_status
* add space so push -f can resolve codecov report upload failure
* remove tracker from truncation_timestamp
* modify No_truncation_logic_in_sec to Delay_truncation_by_sec and combine the if logic when truncation is going to apply
* use MIN_TRUNCATION_INTERVAL_IN_SEC, and refactor __get_status_payload_with_truncated_patches returns
* cm2 add datetime logic test truncation iteration
* use event.wait to pause ut to get different last modified time
* reorder imports in test_truncation
* set EPOCH as constant
* use reflection to set truncation_timestamp
* initial commit
* add test comment to remove changes in truncation pr
* reset Test_statushandler.py
* add public getter methods for truncated removed patches and update __expected_truncated_patch_count
* change test_truncation_method_time_performance max to 35 sec
* comment out the test_truncation_method_time_performance ut
* change time performance to 70 sec
* add assertion for error message
* add error assertion
* comment out the installation debug to see if tests are failing or not
* revert changes add debug for pipeline
* change time performance to 90 sec
* change time performance to 30 sec
* use github env instead of github output
* add unit test ouput to github env
* combine Read test output and check if all tests passed and use bash shell
* remove print
* remove expected_truncated_count, and update uttest assertion for expected count
* add tombstone logic
* reduce iteration to 30 in performance test
* remove pacakge setup to outside for loop, it is not suppose to be inside
* update the method description
* uncomment the debug in set_install_packages
* add tombstone logic and ut
* add assertion for tombstone
* reduce performance time from n2 to n
* add one more ut for keep 5 assessment
* add new time performance config file and add logic for not modifying status during transitioning
* refactor assessment tombstone method
* remove enum object and add space to eof
* add space to eof
* add logic for adding error msg and status change
* reformat the logic for recompose message errors json
* add test for informational message
* refactor test_packages to test_patches
* add tombstone description to information ut
* refactor set_errors_msg to compose_errors_msg
* refactor errors_message to error_detail
* split set_status_file into assessment and instllation
* refactor assessment tombstone methods
* remove todo for installation tombstone
* refactor write_assessment/installation_status_file and use orderdict instead of map to kep order of tombstone for py27
* reduce patch_count size
* initial commit
* add test comment to remove changes in truncation pr
* reset Test_statushandler.py
* add public getter methods for truncated removed patches and update __expected_truncated_patch_count
* change test_truncation_method_time_performance max to 35 sec
* comment out the test_truncation_method_time_performance ut
* change time performance to 70 sec
* add assertion for error message
* add error assertion
* comment out the installation debug to see if tests are failing or not
* revert changes add debug for pipeline
* change time performance to 90 sec
* change time performance to 30 sec
* use github env instead of github output
* add unit test ouput to github env
* combine Read test output and check if all tests passed and use bash shell
* remove print
* remove expected_truncated_count, and update uttest assertion for expected count
* reduce iteration to 30 in performance test
* remove pacakge setup to outside for loop, it is not suppose to be inside
* update the method description
* uncomment the debug in set_install_packages
* add new time performance config file and add logic for not modifying status during transitioning
* remove enum object and add space to eof
* add logic for adding error msg and status change
* reformat the logic for recompose message errors json
* add test for informational message
* revert statushandler test and core main
* add space for runtime
* add description to tests
* cm1 add method descriptions in coremain truncation tests
* cm2 refactor statushandler truncation error
* cm1 remove irrelevant utests
* cm3 remove comments in handler, and extract asserts all msg fields
* add assertion to test all fields in msg json
* add log for packages truncation
* refactor the testCoreMaintruncation into statushandlertruncation
* add 1 extra to eof in status handler truncation.py
* refactoring
* refactor 2
* change truncation time performance to 30sec
* refactor imports
* cm1 refactor packages to patches
* cm2 refactor var and methods name to use patches
* reassign patches_removed_from assessment/installation to class var
* just refactoring
* refactoring 2
* refactor 3
* add remove test comment
* adding stuff here
* refactor 4
* refactor __assert_patch_summary_from_status
* refactor all unit tests logic into __assert_patch_summary_from_status
* refactor method description
* refactor tmp file log logic
* correct the error code
* add expected_truncated_patch_count for assertion
* modify the ut test description
* update __assert_patch_summary_from_status assertio to set status file <= internal agent limit
* format truncation unit test
* add public mthod for accesing private truncation var
* # -*- coding: utf-8 -*- to top of file to ensure py27 recognized euro symobl as ASCII char
* cm1 refactor with method into a function
* cm2 refactor asserting truncation variables
* assessment utest are failing
* fix assessment utest by declaring classification
* cm3 refactor status file setup into a class func
* address pr comments
* chnage log_debug to log_verbos, ignore scratch folder (not needed)
* exlcude unittest.main from code coverage
* revert changes in gitignore but exclude unnitest.test()
* remove prag no cover since it doesn't work with codecov
* updating extension to 1.6.50
* change constant to .49 to perform a force push for codecov
* change version to 1.6.50
* use latest action version to address codecov issue
* add extra to eof in ci.yml to match with master
* set job to use nodejs20
* use v3 instead v4
* use v2 instead v3 for nodejs20
* update action to version that support nodejs20
* remove the job that install nodejs20
* Increasing batch size from 3 to 6
* Updated unit tests for increasing batch size from 3 to 6
* Moved NUMBER_OF_PACKAGES_IN_BATCH_COULD_TAKE_MAX_TIME_TO_INSTALL to Constants file
* Add inline comments for PACKAGE_INSTALL_EXPECTED_AVG_TIME_IN_MINUTES
* Reduced set - safe-deployment enhancements
* Informational message requested added.
* Increased test coverage
* Test coverage and retry exhaustion throw
* Minor comments
* Composite logger log functions can be extended to have built in buffers
* Moving logic for buffer message in TelemetryWriter
* Add unit tests for write_event_with_buffer
* Simplifed the case of Flush. the case event_level != self.last_telemetry_event_level is already handled and hence should not come in flush case.
* Add test case for code coverage
* Obsolete packages should not be attempted to install
* Remove non required changes from test code.
* Using strip() to remove leading and trailing spaces
---------
Co-authored-by: Koshy John <kjohn@microsoft.com>
* APT: Patch Mode set to disabled in ConfigurePatching when os patch config file does not exist
* APT: Patch Mode set to disabled in ConfigurePatching: Fixing failing unit tests
* APT: Patch Mode set to disabled in ConfigurePatching: Trying a fix for codecov failure
* APT: Patch Mode set to disabled in ConfigurePatching: resolving duplicate UT names
* add remove older complete status file logic and refactor json.loads(message)
* change write_complete_status_file() to write_status_file()
* change __removed_older_complete_status_files() list to be files_to_be_removed
* remove unnecessary imports in coremain
* modify logic to keep min 10 and remove oldest complete status files
* use constants for complete status file count
* fix test case to use os.path.join
* commit 2 reorder sort to under base case
* remove print
* commit 1 change constant, and add unit test for exception
* add raise exception to check test_if_complete_and_status_path_is_dir
* modify the test for test_if_complete_and_status_path_is_dir
* add reset to status path
* commit -3 modify the test_remove_old_complete_status_files to make sure 1.complete.status has highest getmtim()
* commit 1 refactor code
* add extra line in status_handler.py
* raise excetion if min is < 2.7
* change log_debug to log_error
* add min_python_version exception to start_assessment()
* reset python version after unit test is completed
* changing python version description and revert changes in bootstrapper.py
* add conditio for python version is not met in installation logic
* revert changes in test_coremain.py
* add complete status file logic, and modify every status file points to complete status file
* add constants, and unit test to status handler
* add unit test for tesitng complete_status path is dir and log
* modify constant truncation warning msg, and reset_status_file()
* revert status_file to complete_status_file
* remove changes in constants, and update tests
* remove unnecessary truncation unit tests
* format code to add extra line and spaces, and change [IncludeAssessmentWithConfigurePatching={3}]
* remove status_handler object reference
* add more verifications to test_if_status_file_resets_on_load_if_malformed
* force push
---------
Co-authored-by: Koshy John <kjohn@microsoft.com>