mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 09:40:20 +00:00
Show test execution order in CI runs to help debug test suite hangs
This commit is contained in:
parent
ef9237e056
commit
a0e96810fd
1 changed files with 14 additions and 4 deletions
18
noxfile.py
18
noxfile.py
|
@ -36,10 +36,12 @@ from nox.command import CommandFailed # isort:skip
|
|||
IS_PY3 = sys.version_info > (2,)
|
||||
|
||||
# Be verbose when runing under a CI context
|
||||
PIP_INSTALL_SILENT = (
|
||||
os.environ.get("JENKINS_URL") or os.environ.get("CI") or os.environ.get("DRONE")
|
||||
) is None
|
||||
|
||||
CI_RUN = (
|
||||
os.environ.get("JENKINS_URL")
|
||||
or os.environ.get("CI")
|
||||
or os.environ.get("DRONE") is not None
|
||||
)
|
||||
PIP_INSTALL_SILENT = CI_RUN is False
|
||||
|
||||
# Global Path Definitions
|
||||
REPO_ROOT = os.path.abspath(os.path.dirname(__file__))
|
||||
|
@ -890,6 +892,14 @@ def _pytest(session, coverage, cmd_args):
|
|||
# https://stackoverflow.com/questions/50168647/multiprocessing-causes-python-to-crash-and-gives-an-error-may-have-been-in-progr
|
||||
env = {"OBJC_DISABLE_INITIALIZE_FORK_SAFETY": "YES"}
|
||||
|
||||
if CI_RUN:
|
||||
# We'll print out the collected tests on CI runs.
|
||||
# This will show a full list of what tests are going to run, in the right order, which, in case
|
||||
# of a test suite hang, helps us pinpoint which test is hanging
|
||||
session.run(
|
||||
"python", "-m", "pytest", *(cmd_args + ["--collect-only", "-qqq"]), env=env
|
||||
)
|
||||
|
||||
try:
|
||||
if coverage is True:
|
||||
_run_with_coverage(
|
||||
|
|
Loading…
Add table
Reference in a new issue