Skip to content

Commit

Permalink
Revert "feat: disable search means don't search for explicitly mentio…
Browse files Browse the repository at this point in the history
…ned file…"

This reverts commit 8810ef7.
  • Loading branch information
joseph-sentry authored Aug 2, 2024
1 parent 8810ef7 commit ca26c58
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion codecov_cli/helpers/folder_searcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def search_files(
filename_exclude_regex: typing.Optional[typing.Pattern] = None,
multipart_include_regex: typing.Optional[typing.Pattern] = None,
multipart_exclude_regex: typing.Optional[typing.Pattern] = None,
search_for_directories: bool = False,
search_for_directories: bool = False
) -> typing.Generator[pathlib.Path, None, None]:
""" "
Searches for files or directories in a given folder
Expand Down
9 changes: 0 additions & 9 deletions codecov_cli/services/upload/file_finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,17 +226,8 @@ def find_files(self) -> typing.List[UploadCollectionResultFile]:
return list(set(result_files + user_result_files))

def get_user_specified_files(self, regex_patterns_to_exclude):
if self.disable_search:
result = []
for file in self.explicitly_listed_files:
filepath = Path(file)
if filepath.exists():
result.append(filepath)
return result

user_filenames_to_include = []
files_excluded_but_user_includes = []

for file in self.explicitly_listed_files:
user_filenames_to_include.append(file.name)
if regex_patterns_to_exclude.match(file.name):
Expand Down
9 changes: 7 additions & 2 deletions tests/commands/test_process_test_results.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging
import os

from click.testing import CliRunner
Expand All @@ -10,6 +11,7 @@ def test_process_test_results(
mocker,
tmpdir,
):

tmp_file = tmpdir.mkdir("folder").join("summary.txt")

mocker.patch.dict(
Expand Down Expand Up @@ -42,6 +44,7 @@ def test_process_test_results(

assert result.exit_code == 0


mocked_post.assert_called_with(
url="https://api.github.com/repos/fake/repo/issues/pull/comments",
data={
Expand All @@ -55,6 +58,7 @@ def test_process_test_results(
)



def test_process_test_results_non_existent_file(mocker, tmpdir):
tmp_file = tmpdir.mkdir("folder").join("summary.txt")

Expand Down Expand Up @@ -89,7 +93,7 @@ def test_process_test_results_non_existent_file(mocker, tmpdir):
assert result.exit_code == 1
expected_logs = [
"ci service found",
"No JUnit XML files were found",
'Some files were not found',
]
for log in expected_logs:
assert log in result.output
Expand Down Expand Up @@ -178,6 +182,7 @@ def test_process_test_results_missing_ref(mocker, tmpdir):
assert log in result.output



def test_process_test_results_missing_step_summary(mocker, tmpdir):
tmp_file = tmpdir.mkdir("folder").join("summary.txt")

Expand Down Expand Up @@ -216,4 +221,4 @@ def test_process_test_results_missing_step_summary(mocker, tmpdir):
"Error: Error getting step summary file path from environment. Can't find GITHUB_STEP_SUMMARY environment variable.",
]
for log in expected_logs:
assert log in result.output
assert log in result.output

0 comments on commit ca26c58

Please sign in to comment.