Skip to content

Commit

Permalink
#13 Add temporary CI debug code
Browse files Browse the repository at this point in the history
  • Loading branch information
mcsken committed Nov 20, 2024
1 parent eeb224f commit fe603ac
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/test_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ def test_can_set_root_dir_argument():
def test_can_execute_check_done_command_and_get_warnings(caplog):
exit_code = check_done_command([])
assert exit_code == 0

debug_envar = os.environ["CHECK_DONE_GITHUB_PROJECT_STATUS_NAME_TO_CHECK"]
print(debug_envar)
print(caplog.text)
check_done_warning_messages = len(caplog.messages)
assert check_done_warning_messages >= 1

Expand All @@ -64,6 +66,9 @@ def test_can_check_done_demo_project(caplog):
exit_code = check_done_command([])
assert exit_code == 0

debug_envar = os.environ["CHECK_DONE_GITHUB_PROJECT_STATUS_NAME_TO_CHECK"]
print(debug_envar)
print(caplog.text)
check_done_warning_messages = len(caplog.messages)
assert check_done_warning_messages >= 1

Expand Down Expand Up @@ -149,10 +154,13 @@ def test_can_log_info_message_if_selected_project_status_is_empty(caplog):
with caplog.at_level(logging.INFO):
envvar_name = "CHECK_DONE_GITHUB_PROJECT_STATUS_NAME_TO_CHECK"
original_envar_value = os.environ[envvar_name]
print(os.environ[envvar_name])
empty_project_status_name_in_check_done_demo_project = "In progress"
os.environ[envvar_name] = empty_project_status_name_in_check_done_demo_project
print(os.environ[envvar_name])
check_done_command([])
os.environ[envvar_name] = original_envar_value
print(os.environ[envvar_name])
assert "Nothing to check. Project has no items in the selected project status." in caplog.messages[1]


Expand All @@ -164,8 +172,11 @@ def test_can_log_info_message_if_no_warnings_were_found_for_checked_project_item
with caplog.at_level(logging.INFO):
envvar_name = "CHECK_DONE_GITHUB_PROJECT_STATUS_NAME_TO_CHECK"
original_envar_value = os.environ[envvar_name]
print(os.environ[envvar_name])
project_status_name_in_check_done_demo_project_with_only_correct_issues = "Archived"
os.environ[envvar_name] = project_status_name_in_check_done_demo_project_with_only_correct_issues
print(os.environ[envvar_name])
check_done_command([])
os.environ[envvar_name] = original_envar_value
print(os.environ[envvar_name])
assert "All project items are correct" in caplog.messages[1]

0 comments on commit fe603ac

Please sign in to comment.