-
Notifications
You must be signed in to change notification settings - Fork 29
Kwxm/e2e/batch6/drop list #3228
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
base: master
Are you sure you want to change the base?
Conversation
Move array builtin scripts to v3/batch6/ subdirectory to align with Kenneth's organizational structure for all PV11 builtins. This makes it easier to: - Locate all Batch 6 (PV11) builtins in one place - Distinguish from earlier batch builtins - Integrate with other PV11 features (dropList, etc.) Related: PR #3228 (dropList tests)
Expand array builtin tests to cover all Plutus version combinations at PV11: - Plutus versions: V1, V2, V3 - Language versions: 1.0.0, 1.1.0 - Functions: indexArray, lengthOfArray, listToArray - Total: 18 test cases (3 × 3 × 2) ## Implementation **Programmatic Script Generation (plutus_common.py):** - Replace hardcoded definitions with loop-based generation - 18 script combinations defined in ~40 lines vs 180+ if hardcoded - Easy to extend: just add to ARRAY_FUNCTIONS list - Clear test IDs: INDEXARRAY_V3_1_1_0, etc. **Directory Structure:** - Organized by version and language: v1/batch6/1.0.0/, v1/batch6/1.1.0/, etc. - Scripts renamed with version suffix for clarity - README.md in each directory documenting missing scripts **Test Matrix:** - Single test method expands to 18 test instances via parametrization - Backward compatible: existing V3/1.1.0 names preserved - Clear documentation of what's tested and what's missing ## Current Status **Existing:** 3 of 18 scripts (V3/1.1.0 only) **Missing:** 15 scripts need generation in plutus-scripts-e2e Missing scripts will cause test failures until generated. READMEs document exact files needed and generation instructions. ## Benefits - Complete coverage when all scripts generated (~3-5 hours effort) - Same pattern applies to other batch6 builtins (dropList, etc.) - Maintainable: programmatic approach scales easily - Clear test names show exactly which combination failed Related: Kenneth's PR #3228 (dropList, establishes batch6 directory pattern)
|
|
Unisay
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏼
Refactored Plutus V3 builtins minting tests to combine batch5 and batch6 into a single test class. Added support for protocol version and cost model checks, and improved test scenario handling. Updated cost model logic and removed duplicated code for batch6. Test following scenarios: - wrong protocol version - correct protocol version with old cost model - correct protocol version with updated cost model
3f759d2 to
d9e07cb
Compare
|
@Unisay @kwxm @zliu41 I have refactored the code to run batch5 and batch6 tests together, in order to be able to test following scenarios:
with just single cost model update. Protocol version 11 is now available for testing. You can follow instructions in https://github.com/IntersectMBO/cardano-node-tests?tab=readme-ov-file#-persistent-local-testnet-for-repeated-testing, and in step 4. run the command as |
|
@mkoura Nice. So we first run the tests locally, and then merge the PR once the tests pass? Is that the right workflow? |
|
@zliu41 We can merge the tests once we can run also the "passing" variant. The only missing thing preventing us from doing that is the correct cost model. |
This adds some end-to-end tests for the Plutus Core
dropListfunction which is due to appear at PV11. The testing machinery doesn't yet know about PV11, so all of these tests fail with messages likeAnother current PR contains some code to skip these tests, but I haven't attempted to copy that because I'm not sure what it's doing. I'd also prefer to merge this PR before the other one because it tries to keep all of the new scripts in one place (see next paragraph).
The test scripts are generated from the code added in mkoura/plutus-scripts-e2e#13 and are stored in the directory
cardano_node_tests/tests/data/plutus/v3/batch6/, where the tests for all of the new PV11 functions will be added. It would be sensible to organise the exisitng tests into similar directories so that it's easier to keep track of them, but that would take some time which we don't have at the moment.Note also that all of these tests are for PlutusV3 and the Plutus language version 1.1.0. At PV11 all of the builtins will become available in PlutusV1 and PlutusV2 as well, and it will also be possible to use all of them with Plutus 1.0.0 (prior to PV11 the possible combinations were very restricted, but we're now able to relax this). We should really test all of the functions in all possilbe combinations of Plutus versions, but this will require some thought and perhaps substantial alterations to the testing code.