tests - no description document tests for now #58
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Codecov | |
on: [push, pull_request] | |
jobs: | |
run: | |
name: test ${{ matrix.os }} / ${{ matrix.python }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
python: ["3.11","3.12"] | |
env: | |
OS: ${{ matrix.os }} | |
PYTHON: ${{ matrix.python }} | |
services: | |
mockup: | |
image: dmtf/redfish-mockup-server:latest | |
volumes: | |
- ${{ github.workspace }}/tmp/DSP8010/public-rackmount1:/tmp/public-rackmount1 | |
options: --name mockup | |
ports: | |
- 8000:8000 | |
steps: | |
- uses: actions/checkout@master | |
with: | |
path: code | |
- uses: pdm-project/setup-pdm@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: install deps | |
working-directory: ./code | |
run: | | |
pdm use -f $PYTHON | |
pdm install -d | |
# https://github.com/actions/virtual-environments/issues/1187 | |
- name: tune linux network | |
run: sudo ethtool -K eth0 tx off rx off | |
- name: Cache Description documents | |
id: cache-www-data | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-www-data | |
with: | |
path: ~/www-data/ | |
key: ${{ env.cache-name }}-20241231 | |
- if: ${{ steps.cache-www-data.outputs.cache-hit != 'true' }} | |
name: Get description documents | |
run: | | |
mkdir ~/www-data | |
wget --directory-prefix=$HOME/www-data https://www.dmtf.org/sites/default/files/standards/documents/DSP2043_2024.3.zip | |
wget --directory-prefix=$HOME/www-data https://www.dmtf.org/sites/default/files/standards/documents/DSP8010_2024.3.zip | |
wget --directory-prefix=$HOME/www-data https://www.snia.org/sites/default/files/technical-work/swordfish/release/v1.2.7/zip/Swordfish_v1.2.7.zip | |
unzip $HOME/www-data/Swordfish_v1.2.7.zip '*_Schema.zip' -d $HOME/www-data/ | |
- name: service::mock - unzip DSP8010 public-rackmount1 | |
run: | | |
ls -al ${{ github.workspace }}/tmp/DSP8010/public-rackmount1/ | |
mkdir -p ${{ github.workspace }}/tmp/DSP8010/public-rackmount1 | |
ls -al ${{ github.workspace }}/tmp/DSP8010/public-rackmount1 | |
sudo touch ${{ github.workspace }}/tmp/DSP8010/public-rackmount1/test | |
sudo unzip $HOME/www-data/DSP2043_2024.3.zip "*/public-rackmount1/*" -d ${{ github.workspace }}/tmp/DSP8010/ | |
- name: service::mock - copy service files | |
uses: docker://docker | |
with: | |
args: docker container exec mockup cp -a /tmp/public-rackmount1 /usr/src/app/ | |
# args: docker cp ${{ runner.temp }}/DSP8010/public-rackmount1 mockup:/usr/src/app/ | |
- name: service::mock - restart to feed the volume | |
# https://github.com/orgs/community/discussions/42127#discussioncomment-7591609 | |
uses: docker://docker | |
with: | |
args: docker restart mockup | |
- name: Setup description documents | |
working-directory: ./code | |
run: | | |
mkdir -p src/aiopenapi3_redfish/description_documents/DSP8010/2024.3/ | |
unzip -j ~/www-data/DSP8010_2024.3.zip '*/openapi/*.yaml' -d src/aiopenapi3_redfish/description_documents/DSP8010/2024.3/ | |
mkdir -p src/aiopenapi3_redfish/description_documents/Swordfish/v1.2.7/ | |
unzip -j ~/www-data/Swordfish_v1.2.7_Schema.zip 'yaml/*.yaml' -d src/aiopenapi3_redfish/description_documents/Swordfish/v1.2.7/ | |
# pdm run pytest --cov=tests/test_description_documents --cov-report=xml:../coverage/reports/coverage-description_documents-tests.xml tests/description_documents_test.py | |
- name: Generate coverage report (DSP 2043) | |
working-directory: ./code | |
run: | | |
pdm run pytest --cov=src/aiopenapi3_redfish/ --cov-report=xml:../coverage/reports/coverage-dsp2043.xml tests/dsp2043_test.py::test_single_{pass,fail} | |
pdm run pytest --cov=tests/ --cov-report=xml:../coverage/reports/coverage-dsp2043-tests.xml tests/dsp2043_test.py::test_single_{pass,fail} | |
- name: Generate coverage report (mock) | |
working-directory: ./code | |
run: | | |
pdm run pytest --cov=src/aiopenapi3_redfish/ --cov-report=xml:../coverage/reports/coverage-mock.xml tests/mock_test.py::test_iter | |
pdm run pytest --cov=tests/ --cov-report=xml:../coverage/reports/coverage-mock-tests.xml tests/mock_test.py::test_iter | |
- name: Generate coverage report (taskset) | |
working-directory: ./code | |
run: | | |
pdm run pytest --cov=src/aiopenapi3_redfish/ --cov-report=xml:../coverage/reports/coverage-taskset.xml tests/taskset_test.py::test_Task | |
pdm run pytest --cov=tests/ --cov-report=xml:../coverage/reports/coverage-taskset-tests.xml tests/taskset_test.py::test_Task | |
- name: Upload coverage to Codecov (core) | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
directory: ./coverage/reports/ | |
files: coverage-dsp2043.xml,coverage-mock.xml,coverage-taskset.xml | |
env_vars: OS,PYTHON | |
fail_ci_if_error: false | |
flags: core | |
name: codecov-aiopenapi3_redfish | |
verbose: true | |
- name: Upload coverage to Codecov (tests) | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
directory: ./coverage/reports/ | |
files: coverage-dsp2043-tests.xml,coverage-mock-tests.xml,coverage-taskset-tests.xml | |
env_vars: OS,PYTHON | |
fail_ci_if_error: false | |
flags: tests | |
name: codecov-aiopenapi3_redfish-tests | |
verbose: true |