mirror of
git://holbrook.no/eth-contract-registry
synced 2024-12-22 04:17:32 +01:00
Ida/ci test
This commit is contained in:
parent
e5f3acc3e3
commit
3e35a8b32a
2
.gitignore
vendored
2
.gitignore
vendored
@ -4,3 +4,5 @@ dist/
|
|||||||
gmon.out
|
gmon.out
|
||||||
__pycache__
|
__pycache__
|
||||||
*.pyc
|
*.pyc
|
||||||
|
venv
|
||||||
|
.idea
|
58
.gitlab-ci.yml
Normal file
58
.gitlab-ci.yml
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
stages:
|
||||||
|
- test
|
||||||
|
- run-coverage
|
||||||
|
- slither-analyzer
|
||||||
|
|
||||||
|
|
||||||
|
variables:
|
||||||
|
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
|
||||||
|
|
||||||
|
cache:
|
||||||
|
paths:
|
||||||
|
- .cache/pip
|
||||||
|
- .venv/
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
- python -V # Print out python version for debugging
|
||||||
|
- pip install virtualenv
|
||||||
|
- virtualenv venv
|
||||||
|
- source venv/bin/activate
|
||||||
|
|
||||||
|
test:
|
||||||
|
image: registry.gitlab.com/grassrootseconomics/cic-base-images/ci-solc-python:latest
|
||||||
|
script:
|
||||||
|
# install test dependencies
|
||||||
|
- cd python
|
||||||
|
- export PYTHONPATH=.
|
||||||
|
- pip install --extra-index-url https://pip.grassrootseconomics.net
|
||||||
|
--extra-index-url https://gitlab.com/api/v4/projects/27624814/packages/pypi/simple
|
||||||
|
-r requirements.txt -r test_requirements.txt
|
||||||
|
# run tests
|
||||||
|
- bash run_tests.sh
|
||||||
|
|
||||||
|
run-coverage:
|
||||||
|
stage: test
|
||||||
|
image: registry.gitlab.com/grassrootseconomics/cic-base-images/ci-solc-python:latest
|
||||||
|
script:
|
||||||
|
- cd python
|
||||||
|
- export PYTHONPATH=.
|
||||||
|
- pip install --extra-index-url https://pip.grassrootseconomics.net
|
||||||
|
--extra-index-url https://gitlab.com/api/v4/projects/27624814/packages/pypi/simple
|
||||||
|
-r requirements.txt -r test_requirements.txt
|
||||||
|
- pip install pytest pytest-cov
|
||||||
|
- coverage run -m pytest
|
||||||
|
- coverage html
|
||||||
|
- coverage report --fail-under=90
|
||||||
|
|
||||||
|
coverage: '/^TOTAL.+?(\d+\%)$/'
|
||||||
|
artifacts:
|
||||||
|
reports:
|
||||||
|
cobertura: python/htmlcov/index.html
|
||||||
|
|
||||||
|
slither-analyzer:
|
||||||
|
image: registry.gitlab.com/grassrootseconomics/cic-base-images/ci-solc-python:latest
|
||||||
|
allow_failure: true
|
||||||
|
script:
|
||||||
|
- cd solidity
|
||||||
|
- slither Registry.sol
|
||||||
|
- slither Registry.sol --print human-summary
|
BIN
python/.coverage
Normal file
BIN
python/.coverage
Normal file
Binary file not shown.
7
python/.coveragerc
Normal file
7
python/.coveragerc
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
[run]
|
||||||
|
branch = True
|
||||||
|
source = eth_contract_registry
|
||||||
|
[report]
|
||||||
|
omit = .venv/*
|
||||||
|
**/runnable/*.py
|
||||||
|
[html]
|
@ -52,7 +52,7 @@ def test_set(
|
|||||||
o = builder.address_of(registry, 'ContractRegistry', sender_address=eth_accounts[0])
|
o = builder.address_of(registry, 'ContractRegistry', sender_address=eth_accounts[0])
|
||||||
r = eth_rpc.do(o)
|
r = eth_rpc.do(o)
|
||||||
r = abi_decode_single(ABIContractType.ADDRESS, r)
|
r = abi_decode_single(ABIContractType.ADDRESS, r)
|
||||||
assert r == registry
|
assert r == strip_0x(registry)
|
||||||
|
|
||||||
(tx_hash_hex, o) = builder.set(registry, roles['CONTRACT_DEPLOYER'], 'ContractRegistry', addr_registry)
|
(tx_hash_hex, o) = builder.set(registry, roles['CONTRACT_DEPLOYER'], 'ContractRegistry', addr_registry)
|
||||||
r = eth_rpc.do(o)
|
r = eth_rpc.do(o)
|
||||||
|
Loading…
Reference in New Issue
Block a user