Skip to content

Commit

Permalink
Add class documentation for format of test logs.
Browse files Browse the repository at this point in the history
  • Loading branch information
gregcorbett committed Oct 18, 2023
1 parent db8af80 commit 529bdf3
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions test/test_check_db_dump_recent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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)
Expand Down

0 comments on commit 529bdf3

Please sign in to comment.