Skip to content

feat(test_local.yml): upload junit report generated by pytest #20

feat(test_local.yml): upload junit report generated by pytest

feat(test_local.yml): upload junit report generated by pytest #20

Workflow file for this run

# yamllint disable
name: tests_local
on: [pull_request]
env:
# Set TEST_TIMING_OPTION if local test should be timed. Default is off.
TEST_TIMING_OPTION: ""
jobs:
run_tests:
runs-on: ubuntu-latest
container:
image: ghcr.io/4c-multiphysics/4c:latest
options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
- name: Install rsync
run: |
sudo apt-get update
sudo apt-get install -y rsync
- name: Create links to 4C
run: |
ln -s /home/user/4C/build/4C config/4C
ln -s /home/user/4C/build/post_ensight config/post_ensight
ln -s /home/user/4C/build/post_processor config/post_processor
- name: Create Python environment
id: environment
uses: ./.github/actions/create_python_environment
- name: Get Python package manager
run: echo "PYTHON_PACKAGE_MANAGER=${{steps.environment.outputs.ppm}}" >> $GITHUB_ENV
- name: Codechecks
run: |
$PYTHON_PACKAGE_MANAGER activate queens
isort --check-only queens tests > track_isort.txt 2>&1
black --check queens tests > track_black.txt 2>&1
pylint --rcfile=.pylintrc_ci queens tests | tee track_pylint.txt 2>&1
pylint queens tests --rcfile=.pylintrc --output-format=json:pylint_warnings.json --fail-under 0
python .gitlab/pipeline_utils/code_quality_creator.py pylint_warnings.json
pydocstyle --match-dir='^(?!.*test).*$' queens > track_pydocstyle.txt 2>&1
- name: Run pytest
run: |
$PYTHON_PACKAGE_MANAGER activate queens
pytest -v -m "unit_tests or integration_tests or integration_tests_fourc" --cov --cov-report=term --cov-report=html:html_coverage_report --cov-report=xml:xml_coverage_report.xml $TEST_TIMING_OPTION --color=yes --junitxml=test_junit.xml
- name: Publish junit pytest report
uses: mikepenz/action-junit-report@v5
if: success() || failure() # always run even if the previous step fails
with:
report_paths: "test_junit.xml"
annotate_only: true