From a8a0111c96a4935b5263877af4d0490984305fa2 Mon Sep 17 00:00:00 2001 From: everoddandeven Date: Thu, 15 Jan 2026 21:17:22 +0100 Subject: [PATCH] Add python coverage report * Fix PyMoneroAltChain::from_property_tree * Update README --- .github/workflows/codacy.yml | 8 ++++---- .github/workflows/test.yml | 11 ++++++----- .gitignore | 1 + README.md | 1 + src/cpp/daemon/py_monero_daemon_model.cpp | 2 +- 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/codacy.yml b/.github/workflows/codacy.yml index 0a7c861..972b442 100644 --- a/.github/workflows/codacy.yml +++ b/.github/workflows/codacy.yml @@ -17,14 +17,14 @@ jobs: runs-on: ubuntu-latest steps: - name: Download coverage report - uses: actions/download-artifact@v5 + uses: actions/download-artifact@v4 with: - name: coverage-report + name: coverage-reports github-token: ${{ secrets.API_GITHUB }} run-id: ${{ github.event.workflow_run.id }} - name: Run codacy-coverage-reporter - uses: codacy/codacy-coverage-reporter-action@v1 + uses: codacy/codacy-coverage-reporter-action@89d6c85cfafaec52c72b6c5e8b2878d33104c699 with: project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} - coverage-reports: coverage.info + coverage-reports: coverage.info,coverage.xml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 05ff4d0..7d8dbcb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,7 +21,7 @@ jobs: - name: Install dependencies run: | sudo apt update - sudo apt install -y build-essential cmake pkg-config libssl-dev libzmq3-dev libunbound-dev libsodium-dev libunwind8-dev liblzma-dev libreadline6-dev libexpat1-dev libpgm-dev qttools5-dev-tools libhidapi-dev libusb-1.0-0-dev libprotobuf-dev protobuf-compiler libudev-dev libboost-chrono-dev libboost-date-time-dev libboost-filesystem-dev libboost-locale-dev libboost-program-options-dev libboost-regex-dev libboost-serialization-dev libboost-system-dev libboost-thread-dev python3 ccache doxygen graphviz git curl autoconf libtool gperf nettle-dev libevent-dev debhelper python3-all python3-pip python3-pybind11 python3-pytest python3-pytest-rerunfailures lcov + sudo apt install -y build-essential cmake pkg-config libssl-dev libzmq3-dev libunbound-dev libsodium-dev libunwind8-dev liblzma-dev libreadline6-dev libexpat1-dev libpgm-dev qttools5-dev-tools libhidapi-dev libusb-1.0-0-dev libprotobuf-dev protobuf-compiler libudev-dev libboost-chrono-dev libboost-date-time-dev libboost-filesystem-dev libboost-locale-dev libboost-program-options-dev libboost-regex-dev libboost-serialization-dev libboost-system-dev libboost-thread-dev python3 ccache doxygen graphviz git curl autoconf libtool gperf nettle-dev libevent-dev debhelper python3-all python3-pip python3-pybind11 python3-pytest python3-pytest-rerunfailures python3-pytest-cov lcov pip3 install pybind11-stubgen pytest --break-system-packages - name: Install expat @@ -123,7 +123,7 @@ jobs: env: IN_CONTAINER: "true" run: | - pytest + pytest --cov=tests --cov-report=xml - name: Cleanup test environment if: always() @@ -137,6 +137,7 @@ jobs: - name: Upload coverage report uses: actions/upload-artifact@v4 with: - name: coverage-report - path: coverage.info - + name: coverage-reports + path: | + coverage.info + coverage.xml diff --git a/.gitignore b/.gitignore index 48b56f5..a0d03be 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ test_wallets .idea .codacy coverage* +.coverage \ No newline at end of file diff --git a/README.md b/README.md index 3a33298..db0f1ef 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Build](https://github.com/everoddandeven/monero-python/actions/workflows/build-deb.yml/badge.svg)](https://github.com/everoddandeven/monero-python/actions/workflows/build-deb.yml) [![Tests](https://github.com/everoddandeven/monero-python/actions/workflows/test.yml/badge.svg)](https://github.com/everoddandeven/monero-python/actions/workflows/test.yml) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/aeff91a5b1d543ddb400f88ffce150a8)](https://app.codacy.com/gh/everoddandeven/monero-python/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade) +[![Codacy Badge](https://app.codacy.com/project/badge/Coverage/aeff91a5b1d543ddb400f88ffce150a8)](https://app.codacy.com/gh/everoddandeven/monero-python/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_coverage) > [!WARNING] > diff --git a/src/cpp/daemon/py_monero_daemon_model.cpp b/src/cpp/daemon/py_monero_daemon_model.cpp index 68767ab..d5fcc94 100644 --- a/src/cpp/daemon/py_monero_daemon_model.cpp +++ b/src/cpp/daemon/py_monero_daemon_model.cpp @@ -656,7 +656,7 @@ void PyMoneroAltChain::from_property_tree(const boost::property_tree::ptree& nod } else if (key == std::string("height")) alt_chain->m_height = it->second.get_value(); else if (key == std::string("length")) alt_chain->m_length = it->second.get_value(); - else if (key == std::string("main_chain_parent_block_hash")) alt_chain->m_main_chain_parent_block_hash = it->second.data(); + else if (key == std::string("main_chain_parent_block")) alt_chain->m_main_chain_parent_block_hash = it->second.data(); } }