Use exact ExpectedTranscriptError in Orchard ZSA workflow block tests (#133 alternative)#142
Use exact ExpectedTranscriptError in Orchard ZSA workflow block tests (#133 alternative)#142dmidem wants to merge 18 commits into
Conversation
…r instead of the is_valid flag
This reverts commit 2b17f2b.
|
|
||
| - name: Install cargo-nextest | ||
| uses: taiki-e/install-action@nextest | ||
|
|
||
| - name: Run regular tests | ||
| run: | | ||
| timeout --preserve-status 1h \ | ||
| cargo nextest run --workspace --locked \ | ||
| -E 'not package(zebra-network) and not binary(acceptance)' | ||
|
|
||
| - name: Run zebra-network tests | ||
| run: | | ||
| timeout --preserve-status 30m \ | ||
| cargo nextest run -p zebra-network --locked \ | ||
| --retries 3 | ||
|
|
||
| - name: Run zebrad acceptance tests | ||
| run: | | ||
| timeout --preserve-status 1h \ | ||
| cargo nextest run -p zebrad --test acceptance --locked \ | ||
| --retries 3 \ | ||
| --test-threads 4 | ||
|
|
There was a problem hiding this comment.
These changes seem to be unrelated to the "[Use exact ExpectedTranscriptError in Orchard ZSA workflow block tests (#133 alternative)]" PR
There was a problem hiding this comment.
Agree. I had to do this to restore the CI workflow. I have now prepared a special PR to fix the CI issue (#132). We can review and merge that one first, then pull those changes into this PR. What do you think?
PaulLaux
left a comment
There was a problem hiding this comment.
I like this approch better then #133 . Consider merging https://github.com/QED-it/zebra/pull/143/changes to get rid of the debug and clean up `ci-basic.yml' from unrelated changes.
Just merged #143 (it definitely makes sense). Do we now need to update (possibly even remove) the comment in // The commit-error wrapper hides its inner error, but every layer derives
// `Error::source()`, so we can walk the chain down to the public leaf
// `AssetStateError` and match the exact variant instead of its Debug output.
if matches!(
err.downcast_ref::<AssetStateError>(),
Some(AssetStateError::Issue(
orchard::issuance::Error::IssueActionPreviouslyFinalizedAssetBase
))
) {
return true;
} |
This is an alternative to #133.
PR #133 replaces the
is_valid: boolfield inOrchardWorkflowBlockwithResult<(), ExpectedTranscriptError>, but keeps block 5 asErr(ExpectedTranscriptError::Any). That version checks that block 5 fails, but still does not check the exact reason.This PR keeps the same typed expected-result direction, but also maps the expected failure for block 5 to
ExpectedTranscriptError::Exact(...).The exact check verifies that the block is rejected because it tries to issue an asset after issuance was finalized. This is closer to the original goal from issue #116.
The downside is that the checker is more complex. In particular,
CommitSemanticallyVerifiedErrorhides its innerCommitBlockError, so the test can type-check the public wrapper but has to inspect the specific innerInvalidIssuedAsset(Issue(IssueActionPreviouslyFinalizedAssetBase))error viaDebugoutput.So the trade-off is: