-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Fix issue with --dest-dir for CI usage #47792
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
36b5175
Fix issue with --dest-dir for CI usage.
tjprescott 3ac1c9f
Run black.
tjprescott 212f3fd
Code review feedback.
tjprescott c54e2cc
Fix black formatting: restore blank line in test_dispatch_checks.py
Copilot 3b642d0
Code review feedback.
tjprescott c088a83
Merge branch 'FixApiStubCIBehavior' of https://github.com/Azure/azure…
tjprescott 16c0ddb
Fix verify-azpysdk-checks mypy feed auth failure
Copilot 1456875
Revert "Fix verify-azpysdk-checks mypy feed auth failure"
tjprescott File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| import os | ||
| import sys | ||
| from types import SimpleNamespace | ||
| from unittest.mock import patch | ||
|
|
||
|
|
||
| REPO_ROOT = os.path.abspath( | ||
| os.path.join(os.path.dirname(__file__), "..", "..", "..", "..") | ||
| ) | ||
| TOOLS_ROOT = os.path.join(REPO_ROOT, "eng", "tools", "azure-sdk-tools") | ||
| if TOOLS_ROOT not in sys.path: | ||
| sys.path.insert(0, TOOLS_ROOT) | ||
| if REPO_ROOT not in sys.path: | ||
| sys.path.insert(0, REPO_ROOT) | ||
|
|
||
| from eng.scripts.dispatch_checks import get_check_dest_dir | ||
|
|
||
|
|
||
| def test_apistub_dest_dir_uses_package_subdirectory(): | ||
| package_dir = os.path.join(REPO_ROOT, "sdk", "core", "azure-core") | ||
| artifact_dir = os.path.join(REPO_ROOT, "artifacts") | ||
|
|
||
| with patch( | ||
| "eng.scripts.dispatch_checks.ParsedSetup.from_path", | ||
| return_value=SimpleNamespace(name="azure-core"), | ||
| ): | ||
| result = get_check_dest_dir(package_dir, "apistub", artifact_dir) | ||
|
|
||
| assert result == os.path.join(artifact_dir, "azure-core") | ||
|
|
||
|
|
||
| def test_non_apistub_dest_dir_is_unchanged(): | ||
| package_dir = os.path.join(REPO_ROOT, "sdk", "core", "azure-core") | ||
| artifact_dir = os.path.join(REPO_ROOT, "artifacts") | ||
|
|
||
| with patch("eng.scripts.dispatch_checks.ParsedSetup.from_path") as parsed_setup: | ||
| result = get_check_dest_dir(package_dir, "pylint", artifact_dir) | ||
|
|
||
| assert result == artifact_dir | ||
| parsed_setup.assert_not_called() | ||
|
|
||
|
|
||
| def test_empty_dest_dir_is_unchanged(): | ||
| package_dir = os.path.join(REPO_ROOT, "sdk", "core", "azure-core") | ||
|
|
||
| with patch("eng.scripts.dispatch_checks.ParsedSetup.from_path") as parsed_setup: | ||
| result = get_check_dest_dir(package_dir, "apistub", None) | ||
|
|
||
| assert result is None | ||
| parsed_setup.assert_not_called() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.