A naming convention easier to split

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
Pedro Algarvio 2023-10-15 15:44:37 +01:00 committed by Pedro Algarvio
parent 01dd7d5722
commit c4444e0080
3 changed files with 6 additions and 7 deletions

View file

@ -404,8 +404,8 @@ jobs:
if: always() && inputs.skip-code-coverage == false && steps.download-coverage-artifacts.outcome == 'success' && job.status != 'cancelled'
run: |
nox -e create-xml-coverage-reports
mv artifacts/coverage/salt.xml artifacts/coverage/salt.${{ inputs.distro-slug }}.${{ inputs.nox-session }}.xml
mv artifacts/coverage/tests.xml artifacts/coverage/tests.${{ inputs.distro-slug }}.${{ inputs.nox-session }}.xml
mv artifacts/coverage/salt.xml artifacts/coverage/salt..${{ inputs.distro-slug }}..${{ inputs.nox-session }}.xml
mv artifacts/coverage/tests.xml artifacts/coverage/tests..${{ inputs.distro-slug }}..${{ inputs.nox-session }}.xml
- name: Report Salt Code Coverage
if: always() && inputs.skip-code-coverage == false && steps.download-coverage-artifacts.outcome == 'success'

View file

@ -351,8 +351,8 @@ jobs:
if: always() && inputs.skip-code-coverage == false && steps.download-coverage-artifacts.outcome == 'success' && job.status != 'cancelled'
run: |
nox -e create-xml-coverage-reports
mv artifacts/coverage/salt.xml artifacts/coverage/salt.${{ inputs.distro-slug }}.${{ inputs.nox-session }}.xml
mv artifacts/coverage/tests.xml artifacts/coverage/tests.${{ inputs.distro-slug }}.${{ inputs.nox-session }}.xml
mv artifacts/coverage/salt.xml artifacts/coverage/salt..${{ inputs.distro-slug }}..${{ inputs.nox-session }}.xml
mv artifacts/coverage/tests.xml artifacts/coverage/tests..${{ inputs.distro-slug }}..${{ inputs.nox-session }}.xml
- name: Report Salt Code Coverage
if: always() && inputs.skip-code-coverage == false && steps.download-coverage-artifacts.outcome == 'success'

View file

@ -1096,12 +1096,11 @@ def upload_coverage(ctx: Context, reports_path: pathlib.Path, commit_sha: str =
flags = fpath.stem
else:
try:
section, distro_slug, nox_session = fpath.stem.split(".")
ctx.print(section, distro_slug, nox_session)
section, distro_slug, nox_session = fpath.stem.split("..")
except ValueError:
ctx.error(
f"The file {fpath} does not respect the expected naming convention "
"'{salt|tests}.<distro-slug>.<nox-session>.xml'. Skipping..."
"'{salt|tests}..<distro-slug>..<nox-session>.xml'. Skipping..."
)
continue
flags = f"{section},{distro_slug}"