mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Increase splits for faster test results turnaround.
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
parent
72976d6a0b
commit
18defa2f5d
3 changed files with 24 additions and 14 deletions
9
.github/workflows/test-action.yml
vendored
9
.github/workflows/test-action.yml
vendored
|
@ -107,6 +107,7 @@ jobs:
|
||||||
include: ${{ fromJSON(needs.generate-matrix.outputs.matrix-include) }}
|
include: ${{ fromJSON(needs.generate-matrix.outputs.matrix-include) }}
|
||||||
env:
|
env:
|
||||||
SALT_TRANSPORT: ${{ matrix.transport }}
|
SALT_TRANSPORT: ${{ matrix.transport }}
|
||||||
|
TEST_GROUP: ${{ matrix.test-group || 1 }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Source Code
|
- name: Checkout Source Code
|
||||||
|
@ -248,8 +249,8 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
tools --timestamps --no-output-timeout-secs=1800 --timeout-secs=14400 vm test --skip-requirements-install \
|
tools --timestamps --no-output-timeout-secs=1800 --timeout-secs=14400 vm test --skip-requirements-install \
|
||||||
--nox-session=${{ inputs.nox-session }} --rerun-failures -E SALT_TRANSPORT ${{ (inputs.skip-code-coverage && matrix.tests-chunk != 'unit') && '--skip-code-coverage' || '' }} \
|
--nox-session=${{ inputs.nox-session }} --rerun-failures -E SALT_TRANSPORT ${{ (inputs.skip-code-coverage && matrix.tests-chunk != 'unit') && '--skip-code-coverage' || '' }} \
|
||||||
${{ inputs.distro-slug }} ${{ matrix.tests-chunk }} -- --slow-tests --core-tests \
|
-E TEST_GROUP ${{ inputs.distro-slug }} ${{ matrix.tests-chunk }} -- --slow-tests --core-tests \
|
||||||
--test-group-count=${{ matrix.test-chunk-total || 1 }} --test-group=${{ matrix.test-chunk-no || 1 }}
|
--test-group-count=${{ matrix.test-group-count || 1 }} --test-group=${{ matrix.test-group || 1 }}
|
||||||
|
|
||||||
- name: Combine Coverage Reports
|
- name: Combine Coverage Reports
|
||||||
if: always() && inputs.skip-code-coverage == false && steps.spin-up-vm.outcome == 'success' && job.status != 'cancelled'
|
if: always() && inputs.skip-code-coverage == false && steps.spin-up-vm.outcome == 'success' && job.status != 'cancelled'
|
||||||
|
@ -266,7 +267,7 @@ jobs:
|
||||||
rm -rf artifacts/salt*
|
rm -rf artifacts/salt*
|
||||||
tree -a artifacts
|
tree -a artifacts
|
||||||
if [ "${{ inputs.skip-code-coverage }}" != "true" ]; then
|
if [ "${{ inputs.skip-code-coverage }}" != "true" ]; then
|
||||||
mv artifacts/coverage/.coverage artifacts/coverage/.coverage.${{ inputs.distro-slug }}.${{ inputs.nox-session }}.${{ matrix.transport }}.${{ matrix.tests-chunk }}.${{ matrix.test-chunk-no || '1' }}
|
mv artifacts/coverage/.coverage artifacts/coverage/.coverage.${{ inputs.distro-slug }}.${{ inputs.nox-session }}.${{ matrix.transport }}.${{ matrix.tests-chunk }}.grp${{ matrix.test-group || '1' }}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Destroy VM
|
- name: Destroy VM
|
||||||
|
@ -311,7 +312,7 @@ jobs:
|
||||||
# always run even if the previous steps fails
|
# always run even if the previous steps fails
|
||||||
if: always() && inputs.skip-junit-reports == false
|
if: always() && inputs.skip-junit-reports == false
|
||||||
with:
|
with:
|
||||||
check_name: Test Results(${{ inputs.distro-slug }}, transport=${{ matrix.transport }}, tests-chunk=${{ matrix.tests-chunk }})
|
check_name: Test Results(${{ inputs.distro-slug }}, transport=${{ matrix.transport }}, tests-chunk=${{ matrix.tests-chunk }}, group=${{ matrix.test-group || '1' }})
|
||||||
report_paths: 'artifacts/xml-unittests-output/*.xml'
|
report_paths: 'artifacts/xml-unittests-output/*.xml'
|
||||||
annotate_only: true
|
annotate_only: true
|
||||||
|
|
||||||
|
|
14
noxfile.py
14
noxfile.py
|
@ -1065,6 +1065,8 @@ def _ci_test(session, transport, onedir=False):
|
||||||
"scenarios": ["tests/pytests/scenarios"],
|
"scenarios": ["tests/pytests/scenarios"],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test_group_number = os.environ.get("TEST_GROUP") or "1"
|
||||||
|
|
||||||
if not session.posargs:
|
if not session.posargs:
|
||||||
chunk_cmd = []
|
chunk_cmd = []
|
||||||
junit_report_filename = "test-results"
|
junit_report_filename = "test-results"
|
||||||
|
@ -1081,20 +1083,20 @@ def _ci_test(session, transport, onedir=False):
|
||||||
for values in chunks.values():
|
for values in chunks.values():
|
||||||
for value in values:
|
for value in values:
|
||||||
chunk_cmd.append(f"--ignore={value}")
|
chunk_cmd.append(f"--ignore={value}")
|
||||||
junit_report_filename = f"test-results-{chunk}"
|
junit_report_filename = f"test-results-{chunk}-grp{test_group_number}"
|
||||||
runtests_log_filename = f"runtests-{chunk}"
|
runtests_log_filename = f"runtests-{chunk}-grp{test_group_number}"
|
||||||
else:
|
else:
|
||||||
chunk_cmd = chunks[chunk]
|
chunk_cmd = chunks[chunk]
|
||||||
junit_report_filename = f"test-results-{chunk}"
|
junit_report_filename = f"test-results-{chunk}-grp{test_group_number}"
|
||||||
runtests_log_filename = f"runtests-{chunk}"
|
runtests_log_filename = f"runtests-{chunk}-grp{test_group_number}"
|
||||||
if session.posargs:
|
if session.posargs:
|
||||||
if session.posargs[0] == "--":
|
if session.posargs[0] == "--":
|
||||||
session.posargs.pop(0)
|
session.posargs.pop(0)
|
||||||
chunk_cmd.extend(session.posargs)
|
chunk_cmd.extend(session.posargs)
|
||||||
else:
|
else:
|
||||||
chunk_cmd = [chunk] + session.posargs
|
chunk_cmd = [chunk] + session.posargs
|
||||||
junit_report_filename = "test-results"
|
junit_report_filename = f"test-results-grp{test_group_number}"
|
||||||
runtests_log_filename = "runtests"
|
runtests_log_filename = f"runtests-grp{test_group_number}"
|
||||||
|
|
||||||
rerun_failures = os.environ.get("RERUN_FAILURES", "0") == "1"
|
rerun_failures = os.environ.get("RERUN_FAILURES", "0") == "1"
|
||||||
track_code_coverage = os.environ.get("SKIP_CODE_COVERAGE", "0") == "0"
|
track_code_coverage = os.environ.get("SKIP_CODE_COVERAGE", "0") == "0"
|
||||||
|
|
15
tools/ci.py
15
tools/ci.py
|
@ -619,6 +619,12 @@ def matrix(ctx: Context, distro_slug: str, full: bool = False):
|
||||||
Generate the test matrix.
|
Generate the test matrix.
|
||||||
"""
|
"""
|
||||||
_matrix = []
|
_matrix = []
|
||||||
|
_splits = {
|
||||||
|
"functional": 4,
|
||||||
|
"integration": 6,
|
||||||
|
"scenarios": 2,
|
||||||
|
"unit": 3,
|
||||||
|
}
|
||||||
for transport in ("zeromq", "tcp"):
|
for transport in ("zeromq", "tcp"):
|
||||||
if transport == "tcp":
|
if transport == "tcp":
|
||||||
if distro_slug not in (
|
if distro_slug not in (
|
||||||
|
@ -635,14 +641,15 @@ def matrix(ctx: Context, distro_slug: str, full: bool = False):
|
||||||
continue
|
continue
|
||||||
if "macos" in distro_slug and chunk == "scenarios":
|
if "macos" in distro_slug and chunk == "scenarios":
|
||||||
continue
|
continue
|
||||||
if full and chunk == "integration":
|
splits = _splits.get(chunk) or 1
|
||||||
for idx in range(1, 3):
|
if full and splits > 1:
|
||||||
|
for split in range(1, splits + 1):
|
||||||
_matrix.append(
|
_matrix.append(
|
||||||
{
|
{
|
||||||
"transport": transport,
|
"transport": transport,
|
||||||
"tests-chunk": chunk,
|
"tests-chunk": chunk,
|
||||||
"test-chunk-no": idx,
|
"test-group": split,
|
||||||
"test-chunk-total": 2,
|
"test-group-count": splits,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Reference in a new issue