-
Notifications
You must be signed in to change notification settings - Fork 418
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(service-naming): improve inferred service naming algorithm [bac…
…kport 2.17] (#11475) Backport 110dcfa from #11458 to 2.17. ## Motivation Updates inferred service naming algorithm. Previously, the service naming algorithm would skip over any flag arguments (args starting with `-`), as well as the following argument as it was assumed to be the argument value. The update changes the algorithm to run again if no service name was found the first time. The second time, the algorithm will not skip arguments that were preceded by a flag argument. Effect: -- Previous Behavior: `pytest --no-cov my/file.py` -> service name = `""` -- New Behavior: `pytest --no-cov my/file.py` -> service name = `"my.file"` Additionally adds check to ensure a python module included after `-m` module is importable before using it as the service name. Also updates the service naming algorithm to use try-catches to prevent any unforeseen errors. Adds many more test cases, fixes a few snapshots.
- Loading branch information
1 parent
e97c293
commit 89fb1ca
Showing
19 changed files
with
228 additions
and
86 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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.