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

Misc fixes #1458

Merged
merged 13 commits into from
Nov 11, 2022
Merged

Misc fixes #1458

merged 13 commits into from
Nov 11, 2022

Conversation

louise-davies
Copy link
Member

@louise-davies louise-davies commented Nov 10, 2022

Description

A branch primarily motiviated to try and fix the download test failures, but is now doing a few misc fixes/improvements:

  • Fixes an issue with the dev login code
  • Updated browserslist
  • Removed errors/log cluttering from unit test runs
    • Some were just surpressing react query failure logging/loglevel logging
    • DownloadProgress was causing validateDomNesting errors as DataCell previously rendered as a p which has strict limits on what it's children can be - it's now a span which encapsulates being a single line better than a div
    • VisitDetailsPanel has a missing null check on the value which the other panels had
  • Improved e2e tests by mocking the timer in download table refresh tests so they should no longer fail if the test runs too fast & the timestamp hasn't changed
  • Hopefully resolved the download test instability by globally increasing timeouts to 15 secs- but as I detailed in the commit if this either doesn't work or is problematic in other ways, we should instead split the tests that were failing (filter tests in download cart, download status & admin download status) so the tests aren't doing as many things which can cause timeouts

Testing instructions

Add a set up instructions describing how the reviewer should test the code

  • Review code
  • Check Actions build
  • Review changes to test coverage

- progress bar was a descendant of the dataCell typography
which was a <p> - so we just change it to be a <span>
@codecov
Copy link

codecov bot commented Nov 10, 2022

Codecov Report

Base: 97.65% // Head: 97.65% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (139877b) compared to base (436f69a).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1458   +/-   ##
========================================
  Coverage    97.65%   97.65%           
========================================
  Files          158      158           
  Lines         7214     7215    +1     
  Branches      2275     2276    +1     
========================================
+ Hits          7045     7046    +1     
  Misses         152      152           
  Partials        17       17           
Flag Coverage Δ
common 98.07% <100.00%> (+<0.01%) ⬆️
dataview 97.92% <ø> (ø)
download 96.71% <ø> (ø)
search 97.03% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/datagateway-common/src/handleICATError.ts 100.00% <ø> (ø)
...mon/src/table/cellRenderers/dataCell.component.tsx 100.00% <ø> (ø)
packages/datagateway-dataview/src/App.tsx 71.42% <ø> (ø)
...ateway-dataview/src/page/doiRedirect.component.tsx 100.00% <ø> (ø)
packages/datagateway-search/src/App.tsx 73.58% <ø> (ø)
.../detailsPanels/dls/visitDetailsPanel.component.tsx 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

- also, change the loglevel import to the more standard form
as this is now preferred according to their docs
- we were wrongly awaiting fetchNextPage, so call it normally
and await for it to start fetching & finish fetching
- also change adminDownloadStatus table to not use jest timers
I think the reason for the flaky tests is that user.type is quite slow
(as it types every character & event handlers are run on them)
and these tests have multiple calls to user.type
If they continue to be flaky these tests should be split up
so that there's not multiple user.type calls in the same test
@louise-davies louise-davies marked this pull request as ready for review November 11, 2022 13:15
@louise-davies
Copy link
Member Author

Between the last 2 commits I did 7 runs of the unit tests and they passed every time, which seems more stable than previously

Copy link
Member

@kennethnym kennethnym left a comment

Choose a reason for hiding this comment

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

I kind of skipped over the enzyme tests changes and the snapshot changes, as I have already rewritten all of them in RTL in #1447.

Copy link
Member

@kennethnym kennethnym left a comment

Choose a reason for hiding this comment

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

LGTM!

@louise-davies louise-davies merged commit 231151a into develop Nov 11, 2022
@louise-davies louise-davies deleted the misc-fixes branch November 11, 2022 14:38
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.

2 participants