-
Notifications
You must be signed in to change notification settings - Fork 185
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
Assignment from no return #658
Changes from 6 commits
e358d1f
10d9cde
07c11c5
0528052
961f1b0
d44624c
c2c9c22
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,9 +94,13 @@ def fetch_opensearch_repo() -> None: | |
# if the run is interrupted from a previous run, it doesn't clean up, and the git add origin command | ||
# errors out; this allows the test to continue | ||
remote_origin_already_exists = 3 | ||
print(e) | ||
if e.returncode != remote_origin_already_exists: | ||
sys.exit(1) | ||
if e.returncode == remote_origin_already_exists: | ||
print( | ||
"Consider setting TEST_OPENSEARCH_NOFETCH=true if you want to reuse the existing local OpenSearch repo" | ||
) | ||
else: | ||
print(e) | ||
sys.exit(1) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My intent here was to make it clear why the exit was happening. I didn't want to change the previous behavior especially after I found the TEST_OPENSEARCH_NOFETCH variable. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @macohen, I apologize if I am causing any confusion, but I believe there's a change in the behavior for It seems that there shouldn't be a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry for the poor explanation on my end. Prior to my change, when the git repository already had a remote origin added, the whole process exited. I was considering just ignoring that state, but then found the TEST_OPENSEARCH_NOFETCH variable which can be set when you want that state to be ignored. I figured it would be better to maintain the behavior of the script in that case and also tell the user that TEST_OPENSEARCH_NOFETCH could help if exiting was not desired. I hope that helps... |
||
|
||
# fetch the sha commit, version from info() | ||
print("Fetching opensearch repo...") | ||
|
@@ -128,6 +132,7 @@ def run_all(argv: Any = None) -> None: | |
codecov_xml = join( | ||
abspath(dirname(dirname(__file__))), "junit", "opensearch-py-codecov.xml" | ||
) | ||
|
||
argv = [ | ||
"pytest", | ||
"--cov=opensearchpy", | ||
|
@@ -137,6 +142,12 @@ def run_all(argv: Any = None) -> None: | |
"-vv", | ||
"--cov-report=xml:%s" % codecov_xml, | ||
] | ||
if ( | ||
"OPENSEARCHPY_GEN_HTML_COV" in environ | ||
and environ.get("OPENSEARCHPY_GEN_HTML_COV") == "true" | ||
): | ||
codecov_html = join(abspath(dirname(dirname(__file__))), "junit", "html") | ||
argv.append("--cov-report=html:%s" % codecov_html) | ||
|
||
secured = False | ||
if environ.get("OPENSEARCH_URL", "").startswith("https://"): | ||
|
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.
Please change PR number 658