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

Ensure sufficient test coverage around recent changes to compression/grouping config in tests #23693

Merged
merged 14 commits into from
Feb 3, 2025

Conversation

MarioJGMsoft
Copy link
Contributor

@MarioJGMsoft MarioJGMsoft commented Jan 30, 2025

Description

See the test changes (and PR comments) in this PR: [BREAKING IN 2.20] Added assert for compression ON grouping OFF by MarioJGMsoft · Pull Request #23608 · microsoft/FluidFramework

There were some tests that had compression enabled but grouping disabled. We had to choose to either enable grouping or disable compression in that PR. We should revisit each case and consider if the other should be added as well.

Reviewer Guidance

Let me know if you think there's anything else that I'm missing or that should be tested.

Fixes: AB#28720

@github-actions github-actions bot added area: tests Tests to add, test infrastructure improvements, etc base: main PRs targeted against main branch labels Jan 30, 2025
@MarioJGMsoft MarioJGMsoft requested review from a team, pragya91, markfields, jason-ha, jatgarg, kian-thompson, WillieHabi and rajatch-ff and removed request for a team January 30, 2025 18:56
@MarioJGMsoft MarioJGMsoft marked this pull request as ready for review January 30, 2025 18:56
@Copilot Copilot bot review requested due to automatic review settings January 30, 2025 18:56

Choose a reason for hiding this comment

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

packages/test/test-end-to-end-tests/src/test/messageSize.spec.ts:1

  • The function should ensure that sizeInBytes is even before calling crypto.randomBytes to prevent potential runtime errors.
generateRandomStringOfSize = (sizeInBytes: number): string =>
@github-actions github-actions bot added the area: runtime Runtime related issues label Jan 31, 2025
Copy link
Contributor

@jason-ha jason-ha left a comment

Choose a reason for hiding this comment

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

I was just peeking - not able to provide competent review at this time.

@@ -1264,7 +1264,34 @@ describe("Runtime", () => {
"Ops with unrecognized type should fail to process",
);
});

it.only("Throws when op compression is on and op grouping is off", async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Build (lint) fails with this saying only is not allowed, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I accidentally missed that, thanks for pointing it out!

localMap.set(`key${i}`, content);
}
itExpects(
`Batch with 4000 ops - grouped batches`,
Copy link
Member

Choose a reason for hiding this comment

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

What do you think - would this be worth testing with both grouping and compression disabled? If it feels worth it to you, maybe pull it out and do the [true, false].forEach thing. If not, then just leave it.

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 feel like it isn't, because in the original flow, it used to compress those 4000 ops with the empty placeholders, but since we no longer support that flow I find it unnecessary to create a test where both are disabled.

@@ -1268,7 +1268,34 @@ describe("Runtime", () => {
"Ops with unrecognized type should fail to process",
);
});

it("Throws when op compression is on and op grouping is off", async () => {
Copy link
Member

Choose a reason for hiding this comment

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

Perfect test case! It doesn't belong under the "Unrecognized types" block though. You can just put it at the very top (not under another describe), or add a describe called somethign like "runtimeOptions validation"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added change

@MarioJGMsoft MarioJGMsoft merged commit 179fdd5 into microsoft:main Feb 3, 2025
31 checks passed
@MarioJGMsoft MarioJGMsoft deleted the compressionTestCoverage branch February 3, 2025 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: runtime Runtime related issues area: tests Tests to add, test infrastructure improvements, etc base: main PRs targeted against main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants