MCPcopy
hub / github.com/saltstack/salt / _ci_test

Function _ci_test

noxfile.py:1114–1214  ·  view source on GitHub ↗
(session, transport, onedir=False)

Source from the content-addressed store, hash-verified

1112
1113
1114def _ci_test(session, transport, onedir=False):
1115 # Install requirements
1116 _install_requirements(session, onedir=onedir)
1117 env = {}
1118 if onedir:
1119 env["ONEDIR_TESTRUN"] = "1"
1120 chunks = {
1121 "pkg": [
1122 "tests/pytests/pkg",
1123 ],
1124 "unit": [
1125 "tests/unit",
1126 "tests/pytests/unit",
1127 ],
1128 "functional": [
1129 "tests/pytests/functional",
1130 ],
1131 "scenarios": [
1132 "tests/pytests/scenarios",
1133 ],
1134 }
1135
1136 test_group_number = os.environ.get("TEST_GROUP") or "1"
1137
1138 if not session.posargs:
1139 chunk_cmd = []
1140 junit_report_filename = "test-results"
1141 runtests_log_filename = "runtests"
1142 else:
1143 chunk = session.posargs.pop(0)
1144 if chunk in ["unit", "functional", "integration", "scenarios", "all"]:
1145 if chunk == "all":
1146 chunk_cmd = []
1147 junit_report_filename = "test-results"
1148 runtests_log_filename = "runtests"
1149 elif chunk == "integration":
1150 chunk_cmd = []
1151 for values in chunks.values():
1152 for value in values:
1153 chunk_cmd.append(f"--ignore={value}")
1154 junit_report_filename = f"test-results-{chunk}-grp{test_group_number}"
1155 runtests_log_filename = f"runtests-{chunk}-grp{test_group_number}"
1156 else:
1157 chunk_cmd = chunks[chunk]
1158 junit_report_filename = f"test-results-{chunk}-grp{test_group_number}"
1159 runtests_log_filename = f"runtests-{chunk}-grp{test_group_number}"
1160 if session.posargs:
1161 if session.posargs[0] == "--":
1162 session.posargs.pop(0)
1163 chunk_cmd.extend(session.posargs)
1164 else:
1165 chunk_cmd = [chunk] + session.posargs
1166 junit_report_filename = f"test-results-grp{test_group_number}"
1167 runtests_log_filename = f"runtests-grp{test_group_number}"
1168
1169 rerun_failures = os.environ.get("RERUN_FAILURES", "0") == "1"
1170 track_code_coverage = os.environ.get("SKIP_CODE_COVERAGE", "0") == "0"
1171

Callers 4

ci_testFunction · 0.85
ci_test_tcpFunction · 0.85
ci_test_onedirFunction · 0.85
ci_test_onedir_tcpFunction · 0.85

Calls 7

_install_requirementsFunction · 0.85
_pytestFunction · 0.85
getMethod · 0.45
popMethod · 0.45
valuesMethod · 0.45
appendMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected