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

Validate target purpose in spec tests #7113

Merged
merged 5 commits into from Mar 11, 2023
Merged

Conversation

milaGGL
Copy link
Contributor

@milaGGL milaGGL commented Mar 10, 2023

Validate targetPurpose in spec test ValidateActiveTargets function.

@milaGGL milaGGL self-assigned this Mar 10, 2023
@changeset-bot
Copy link

changeset-bot bot commented Mar 10, 2023

⚠️ No Changeset found

Latest commit: e995f3a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@@ -398,7 +404,10 @@ export class MockConnection implements Connection {
++this.watchStreamRequestCount;
if (request.addTarget) {
const targetId = request.addTarget.targetId!;
this.activeTargets[targetId] = request.addTarget;
this.activeTargets[targetId] = {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Record the actual listen request label to validate targetPurpose in active targets.

let targetData = new TargetData(
queryToTarget(parseQuery(expected.queries[0])),
targetId,
TargetPurpose.Listen,
expected.targetPurpose,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

expected.targetPurpose either specified in the spec test file, or default to listen.

@@ -1117,6 +1116,11 @@ abstract class TestRunner {
version(expected.readTime!)
);
}

const expectedLabels =
Copy link
Contributor Author

Choose a reason for hiding this comment

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

compare actual listen request label with the label generated by expected target purpose.

@milaGGL milaGGL requested a review from dconeybe March 10, 2023 20:37
@google-oss-bot
Copy link
Contributor

google-oss-bot commented Mar 10, 2023

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Mar 10, 2023

Copy link
Contributor

@dconeybe dconeybe left a comment

Choose a reason for hiding this comment

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

Approved, with one minor comment. Thanks for making this improvement! Please open PRs in the ios and android sdks with the updated json files.

packages/firestore/test/unit/specs/spec_test_runner.ts Outdated Show resolved Hide resolved
@milaGGL milaGGL merged commit a2505bd into master Mar 11, 2023
@milaGGL milaGGL deleted the mila/check-TargetPurpose-in-spec branch March 11, 2023 00:52
renkelvin pushed a commit that referenced this pull request Mar 21, 2023
@firebase firebase locked and limited conversation to collaborators Apr 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants