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

Refactor RunList, add test suite #127

Merged
merged 5 commits into from
Nov 15, 2018
Merged

Conversation

yebrahim
Copy link
Contributor

@yebrahim yebrahim commented Nov 7, 2018

  • Refactor RunList to have one code path for loading runs, which branches only to get the list of run IDs.
  • Add comprehensive test suite for RunList.
  • Refactor extractMetricMetadata into RunUtils for easier testing (not done yet).
  • Explicitly hard code the initial sort column in all CustomTable instances, since this is no longer maintained by the parent component.

This change is Reviewable

@yebrahim yebrahim changed the title [WIP] Refactor RunList, add test suite Refactor RunList, add test suite Nov 8, 2018
frontend/src/pages/RunList.test.tsx Show resolved Hide resolved
frontend/src/pages/RunList.test.tsx Outdated Show resolved Hide resolved
frontend/src/pages/RunList.test.tsx Outdated Show resolved Hide resolved
frontend/src/pages/RunList.test.tsx Outdated Show resolved Hide resolved
expect(noMetricValueTree).toMatchSnapshot();
});

it('renders a empty metric container when a metric has value of zero', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

this is empty? so the same as the above test where there's no data at all?

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. Currently the metric is validated to either be a percentage metric, in which case a value of zero will show something, or a raw metric, in which case maximum and minimum values are required in order for it to show something. This tests that for a raw metric (this is the default format), if no max/min values are specified, nothing shows up.

We need to make this more resilient, but it's the current code that I'm testing.

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 more tests around this.

frontend/src/pages/RunList.test.tsx Outdated Show resolved Hide resolved
}

/**
* For each DisplayRun, get its ApiRun and retrieve that ApiRun's Pipeline ID if it has one, then
* use that Pipeline ID to fetch its associated Pipeline and attach that Pipeline's name to the
* DisplayRun. If the ApiRun has no Pipeline ID, then the corresponding DisplayRun will show '-'.
*/
private async _getAndSetPipelineNames(displayRuns: DisplayRun[]): Promise<DisplayRun[]> {
return await Promise.all(
private _getAndSetPipelineNames(displayRuns: DisplayRun[]): Promise<DisplayRun[]> {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: why not leave the await and async?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just because it's more code. With function signature enforced, I don't think adding the await adds more safety over returning the promise. wdyt?

@coveralls
Copy link

coveralls commented Nov 13, 2018

Pull Request Test Coverage Report for Build 354

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 41 unchanged lines in 5 files lost coverage.
  • Overall coverage increased (+2.7%) to 77.692%

Files with Coverage Reduction New Missed Lines %
src/pages/ExperimentList.tsx 1 89.77%
src/lib/RunUtils.ts 3 83.33%
src/pages/RunList.tsx 3 95.0%
src/pages/PipelineSelector.tsx 9 61.22%
src/pages/RecurringRunsManager.tsx 25 14.81%
Totals Coverage Status
Change from base Build 340: 2.7%
Covered Lines: 1765
Relevant Lines: 2196

💛 - Coveralls

@coveralls
Copy link

Pull Request Test Coverage Report for Build 320

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 51 unchanged lines in 5 files lost coverage.
  • Overall coverage increased (+2.9%) to 70.386%

Files with Coverage Reduction New Missed Lines %
src/pages/ExperimentList.tsx 1 89.77%
src/lib/RunUtils.ts 3 83.33%
src/pages/RunList.tsx 3 95.0%
src/pages/PipelineSelector.tsx 19 14.63%
src/pages/RecurringRunsManager.tsx 25 14.81%
Totals Coverage Status
Change from base Build 265: 2.9%
Covered Lines: 1591
Relevant Lines: 2180

💛 - Coveralls

@rileyjbauer
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rileyjbauer

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

1 similar comment
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rileyjbauer

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@rileyjbauer
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot removed the lgtm label Nov 15, 2018
@rileyjbauer
Copy link
Contributor

/lgtm

@yebrahim
Copy link
Contributor Author

/test presubmit-e2e-test

@k8s-ci-robot k8s-ci-robot merged commit 36dc868 into master Nov 15, 2018
@yebrahim yebrahim deleted the yebrahim/run-list-tests branch November 15, 2018 05:54
HumairAK pushed a commit to red-hat-data-services/data-science-pipelines that referenced this pull request Mar 11, 2024
* fix doc structure

* fix typo
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.

4 participants