Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add mutation testing element transformation #9

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rjaegers
Copy link
Member

🚀 Hey, I have created a Pull Request

Description of changes

✔️ Checklist

  • I have followed the contribution guidelines for this repository
  • I have added tests for new behavior, and have not broken any existing tests
  • I have added or updated relevant documentation

Copy link

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ ACTION actionlint 8 0 0.01s
✅ JSON prettier 3 3 0 0.43s
✅ JSON v8r 3 0 2.61s
✅ MARKDOWN markdownlint 5 0 0 0.71s
✅ MARKDOWN markdown-table-formatter 5 0 0 0.21s
✅ REPOSITORY checkov yes no 12.48s
✅ REPOSITORY gitleaks yes no 0.71s
✅ REPOSITORY git_diff yes no 0.01s
✅ REPOSITORY grype yes no 9.94s
✅ REPOSITORY secretlint yes no 0.87s
✅ REPOSITORY trivy yes no 4.73s
✅ REPOSITORY trivy-sbom yes no 0.06s
✅ REPOSITORY trufflehog yes no 2.91s
✅ SPELL lychee 20 0 0.89s
✅ YAML prettier 11 11 0 0.52s
✅ YAML v8r 11 0 4.92s
✅ YAML yamllint 11 0 0.39s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MegaLinter] reported by reviewdog 🐶

name: SonarQube Issue Conversion
description: Transform tool output into generic SonarQube format(s)
inputs:
input:
description: Single or multiple tool output files to convert
required: true
output:
description: Output file for converted issues
required: true
transformation:
description: Type of transformation to apply (one of gtest-to-generic-execution, mutation-test-to-generic-issue)
required: true
runs:
using: composite
steps:
- uses: dcarbone/install-jq-action@e397bd87438d72198f81efd21f876461183d383a # v3.0.1
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: '3.12'
- shell: bash
run: |
python -m pip install --upgrade pip==24.3.1
pip install lxml
- shell: bash
run: |
echo 'Using transformation: ${{ inputs.transformation }} to convert ${{ inputs.input }} to ${{ inputs.output }}'
case ${{ inputs.transformation }} in
'gtest-to-generic-execution')
{ echo '<testExecutions version="1">'; xsltproc ${GITHUB_ACTION_PATH}/converters/gtest-to-generic-execution.xslt ${{ inputs.input }}; echo '</testExecutions>'; } | tee ${{ inputs.output }} > /dev/null
;;
'mutation-test-to-generic-issue')
MERGED_MUTATION_FILE=$(mktemp)
jq -s 'reduce .[] as $item ({}; . * $item)' ${{ inputs.input }} > ${MERGED_MUTATION_FILE}
jq --arg workspace "${GITHUB_WORKSPACE}" -f ${GITHUB_ACTION_PATH}/converters/mutation-elements-to-generic-issue.jq ${MERGED_MUTATION_FILE} > ${{ inputs.output }}
;;
*)
echo 'Unknown transformation type: ${{ inputs.transformation }}'
exit 1
;;
esac

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant