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

[#1220] Cypress: test ramp chart in zoom view #1930

Merged
merged 22 commits into from
Mar 19, 2023

Conversation

ckcherry23
Copy link
Member

@ckcherry23 ckcherry23 commented Mar 5, 2023

Fixes #1220

Proposed commit message

Currently, there are very few tests for the ramp chart component of 
RepoSense. One aspect that is not tested is whether the ramps shown in 
the ramp chart are correct for the timeframe provided.

Let us make our front-end tests more robust by adding cypress tests to 
check whether the ramps shown in the ramp chart of the zoom view 
correspond with the commits from the selected time period. Let us also
test other aspects of the ramp chart like ramp properties, relative 
distances between ramps and links.

Other information

For this PR, I check whether the ramp chart corresponds with the selected timeframe by checking if the number of ramps is equal to the number of commit messages. Therefore the confidence level of these tests depends on the correctness of the filtering of commit messages.

For the other tests, one downside is that a lot of them are hardcoded or skipped as the values cannot be correctly estimated using conventional Cypress test methods. I will be exploring the use of jQuery methods to make these test cases more robust.

@ckcherry23 ckcherry23 requested a review from a team March 5, 2023 20:09
@ckcherry23
Copy link
Member Author

The frontend tests are failing due to the new merge commits made and can be fixed by merging #1882.

Copy link
Contributor

@vvidday vvidday left a comment

Choose a reason for hiding this comment

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

LGTM! I think that it would be important to add tests to test for the correctness of the filtering of commit messages, as these tests rely on the correctness of those (as you mentioned) e.g. setting date/zoom range in summary panel correctly filters commits in zoom panel.

I'll open a separate issue/PR for that!

@HCY123902 HCY123902 requested a review from a team March 6, 2023 09:20
@ckcherry23 ckcherry23 changed the title Test if ramp chart in zoom view shows selected period [#1220] Test if ramp chart in zoom view shows selected period Mar 7, 2023
Copy link
Contributor

@zhoukerrr zhoukerrr left a comment

Choose a reason for hiding this comment

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

@ckcherry23 More test cases are always welcomed and the test cases added are certainly useful. However, I think other test cases could be added to make this test file more powerful. I am not too sure if it is possible to cover cases regarding the width, start/end date, link to the commit, relative distance between each ramp. Would you mind exploring if any of those are possible?

If there are other areas of testing that you think we can add, feel free to add on. If the ones that I mentioned above are not possible to do/not worth the effort, do share below and feel free to discuss!

@ckcherry23 ckcherry23 marked this pull request as draft March 12, 2023 20:35
@ckcherry23
Copy link
Member Author

I am not too sure if it is possible to cover cases regarding the width, start/end date, link to the commit, relative distance between each ramp. Would you mind exploring if any of those are possible?

Though the initial purpose of this PR was just to test if the ramp chart matches the selected timeframe, I agree that more tests need to be added for the ramp charts. However, many of these properties are difficult to test and some values like ramp width and distance may even change between platforms, even if the viewport size is the same.

While I have added a few test cases with hardcoded expected values, I will explore if there are ways to test these in a more robust manner.

@ckcherry23 ckcherry23 changed the title [#1220] Test if ramp chart in zoom view shows selected period [#1220] Test ramp chart in zoom view Mar 12, 2023
@ckcherry23 ckcherry23 marked this pull request as ready for review March 12, 2023 21:02
Copy link
Contributor

@zhoukerrr zhoukerrr left a comment

Choose a reason for hiding this comment

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

LGTM! I do agree with your point. But I think these hardcoded test cases do add value as a sanity check for future updates.

@dcshzj dcshzj changed the title [#1220] Test ramp chart in zoom view [#1220] Cypress: test ramp chart in zoom view Mar 19, 2023
@dcshzj dcshzj merged commit 086664c into reposense:master Mar 19, 2023
@github-actions
Copy link
Contributor

The following links are for previewing this pull request:

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

Successfully merging this pull request may close these issues.

More robust front end tests
5 participants