Testing: Modify cucumber steps to use dev mode network#360
Conversation
This reverts commit d951d75.
| # Reset test harness | ||
| rm -rf test-harness | ||
| git clone --single-branch --branch master https://github.com/algorand/algorand-sdk-testing.git test-harness | ||
| git clone --single-branch --branch devmodenet https://github.com/algorand/algorand-sdk-testing.git test-harness |
There was a problem hiding this comment.
Related SDK Testing PR: algorand/algorand-sdk-testing#206
| behave --tags=$(UNITS) tests -f progress2 | ||
|
|
||
| INTEGRATIONS = "@abi or @algod or @applications or @applications.verified or @assets or @auction or @c2c or @compile or @dryrun or @dryrun.testing or @indexer or @indexer.231 or @indexer.applications or @kmd or @rekey or @send.keyregtxn or @send or @compile.sourcemap" | ||
| INTEGRATIONS = "@abi or @algod or @applications or @applications.verified or @assets or @auction or @c2c or @compile or @dryrun or @dryrun.testing or @indexer or @indexer.231 or @indexer.applications or @kmd or @send.keyregtxn or @send or @compile.sourcemap" |
There was a problem hiding this comment.
The existing v1 rekeying tests alters the default wallet key which causes problems in sending transactions after rekeying in dev mode - I decided to just remove it here since v1 APIs are deprecated anyway, but a more complete solution would be to re-write them so that they alter a transient private key instead.
There was a problem hiding this comment.
Do you know if this problem is universal across SDK's?
There was a problem hiding this comment.
Do you know if this problem is universal across SDK's?
I haven't looked into all of them, but I think it would be. I also think the order of execution matters - it poses the least amount of problems if @rekey is executed last.
I did push a workaround hack for the v1 functions in my latest commit - I created a transient dev account with some funds to send transactions before a potential rekey.
tzaffi
left a comment
There was a problem hiding this comment.
I haven't tested locally yet, but I plan to. I have some questions mostly regarding transaction amounts and the number of rounds needed to be waited for in dev mode.
Also some minor suggestions.
| def wait_for_app_txn_confirm(context): | ||
| sp = context.app_acl.suggested_params() | ||
| last_round = sp.first | ||
| send_zero_transactions(context, 3) |
There was a problem hiding this comment.
Curious on how the number 3 was arrived at.
There was a problem hiding this comment.
In the line below, it checks the status after block last_round + 2, so I sent 3 transactions (advances 3 blocks in dev mode) for good measure!
I'll add a small comment here to explain this
| context.accounts[0], | ||
| sp, | ||
| constants.ZERO_ADDRESS, | ||
| random.randint(100000, 900000), |
There was a problem hiding this comment.
@algochoi Optionally, I propose configuring the upper bound proportional to the funding amount. Intent is to avoid generating a value that's too large if/when the funding amount changes.
Here's the Java SDK analog: algorand/java-algorand-sdk@3390a6d.
Feel welcomed to resolve as is.
There was a problem hiding this comment.
Good point - Added proportional funding amounts in latest commit 3f11057
michaeldiamant
left a comment
There was a problem hiding this comment.
@algochoi Great work here - looks ready to me. ☕
Approval presumes the following prior to merge:
- Revert algorand-sdk-testing branch to
master. - Remove
NETWORK_TEMPLATEoverride. Assumes upstream defaults toDevModeNetwork.
This PR introduces some instrumentation to support dev mode testing (add zero payment transaction to advance blocks in certain scenarios) and delete v1 algod cucumber tests.
v1 API Changes
There are two changes to the v1 steps:
the transaction should go throughstep, especially ones that test recent block rounds (harder to test in dev mode as blocks need to be manually advanced and may not be recent).Experimental results
Initial testing looks like just deleting v1 algod steps will have a ~7 min speedup (21min -> 14min)
Dev mode, disabling wait_for_transaction v1 step (~10 min):