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

[HOLD for payment 2024-04-03] [PAY March 27][$250] [Reassure] Add reassure test for BaseOptionsList #38168

Closed
mountiny opened this issue Mar 12, 2024 · 36 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production External Added to denote the issue can be worked on by a contributor NewFeature Something to build that is a new item. Weekly KSv2

Comments

@mountiny
Copy link
Contributor

mountiny commented Mar 12, 2024

Problem

The components/OptionsList/BaseOptionsList is a complex component in the App and if its performance degrades, it can have considerable impact on the App performance.

Solution

Let's add a reassure test to cover various cases of this component use similarly as we have created such tests for SelectionList component for example.


Please refer to other tests in the repository, here is a readme for reassure tests which should help you get familiar with the tool.

All new tests should be written in TS.

Please provide a proposal stating, how you could write such test and scenarios for the component such that we test the slowest execution path as well.

cc @OlimpiaZurek

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~013308adf811c76d8b
  • Upwork Job ID: 1767637401542344704
  • Last Price Increase: 2024-03-12
Issue OwnerCurrent Issue Owner: @slafortune
@mountiny mountiny added Daily KSv2 NewFeature Something to build that is a new item. labels Mar 12, 2024
@mountiny mountiny self-assigned this Mar 12, 2024
Copy link

melvin-bot bot commented Mar 12, 2024

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Mar 12, 2024
@mountiny mountiny added the External Added to denote the issue can be worked on by a contributor label Mar 12, 2024
@melvin-bot melvin-bot bot changed the title [Reassure] Add reassure test for BaseOptionsList [$500] [Reassure] Add reassure test for BaseOptionsList Mar 12, 2024
Copy link

melvin-bot bot commented Mar 12, 2024

Job added to Upwork: https://www.upwork.com/jobs/~013308adf811c76d8b

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Mar 12, 2024
Copy link

melvin-bot bot commented Mar 12, 2024

Triggered auto assignment to Contributor-plus team member for initial proposal review - @jayeshmangwani (External)

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Mar 12, 2024
@mountiny mountiny changed the title [$500] [Reassure] Add reassure test for BaseOptionsList [$250] [Reassure] Add reassure test for BaseOptionsList Mar 12, 2024
Copy link

melvin-bot bot commented Mar 12, 2024

Upwork job price has been updated to $250

@ShridharGoel
Copy link
Contributor

Proposal

Please re-state the problem that we are trying to solve in this issue.

Add performance test for BaseOptionsList.

What is the root cause of that problem?

New tests to ensure stability of performance in BaseOptionsList.

What changes do you think we should make in order to solve the problem?

Example test:


function BaseOptionsListWrapper({
    sections,
}: {
    sections: OptionsListData<Section>[];
}) {
    return (
        <BaseOptionsList
            sections={sections}
            headerMessage="Options List Header"
            isLoading={false}
            onSelectRow={() => {}}
            focusedIndex={0}
        />
    );
}

test('[BaseOptionsList] should render 1 section and a thousand items', () => {
    const sections: OptionsListData<Section>[] = [
        {
            data: Array.from({length: 1000}, (_, index) => ({
                text: `Item ${index}`,
                keyForList: `item-${index}`,
            })),
            indexOffset: 0,
            isDisabled: false,
            shouldShow: true,
            title: 'Section 1',
        },
    ];

    measurePerformance(
        <BaseOptionsListWrapper sections={sections} />,
    );
});

@brunovjk
Copy link
Contributor

Please re-state the problem that we are trying to solve in this issue.

Add reassure test for BaseOptionsList

What is the root cause of that problem?

The intricate nature of the BaseOptionsList component, when experiencing performance degradation, can have a notable impact on the application's responsiveness.

What changes do you think we should make in order to solve the problem?

To address this concern, we propose the addition of a reassurance test that comprehensively covers different use cases of the BaseOptionsList component. This reassurance test should be crafted in TypeScript (TS) to align with our project's language choices. The focus should be on evaluating the slowest execution path of the component, ensuring its robustness and optimal performance.

Additionally, we could follow the measurePerformance approach outlined in the App/tests/perf-test/SelectionList.perf-test.tsx file. This approach involves scenarios such as rendering lists with multiple items, testing scrolling performance, assessing onPress/onSelect actions, and evaluating text input interactions. By implementing this strategy, we can ensure that the reassurance test covers a broad range of potential performance bottlenecks.

What alternative solutions did you explore? (Optional)

@ghost
Copy link

ghost commented Mar 12, 2024

Proposal

Please re-state the problem that we are trying to solve in this issue.

[Reassure] Add reassure test for BaseOptionsList]

What is the root cause of that problem?

** New Feature of Writing Test **

What changes do you think we should make in order to solve the problem?

This is the example Test for reference :

import {measureFunction} from 'reassure';  
import BaseOptionsList from '@src/components/OptionsList/BaseOptionsList';

describe('BaseOptionsList performance', () => {

  const mockSections = // array of 1000 sections
  const mockSelectedOptions = // array of 1000 selected options

  it('measures rendering with 1000 sections', async () => {

    const wrapper = shallow(
      <BaseOptionsList 
        sections={mockSections}
        selectedOptions={mockSelectedOptions}
      />
    );
    
    await measureFunction(() => {
      wrapper.render();
    });

  });

});
  • This test creates a large amount of mock data - 1000 sections and 1000 selected options.

  • It renders the BaseOptionsList component with this data and times how long the initial render takes.

  • This allows assessing the performance rendering BaseOptionsList with a realistic amount of data it may handle.

  • Additional tests could try different amounts of mock data to test scaling. Or measure rerender times by changing specific props like selectedOptions.

  • The goal is to catch any regressions in rendering performance as the data grows over time. By testing with production-level data volumes, it reduces the risk of slowdowns when users have large amounts of options.

What alternative solutions did you explore? (Optional)

N/A

@jayeshmangwani
Copy link
Contributor

Thanks for the proposals

From the above proposals I like the @ShridharGoel 's Proposal, they have mentioned a basic thousand items render scenario, in the PR we can add the few real-life other scenarios like,

  1. scroll and press a option list item
  2. render multiple options and select list items

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Mar 13, 2024

Current assignee @mountiny is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Mar 13, 2024
Copy link

melvin-bot bot commented Mar 13, 2024

❌ There was an error making the offer to @jayeshmangwani for the Reviewer role. The BZ member will need to manually hire the contributor.

Copy link

melvin-bot bot commented Mar 13, 2024

❌ There was an error making the offer to @ShridharGoel for the Contributor role. The BZ member will need to manually hire the contributor.

@mountiny
Copy link
Contributor Author

@ShridharGoel please create a Pr and can you please add the scenarios @jayeshmangwani mentioned?

@melvin-bot melvin-bot bot removed the Overdue label Mar 18, 2024
@mountiny
Copy link
Contributor Author

PR is up

@slafortune
Copy link
Contributor

Merged on 3/20 - so without a regression, payment would be 3/27

@slafortune slafortune changed the title [$250] [Reassure] Add reassure test for BaseOptionsList [PAY March 27][$250] [Reassure] Add reassure test for BaseOptionsList Mar 22, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Mar 27, 2024
@melvin-bot melvin-bot bot changed the title [PAY March 27][$250] [Reassure] Add reassure test for BaseOptionsList [HOLD for payment 2024-04-03] [PAY March 27][$250] [Reassure] Add reassure test for BaseOptionsList Mar 27, 2024
Copy link

melvin-bot bot commented Mar 27, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Mar 27, 2024
Copy link

melvin-bot bot commented Mar 27, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.56-8 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-04-03. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Mar 27, 2024

BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@jayeshmangwani] Please propose regression test steps to ensure the new feature will work correctly on production in further releases.
  • [@slafortune] Link the GH issue for creating/updating the regression test once above steps have been agreed upon.

@slafortune
Copy link
Contributor

@mountiny @jayeshmangwani will we need regression tests for this?

@slafortune
Copy link
Contributor

slafortune commented Mar 27, 2024

@jayeshmangwani offer sent here
@ShridharGoel offer sent here

Holding until 4/3

@jayeshmangwani
Copy link
Contributor

@slafortune No regression tests are needed, update was in the automated tests

@mountiny
Copy link
Contributor Author

No tests required here

@slafortune
Copy link
Contributor

@jayeshmangwani @ShridharGoel please accept the offers sent.

@jayeshmangwani
Copy link
Contributor

@slafortune Please send a new offer; Getting an error when accepting the old offer.
Screenshot 2024-04-03 at 6 32 33 PM

@slafortune
Copy link
Contributor

Can you try to search for it another way - Upworks is wonky sometimes -
image

@jayeshmangwani
Copy link
Contributor

@slafortune Declined the offer, and I have applied manually to the job Upwork job https://www.upwork.com/jobs/~013308adf811c76d8b

@slafortune
Copy link
Contributor

Alright - I accepted the proposal and sent you another offer - https://www.upwork.com/nx/wm/offer/101721107

@slafortune
Copy link
Contributor

@jayeshmangwani is paid
Waiting on @ShridharGoel to accept offer sent here

@ShridharGoel
Copy link
Contributor

@slafortune I'm getting the same issue, unable to accept it.

@slafortune
Copy link
Contributor

@ShridharGoel are you able to do the same thing that @jayeshmangwani just did? Since it worked, seems like the best option.

@ShridharGoel
Copy link
Contributor

@slafortune It says "This job is no longer available.".

@slafortune
Copy link
Contributor

I've sent you another offer here - https://www.upwork.com/nx/wm/offer/101722838

@ShridharGoel
Copy link
Contributor

ShridharGoel commented Apr 4, 2024 via email

@slafortune
Copy link
Contributor

All paid

@github-project-automation github-project-automation bot moved this from HIGH to Done in [#whatsnext] #quality Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production External Added to denote the issue can be worked on by a contributor NewFeature Something to build that is a new item. Weekly KSv2
Projects
Development

No branches or pull requests

5 participants