20219: Rearrange non-sortable logs to top of merged all logs view
authorStephen Smith <stephen@curii.com>
Wed, 2 Aug 2023 01:26:37 +0000 (21:26 -0400)
committerStephen Smith <stephen@curii.com>
Wed, 2 Aug 2023 02:36:43 +0000 (22:36 -0400)
Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen@curii.com>

cypress/integration/process.spec.js
src/store/process-logs-panel/process-logs-panel-actions.ts

index 2be9c5c3381ae22887a0ddf034088324765a8c69..00a6631bcdcbd434fb9fd3c4eab175803fb0a660 100644 (file)
@@ -576,24 +576,24 @@ describe('Process tests', function() {
                     // Switch to All logs
                     cy.get('[data-cy=process-logs-filter]').click();
                     cy.get('body').contains('li', 'All logs').click();
-                    // Verify sorted logs
+                    // Verify non-sorted lines were preserved
                     cy.get('[data-cy=process-logs] pre')
-                        .eq(0).should('contain', '2023-07-18T20:14:48.128642814Z first');
+                        .eq(0).should('contain', '3: nodeinfo 1');
                     cy.get('[data-cy=process-logs] pre')
-                        .eq(1).should('contain', '2023-07-18T20:14:48.528642814Z second');
+                        .eq(1).should('contain', '2: nodeinfo 2');
                     cy.get('[data-cy=process-logs] pre')
-                        .eq(2).should('contain', '2023-07-18T20:14:49.128642814Z third');
-                    // Verify non-sorted lines were preserved
+                        .eq(2).should('contain', '1: nodeinfo 3');
                     cy.get('[data-cy=process-logs] pre')
-                        .eq(3).should('contain', '3: nodeinfo 1');
+                        .eq(3).should('contain', '2: nodeinfo 4');
                     cy.get('[data-cy=process-logs] pre')
-                        .eq(4).should('contain', '2: nodeinfo 2');
+                        .eq(4).should('contain', '3: nodeinfo 5');
+                    // Verify sorted logs
                     cy.get('[data-cy=process-logs] pre')
-                        .eq(5).should('contain', '1: nodeinfo 3');
+                        .eq(5).should('contain', '2023-07-18T20:14:48.128642814Z first');
                     cy.get('[data-cy=process-logs] pre')
-                        .eq(6).should('contain', '2: nodeinfo 4');
+                        .eq(6).should('contain', '2023-07-18T20:14:48.528642814Z second');
                     cy.get('[data-cy=process-logs] pre')
-                        .eq(7).should('contain', '3: nodeinfo 5');
+                        .eq(7).should('contain', '2023-07-18T20:14:49.128642814Z third');
                 });
             });
         });
index 23aeb96a10b34e561490fec81747120a2ba1f65d..851d13ef1aa9d0cb9769ae8c57e09758e330c2de 100644 (file)
@@ -237,7 +237,7 @@ const mergeSortLogFragments = (logFragments: LogFragment[]): string[] => {
         .filter((fragment) => (NON_SORTED_LOG_TYPES.includes(fragment.logType)))
         .sort((a, b) => (a.logType.localeCompare(b.logType))));
 
-    return [...sortableLines.sort(sortLogLines), ...nonSortableLines]
+    return [...nonSortableLines, ...sortableLines.sort(sortLogLines)]
 };
 
 const sortLogLines = (a: string, b: string) => {