From 529bdf35939aafeb68acc2b36c1d4c9d2d12d857 Mon Sep 17 00:00:00 2001 From: gregcorbett Date: Wed, 18 Oct 2023 16:35:36 +0100 Subject: [PATCH] Add class documentation for format of test logs. --- test/test_check_db_dump_recent.py | 37 +++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/test/test_check_db_dump_recent.py b/test/test_check_db_dump_recent.py index b657d81..74aeaba 100644 --- a/test/test_check_db_dump_recent.py +++ b/test/test_check_db_dump_recent.py @@ -16,6 +16,42 @@ class TestCheckDBDumpRecent(unittest.TestCase): + """ + This class tests the check.check_db_dump_recent module. + + For ORACLE test cases, the example log format is as follows: + YYYY-MM-DDTHH:MM:SS+0000 + YYYY-MM-DDTHH:MM:SS+0000 INFO: completed ok + YYYY-MM-DDTHH:MM:SS+0000 + An Error + YYYY-MM-DDTHH:MM:SS+0000 + 2023-01-01T11:41:01+0000 INFO: completed ok + + The example log formats follow the style of the actual logs generated. + That is to say, an attempt to restore the database dump: + - Starts with an ISO 8601 timestamp, this is because the restore is + triggered by a cron job based off quattor cron jobs. + - Ends with either (generated from the 1_runDbUpdate.sh): + - an error with no timestamp + - an ISO 8601 timestamp and the string "INFO: completed ok" + + For MariaDB test cases, the example log format is as follows: + YYYY-MM-DDTHH:MM:SS+0000 + YYYY-MM-DDTHH:MM:SS+0000 INFO: completed ok + YYYY-MM-DDTHH:MM:SS+0000 + YYYY-MM-DDTHH:MM:SS+0000 ERROR: An Error + YYYY-MM-DDTHH:MM:SS+0000 + YYYY-MM-DDTHH:MM:SS+0000 INFO: completed ok + + The example log formats follow the style of the actual logs generated. + That is to say, an attempt to restore the database dump: + - Starts with an ISO 8601 timestamp, this is because the restore is + triggered by a cron job based off quattor cron jobs. + - Ends with an ISO 8601 timestamp followed by either (generated by + failover_import.py): + - an error + - the string "INFO: completed ok" + """ def setUp(self): self.test_checker = check_db_dump_recent.CheckDBDumpRecent( @@ -31,6 +67,7 @@ def setUp(self): # Monkey patch the datetime module within check.check_db_dump_recent # so we don't have to worry about hard coded datetimes in these tests. check_db_dump_recent.datetime = MonkeyDateTime + help(check_db_dump_recent) def tearDown(self): os.remove(self.temp_file_path)