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

Message Compatibility Tests #765

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Message Compatibility Tests #765

wants to merge 2 commits into from

Conversation

andymandias
Copy link
Collaborator

Adds some forward and backward compatibility tests with release version 2025.1 for (de)serializing messages.

data/Cargo.toml Outdated
Comment on lines 46 to 48
irc_2025_1 = { git = "https://github.com/squidowl/halloy.git", tag = "2025.1", package = "irc" }
data_2025_1 = { git = "https://github.com/squidowl/halloy.git", tag = "2025.1", package = "data" }

Copy link
Member

Choose a reason for hiding this comment

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

This is mega cursed, we will link to all past versions this way, which will grow linearly with each new version.

I'd rather see static json test fixtures for all known existing variants and just attempt to Deserialize it. If it fails, we have a breakage.

We will obviously need to update these tests as we add new forward compatible fields

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is indeed mega-cursed! I think I mislabeled my tests, so for clarity I'm going to avoid using the terms forward/backward compatibility for the moment. If we have static json test fixtures for all known existing variants we can ensure the current version can read all older serialized messages, but we can't ensure old versions can read the current version's serialized messages. I was operating under the assumption that we wanted tests to ensure users could downgrade as well.

Normally I'd try and build these tests into an exterior system, but I wasn't sure which would be appropriate here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants