-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing test coverage #70
Comments
I'd like to do the vsp tests, unless @teknico is already working on it? |
@JoeGruffins I'm not, go ahead. |
I'll take |
I'll do the dcrdata ones next, including the fake network connection class. |
Don't worry too much about the |
I will start on txscript tests if that's ok. From the bottom, one at a time, will do isDustAmount first. |
Not sure where that 96% for |
It's 96% with integration tests. At least it is for me. |
Uhm, weird. The |
I'm using |
Ah, the skipped tests! Makes sense, I'll try executing |
Oh yeah. I forgot there was a |
I had to run
|
What dcrd version are you running? |
The decrediton one: EDIT: solved after dropping and rebuilding the CF index in my local |
After applying #138 and #142, the overall test coverage is up to 97%. All files have at least 90%. 🙂 The most remaining work is on |
Total coverage 98%, all files have at least 94%. Looking at |
Nice work, @teknico and @JoeGruffins. Closing now. decred is in a great state, so I'll plan on tagging a release now. |
Follows up on #34 and #35. Also related to #38.
Here is a list of areas needing unit test coverage for decred.
Selected notes
Some specific areas lacking coverage. I've added some recommendations for tests to translate from dcrd where possible.
curve.py
NAF
:TestNAF
,TestNAFRand
splitK
:TestSplitK
,TestSplitKRand
scalarMult
:TestScalarMult
,TestScalarMult
parsePubKey
:TestPubKeys
,TestPublicKeyIsEqual
account.py
TicketRequest
constructorTicketInfo.parse
UTXO
class, numerous methodsAccount
class, numerous methods (mostly done. maybe a couple more paths worth hitting)dcrdata.py
DcrdataPath
classAgendaChoices
classAgendasInfo
classmakeOutputs
functioncheckOutput
functionThe following will benefit greatly from having a fake network connection class. @teknico has previously pointed to the pytest monkeypatching fixture, but I haven't looked too closely yet.
DcrdataClient
classWebsocketClient
class. related: Improve the WebsocketClient class #43. (resolved by ws: refactor websocket client #100)DcrdataBlockchain
class (mostly done. maybe a couple more paths worth hitting)txscript.py
finalOpcodeData
functionisStakeScriptHash
functioncheckSStx
function negative pathsasSmallInt
functionpayToAddrScript
unsupported sig type exceptionsmultiSigScript
functionpayToSSRtxSHDirect
functionpayToSStxChange
script-hash pathsint2octets
andbits2octets
functionsnonceRFC6979
function. Consider simplifying this function if we aren't going to use theextra
andversion
arguments. Needs additional investigation.verifySig
function:TestPrivKeys
putVarInt
function:TestPutVarInt
addInt
function:TestScriptBuilderAddInt64
addData
function:TestScriptBuilderAddData
signP2PKHMsgTx
function negative pathspaysHighFees
functionextractPkScriptAddrs
functionmergeScripts
function. May find some additional subtests inTestSignTxOutput
getP2PKHOpCode
functionspendScriptSize
functioncalcMinRequiredTxRelayFee
function:TestCalcMinRequiredTxRelayFee
isUnspendable
function:TestIsUnspendable
isDustOutput
functionOther negative paths sparsely throughout that could get some coverage.
vsp.py
encode.py
blobStrList
functionunblobStrList
functionhelpers.py
The following unused code has been removed, the remaining is entirely tested.
moveFile
functionyearmonthday
functionrecursiveUpdate
functionBenchmarker
classformatNumber
functionsaveFile
,fetchSettingsFile
,saveJSON
, andloadJSON
functionsappDataDir
function:TestAppDataDir
. will require significant adaptation.api.py
Considering dropping this module altogether. It's really just API definitions, but it's drifing out-of-date
and will require a massive rewrite when multi-asset is implemented.
EDIT: removed, together with
calc.py
.wallet.py
All of it. Might need to create a test
Blockchain
class.The text was updated successfully, but these errors were encountered: