Skip to content
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

fix(CI): Update test baselines in iota-adapter-transactional-tests #957

Merged
merged 14 commits into from
Jul 5, 2024

Conversation

DaughterOfMars
Copy link
Contributor

@DaughterOfMars DaughterOfMars commented Jul 2, 2024

Description of change

Updates the baseline tests data for this crate, and replaces the protocol version in the init commands. For context, the line numbers in these files changed due to the added copyright line at the top of each file.

Some of the .move files had to be changed additionally, due to objects being reordered in the test storage map. These objects are referred to by index, and some of those changed. However, this should not fundamentally change the test.

Links to any relevant issues

#806

@DaughterOfMars DaughterOfMars requested a review from a team as a code owner July 2, 2024 16:59
@DaughterOfMars DaughterOfMars added the dev-tools Issues related to the Developer Tools Team label Jul 2, 2024
@@ -16,7 +16,7 @@ module A0::m {
}
}

//# upgrade --package A0 --upgrade-capability 1,2 --sender A
//# upgrade --package A0 --upgrade-capability 1,1 --sender A
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More than just line changes

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and a few others with some number changes only are probably related to due to objects being reordered in the test storage map you mentioned, can you also tell why they are reordered now? Also where is this map defined?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume they are reordered due to the packages/addresses changing but I am not 100% sure. However, they are clearly reordered, which you can see from the output. Whenever read-object is called in the script it outputs the object stored at those indexes (which I believe are package_index,index_within_package) and despite not changing the commands, many of these are in a new ordering. I can do a deeper dive into the specific reason they are reordered if you want.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the fn that determines the ordering.

// stable way of sorting objects by type. Does not however, produce a stable
// sorting between objects of the same type
fn get_object_sorting_key(&self, id: &ObjectID) -> String {
    match &self.get_object(id, None).unwrap().data {
        object::Data::Move(obj) => self.stabilize_str(format!("{}", obj.type_())),
        object::Data::Package(pkg) => pkg
            .serialized_module_map()
            .keys()
            .map(|s| s.as_str())
            .collect::<Vec<_>>()
            .join(","),
    }
}

Before, the type names of some packages started with "s" and now they start with "i", which I assume caused those to be reordered above some of the others.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense, thanks for investigating, maybe also put it in the PR description
Btw what command did you run for these tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran UB=1 cargo nextest run -p iota-adapter-transactional-tests (usually with the test name specified) in order to update the .exp whenever I made a change to the .move file. For simtests just replace cargo nextest run with scripts/simtest/cargo-simtest simtest.

But there was not an easy way to update the .move files, I had to manually inspect the output and determine what changed and how to update appropriately. It sucked.

And I think we can just leave this comment thread open for other folks to read.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we don't really have an easy way to verify if these numbers are correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really. I know the values are correct because the fundamental test case outlined in the .exp is unchanged, but that is not easy to check.

@DaughterOfMars DaughterOfMars merged commit fe09ee0 into develop Jul 5, 2024
36 of 42 checks passed
@DaughterOfMars DaughterOfMars deleted the dev-tools/fix-more-tests branch July 5, 2024 11:34
alexsporn pushed a commit that referenced this pull request Sep 6, 2024
…957)

* update iota-adapter-transaction-test baselines

* Replace protocol version in init commands and update more baselines

* Revert accidental included change

* ignore a test in `iota-replay`

* Fix some broken move tests  and remove unnecesssary ones from past protocol versions

* Revert change in other crate

---------

Co-authored-by: Thibault Martinez <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev-tools Issues related to the Developer Tools Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants