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

Fix: proper sorting resources by age column #2182

Merged
merged 3 commits into from Feb 19, 2021

Conversation

ixrock
Copy link
Member

@ixrock ixrock commented Feb 18, 2021

Fixes:

  • sorting resources by age is broken (previously sorted by iso-string timestamp)

image

Maintenance / tech debt:

- use Date.now() instead of new Date().getTime() (#2141 follow-up)

Signed-off-by: Roman <ixrock@gmail.com>
@ixrock ixrock added bug Something isn't working area/ui labels Feb 18, 2021
@ixrock ixrock added this to the 4.1.2 milestone Feb 18, 2021
@ixrock ixrock requested a review from a team February 18, 2021 11:47
@ixrock ixrock self-assigned this Feb 18, 2021
@jakolehm jakolehm modified the milestones: 4.1.2, 4.1.3 Feb 18, 2021
Copy link
Collaborator

@Nokel81 Nokel81 left a comment

Choose a reason for hiding this comment

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

Very good work, except one thing.

src/renderer/components/chart/bar-chart.tsx Outdated Show resolved Hide resolved
Signed-off-by: Roman <ixrock@gmail.com>
@ixrock ixrock requested a review from a team February 18, 2021 18:29
Nokel81
Nokel81 previously approved these changes Feb 18, 2021
Copy link
Contributor

@jim-docker jim-docker left a comment

Choose a reason for hiding this comment

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

You missed cronjobs.
Also, you could replace the new Date().getTime() calls in src/renderer/utils/__test__/formatDuration.test.ts too :)

Signed-off-by: Roman <ixrock@gmail.com>
@ixrock
Copy link
Member Author

ixrock commented Feb 18, 2021

@Nokel81 @jim-docker please re-review.

@ixrock
Copy link
Member Author

ixrock commented Feb 19, 2021

@lensapp/lens-maintainers anybody can spot the issue why integration tests could be failed?

...
2021-02-18T23:58:55.8126130Z yarn integration
2021-02-18T23:58:56.0570630Z yarn run v1.22.5
2021-02-18T23:58:56.1188220Z $ jest --runInBand integration
2021-02-18T23:59:22.1848760Z   console.warn
2021-02-18T23:59:22.1948990Z     minikube not running
2021-02-18T23:59:22.2050170Z 
2021-02-18T23:59:22.2151230Z        8 | 
2021-02-18T23:59:22.2252310Z        9 |     if (status !== 0) {
2021-02-18T23:59:22.2353940Z     > 10 |       console.warn("minikube not running");
2021-02-18T23:59:22.2454660Z          |               ^
2021-02-18T23:59:22.2556030Z       11 | 
2021-02-18T23:59:22.2578690Z       12 |       return false;
2021-02-18T23:59:22.2592210Z       13 |     }
2021-02-18T23:59:22.2631220Z 
2021-02-18T23:59:22.2678680Z       at Object.minikubeReady (integration/helpers/minikube.ts:10:15)
2021-02-18T23:59:22.2711530Z       at Suite.<anonymous> (integration/__tests__/cluster-pages.tests.ts:22:17)
2021-02-18T23:59:22.2757590Z       at Object.<anonymous> (integration/__tests__/cluster-pages.tests.ts:18:1)
2021-02-18T23:59:22.2819380Z 
2021-02-18T23:59:24.1999810Z   console.warn
2021-02-18T23:59:24.2102060Z     minikube not running
2021-02-18T23:59:24.2203650Z 
2021-02-18T23:59:24.2312160Z        8 | 
2021-02-18T23:59:24.2413520Z        9 |     if (status !== 0) {
2021-02-18T23:59:24.2561620Z     > 10 |       console.warn("minikube not running");
2021-02-18T23:59:24.2668670Z          |               ^
2021-02-18T23:59:24.2728560Z       11 | 
2021-02-18T23:59:24.2770540Z       12 |       return false;
2021-02-18T23:59:24.2829030Z       13 |     }
2021-02-18T23:59:24.2901260Z 
2021-02-18T23:59:24.2943320Z       at Object.minikubeReady (integration/helpers/minikube.ts:10:15)
2021-02-18T23:59:24.2979330Z       at Suite.<anonymous> (integration/__tests__/workspace.tests.ts:13:17)
2021-02-18T23:59:24.3027130Z       at Object.<anonymous> (integration/__tests__/workspace.tests.ts:11:1)
2021-02-18T23:59:24.3082970Z 
2021-02-18T23:59:59.2858450Z FAIL integration/__tests__/app.tests.ts (35.065 s)
2021-02-18T23:59:59.2954620Z   Lens integration tests
2021-02-18T23:59:59.3058630Z     app start
2021-02-18T23:59:59.3161150Z       ✕ shows "whats new" (2 ms)
2021-02-18T23:59:59.3277180Z       ✕ shows "add cluster" (5 ms)
2021-02-18T23:59:59.3469960Z       â—‹ skipped quits Lens"
2021-02-18T23:59:59.3512770Z       preferences page
2021-02-18T23:59:59.3603370Z         ✕ shows "preferences"
2021-02-18T23:59:59.3707480Z         ✕ ensures helm repos (11657 ms)
2021-02-18T23:59:59.3830660Z 
2021-02-18T23:59:59.3935090Z   � Lens integration tests › app start › shows "whats new"
2021-02-18T23:59:59.4036540Z 
2021-02-18T23:59:59.4139700Z     Timeout - Async callback was not invoked within the 20000 ms timeout specified by jest.setTimeout.Error: Timeout - Async callback was not invoked within the 20000 ms timeout specified by jest.setTimeout.
2021-02-18T23:59:59.4175650Z 
2021-02-18T23:59:59.4235200Z       at mapper (node_modules/jest-jasmine2/build/queueRunner.js:29:45)
2021-02-18T23:59:59.4330060Z 
2021-02-18T23:59:59.4437170Z   � Lens integration tests › app start › shows "whats new"
2021-02-18T23:59:59.4591300Z 
2021-02-18T23:59:59.4614160Z     TypeError: Cannot read property 'client' of undefined
2021-02-18T23:59:59.4710190Z 
2021-02-18T23:59:59.4811790Z       46 | 
2021-02-18T23:59:59.4883650Z       47 | export async function clickWhatsNew(app: Application) {
2021-02-18T23:59:59.4929570Z     > 48 |   await app.client.waitUntilTextExists("h1", "What's new?");
2021-02-18T23:59:59.5031310Z          |             ^
2021-02-18T23:59:59.5104820Z       49 |   await app.client.click("button.primary");
2021-02-18T23:59:59.5165310Z       50 |   await app.client.waitUntilTextExists("h1", "Welcome");
2021-02-18T23:59:59.5266990Z       51 | }
2021-02-18T23:59:59.5316560Z 
2021-02-18T23:59:59.5352690Z       at Object.clickWhatsNew (integration/helpers/utils.ts:48:13)
2021-02-18T23:59:59.5390520Z       at Object.<anonymous> (integration/__tests__/app.tests.ts:23:19)
2021-02-18T23:59:59.5440660Z 
2021-02-18T23:59:59.5480380Z   � Lens integration tests › app start › shows "add cluster"
2021-02-18T23:59:59.5494100Z 
2021-02-18T23:59:59.5511410Z     Timeout - Async callback was not invoked within the 20000 ms timeout specified by jest.setTimeout.Error: Timeout - Async callback was not invoked within the 20000 ms timeout specified by jest.setTimeout.
2021-02-18T23:59:59.6689480Z 
2021-02-18T23:59:59.6692020Z       at mapper (node_modules/jest-jasmine2/build/queueRunner.js:29:45)
2021-02-18T23:59:59.6692850Z 
2021-02-18T23:59:59.6693810Z   � Lens integration tests › app start › shows "add cluster"
2021-02-18T23:59:59.6694090Z 
2021-02-18T23:59:59.6694870Z     TypeError: Cannot read property 'electron' of undefined
2021-02-18T23:59:59.6695130Z 
2021-02-18T23:59:59.6695470Z       25 | 
2021-02-18T23:59:59.6696320Z       26 |     it('shows "add cluster"', async () => {
2021-02-18T23:59:59.6697430Z     > 27 |       await app.electron.ipcRenderer.send("test-menu-item-click", "File", "Add Cluster");
2021-02-18T23:59:59.6698000Z          |                 ^
2021-02-18T23:59:59.6698520Z       28 |       await app.client.waitUntilTextExists("h2", "Add Cluster");
2021-02-18T23:59:59.6698990Z       29 |     });
2021-02-18T23:59:59.6699330Z       30 | 
2021-02-18T23:59:59.6699490Z 
2021-02-18T23:59:59.6699910Z       at Object.<anonymous> (integration/__tests__/app.tests.ts:27:17)
2021-02-18T23:59:59.6700200Z 
2021-02-18T23:59:59.6701000Z   � Lens integration tests › app start › preferences page › shows "preferences"
2021-02-18T23:59:59.6701310Z 
2021-02-18T23:59:59.6702660Z     Timeout - Async callback was not invoked within the 20000 ms timeout specified by jest.setTimeout.Error: Timeout - Async callback was not invoked within the 20000 ms timeout specified by jest.setTimeout.
2021-02-18T23:59:59.6703500Z 
2021-02-18T23:59:59.6704390Z       at mapper (node_modules/jest-jasmine2/build/queueRunner.js:29:45)
2021-02-18T23:59:59.6704680Z 
2021-02-18T23:59:59.6705480Z   � Lens integration tests › app start › preferences page › shows "preferences"
2021-02-18T23:59:59.6705810Z 
2021-02-18T23:59:59.6706570Z     TypeError: Cannot read property 'electron' of undefined
2021-02-18T23:59:59.6706830Z 
2021-02-18T23:59:59.6707320Z       33 |         const appName: string = process.platform === "darwin" ? "Lens" : "File";
2021-02-18T23:59:59.6707820Z       34 | 
2021-02-18T23:59:59.6708710Z     > 35 |         await app.electron.ipcRenderer.send("test-menu-item-click", appName, "Preferences");
2021-02-18T23:59:59.6709300Z          |                   ^
2021-02-18T23:59:59.6709790Z       36 |         await app.client.waitUntilTextExists("h2", "Preferences");
2021-02-18T23:59:59.6710260Z       37 |       });
2021-02-18T23:59:59.6710610Z       38 | 
2021-02-18T23:59:59.6710770Z 
2021-02-18T23:59:59.6711200Z       at Object.<anonymous> (integration/__tests__/app.tests.ts:35:19)
2021-02-18T23:59:59.6711460Z 
2021-02-18T23:59:59.6712370Z   � Lens integration tests › app start › preferences page › ensures helm repos
2021-02-18T23:59:59.6712680Z 
2021-02-18T23:59:59.6714280Z     Timeout - Async callback was not invoked within the 20000 ms timeout specified by jest.setTimeout.Error: Timeout - Async callback was not invoked within the 20000 ms timeout specified by jest.setTimeout.
2021-02-18T23:59:59.6714860Z 
2021-02-18T23:59:59.6715770Z       at mapper (node_modules/jest-jasmine2/build/queueRunner.js:29:45)
2021-02-18T23:59:59.6716090Z 
2021-02-18T23:59:59.6716890Z   � Lens integration tests › app start › preferences page › ensures helm repos
2021-02-18T23:59:59.6717180Z 
2021-02-18T23:59:59.6717560Z     assert.fail(received, expected)
2021-02-18T23:59:59.6717760Z 
2021-02-18T23:59:59.6718070Z     Message:
2021-02-18T23:59:59.6718460Z       Lens failed to add Bitnami repository
2021-02-18T23:59:59.6718680Z 
2021-02-18T23:59:59.6718980Z       41 | 
2021-02-18T23:59:59.6719350Z       42 |         if (!repos[0]) {
2021-02-18T23:59:59.6719830Z     > 43 |           fail("Lens failed to add Bitnami repository");
2021-02-18T23:59:59.6720290Z          |           ^
2021-02-18T23:59:59.6720670Z       44 |         }
2021-02-18T23:59:59.6721010Z       45 | 
2021-02-18T23:59:59.6722020Z       46 |         await app.client.waitUntilTextExists("div.repos #message-bitnami", repos[0].name); // wait for the helm-cli to fetch the repo(s)
2021-02-18T23:59:59.6722460Z 
2021-02-18T23:59:59.6722900Z       at Object.<anonymous> (integration/__tests__/app.tests.ts:43:11)
2021-02-18T23:59:59.6723490Z 
2021-02-18T23:59:59.6724260Z   � Lens integration tests › app start › quits Lens"
2021-02-18T23:59:59.6724510Z 
2021-02-18T23:59:59.6725680Z     Timeout - Async callback was not invoked within the 20000 ms timeout specified by jest.setTimeout.Error: Timeout - Async callback was not invoked within the 20000 ms timeout specified by jest.setTimeout.
2021-02-18T23:59:59.6726270Z 
2021-02-18T23:59:59.6727140Z       at mapper (node_modules/jest-jasmine2/build/queueRunner.js:29:45)
2021-02-18T23:59:59.6727430Z 
2021-02-19T00:00:23.2250080Z PASS integration/__tests__/command-palette.tests.ts (23.923 s)
2021-02-19T00:00:23.2280190Z   Lens command palette
2021-02-19T00:00:23.2280650Z     menu
2021-02-19T00:00:23.2281790Z       ✓ opens command dialog from menu (1659 ms)
2021-02-19T00:00:23.2282050Z 
2021-02-19T00:00:23.2282490Z Test Suites: 1 failed, 2 skipped, 1 passed, 2 of 4 total
2021-02-19T00:00:23.2283010Z Tests:       4 failed, 56 skipped, 1 passed, 61 total
2021-02-19T00:00:23.2283490Z Snapshots:   0 total
2021-02-19T00:00:23.2283870Z Time:        76.744 s
2021-02-19T00:00:23.2284280Z Ran all test suites matching /integration/i.
2021-02-19T00:00:23.8296950Z error Command failed with exit code 1.
2021-02-19T00:00:23.8315530Z info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
2021-02-19T00:00:23.8647230Z make: *** [integration-mac] Error 1
2021-02-19T00:00:23.9021180Z ##[error]Bash exited with code '2'.
2021-02-19T00:00:23.9058300Z ##[section]Finishing: Run integration tests

