-
Notifications
You must be signed in to change notification settings - Fork 122
HelpersTask629_Add_tests_for_dockerized_executable_sync_gh_issue_labels #649
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
base: master
Are you sure you want to change the base?
HelpersTask629_Add_tests_for_dockerized_executable_sync_gh_issue_labels #649
Conversation
Pre-commit checks: - 'check_master' passed - 'check_author' passed - 'check_file_size' passed - 'check_python_compile' passed - 'check_gitleaks' passed All checks passed ✅
Pre-commit checks: - 'check_master' passed - 'check_author' passed - 'check_file_size' passed - 'check_python_compile' passed - 'check_gitleaks' passed All checks passed ✅
Pre-commit checks: - 'check_master' passed - 'check_author' passed - 'check_file_size' passed - 'check_python_compile' passed - 'check_gitleaks' passed All checks passed ✅
Pre-commit checks: - 'check_master' passed - 'check_author' passed - 'check_file_size' passed - 'check_python_compile' passed - 'check_gitleaks' passed All checks passed ✅
Pre-commit checks: - 'check_master' passed - 'check_author' passed - 'check_file_size' passed - 'check_python_compile' passed - 'check_gitleaks' passed All checks passed ✅
Pre-commit checks: - 'check_master' passed - 'check_author' passed - 'check_file_size' passed - 'check_python_compile' passed - 'check_gitleaks' passed All checks passed ✅
…tests_for_dockerized_executable_sync_gh_issue_labels Pre-commit checks: - 'check_master' passed - 'check_author' passed - 'check_file_size' passed - 'check_python_compile' passed - 'check_gitleaks' passed All checks passed ✅
Pre-commit checks: - 'check_master' passed - 'check_author' passed - 'check_file_size' passed - 'check_python_compile' passed - 'check_gitleaks' passed All checks passed ✅
…ecutable_sync_gh_issue_labels
dev_scripts_helpers/github/test/test_dockerized_sync_gh_issue_labels.py
Outdated
Show resolved
Hide resolved
dev_scripts_helpers/github/test/test_dockerized_sync_gh_issue_labels.py
Outdated
Show resolved
Hide resolved
dev_scripts_helpers/github/test/test_dockerized_sync_gh_issue_labels.py
Outdated
Show resolved
Hide resolved
dev_scripts_helpers/github/test/test_dockerized_sync_gh_issue_labels.py
Outdated
Show resolved
Hide resolved
…tests_for_dockerized_executable_sync_gh_issue_labels Pre-commit checks: - 'check_master' passed - 'check_author' passed - 'check_file_size' passed - 'check_python_compile' passed - 'check_gitleaks' passed All checks passed ✅
Pre-commit checks: - 'check_master' passed - 'check_author' passed - 'check_file_size' passed - 'check_python_compile' passed - 'check_gitleaks' passed All checks passed ✅
Pre-commit checks: - 'check_master' passed - 'check_author' passed - 'check_file_size' passed - 'check_python_compile' passed - 'check_gitleaks' passed All checks passed ✅
Pre-commit checks: - 'check_master' passed - 'check_author' passed - 'check_file_size' passed - 'check_python_compile' passed - 'check_gitleaks' passed All checks passed ✅
Pre-commit checks: - 'check_master' passed - 'check_author' passed - 'check_file_size' passed - 'check_python_compile' passed - 'check_gitleaks' passed All checks passed ✅
Pre-commit checks: - 'check_master' passed - 'check_author' passed - 'check_file_size' passed - 'check_python_compile' passed - 'check_gitleaks' passed All checks passed ✅
Pre-commit checks: - 'check_master' passed - 'check_author' passed - 'check_file_size' passed - 'check_python_compile' passed - 'check_gitleaks' passed All checks passed ✅
dev_scripts_helpers/github/test/test_dockerized_sync_gh_issue_labels.py
Outdated
Show resolved
Hide resolved
dev_scripts_helpers/github/test/test_dockerized_sync_gh_issue_labels.py
Outdated
Show resolved
Hide resolved
dev_scripts_helpers/github/test/test_dockerized_sync_gh_issue_labels.py
Outdated
Show resolved
Hide resolved
dev_scripts_helpers/github/test/test_dockerized_sync_gh_issue_labels.py
Outdated
Show resolved
Hide resolved
Pre-commit checks: - 'check_master' passed - 'check_author' passed - 'check_file_size' passed - 'check_python_compile' passed - 'check_gitleaks' passed All checks passed ✅
…tests_for_dockerized_executable_sync_gh_issue_labels Pre-commit checks: - 'check_master' passed - 'check_author' passed - 'check_file_size' passed - 'check_python_compile' passed - 'check_gitleaks' passed All checks passed ✅
Pre-commit checks: - 'check_master' passed - 'check_author' passed - 'check_file_size' passed - 'check_python_compile' passed - 'check_gitleaks' passed All checks passed ✅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Just a couple of small nits.
parser = dshgdsgil._parse() | ||
dshgdsgil._main(parser) | ||
|
||
def _save_label(self, label_data: Dict[str, str]) -> dshgdsgil.Label: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use the dshgdsgil.Label.save_labels
directly so that we don't have to create another wrapper around it?
|
||
|
||
def _get_label_data() -> Dict[str, str]: | ||
return {"name": "test", "description": "test label", "color": "FF0000"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason why we don't use the Label object right away so there's no extra layer of conversion?
self._save_label(label_data) | ||
# Run. | ||
self._run_with_args() | ||
# Check if the mock was called. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we check if the create operation was called too?
label_data = { | ||
"name": "bug", | ||
"color": "f29513", | ||
"description": "Something isn't working", | ||
} | ||
mock_label = umock.Mock() | ||
for k, v in label_data.items(): | ||
setattr(mock_label, k, v) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about creating a label object and mock it?
"in_dir_name": self.get_input_dir(), | ||
"owner": "test-org", | ||
"repo": "test-repo", | ||
"token_env_var": "GITHUB_TEST_TOKEN", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the client running the tests might not have this var set
|
||
@pytest.mark.skipif( | ||
hserver.is_inside_ci() or hserver.is_dev_csfy(), | ||
reason="Disabled because of CmampTask10710", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you able to run this test locally?
I'm okay with removing this test as well, since the cases covered here are already handled in the other files. Your call.
return {"name": "test", "description": "test label", "color": "FF0000"} | ||
|
||
|
||
def _make_mock_label(label_data: Dict[str, str]) -> umock.Mock: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add doc string
Addressing #629
Implemented tests to check the Docker flow sequence for the Docker executable and also for the functionality class.