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

Add test for checking ordering of customers #136

Merged
merged 1 commit into from
Mar 6, 2024

Conversation

marioCluml
Copy link
Contributor

@marioCluml marioCluml commented Feb 21, 2024

Closes: #140 ; Closes: #139

Outlier and RankedOutlier ordering does not need to be changed. However, some APIs including Customers does not have unit tests to check the ordering of edges and some may use load differently. In doing so, unit tests are required to confirm. This PR is test case for Customers first and the two APIs that need unit tests (NodeStatusList and AccountList) will come in a different PR.

@marioCluml
Copy link
Contributor Author

marioCluml commented Feb 21, 2024

After this is merged I use a separate PR for the Changelog? Or are those for releases only and not unreleased? The Notion page for the versioning policy seems to be blocked for me today. For some reason, I do not have access to view the page.

@codecov-commenter
Copy link

codecov-commenter commented Feb 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 52.26%. Comparing base (8247a88) to head (7900e95).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #136      +/-   ##
==========================================
+ Coverage   51.17%   52.26%   +1.08%     
==========================================
  Files          65       65              
  Lines       10708    10881     +173     
==========================================
+ Hits         5480     5687     +207     
+ Misses       5228     5194      -34     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@marioCluml marioCluml force-pushed the mario/customer-unit-test branch from 053cf6e to 2fa8f07 Compare February 21, 2024 01:53
@sophie-cluml
Copy link
Contributor

Writing down the changes made in each PR should be done within each PR. So please document the change in CHANGELOG.md in this PR.

@sophie-cluml
Copy link
Contributor

sophie-cluml commented Feb 21, 2024

Could you also create an issue for this PR? That issue has to contain why we need to insert node.reverse() in outlier.rs, and perhaps the link to the similar issue handled by Min.
I also suggest to change the title of this PR to show that this PR adds reverse() in outlier.rs to maintain uniform ordering of edges in graphql API response.

let to = earliest_outlier_key(&after)?;
iter_to_nodes_with_outlier(iter, &to, cmp::Ordering::is_ge, last, filter, true)
} else {
iter_to_nodes_with_outlier(iter, &[], always_true, last, filter, true)
}?;
nodes.reverse();
Copy link
Contributor

@sophie-cluml sophie-cluml Feb 21, 2024

Choose a reason for hiding this comment

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

It would also be beneficial if we have a test on outliers API, that looks very similar to check_customer_ordering, so that we are sure that edges in the outliers graphql API response are in ascending order after this change.

Copy link
Contributor Author

@marioCluml marioCluml Feb 21, 2024

Choose a reason for hiding this comment

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

Sounds good! I'll write the outlier test and ping you

Copy link
Contributor

@sehkone sehkone Feb 26, 2024

Choose a reason for hiding this comment

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

From what I have tested the version without this change, I've got proper results like the attached screenshots. So did I from other APIs like clusters, eventList, and models. This means adding reverse is not necessary at all.

스크린샷 2024-02-26 오후 8 00 35
스크린샷 2024-02-26 오후 8 01 04
스크린샷 2024-02-26 오후 8 01 19
스크린샷 2024-02-26 오후 8 01 50

Copy link
Contributor

@sehkone sehkone Feb 26, 2024

Choose a reason for hiding this comment

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

Besides, the part where you test customerList should include other cases which use after and/or last just like the above screenshots do.

Copy link
Contributor

@sehkone sehkone Feb 26, 2024

Choose a reason for hiding this comment

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

If other APIs rather than customerList need to be tested because they differ regarding how they use the changed code, I think you should test those as well.

@marioCluml marioCluml force-pushed the mario/customer-unit-test branch from 0eb1604 to 903a5cd Compare February 22, 2024 00:04
@sehkone
Copy link
Contributor

sehkone commented Feb 23, 2024

@marioCluml @sophie-cluml , as I put a comment in the UI repo, customerXXX APIs are not affected by the change.

@sophie-cluml
Copy link
Contributor

sophie-cluml commented Feb 23, 2024

@sehkone My understanding is that the main purpose of this PR is to add reverse() in outliers.rs Adding a test on customer is a bonus. The bonus code is a longer than the code doing reverse(), so splitting this PR into 2 may be more organized? (Or else, maintain a single PR, but modify the title)

Since the change in outlier.rs is unwanted and is requested to be withdrawn, the title of current PR should stay as it is now.

CHANGELOG.md Outdated Show resolved Hide resolved
@marioCluml marioCluml force-pushed the mario/customer-unit-test branch from add26b5 to 153b5a1 Compare February 28, 2024 04:57
@marioCluml marioCluml force-pushed the mario/customer-unit-test branch from 153b5a1 to f44679d Compare February 28, 2024 05:00
CHANGELOG.md Outdated Show resolved Hide resolved
@marioCluml marioCluml force-pushed the mario/customer-unit-test branch from 721eccc to b1661a1 Compare February 28, 2024 06:00
Copy link
Contributor

@sophie-cluml sophie-cluml left a comment

Choose a reason for hiding this comment

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

LGTM

CHANGELOG.md Outdated Show resolved Hide resolved
@marioCluml marioCluml force-pushed the mario/customer-unit-test branch from 084e0d8 to ac945f7 Compare February 28, 2024 06:24
Copy link
Contributor

@sophie-cluml sophie-cluml left a comment

Choose a reason for hiding this comment

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

LGTM
@sehkone please check for merge

Remove outlier changes for different PR

Fix outlier to have correct pagination

Remove outlier reverse changes

Remove outlier changes in CHANGELOG

Add more cases for customers

Change change log

Fix unreleased section to have no date
@marioCluml marioCluml force-pushed the mario/customer-unit-test branch from ac945f7 to 7900e95 Compare March 6, 2024 02:13
@sehkone sehkone merged commit 2a0d0cf into main Mar 6, 2024
8 checks passed
@sehkone sehkone deleted the mario/customer-unit-test branch March 6, 2024 03:42
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.

Check ordering of GraphQL API pagination changes Fix GraphQL pagination ordering for Outliers
4 participants