UPD: all fine for now, good-old restart did the job :)

@ixrock ixrock merged commit 82d8181 into master Feb 19, 2021
@ixrock ixrock deleted the fix/sorting-resources-by-age branch February 19, 2021 12:21
@jakolehm jakolehm modified the milestones: 4.1.3, 4.2.0 Feb 24, 2021
This was referenced Mar 5, 2021
MJ111 added a commit to MJ111/lens that referenced this pull request Mar 30, 2021
sorting resources by age in cluster-issues is broken (previously sorted by iso-string timestamp)
MJ111 added a commit to MJ111/lens that referenced this pull request Mar 30, 2021
sorting resources by age in cluster-issues is broken (previously sorted by iso-string timestamp)

Signed-off-by: MinJeong Kim <min7859@gmail.com>
MJ111 added a commit to MJ111/lens that referenced this pull request Mar 31, 2021
sorting resources by age in cluster-issues is broken (previously sorted by iso-string timestamp)

Signed-off-by: MinJeong Kim <min7859@gmail.com>
Nokel81 pushed a commit to MJ111/lens that referenced this pull request Apr 6, 2021
sorting resources by age in cluster-issues is broken (previously sorted by iso-string timestamp)

Signed-off-by: MinJeong Kim <min7859@gmail.com>
Nokel81 pushed a commit that referenced this pull request Apr 14, 2021
Co-authored-by: Jim Ehrismann <40840436+jim-docker@users.noreply.github.com>
@Nokel81 Nokel81 mentioned this pull request Apr 15, 2021
Nokel81 pushed a commit that referenced this pull request Apr 16, 2021
Co-authored-by: Jim Ehrismann <40840436+jim-docker@users.noreply.github.com>
Nokel81 pushed a commit that referenced this pull request Apr 19, 2021
Co-authored-by: Jim Ehrismann <40840436+jim-docker@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ui bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants