Skip to content

Commit d11c317

Browse files
Add python coverage report
* Fix PyMoneroAltChain::from_property_tree * Update README
1 parent 1e91d20 commit d11c317

File tree

5 files changed

+13
-10
lines changed

5 files changed

+13
-10
lines changed

.github/workflows/codacy.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- name: Download coverage report
20-
uses: actions/download-artifact@v5
20+
uses: actions/download-artifact@v4
2121
with:
22-
name: coverage-report
22+
name: coverage-reports
2323
github-token: ${{ secrets.API_GITHUB }}
2424
run-id: ${{ github.event.workflow_run.id }}
2525

2626
- name: Run codacy-coverage-reporter
27-
uses: codacy/codacy-coverage-reporter-action@v1
27+
uses: codacy/codacy-coverage-reporter-action@89d6c85cfafaec52c72b6c5e8b2878d33104c699
2828
with:
2929
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
30-
coverage-reports: coverage.info
30+
coverage-reports: coverage.info,coverage.xml

.github/workflows/test.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Install dependencies
2222
run: |
2323
sudo apt update
24-
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
24+
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
2525
pip3 install pybind11-stubgen pytest --break-system-packages
2626
2727
- name: Install expat
@@ -123,7 +123,7 @@ jobs:
123123
env:
124124
IN_CONTAINER: "true"
125125
run: |
126-
pytest
126+
pytest --cov=tests --cov-report=xml
127127
128128
- name: Cleanup test environment
129129
if: always()
@@ -137,6 +137,7 @@ jobs:
137137
- name: Upload coverage report
138138
uses: actions/upload-artifact@v4
139139
with:
140-
name: coverage-report
141-
path: coverage.info
142-
140+
name: coverage-reports
141+
path: |
142+
coverage.info
143+
coverage.xml

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ test_wallets
1212
.idea
1313
.codacy
1414
coverage*
15+
.coverage

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
[![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)
33
[![Tests](https://github.com/everoddandeven/monero-python/actions/workflows/test.yml/badge.svg)](https://github.com/everoddandeven/monero-python/actions/workflows/test.yml)
44
[![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)
5+
[![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)
56

67
> [!WARNING]
78
>

src/cpp/daemon/py_monero_daemon_model.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ void PyMoneroAltChain::from_property_tree(const boost::property_tree::ptree& nod
656656
}
657657
else if (key == std::string("height")) alt_chain->m_height = it->second.get_value<uint64_t>();
658658
else if (key == std::string("length")) alt_chain->m_length = it->second.get_value<uint64_t>();
659-
else if (key == std::string("main_chain_parent_block_hash")) alt_chain->m_main_chain_parent_block_hash = it->second.data();
659+
else if (key == std::string("main_chain_parent_block")) alt_chain->m_main_chain_parent_block_hash = it->second.data();
660660
}
661661
}
662662

0 commit comments

Comments
 (0)