Skip to content

Commit 3b1c811

Browse files
authored
Common-sense tox environment skipping (Azure#27487)
* move exclusion list to a file within sdk-tools that we can import from random places in the CI. clean up tox_harness as the serial invocation is unused, untested, and worthless. * type and doccomment all touched functions * replacing in_ci in favor of ci_tools common version that also honors github actions * enable filtering based on the opt out lists from the unified exclusion set * rename tox environment from lint -> pylint. update single reference to said environment. update documentation to reflect new location of exclusion list * re-add azure-ai-textanalytics and azure-ai-metricsadvisor to opt_out lists * adding further cspell exclusions
1 parent 42b3884 commit 3b1c811

File tree

17 files changed

+501
-586
lines changed

17 files changed

+501
-586
lines changed

.vscode/cspell.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@
9797
"tools/azure-sdk-tools/setup.py"
9898
],
9999
"words": [
100+
"qnamaker",
101+
"mindependency",
100102
"automl",
101103
"pyyaml",
102104
"CONLL",

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ sdist
4343
4444
```
4545

46-
Unfortunately, the command `tox -l` only returns the _default_ test builds. The common `tox.ini` file also supports `lint` and `mypy` environments.
46+
Unfortunately, the command `tox -l` only returns the _default_ test builds. The common `tox.ini` file also supports `pylint` and `mypy` environments.
4747

4848
### Example Usage of the common Azure SDK For Python `tox.ini`
4949

@@ -91,11 +91,11 @@ Used for the local dev loop.
9191
9292
```
9393

94-
#### `lint` environment
94+
#### `pylint` environment
9595
Pylint install and run.
9696

9797
```
98-
\> tox -e lint -c <path to tox.ini>
98+
\> tox -e pylint -c <path to tox.ini>
9999
```
100100

101101

doc/dev/static_type_checking.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ All client libraries in the Python SDK repo are automatically opted in to runnin
298298
reason why a particular library should not run type checking, it is possible to add that library to a block list to prevent mypy/pyright
299299
from running checks.
300300

301-
1) Place the package name on the appropriate block list: [eng/tox/environment_exclusion_list.py](https://github.com/Azure/azure-sdk-for-python/blob/main/eng/tox/environment_exclusion_list.py).
301+
1) Place the package name on the appropriate block list: [tools/azure-sdk-tools/ci_tools/environment_exclusions.py](https://github.com/Azure/azure-sdk-for-python/blob/main/tools/azure-sdk-tools/ci_tools/environment_exclusions.py).
302302
2) Open an issue tracking that "library-name" should be opted in to running type checking
303303

304304
> Note: Blocking your library from type checking is a *temporary* state. It is expected that checks are re-enabled as soon as possible.

doc/dev/tests.md

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,36 @@ testing infrastructure, and demonstrates how to write and run tests for a servic
55

66
### Table of contents
77

8-
- [Set up your development environment](#set-up-your-development-environment)
9-
- [Integrate with pytest](#integrate-with-the-pytest-test-framework)
10-
- [Use Tox](#tox)
11-
- [The `devtools_testutils` package](#the-devtools_testutils-package)
12-
- [Write or run tests](#write-or-run-tests)
13-
- [Set up the test proxy](#perform-one-time-test-proxy-setup)
14-
- [Set up test resources](#set-up-test-resources)
15-
- [Configure credentials](#configure-credentials)
16-
- [Start the test proxy server](#start-the-test-proxy-server)
17-
- [Deliver environment variables to tests](#deliver-environment-variables-to-tests)
18-
- [Write your tests](#write-your-tests)
19-
- [Configure live or playback testing mode](#configure-live-or-playback-testing-mode)
20-
- [Run and record tests](#run-and-record-tests)
21-
- [Sanitize secrets](#sanitize-secrets)
22-
- [Functional vs. unit tests](#functional-vs-unit-tests)
23-
- [Further reading](#further-reading)
24-
- [Deprecated testing instructions](#deprecated-testing-instructions)
8+
- [Python SDK testing guide](#python-sdk-testing-guide)
9+
- [Table of contents](#table-of-contents)
10+
- [Set up your development environment](#set-up-your-development-environment)
11+
- [SDK root directory](#sdk-root-directory)
12+
- [Dependency installation](#dependency-installation)
13+
- [Open code in IDE](#open-code-in-ide)
14+
- [Integrate with the pytest test framework](#integrate-with-the-pytest-test-framework)
15+
- [Tox](#tox)
16+
- [The `devtools_testutils` package](#the-devtools_testutils-package)
17+
- [Write or run tests](#write-or-run-tests)
18+
- [Perform one-time test proxy setup](#perform-one-time-test-proxy-setup)
19+
- [Set up test resources](#set-up-test-resources)
20+
- [Configure credentials](#configure-credentials)
21+
- [Start the test proxy server](#start-the-test-proxy-server)
22+
- [Deliver environment variables to tests](#deliver-environment-variables-to-tests)
23+
- [Write your tests](#write-your-tests)
24+
- [Configure live or playback testing mode](#configure-live-or-playback-testing-mode)
25+
- [Run and record tests](#run-and-record-tests)
26+
- [Sanitize secrets](#sanitize-secrets)
27+
- [Special case: SAS tokens](#special-case-sas-tokens)
28+
- [Functional vs. unit tests](#functional-vs-unit-tests)
29+
- [Further reading](#further-reading)
30+
- [Deprecated testing instructions](#deprecated-testing-instructions)
31+
- [Define credentials (deprecated)](#define-credentials-deprecated)
32+
- [Create live test resources (deprecated)](#create-live-test-resources-deprecated)
33+
- [Write your tests (deprecated)](#write-your-tests-deprecated)
34+
- [An example test (deprecated)](#an-example-test-deprecated)
35+
- [Run and record the test (deprecated)](#run-and-record-the-test-deprecated)
36+
- [Purging secrets (deprecated)](#purging-secrets-deprecated)
37+
- [Special case: Shared Access Signature (deprecated)](#special-case-shared-access-signature-deprecated)
2538

2639
## Set up your development environment
2740

@@ -115,7 +128,7 @@ The Python SDK uses the [tox project](https://tox.readthedocs.io/en/latest/) to
115128
To run a tox command from your directory use the following commands:
116129
```cmd
117130
(env) azure-sdk-for-python\sdk\my-service\my-package> tox -c ../../../eng/tox/tox.ini -e sphinx
118-
(env) azure-sdk-for-python\sdk\my-service\my-package> tox -c ../../../eng/tox/tox.ini -e lint
131+
(env) azure-sdk-for-python\sdk\my-service\my-package> tox -c ../../../eng/tox/tox.ini -e pylint
119132
(env) azure-sdk-for-python\sdk\my-service\my-package> tox -c ../../../eng/tox/tox.ini -e mypy
120133
(env) azure-sdk-for-python\sdk\my-service\my-package> tox -c ../../../eng/tox/tox.ini -e pyright
121134
(env) azure-sdk-for-python\sdk\my-service\my-package> tox -c ../../../eng/tox/tox.ini -e verifytypes

eng/pipelines/templates/steps/run_pylint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ steps:
2929
"$(TargetingString)"
3030
--mark_arg="${{ parameters.TestMarkArgument }}"
3131
--service="${{ parameters.ServiceDirectory }}"
32-
--toxenv="lint"
32+
--toxenv="pylint"
3333
--disablecov
3434
--filter-type="Omit_management"
3535
env: ${{ parameters.EnvVars }}

0 commit comments

Comments
 (0)