;
-
- beforeEach(() => {
- mockAddMoreRows = jasmine.createSpy();
- root = render(
- ,
- );
- });
-
- afterEach(cleanup);
-
- it('formats dates correctly', async () => {
- const tableFirstDateElement = (await root.getAllByTestId('task-table-date'))[0];
- expect(tableFirstDateElement.innerHTML).toBe(format(timestamp, 'MMM dd yyy hh:mm aaa'));
- });
-
- it('shows the correct number of rows', () => {
- const allRows = root.container.querySelectorAll('.MuiDataGrid-row').length;
- expect(allRows).toBe(100);
- });
-
- it('shows the correct headers', () => {
- expect(screen.queryByText('Task ID')).toBeTruthy();
- expect(screen.queryByText('Fleet')).toBeTruthy();
- expect(screen.queryByText('Robot')).toBeTruthy();
- expect(screen.queryByText('Task Description')).toBeTruthy();
- expect(screen.queryByText('State')).toBeTruthy();
- expect(screen.queryByText('Time')).toBeTruthy();
- expect(screen.queryByText('Timestamp')).toBeTruthy();
- });
-
- it('executes the addMoreRows function', () => {
- const nextPageButton = screen.queryByTitle('Go to next page');
- nextPageButton && userEvent.click(nextPageButton);
- expect(mockAddMoreRows).toHaveBeenCalled();
- });
-});
diff --git a/packages/react-components/lib/reports/task-summary/task-summary-report-table.tsx b/packages/react-components/lib/reports/task-summary/task-summary-report-table.tsx
deleted file mode 100644
index db1a5a7d6..000000000
--- a/packages/react-components/lib/reports/task-summary/task-summary-report-table.tsx
+++ /dev/null
@@ -1,126 +0,0 @@
-import React from 'react';
-import { DataGrid, GridRenderCellParams } from '@mui/x-data-grid';
-import type { Time } from 'api-client';
-import { format } from 'date-fns';
-import { Typography } from '@mui/material';
-import { rosTimeToJs } from '../../utils';
-import { DefaultLogTableProps } from '../default-report-interface';
-import { returnTaskDetails } from './utils';
-
-export type TaskSummaryRowsType = {
- created: string; //date
- fleet: { id: number; name: string };
- robot: { id: number; name: string; model?: string };
- task_id: string;
- task_profile: any;
- state: string;
- status: string;
- submission_time: Time;
- start_time: Time;
- end_time: Time;
-}[];
-
-export interface TaskSummaryReportTable extends DefaultLogTableProps {
- rows: TaskSummaryRowsType | [];
-}
-
-export const TaskSummaryReportTable = (props: TaskSummaryReportTable): React.ReactElement => {
- const { rows, addMoreRows } = props;
-
- return (
-
- r.task_id}
- columns={[
- {
- headerName: 'Task ID',
- field: 'task_id',
- type: 'string',
- renderCell: (rowData: GridRenderCellParams) => {
- return {rowData.row.task_id};
- },
- },
- {
- headerName: 'Fleet',
- field: 'fleet_name',
- type: 'string',
- renderCell: (rowData: GridRenderCellParams) => {
- return {rowData.row.fleet.name};
- },
- },
- {
- headerName: 'Robot',
- field: 'robot_name',
- type: 'string',
- renderCell: (rowData: GridRenderCellParams) => {
- return {rowData.row.robot.name};
- },
- },
- {
- headerName: 'Task Description',
- field: 'description',
- type: 'string',
- renderCell: (rowData: GridRenderCellParams) => {
- const taskTypeDetails = returnTaskDetails(
- rowData.row.task_id,
- rowData.row.task_profile.description,
- );
- return taskTypeDetails;
- },
- },
- {
- headerName: 'State',
- field: 'state',
- type: 'string',
- renderCell: (rowData: GridRenderCellParams) => {
- return {rowData.row.state};
- },
- },
- {
- headerName: 'Time',
- field: 'time_information',
- type: 'string',
- renderCell: (rowData: GridRenderCellParams) => {
- const submissionTime = rosTimeToJs(
- rowData.row.task_profile.submission_time,
- ).toLocaleTimeString();
- const startTime = rosTimeToJs(rowData.row.start_time).toLocaleTimeString();
- const endTime = rosTimeToJs(rowData.row.end_time).toLocaleTimeString();
- return (
- <>
- Submitted: {submissionTime}
- Start: {startTime}
- End: {endTime}
- >
- );
- },
- },
- {
- headerName: 'Timestamp',
- field: 'created',
- type: 'datetime',
- filterable: false,
- align: 'center',
- renderCell: (rowData: GridRenderCellParams) => {
- return (
-
- {format(new Date(rowData.value as number), 'MMM dd yyyy hh:mm aaa')}
-
- );
- },
- },
- ]}
- rows={rows}
- pageSize={100}
- rowsPerPageOptions={[50, 100]}
- onPageChange={() => {
- if (addMoreRows) {
- addMoreRows();
- }
- }}
- disableColumnMenu={true}
- />
-
- );
-};
diff --git a/packages/react-components/lib/reports/task-summary/task-summary-report.spec.tsx b/packages/react-components/lib/reports/task-summary/task-summary-report.spec.tsx
deleted file mode 100644
index fd86510e8..000000000
--- a/packages/react-components/lib/reports/task-summary/task-summary-report.spec.tsx
+++ /dev/null
@@ -1,38 +0,0 @@
-import { render, screen, waitFor } from '@testing-library/react';
-import userEvent from '@testing-library/user-event';
-import React from 'react';
-import { TestLocalizationProvider } from '../../test/locale';
-import { getTaskSummaryLogs, reportConfigProps } from '../utils.spec';
-import { TaskSummaryReport } from './task-summary-report';
-
-const getLogsPromise = async () => getTaskSummaryLogs();
-
-it('smoke test', async () => {
- await waitFor(() => {
- render();
- });
-});
-
-it('does not show the table when the logs list is empty', async () => {
- await waitFor(() => {
- render( []} />);
- });
-
- expect(screen.queryByText('Task Summary')).toBeFalsy();
-});
-
-it('calls the Retrieve Logs function when the button is clicked', async () => {
- const getLogsPromiseMock = jasmine.createSpy();
- const getLogsPromise = async () => {
- getLogsPromiseMock();
- return getTaskSummaryLogs();
- };
-
- render(, {
- wrapper: TestLocalizationProvider,
- });
- const retrieveLogsButton = screen.getByRole('button', { name: /Retrieve Logs/i });
- expect(retrieveLogsButton).toBeTruthy();
- userEvent.click(retrieveLogsButton);
- expect(getLogsPromiseMock).toHaveBeenCalled();
-});
diff --git a/packages/react-components/lib/reports/task-summary/task-summary-report.tsx b/packages/react-components/lib/reports/task-summary/task-summary-report.tsx
deleted file mode 100644
index f7d0c2835..000000000
--- a/packages/react-components/lib/reports/task-summary/task-summary-report.tsx
+++ /dev/null
@@ -1,41 +0,0 @@
-import React from 'react';
-import {
- DefaultReportQueryPayload,
- defaultReportClasses,
- DefaultReportContainer,
-} from '../default-report-interface';
-import { DefaultDatesForm } from '../default-dates-form';
-import { TaskSummaryReportTable, TaskSummaryRowsType } from './task-summary-report-table';
-import { ReportConfigProps } from '../utils';
-
-export interface TaskSummaryReportProps extends ReportConfigProps {
- getLogs: (data: DefaultReportQueryPayload) => Promise;
-}
-
-export const TaskSummaryReport = (props: TaskSummaryReportProps): React.ReactElement => {
- const { getLogs, ...otherProps } = props;
- const [logs, setLogs] = React.useState([]);
- const [lastSearchParams, setLastSearchParams] = React.useState({});
-
- const searchLogs = async (payload: DefaultReportQueryPayload) => {
- setLastSearchParams(payload);
- setLogs(await getLogs(payload));
- };
-
- const getMoreLogs = async () => {
- setLogs(logs.concat(await getLogs({ ...lastSearchParams, offset: logs.length })));
- };
-
- return (
-
-
-
- {logs.length !== 0 && (
-
- )}
-
-
- );
-};
-
-export default TaskSummaryReport;
diff --git a/packages/react-components/lib/reports/task-summary/utils.tsx b/packages/react-components/lib/reports/task-summary/utils.tsx
deleted file mode 100644
index 6437b6277..000000000
--- a/packages/react-components/lib/reports/task-summary/utils.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import { Typography } from '@mui/material';
-// import type { TaskDescription } from 'api-client';
-import React from 'react';
-
-export const returnTaskDetails = (taskId: string, taskDescription: any): React.ReactNode => {
- let taskTypeDetails;
- if (taskId.includes('Loop')) {
- taskTypeDetails = taskDescription.loop;
- return (
- <>
- Num of Loops: {taskTypeDetails.num_loops}
- Start Point: {taskTypeDetails.start_name}
- End Point: {taskTypeDetails.finish_name}
- >
- );
- } else if (taskId.includes('Delivery')) {
- taskTypeDetails = taskDescription.delivery;
- return (
- <>
- Pick Up: {taskTypeDetails.pickup_place_name}
- Drop Off: {taskTypeDetails.dropoff_place_name}
- End Point: {taskTypeDetails.items}
- >
- );
- } else if (taskId.includes('Clean')) {
- taskTypeDetails = taskDescription.clean;
- return (
- <>
- Start Point: {taskTypeDetails.start_waypoint}
- >
- );
- }
-};
diff --git a/packages/react-components/lib/reports/user-report/index.ts b/packages/react-components/lib/reports/user-report/index.ts
deleted file mode 100644
index 9c04239c0..000000000
--- a/packages/react-components/lib/reports/user-report/index.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-export * from './user-login-failure-report-table';
-export * from './user-login-failure-report';
-export * from './user-login-report';
-export * from './user-login-report-table';
-export * from './user-logout-report';
-export * from './user-logout-report-table';
diff --git a/packages/react-components/lib/reports/user-report/user-login-failure-report-table.tsx b/packages/react-components/lib/reports/user-report/user-login-failure-report-table.tsx
deleted file mode 100644
index c8198dfb9..000000000
--- a/packages/react-components/lib/reports/user-report/user-login-failure-report-table.tsx
+++ /dev/null
@@ -1,83 +0,0 @@
-import React from 'react';
-import { DataGrid, GridRenderCellParams } from '@mui/x-data-grid';
-import { Typography } from '@mui/material';
-import { DefaultLogTableProps } from '../default-report-interface';
-import { format } from 'date-fns';
-
-export type UserLoginFailureRowsType = {
- created: string; //date
- ip_address: string;
- client_id: string;
- username: string;
- error: string;
-}[];
-
-export interface UserLoginFailureReportTable extends DefaultLogTableProps {
- rows: UserLoginFailureRowsType;
-}
-
-export const UserLoginFailureReportTable = (
- props: UserLoginFailureReportTable,
-): React.ReactElement => {
- const { rows, addMoreRows } = props;
-
- return (
-
- r.client_id}
- columns={[
- {
- headerName: 'Username',
- field: 'username',
- type: 'string',
- renderCell: (rowData: GridRenderCellParams) => {
- return {rowData.row.username};
- },
- },
-
- {
- headerName: 'Client ID',
- field: 'client_id',
- type: 'string',
- renderCell: (rowData: GridRenderCellParams) => {
- return {rowData.row.client_id};
- },
- },
- {
- headerName: 'IP Addr.',
- field: 'ip_address',
- type: 'string',
- renderCell: (rowData: GridRenderCellParams) => {
- return {rowData.row.ip_address};
- },
- },
-
- {
- headerName: 'Timestamp',
- field: 'created',
- type: 'datetime',
- filterable: false,
- align: 'center',
- renderCell: (rowData: GridRenderCellParams) => {
- return (
-
- {format(new Date(rowData.value as number), 'MMM dd yyyy hh:mm aaa')}
-
- );
- },
- },
- ]}
- rows={rows}
- pageSize={100}
- rowsPerPageOptions={[50, 100]}
- onPageChange={() => {
- if (addMoreRows) {
- addMoreRows();
- }
- }}
- disableColumnMenu={true}
- />
-
- );
-};
diff --git a/packages/react-components/lib/reports/user-report/user-login-failure-report.tsx b/packages/react-components/lib/reports/user-report/user-login-failure-report.tsx
deleted file mode 100644
index d40ee77af..000000000
--- a/packages/react-components/lib/reports/user-report/user-login-failure-report.tsx
+++ /dev/null
@@ -1,44 +0,0 @@
-import React from 'react';
-import {
- DefaultReportQueryPayload,
- DefaultReportContainer,
- defaultReportClasses,
-} from '../default-report-interface';
-import { DefaultDatesForm } from '../default-dates-form';
-import {
- UserLoginFailureReportTable,
- UserLoginFailureRowsType,
-} from './user-login-failure-report-table';
-import { ReportConfigProps } from '../utils';
-
-export interface UserLoginFailureReportProps extends ReportConfigProps {
- getLogs: (data: DefaultReportQueryPayload) => Promise;
-}
-
-export const UserLoginFailureReport = (props: UserLoginFailureReportProps): React.ReactElement => {
- const { getLogs, ...otherProps } = props;
- const [logs, setLogs] = React.useState([]);
- const [lastSearchParams, setLastSearchParams] = React.useState({});
-
- const searchLogs = async (payload: DefaultReportQueryPayload) => {
- setLastSearchParams(payload);
- setLogs(await getLogs(payload));
- };
-
- const getMoreLogs = async () => {
- setLogs(logs.concat(await getLogs({ ...lastSearchParams, offset: logs.length })));
- };
-
- return (
-
-
-
- {logs.length !== 0 && (
-
- )}
-
-
- );
-};
-
-export default UserLoginFailureReport;
diff --git a/packages/react-components/lib/reports/user-report/user-login-report-table.tsx b/packages/react-components/lib/reports/user-report/user-login-report-table.tsx
deleted file mode 100644
index b1a95ba53..000000000
--- a/packages/react-components/lib/reports/user-report/user-login-report-table.tsx
+++ /dev/null
@@ -1,87 +0,0 @@
-import React from 'react';
-import { DataGrid, GridRenderCellParams } from '@mui/x-data-grid';
-import { Typography } from '@mui/material';
-import { DefaultLogTableProps } from '../default-report-interface';
-import { format } from 'date-fns';
-
-export type UserLoginRowsType = {
- client_id: string;
- created: string; //date
- ip_address: string;
- user_id: string;
- username: string;
-}[];
-
-export interface UserLoginReportTable extends DefaultLogTableProps {
- rows: UserLoginRowsType;
-}
-
-export const UserLoginReportTable = (props: UserLoginReportTable): React.ReactElement => {
- const { rows, addMoreRows } = props;
-
- return (
-
- r.client_id}
- columns={[
- {
- headerName: 'Username',
- field: 'username',
- type: 'string',
- renderCell: (rowData: GridRenderCellParams) => {
- return {rowData.row.username};
- },
- },
- {
- headerName: 'Timestamp',
- field: 'created',
- type: 'datetime',
- filterable: false,
- align: 'center',
- renderCell: (rowData: GridRenderCellParams) => {
- return (
-
- {format(new Date(rowData.value as number), 'MMM dd yyyy hh:mm aaa')}
-
- );
- },
- },
- {
- headerName: 'Client ID',
- field: 'client_id',
- type: 'string',
- renderCell: (rowData: GridRenderCellParams) => {
- return {rowData.row.client_id};
- },
- },
- {
- headerName: 'User ID',
- field: 'user_id',
- type: 'string',
- renderCell: (rowData: GridRenderCellParams) => {
- return {rowData.row.user_id};
- },
- },
- {
- headerName: 'IP Addr',
- field: 'ip_address',
- type: 'string',
- renderCell: (rowData: GridRenderCellParams) => {
- return {rowData.row.ip_address};
- },
- },
- ]}
- rows={rows}
- pageSize={100}
- rowsPerPageOptions={[50, 100]}
- onPageChange={() => {
- if (addMoreRows) {
- addMoreRows();
- }
- }}
- disableColumnMenu={true}
- />
-
- );
-};
diff --git a/packages/react-components/lib/reports/user-report/user-login-report.tsx b/packages/react-components/lib/reports/user-report/user-login-report.tsx
deleted file mode 100644
index 630fa09dc..000000000
--- a/packages/react-components/lib/reports/user-report/user-login-report.tsx
+++ /dev/null
@@ -1,41 +0,0 @@
-import React from 'react';
-import {
- DefaultReportQueryPayload,
- defaultReportClasses,
- DefaultReportContainer,
-} from '../default-report-interface';
-import { DefaultDatesForm } from '../default-dates-form';
-import { UserLoginReportTable, UserLoginRowsType } from './user-login-report-table';
-
-import { ReportConfigProps } from '../utils';
-export interface UserLoginReportProps extends ReportConfigProps {
- getLogs: (data: DefaultReportQueryPayload) => Promise;
-}
-
-export const UserLoginReport = (props: UserLoginReportProps): React.ReactElement => {
- const { getLogs, ...otherProps } = props;
- const [logs, setLogs] = React.useState([]);
- const [lastSearchParams, setLastSearchParams] = React.useState({});
-
- const searchLogs = async (payload: DefaultReportQueryPayload) => {
- setLastSearchParams(payload);
- setLogs(await getLogs(payload));
- };
-
- const getMoreLogs = async () => {
- setLogs(logs.concat(await getLogs({ ...lastSearchParams, offset: logs.length })));
- };
-
- return (
-
-
-
- {logs.length !== 0 && (
-
- )}
-
-
- );
-};
-
-export default UserLoginReport;
diff --git a/packages/react-components/lib/reports/user-report/user-logout-report-table.tsx b/packages/react-components/lib/reports/user-report/user-logout-report-table.tsx
deleted file mode 100644
index cc96e062f..000000000
--- a/packages/react-components/lib/reports/user-report/user-logout-report-table.tsx
+++ /dev/null
@@ -1,78 +0,0 @@
-import React from 'react';
-import { DataGrid, GridRenderCellParams } from '@mui/x-data-grid';
-import { Typography } from '@mui/material';
-import { DefaultLogTableProps } from '../default-report-interface';
-import { format } from 'date-fns';
-
-export type UserLogoutRowsType = {
- created: string; //date
- ip_address: string;
- user_id: string;
- username: string;
-}[];
-
-export interface UserLogoutReportTable extends DefaultLogTableProps {
- rows: UserLogoutRowsType;
-}
-
-export const UserLogoutReportTable = (props: UserLogoutReportTable): React.ReactElement => {
- const { rows, addMoreRows } = props;
-
- return (
-
- r.user_id}
- columns={[
- {
- headerName: 'Username',
- field: 'username',
- type: 'string',
- renderCell: (rowData: GridRenderCellParams) => {
- return {rowData.row.username};
- },
- },
- {
- headerName: 'Timestamp',
- field: 'created',
- type: 'datetime',
- filterable: false,
- align: 'center',
- renderCell: (rowData: GridRenderCellParams) => {
- return (
-
- {format(new Date(rowData.value as number), 'MMM dd yyyy hh:mm aaa')}
-
- );
- },
- },
- {
- headerName: 'User ID',
- field: 'user_id',
- type: 'string',
- renderCell: (rowData: GridRenderCellParams) => {
- return {rowData.row.user_id};
- },
- },
- {
- headerName: 'IP Addr',
- field: 'ip_address',
- type: 'string',
- renderCell: (rowData: GridRenderCellParams) => {
- return {rowData.row.ip_address};
- },
- },
- ]}
- rows={rows}
- pageSize={100}
- rowsPerPageOptions={[50, 100]}
- onPageChange={() => {
- if (addMoreRows) {
- addMoreRows();
- }
- }}
- disableColumnMenu={true}
- />
-
- );
-};
diff --git a/packages/react-components/lib/reports/user-report/user-logout-report.tsx b/packages/react-components/lib/reports/user-report/user-logout-report.tsx
deleted file mode 100644
index 05198e7f9..000000000
--- a/packages/react-components/lib/reports/user-report/user-logout-report.tsx
+++ /dev/null
@@ -1,41 +0,0 @@
-import React from 'react';
-import {
- DefaultReportQueryPayload,
- defaultReportClasses,
- DefaultReportContainer,
-} from '../default-report-interface';
-import { DefaultDatesForm } from '../default-dates-form';
-import { UserLogoutReportTable, UserLogoutRowsType } from './user-logout-report-table';
-import { ReportConfigProps } from '../utils';
-
-export interface UserLogoutReportProps extends ReportConfigProps {
- getLogs: (data: DefaultReportQueryPayload) => Promise;
-}
-
-export const UserLogoutReport = (props: UserLogoutReportProps): React.ReactElement => {
- const { getLogs, ...otherProps } = props;
- const [logs, setLogs] = React.useState([]);
- const [lastSearchParams, setLastSearchParams] = React.useState({});
-
- const searchLogs = async (payload: DefaultReportQueryPayload) => {
- setLastSearchParams(payload);
- setLogs(await getLogs(payload));
- };
-
- const getMoreLogs = async () => {
- setLogs(logs.concat(await getLogs({ ...lastSearchParams, offset: logs.length })));
- };
-
- return (
-
-
-
- {logs.length !== 0 && (
-
- )}
-
-
- );
-};
-
-export default UserLogoutReport;
diff --git a/packages/react-components/lib/reports/utils.spec.ts b/packages/react-components/lib/reports/utils.spec.ts
deleted file mode 100644
index d3ac72ada..000000000
--- a/packages/react-components/lib/reports/utils.spec.ts
+++ /dev/null
@@ -1,138 +0,0 @@
-import {
- DispenserStateRowsType,
- DoorStateRowsType,
- FleetStateRowsType,
- HealthRowsType,
- IngestorStateRowsType,
- LiftStateRowsType,
- TaskSummaryRowsType,
-} from '.';
-import { ReportConfigProps } from './utils';
-
-const timestamp = new Date('Mon Jan 1 00:00:02 UTC 2001').toISOString();
-
-export const getDispenserLogs = (): DispenserStateRowsType => {
- const rows = [];
- for (let i = 0; i < 200; i++) {
- rows.push({
- state: 'OPEN',
- guid: `dispenser_test_${i}`,
- created: timestamp,
- });
- }
- return rows;
-};
-
-export const getDoorLogs = (): DoorStateRowsType => {
- const rows = [];
- for (let i = 0; i < 200; i++) {
- rows.push({
- created: timestamp,
- state: 'OPEN',
- door: { id: i, name: 'door_test' },
- });
- }
- return rows;
-};
-
-export const getFleetLogs = (): FleetStateRowsType => {
- const rows: FleetStateRowsType = [];
- for (let i = 0; i < 200; i++) {
- rows.push({
- created: timestamp,
- fleet: { id: 1, name: 'fleet_test' },
- robot: { id: i, name: 'robot_test', model: 'model' },
- robot_battery_percent: 'test',
- robot_location: 'test',
- robot_mode: 'test',
- robot_seq: 1,
- robot_task_id: 'test',
- });
- }
- return rows as FleetStateRowsType;
-};
-
-export const getHealthLogs = (): HealthRowsType => {
- const rows = [];
- for (let i = 0; i < 200; i++) {
- rows.push({
- device: { id: i, type: 'door', actor: 'door-1' },
- health_status: 'DEAD',
- health_message: 'this is a message',
- created: timestamp,
- });
- }
- return rows;
-};
-
-export const getIngestorLogs = (): IngestorStateRowsType =>
- getDispenserLogs() as IngestorStateRowsType;
-
-export const getLiftLogs = (): LiftStateRowsType => {
- const rows = [];
- for (let i = 0; i < 200; i++) {
- rows.push({
- state: 'AVG',
- door_state: 'Closed',
- destination_floor: 'L1',
- motion_state: 'DOWN',
- current_floor: 'L2',
- session_id: 'session',
- created: timestamp,
- lift: { id: i, name: `lift_${i}` },
- });
- }
- return rows;
-};
-
-export const getTaskSummaryLogs = (): TaskSummaryRowsType => {
- const exampleData = {
- task_id: 'test',
- submission_time: { sec: 131, nanosec: 553000000 },
- description: {
- start_time: { sec: 1623383402, nanosec: 0 },
- priority: { value: 0 },
- task_type: { type: 1 },
- station: { task_id: '', robot_type: '', place_name: '' },
- loop: { task_id: '', robot_type: '', num_loops: 1, start_name: '', finish_name: '' },
- delivery: {
- task_id: '1',
- items: [],
- pickup_place_name: '',
- pickup_dispenser: '',
- pickup_behavior: { name: '', parameters: [] },
- dropoff_place_name: '',
- dropoff_ingestor: '',
- dropoff_behavior: { name: '', parameters: [] },
- },
- clean: { start_waypoint: '' },
- },
- };
- const rows = [];
- for (let i = 0; i < 200; i++) {
- rows.push({
- created: timestamp,
- fleet: { id: 1, name: 'fleet_test' },
- robot: { id: i, name: 'robot_test', model: 'model' },
- task_id: i.toString(),
- task_profile: exampleData,
- state: 'test',
- status: 'test',
- submission_time: { sec: 131, nanosec: 553000000 },
- start_time: { sec: 131, nanosec: 553000000 },
- end_time: { sec: 131, nanosec: 553000000 },
- });
- }
- return rows;
-};
-
-export const reportConfigProps: ReportConfigProps = {
- toLogDate: new Date(),
- fromLogDate: new Date(),
- onSelectFromDate: (/* date: Date */) => {
- /* no-op */
- },
- onSelectToDate: (/* date: Date */) => {
- /* no-op */
- },
-};
diff --git a/packages/react-components/lib/reports/utils.ts b/packages/react-components/lib/reports/utils.ts
deleted file mode 100644
index 1defe236c..000000000
--- a/packages/react-components/lib/reports/utils.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-export interface ReportConfigProps {
- fromLogDate?: Date;
- toLogDate?: Date;
- onSelectFromDate?: (date: unknown) => void;
- onSelectToDate?: (date: unknown) => void;
-}
diff --git a/packages/react-components/lib/tasks/utils.ts b/packages/react-components/lib/tasks/utils.ts
index d303b487a..dd1f00363 100644
--- a/packages/react-components/lib/tasks/utils.ts
+++ b/packages/react-components/lib/tasks/utils.ts
@@ -33,7 +33,10 @@ function parsePhaseDetail(phases: TaskState['phases'], category?: string) {
return {};
}
-export function parseTaskDetail(task: TaskState, category?: string) {
+export function parseTaskDetail(
+ task: TaskState,
+ category?: string,
+): { to: string; from: string } | {} {
if (category?.includes('Loop')) return parsePhaseDetail(task.phases, category);
if (category?.includes('Delivery')) {
const from = category?.split('[place:')[1].split(']')[0];
diff --git a/packages/reporting-e2e/.eslintrc.js b/packages/reporting-e2e/.eslintrc.js
deleted file mode 100644
index 933322cd0..000000000
--- a/packages/reporting-e2e/.eslintrc.js
+++ /dev/null
@@ -1,6 +0,0 @@
-module.exports = {
- extends: ['../../.eslintrc.js'],
- globals: {
- browser: 'readonly',
- },
-};
diff --git a/packages/reporting-e2e/.gitignore b/packages/reporting-e2e/.gitignore
deleted file mode 100644
index 15105c597..000000000
--- a/packages/reporting-e2e/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-/static/
-/build
-/artifacts
\ No newline at end of file
diff --git a/packages/reporting-e2e/README.md b/packages/reporting-e2e/README.md
deleted file mode 100644
index df011cc28..000000000
--- a/packages/reporting-e2e/README.md
+++ /dev/null
@@ -1,77 +0,0 @@
-# Running with Keycloak
-
-The tests are run with keycloak as the authentication server and we use docker and docker-compose to simplify the setup of keycloak.
-
-## Ubuntu 20.04
-
-Install docker and docker-compose
-```bash
-sudo apt update && sudo apt install docker.io docker-compose
-```
-
-If you're using GNOME or KDE, there will be a pop-up window to ask for privilege escalation when running the Docker container which runs Keycloak, the authentication mechanism we are currently using.
-If you're using `i3` or other "unusual" window managers, this pop-up may not occur, which can be confusing since a password prompt can be easily lost in the console text stream.
-You can add yourself to the `docker` group to allow containers to start without requesting your password:
-```
-sudo usermod -aG docker $USER
-```
-After issuing this command, you may need to logout/login or restart your system depending on your OS/environment.
-
-Keep in mind that this convenience has security implications. This tradeoff is described in more detail in the Docker documentation:
-https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user
-
-## Others
-
-See
-
-* [docker](https://docs.docker.com/engine/install/ubuntu/)
-* [docker-compose](https://docs.docker.com/compose/install/)
-
-# Settings
-
-There are some environment variables that control how the test runs.
-
-| Key | Description |
-|---|---|
-| E2E_DOCKER_NETWORK | _(string)_ The network that services uses, defaults to `rmf-web_default` |
-| E2E_NO_AUTH | _(bool)_ Do not launch the authentication provider service |
-| E2E_NO_REPORTING | _(bool)_ Do not launch the reporting ui server |
-| E2E_NO_REPORTING_SERVER | _(bool)_ Do not launch the reporting server |
-| E2E_USER | _(string)_ The user to login with |
-| E2E_PASSWORD | _(string)_ The password to login with |
-| E2E_REPORTING_URL | _(string)_ Base url where the dashboard is hosted |
-
-Boolean values can be 0/1/true/false.
-
-There are also some environment variables the test runner sets by default
-
-| Key | Default Value |
-|---|---|
-| REACT_APP_AUTH_PROVIDER | keycloak |
-| REACT_APP_KEYCLOAK_CONFIG | { "realm": "master", "clientId": "reporting", "url": "http://localhost:8088/auth" } |
-| E2E_USER | admin |
-| E2E_PASSWORD | admin |
-| E2E_REPORTING_URL | http://localhost:5000 |
-
-You can overwrite them by setting them in your environment variables.
-
-# E2E workflow in CI
-
-NOTE: This section only pertains to running the e2e tests in github workflows.
-
-This is to document the flow and interaction of the e2e services in the github environment when:
-
-- starting up the services
-- running the tests
-
-## Starting up the services
-
-Below is a diagram representing the flow of commands when running `npm run test`
-
-
-
-## Container and network interactions
-
-The key difference between running the tests locally and in github workflows is that in github, the tests are ran from inside a container with docker-beside-docker. So, the docker commands connect to the host daemon, this causes that the "localhost" in GitHub refers to the container. "Localhost" in local runs refers to the host (where the docker daemon is running). Tests in CI runs wouldn't be able to connect to the auth service with "localhost" because when a port is "exposed" or "published" is mapped to the host and not the container.
-
-Instead of host <-> container communication, we will need to do container <-> container communication. This is achieved by setting `E2E_DOCKER_NETWORK` to the github workflow's network and setting `REACT_APP_KEYCLOAK_CONFIG` to point to the auth service via the container name.
\ No newline at end of file
diff --git a/packages/reporting-e2e/docs/resources/reporting-e2e-process.png b/packages/reporting-e2e/docs/resources/reporting-e2e-process.png
deleted file mode 100644
index 2485a361f..000000000
Binary files a/packages/reporting-e2e/docs/resources/reporting-e2e-process.png and /dev/null differ
diff --git a/packages/reporting-e2e/package.json b/packages/reporting-e2e/package.json
deleted file mode 100644
index a78bb848d..000000000
--- a/packages/reporting-e2e/package.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "name": "reporting-e2e",
- "description": "",
- "main": "index.js",
- "directories": {
- "test": "tests"
- },
- "scripts": {
- "start:reporting-server": "scripts/start-reporting-server.sh",
- "test": "node scripts/test-e2e.js",
- "test:dev": "E2E_REPORTING_URL=http://localhost:3000 RMF_LAUNCH_MODE=none wdio"
- },
- "devDependencies": {
- "@types/mocha": "^9.0.0",
- "@wdio/cli": "7.11.1",
- "@wdio/local-runner": "7.11.1",
- "@wdio/mocha-framework": "7.11.1",
- "@wdio/spec-reporter": "7.10.1",
- "concurrently": "^5.3.0",
- "node-fetch": "^2.6.1",
- "reporting": "file:../reporting",
- "serve": "^11.3.2",
- "ts-node": "^9.1.1",
- "typescript": "~4.4.4"
- }
-}
diff --git a/packages/reporting-e2e/scripts/start-reporting-server.sh b/packages/reporting-e2e/scripts/start-reporting-server.sh
deleted file mode 100755
index 8b572ef6a..000000000
--- a/packages/reporting-e2e/scripts/start-reporting-server.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-set -e;
-
-export PIPENV_PIPFILE=../../Pipfile
-
-pipenv run reporting_server
diff --git a/packages/reporting-e2e/scripts/test-e2e.js b/packages/reporting-e2e/scripts/test-e2e.js
deleted file mode 100644
index cfc3b06f6..000000000
--- a/packages/reporting-e2e/scripts/test-e2e.js
+++ /dev/null
@@ -1,48 +0,0 @@
-const concurrently = require('concurrently');
-const { execSync } = require('child_process');
-
-process.env.BUILD_PATH = process.env.BUILD_PATH || '../reporting-e2e/build';
-process.env.REACT_APP_REPORTING_SERVER =
- process.env.REACT_APP_REPORTING_SERVER || 'http://localhost:8002';
-process.env.E2E_REPORTING_SERVER = process.env.E2E_REPORTING_SERVER || 'http://localhost:8003';
-process.env.E2E_REPORTING_URL = process.env.E2E_REPORTING_URL || 'http://localhost:5000';
-
-execSync('npm --prefix ../reporting run build', { stdio: 'inherit' });
-
-// wrap in double quotes to support args with spaces
-const wdioArgs = process.argv
- .slice(2)
- .map((arg) => `"${arg}"`)
- .join(' ');
-
-const services = [];
-
-// eslint-disable-next-line no-eval
-if (!eval(process.env.E2E_NO_REPORTING)) {
- services.push('serve build');
-}
-// eslint-disable-next-line no-eval
-if (!eval(process.env.E2E_NO_REPORTING_SERVER)) {
- services.push('npm run start:reporting-server');
-}
-
-concurrently([...services, `wdio ${wdioArgs}`], {
- killOthers: ['success', 'failure'],
- successCondition: 'first',
-})
- .then(
- function onSuccess(/* exitInfo */) {
- // This code is necessary to make sure the parent terminates
- // when the application is closed successfully.
- process.exit();
- },
- function onFailure(/* exitInfo */) {
- // This code is necessary to make sure the parent terminates
- // when the application is closed because of a failure.
- process.exit();
- },
- )
- .catch((e) => {
- console.error(e);
- process.exitCode = -1;
- });
diff --git a/packages/reporting-e2e/tests/1-logs.test.ts b/packages/reporting-e2e/tests/1-logs.test.ts
deleted file mode 100644
index c90ad0f26..000000000
--- a/packages/reporting-e2e/tests/1-logs.test.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import { rmfData } from './mock-data';
-import fetch from 'node-fetch';
-
-describe('logs', () => {
- it('should store the logs correctly', async () => {
- const options = {
- method: 'POST',
- body: JSON.stringify(rmfData),
- headers: {
- 'Content-Type': 'application/json',
- },
- };
-
- let response;
- try {
- const res = await fetch(`http://localhost:8003/log/rmfserver`, options);
- response = await res.text();
- } catch (error) {
- console.log(error);
- }
-
- expect(response).toBe('"Logs were saved correctly"');
- });
-});
diff --git a/packages/reporting-e2e/tests/2-reporting.test.ts b/packages/reporting-e2e/tests/2-reporting.test.ts
deleted file mode 100644
index 71a2b7053..000000000
--- a/packages/reporting-e2e/tests/2-reporting.test.ts
+++ /dev/null
@@ -1,95 +0,0 @@
-import fetch from 'node-fetch';
-import { rmfData } from './mock-data';
-import { getReport, overwriteClick } from './utils';
-
-describe('reporting interactions', () => {
- before(() => overwriteClick());
- before(() => browser.url('/'));
-
- before(async () => {
- const options = {
- method: 'POST',
- body: JSON.stringify(rmfData),
- headers: {
- 'Content-Type': 'application/json',
- },
- };
-
- try {
- const res = await fetch(`http://localhost:8003/log/rmfserver`, options);
- await res.text();
- } catch (error) {
- console.log(error);
- }
- });
-
- it('should retrieve dispenser state report', async () => {
- const options = {
- listOrder: 2,
- elemName: 'div*=Dispensers',
- reportTitle: 'h6*=Dispenser State',
- };
- await getReport(options);
- await expect($('h6*=Dispenser State')).toBeDisplayed();
- });
-
- it('should retrieve door state report', async () => {
- const options = {
- listOrder: 3,
- elemName: 'div*=Doors',
- reportTitle: 'h6*=Door State',
- };
- await getReport(options);
- await expect($('h6*=Door State')).toBeDisplayed();
- });
-
- it('should retrieve the fleet state report', async () => {
- const options = {
- listOrder: 4,
- elemName: 'div*=Fleets',
- reportTitle: 'h6*=Fleet State',
- };
- await getReport(options);
- await expect($('h6*=Fleet State')).toBeDisplayed();
- });
-
- it('should retrieve the health report', async () => {
- const options = {
- listOrder: 5,
- elemName: 'div*=Health',
- reportTitle: 'h6*=Health',
- };
- await getReport(options);
- await expect($('h6*=Health')).toBeDisplayed();
- });
-
- it('should retrieve ingestor state report', async () => {
- const options = {
- listOrder: 6,
- elemName: 'div*=Ingestor',
- reportTitle: 'h6*=Ingestor State',
- };
- await getReport(options);
- await expect($('h6*=Ingestor State')).toBeDisplayed();
- });
-
- it('should retrieve lift state report', async () => {
- const options = {
- listOrder: 7,
- elemName: 'div*=Lifts',
- reportTitle: 'h6*=Lift State',
- };
- await getReport(options);
- await expect($('h6*=Lift State')).toBeDisplayed();
- });
-
- it('should retrieve the task summary report', async () => {
- const options = {
- listOrder: 8,
- elemName: 'div*=Tasks',
- reportTitle: 'h6*=Task',
- };
- await getReport(options);
- await expect($('h6*=Task')).toBeDisplayed();
- });
-});
diff --git a/packages/reporting-e2e/tests/mock-data.ts b/packages/reporting-e2e/tests/mock-data.ts
deleted file mode 100644
index 940b4a304..000000000
--- a/packages/reporting-e2e/tests/mock-data.ts
+++ /dev/null
@@ -1,147 +0,0 @@
-export const rmfData = [
- {
- log:
- 'INFO:app.BookKeeper.dispenser_state:{"time": {"sec": 1600, "nanosec": 0}, "guid": "coke_dispenser", "mode": 0, "request_guid_queue": [], "seconds_remaining": 0.0}\n',
- stream: 'stdout',
- kubernetes: {
- container_name: 'app-that-writes-logs',
- namespace_name: 'default',
- pod_name: 'app-that-writes-logs',
- container_image: 'busybox:latest',
- container_image_id:
- 'docker-pullable://busybox@sha256:ae39a6f5c07297d7ab64dbd4f82c77c874cc6a94cea29fdec309d0992574b4f7',
- pod_id: '978761c6-2a19-422f-b710-d43da2348f1f',
- host: 'minikube',
- master_url: 'https://10.96.0.1:443/api',
- namespace_id: 'e192acd4-e6e7-46c2-8514-44a27a367749',
- },
- },
- {
- log:
- 'INFO:app.BookKeeper.door_state:{"door_time": {"sec": 1596, "nanosec": 548000000}, "door_name": "hardware_door", "current_mode": {"value": 0}}\n',
- stream: 'stdout',
- },
- {
- log:
- 'INFO:app.BookKeeper.fleet_state:{"name": "tinyRobot", "robots": [{"name": "tinyRobot1", "model": "", "task_id": "", "seq": 3194, "mode": {"mode": 1, "mode_request_id": 0}, "battery_percent": 100.0, "location": {"t": {"sec": 1600, "nanosec": 189000000}, "x": 11.55367374420166, "y": -11.317498207092285, "yaw": -1.5998055934906006, "level_name": "L1", "index": 0}, "path": []}, {"name": "tinyRobot2", "model": "", "task_id": "", "seq": 3194, "mode": {"mode": 1, "mode_request_id": 0}, "battery_percent": 100.0, "location": {"t": {"sec": 1600, "nanosec": 189000000}, "x": 15.15751838684082, "y": -11.22861385345459, "yaw": -1.5839799642562866, "level_name": "L1", "index": 0}, "path": []}]}\n',
- stream: 'stdout',
- },
- {
- log:
- 'INFO:app.BookKeeper.door_health:{"id": "hardware_door", "health_status": "HealthStatus.HEALTHY", "health_message": null}\n',
- stream: 'stdout',
- },
- {
- log:
- 'INFO:app.BookKeeper.ingestor_state:{"time": {"sec": 1600, "nanosec": 0}, "guid": "coke_ingestor", "mode": 0, "request_guid_queue": [], "seconds_remaining": 0.0}\n',
- stream: 'stdout',
- },
- {
- log:
- 'INFO:app.BookKeeper.lift_state: {"lift_name": "test_lift", "lift_time": 0, "available_floors": ["L1", "L2"], "current_floor": "L1", "destination_floor": "L2", "door_state": 0, "motion_state": 0, "available_modes": [0], "current_mode": 0, "session_id": "test_session"}\n',
- stream: 'stdout',
- },
- {
- log:
- 'INFO:app.BookKeeper.task_summary:{"fleet_name": "tinyRobot", "task_id": "Loop0", "task_profile": {"task_id": "Loop0", "submission_time": {"sec": 131, "nanosec": 553000000}, "description": {"start_time": {"sec": 1623383402, "nanosec": 0}, "priority": {"value": 0}, "task_type": {"type": 1}, "station": {"task_id": "", "robot_type": "", "place_name": ""}, "loop": {"task_id": "", "robot_type": "", "num_loops": 1, "start_name": "supplies", "finish_name": "coe"}, "delivery": {"task_id": "", "items": [], "pickup_place_name": "", "pickup_dispenser": "", "pickup_behavior": {"name": "", "parameters": []}, "dropoff_place_name": "", "dropoff_ingestor": "", "dropoff_behavior": {"name": "", "parameters": []}}, "clean": {"start_waypoint": ""}}}, "state": 0, "status": "test_status", "submission_time": {"sec": 0, "nanosec": 0}, "start_time": {"sec": 1623383362, "nanosec": 348338289}, "end_time": {"sec": 1623383449, "nanosec": 79154833}, "robot_name": "tinyRobot2"}',
- stream: 'stdout',
- },
- {
- log:
- 'INFO:app.BookKeeper.task_summary:{"fleet_name": "tinyRobot", "task_id": "Delivery1", "task_profile": {"task_id": "Delivery1", "submission_time": {"sec": 132, "nanosec": 553000098}, "description": {"start_time": {"sec": 1623383487, "nanosec": 0}, "priority": {"value": 0}, "task_type": {"type": 2}, "station": {"task_id": "", "robot_type": "", "place_name": ""}, "loop": {"task_id": "", "robot_type": "", "num_loops": "", "start_name": "", "finish_name": ""}, "delivery": {"task_id": "", "items": ["item1", "item2"], "pickup_place_name": "pantry", "pickup_dispenser": "coke_dispenser", "pickup_behavior": {"name": "", "parameters": []}, "dropoff_place_name": "lounge", "dropoff_ingestor": "ingestor", "dropoff_behavior": {"name": "", "parameters": []}}, "clean": {"start_waypoint": ""}}}, "state": 0, "status": "test_status2", "submission_time": {"sec": 0, "nanosec": 0}, "start_time": {"sec": 1623383362, "nanosec": 348338289}, "end_time": {"sec": 1623383449, "nanosec": 79154833}, "robot_name": "tinyRobot1"}',
- stream: 'stdout',
- },
- {
- log:
- 'INFO:app.BookKeeper.task_summary:{"fleet_name": "tinyRobot", "task_id": "Clean2", "task_profile": {"task_id": "Clean2", "submission_time": {"sec": 131, "nanosec": 552120070}, "description": {"start_time": {"sec": 145383402, "nanosec": 0}, "priority": {"value": 0}, "task_type": {"type": 4}, "station": {"task_id": "", "robot_type": "", "place_name": ""}, "loop": {"task_id": "", "robot_type": "", "num_loops": "", "start_name": "", "finish_name": ""}, "delivery": {"task_id": "", "items": [], "pickup_place_name": "", "pickup_dispenser": "", "pickup_behavior": {"name": "", "parameters": []}, "dropoff_place_name": "", "dropoff_ingestor": "", "dropoff_behavior": {"name": "", "parameters": []}}, "clean": {"start_waypoint": "cleanzone"}}}, "state": 0, "status": "test_status3", "submission_time": {"sec": 0, "nanosec": 0}, "start_time": {"sec": 1623283162, "nanosec": 348332939}, "end_time": {"sec": 162593449, "nanosec": 79154833}, "robot_name": "tinyRobot3"}',
- stream: 'stdout',
- },
-];
-
-export const dispenserStateData = [
- {
- log:
- 'INFO:app.BookKeeper.dispenser_state:{"time": {"sec": 1600, "nanosec": 0}, "guid": "coke_dispenser", "mode": 0, "request_guid_queue": [], "seconds_remaining": 0.0}\n',
- stream: 'stdout',
- kubernetes: {
- container_name: 'app-that-writes-logs',
- namespace_name: 'default',
- pod_name: 'app-that-writes-logs',
- container_image: 'busybox:latest',
- container_image_id:
- 'docker-pullable://busybox@sha256:ae39a6f5c07297d7ab64dbd4f82c77c874cc6a94cea29fdec309d0992574b4f7',
- pod_id: '978761c6-2a19-422f-b710-d43da2348f1f',
- host: 'minikube',
- master_url: 'https://10.96.0.1:443/api',
- namespace_id: 'e192acd4-e6e7-46c2-8514-44a27a367749',
- },
- },
-];
-
-export const doorStateData = [
- {
- log:
- 'INFO:app.BookKeeper.door_state:{"door_time": {"sec": 1596, "nanosec": 548000000}, "door_name": "hardware_door", "current_mode": {"value": 0}}\n',
- stream: 'stdout',
- },
-];
-
-export const fleetStateData = [
- {
- log:
- 'INFO:app.BookKeeper.fleet_state:{"name": "tinyRobot", "robots": [{"name": "tinyRobot1", "model": "", "task_id": "", "seq": 3194, "mode": {"mode": 1, "mode_request_id": 0}, "battery_percent": 100.0, "location": {"t": {"sec": 1600, "nanosec": 189000000}, "x": 11.55367374420166, "y": -11.317498207092285, "yaw": -1.5998055934906006, "level_name": "L1", "index": 0}, "path": []}, {"name": "tinyRobot2", "model": "", "task_id": "", "seq": 3194, "mode": {"mode": 1, "mode_request_id": 0}, "battery_percent": 100.0, "location": {"t": {"sec": 1600, "nanosec": 189000000}, "x": 15.15751838684082, "y": -11.22861385345459, "yaw": -1.5839799642562866, "level_name": "L1", "index": 0}, "path": []}]}\n',
- stream: 'stdout',
- },
-];
-
-export const healthData = [
- {
- log:
- 'INFO:app.BookKeeper.door_health:{"id": "hardware_door", "health_status": "HealthStatus.HEALTHY", "health_message": null}\n',
- stream: 'stdout',
- },
-];
-
-export const ingestorData = [
- {
- log:
- 'INFO:app.BookKeeper.ingestor_state:{"time": {"sec": 1600, "nanosec": 0}, "guid": "coke_ingestor", "mode": 0, "request_guid_queue": [], "seconds_remaining": 0.0}\n',
- stream: 'stdout',
- },
-];
-
-export const liftsStateData = [
- {
- log:
- 'INFO:app.BookKeeper.lift_state: {"lift_name": "test_lift", "lift_time": 0, "available_floors": ["L1", "L2"], "current_floor": "L1", "destination_floor": "L2", "door_state": 0, "motion_state": 0, "available_modes": [0], "current_mode": 0, "session_id": "test_session"}\n',
- stream: 'stdout',
- },
-];
-
-export const taskSummaryData = [
- {
- log:
- 'INFO:app.BookKeeper.task_summary:{"fleet_name": "tinyRobot", "task_id": "Loop0", "task_profile": {"task_id": "Loop0", "submission_time": {"sec": 131, "nanosec": 553000000}, "description": {"start_time": {"sec": 1623383402, "nanosec": 0}, "priority": {"value": 0}, "task_type": {"type": 1}, "station": {"task_id": "", "robot_type": "", "place_name": ""}, "loop": {"task_id": "", "robot_type": "", "num_loops": 1, "start_name": "supplies", "finish_name": "coe"}, "delivery": {"task_id": "", "items": [], "pickup_place_name": "", "pickup_dispenser": "", "pickup_behavior": {"name": "", "parameters": []}, "dropoff_place_name": "", "dropoff_ingestor": "", "dropoff_behavior": {"name": "", "parameters": []}}, "clean": {"start_waypoint": ""}}}, "state": 0, "status": "test_status", "submission_time": {"sec": 0, "nanosec": 0}, "start_time": {"sec": 1623383362, "nanosec": 348338289}, "end_time": {"sec": 1623383449, "nanosec": 79154833}, "robot_name": "tinyRobot2"}',
- stream: 'stdout',
- },
- {
- log:
- 'INFO:app.BookKeeper.task_summary:{"fleet_name": "tinyRobot", "task_id": "Delivery1", "task_profile": {"task_id": "Delivery1", "submission_time": {"sec": 132, "nanosec": 553000098}, "description": {"start_time": {"sec": 1623383487, "nanosec": 0}, "priority": {"value": 0}, "task_type": {"type": 2}, "station": {"task_id": "", "robot_type": "", "place_name": ""}, "loop": {"task_id": "", "robot_type": "", "num_loops": "", "start_name": "", "finish_name": ""}, "delivery": {"task_id": "", "items": ["item1", "item2"], "pickup_place_name": "pantry", "pickup_dispenser": "coke_dispenser", "pickup_behavior": {"name": "", "parameters": []}, "dropoff_place_name": "lounge", "dropoff_ingestor": "ingestor", "dropoff_behavior": {"name": "", "parameters": []}}, "clean": {"start_waypoint": ""}}}, "state": 0, "status": "test_status2", "submission_time": {"sec": 0, "nanosec": 0}, "start_time": {"sec": 1623383362, "nanosec": 348338289}, "end_time": {"sec": 1623383449, "nanosec": 79154833}, "robot_name": "tinyRobot1"}',
- stream: 'stdout',
- },
- {
- log:
- 'INFO:app.BookKeeper.task_summary:{"fleet_name": "tinyRobot", "task_id": "Clean2", "task_profile": {"task_id": "Clean2", "submission_time": {"sec": 131, "nanosec": 552120070}, "description": {"start_time": {"sec": 145383402, "nanosec": 0}, "priority": {"value": 0}, "task_type": {"type": 4}, "station": {"task_id": "", "robot_type": "", "place_name": ""}, "loop": {"task_id": "", "robot_type": "", "num_loops": "", "start_name": "", "finish_name": ""}, "delivery": {"task_id": "", "items": [], "pickup_place_name": "", "pickup_dispenser": "", "pickup_behavior": {"name": "", "parameters": []}, "dropoff_place_name": "", "dropoff_ingestor": "", "dropoff_behavior": {"name": "", "parameters": []}}, "clean": {"start_waypoint": "cleanzone"}}}, "state": 0, "status": "test_status3", "submission_time": {"sec": 0, "nanosec": 0}, "start_time": {"sec": 1623283162, "nanosec": 348332939}, "end_time": {"sec": 162593449, "nanosec": 79154833}, "robot_name": "tinyRobot3"}',
- stream: 'stdout',
- },
-];
-
-export const singleLog = [
- {
- log:
- 'INFO:app.BookKeeper.task_summary:{"fleet_name": "tinyRobot", "task_id": "Clean2", "task_profile": {"task_id": "Clean2", "submission_time": {"sec": 131, "nanosec": 552120070}, "description": {"start_time": {"sec": 145383402, "nanosec": 0}, "priority": {"value": 0}, "task_type": {"type": 4}, "station": {"task_id": "", "robot_type": "", "place_name": ""}, "loop": {"task_id": "", "robot_type": "", "num_loops": "", "start_name": "", "finish_name": ""}, "delivery": {"task_id": "", "items": [], "pickup_place_name": "", "pickup_dispenser": "", "pickup_behavior": {"name": "", "parameters": []}, "dropoff_place_name": "", "dropoff_ingestor": "", "dropoff_behavior": {"name": "", "parameters": []}}, "clean": {"start_waypoint": "cleanzone"}}}, "state": 0, "status": "test_status3", "submission_time": {"sec": 0, "nanosec": 0}, "start_time": {"sec": 1623283162, "nanosec": 348332939}, "end_time": {"sec": 162593449, "nanosec": 79154833}, "robot_name": "tinyRobot3"}',
- stream: 'stdout',
- },
-];
-
-export const userData = [];
diff --git a/packages/reporting-e2e/tests/utils.ts b/packages/reporting-e2e/tests/utils.ts
deleted file mode 100644
index 00eaec060..000000000
--- a/packages/reporting-e2e/tests/utils.ts
+++ /dev/null
@@ -1,85 +0,0 @@
-import fetch from 'node-fetch';
-
-/**
- * Overwrites the default click command to wait for animation to finish before attempting to click,
- * this can fix flaky tests where the click is missed as the position changes as the animation is
- * running.
- */
-export function overwriteClick(): void {
- browser.overwriteCommand(
- 'click',
- async function (this: WebdriverIO.Element, origClick) {
- await this.waitForClickable();
- let prevLocation = await this.getLocation();
- await this.waitUntil(async () => {
- const newLocation = await this.getLocation();
- const stablized = prevLocation.x === newLocation.x && prevLocation.y === newLocation.y;
- prevLocation = newLocation;
- return stablized;
- });
- return origClick();
- },
- true,
- );
-}
-
-/**
- * Return a list of backspace characters. This is only used in case we want to delete characters from the Autocomplete material-ui component
- */
-export function removeTextFromAutocomplete(characterNum: number): string {
- const backspace = '\u0008';
- let backspaces = '';
- for (let index = 0; index < characterNum; index++) {
- backspaces += backspace;
- }
- return backspaces;
-}
-
-export const populateDatabase = async (
- data: { log: string; stream: string }[],
-): Promise => {
- const options = {
- method: 'POST',
- body: JSON.stringify(data),
- headers: {
- 'Content-Type': 'application/json',
- },
- };
-
- try {
- const res = await fetch('http:localhost:8003/log/rmfserver', options);
- return await res.json();
- } catch (error) {
- return error as Error;
- }
-};
-
-export const selectDateAndRetrieveLogs = async (): Promise => {
- const datePickerIconButton = await (await $('.MuiInputBase-root')).$('.MuiIconButton-root');
- await datePickerIconButton.click();
- const prevMonthButton = (await $$('.MuiPickersCalendarHeader-iconButton'))[0];
- await prevMonthButton.click();
- const dayOneButton = await $('button=1');
- await dayOneButton.click();
- await (await $('body')).click();
- await (await $('button=Retrieve Logs')).click();
- await browser.pause(1000);
-};
-
-export const getReport = async (options: {
- listOrder: number;
- elemName: string;
- reportTitle: string;
-}): Promise => {
- await browser.waitUntil(
- async () => (await (await $('.MuiList-root')).waitForDisplayed()) === true,
- );
- const targetButton = await (
- await $(`.MuiList-root .MuiListItem-root:nth-child(${options.listOrder})`)
- ).$(options.elemName);
- await targetButton.click();
- await selectDateAndRetrieveLogs();
- await browser.waitUntil(
- async () => (await (await $(options.reportTitle)).waitForDisplayed({ timeout: 5000 })) === true,
- );
-};
diff --git a/packages/reporting-e2e/tsconfig.json b/packages/reporting-e2e/tsconfig.json
deleted file mode 100644
index c77ffd695..000000000
--- a/packages/reporting-e2e/tsconfig.json
+++ /dev/null
@@ -1,66 +0,0 @@
-{
- "compilerOptions": {
- /* Basic Options */
- // "incremental": true, /* Enable incremental compilation */
- "target": "es2019", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
- "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
- // "lib": [], /* Specify library files to be included in the compilation. */
- // "allowJs": true, /* Allow javascript files to be compiled. */
- // "checkJs": true, /* Report errors in .js files. */
- // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
- // "declaration": true, /* Generates corresponding '.d.ts' file. */
- // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
- // "sourceMap": true, /* Generates corresponding '.map' file. */
- // "outFile": "./", /* Concatenate and emit output to single file. */
- // "outDir": "./", /* Redirect output structure to the directory. */
- // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
- // "composite": true, /* Enable project compilation */
- // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
- // "removeComments": true, /* Do not emit comments to output. */
- // "noEmit": true, /* Do not emit outputs. */
- // "importHelpers": true, /* Import emit helpers from 'tslib'. */
- // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
- // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
-
- /* Strict Type-Checking Options */
- "strict": true, /* Enable all strict type-checking options. */
- // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
- // "strictNullChecks": true, /* Enable strict null checks. */
- // "strictFunctionTypes": true, /* Enable strict checking of function types. */
- // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
- // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
- // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
- // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
-
- /* Additional Checks */
- // "noUnusedLocals": true, /* Report errors on unused locals. */
- // "noUnusedParameters": true, /* Report errors on unused parameters. */
- // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
- // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
-
- /* Module Resolution Options */
- // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
- // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
- // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
- // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
- // "typeRoots": [], /* List of folders to include type definitions from. */
- "types": ["node", "webdriverio/async", "@wdio/mocha-framework", "expect-webdriverio"], /* Type declaration files to be included in compilation. */
- // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
- "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
- // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
- // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
-
- /* Source Map Options */
- // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
- // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
- // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
- // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
-
- /* Experimental Options */
- // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
- // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
-
- /* Advanced Options */
- "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
- }
-}
diff --git a/packages/reporting-e2e/wdio.conf.js b/packages/reporting-e2e/wdio.conf.js
deleted file mode 100644
index ee7f1b093..000000000
--- a/packages/reporting-e2e/wdio.conf.js
+++ /dev/null
@@ -1,291 +0,0 @@
-const path = require('path');
-const fs = require('fs');
-const os = require('os');
-const { execSync } = require('child_process');
-
-const headlessArgs = process.env.CI ? ['--headless', '--disable-gpu'] : [];
-const chromeArgs = [...headlessArgs];
-if (os.userInfo().uid === 0) {
- chromeArgs.push('--no-sandbox');
-}
-
-exports.config = {
- //
- // ====================
- // Runner Configuration
- // ====================
- //
- // WebdriverIO allows it to run your tests in arbitrary locations (e.g. locally or
- // on a remote machine).
- runner: 'local',
- //
- // ==================
- // Specify Test Files
- // ==================
- // Define which test specs should run. The pattern is relative to the directory
- // from which `wdio` was called. Notice that, if you are calling `wdio` from an
- // NPM script (see https://docs.npmjs.com/cli/run-script) then the current working
- // directory is where your package.json resides, so `wdio` will be called from there.
- //
- specs: ['tests/**/*.test.ts'],
- // Patterns to exclude.
- exclude: [
- // 'path/to/excluded/files'
- ],
- //
- // ============
- // Capabilities
- // ============
- // Define your capabilities here. WebdriverIO can run multiple capabilities at the same
- // time. Depending on the number of capabilities, WebdriverIO launches several test
- // sessions. Within your capabilities you can overwrite the spec and exclude options in
- // order to group specific specs to a specific capability.
- //
- // First, you can define how many instances should be started at the same time. Let's
- // say you have 3 different capabilities (Chrome, Firefox, and Safari) and you have
- // set maxInstances to 1; wdio will spawn 3 processes. Therefore, if you have 10 spec
- // files and you set maxInstances to 10, all spec files will get tested at the same time
- // and 30 processes will get spawned. The property handles how many capabilities
- // from the same test should run tests.
- //
- maxInstances: 1,
- //
- // If you have trouble getting all important capabilities together, check out the
- // Sauce Labs platform configurator - a great tool to configure your capabilities:
- // https://docs.saucelabs.com/reference/platforms-configurator
- //
- capabilities: [
- {
- // maxInstances can get overwritten per capability. So if you have an in-house Selenium
- // grid with only 5 firefox instances available you can make sure that not more than
- // 5 instances get started at a time.
- maxInstances: 1,
- //
- browserName: 'chrome',
- // If outputDir is provided WebdriverIO can capture driver session logs
- // it is possible to configure which logTypes to include/exclude.
- // excludeDriverLogs: ['*'], // pass '*' to exclude all driver session logs
- // excludeDriverLogs: ['bugreport', 'server'],
-
- acceptInsecureCerts: true,
-
- 'goog:chromeOptions': {
- binary: process.env.CHROME_BIN || undefined,
- // to run chrome headless the following flags are required
- // (see https://developers.google.com/web/updates/2017/04/headless-chrome)
- args: [...chromeArgs, '--window-size=1366,768'],
- },
- },
- ],
- //
- // ===================
- // Test Configurations
- // ===================
- // Define all options that are relevant for the WebdriverIO instance here
- //
- // Level of logging verbosity: trace | debug | info | warn | error | silent
- logLevel: 'warn',
- //
- // Set specific log levels per logger
- // loggers:
- // - webdriver, webdriverio
- // - @wdio/applitools-service, @wdio/browserstack-service, @wdio/devtools-service, @wdio/sauce-service
- // - @wdio/mocha-framework, @wdio/jasmine-framework
- // - @wdio/local-runner, @wdio/lambda-runner
- // - @wdio/sumologic-reporter
- // - @wdio/cli, @wdio/config, @wdio/sync, @wdio/utils
- // Level of logging verbosity: trace | debug | info | warn | error | silent
- // logLevels: {
- // webdriver: 'info',
- // '@wdio/applitools-service': 'info'
- // },
- //
- // If you only want to run your tests until a specific amount of tests have failed use
- // bail (default is 0 - don't bail, run all tests).
- bail: 1,
- //
- // Set a base URL in order to shorten url command calls. If your `url` parameter starts
- // with `/`, the base url gets prepended, not including the path portion of your baseUrl.
- // If your `url` parameter starts without a scheme or `/` (like `some/path`), the base url
- // gets prepended directly.
- baseUrl: process.env.E2E_REPORTING_URL,
- //
- // Default timeout for all waitFor* commands.
- waitforTimeout: 10000,
- //
- // Default timeout in milliseconds for request
- // if browser driver or grid doesn't send response
- connectionRetryTimeout: 120000,
- //
- // Default request retries count
- connectionRetryCount: 3,
- //
- // Test runner services
- // Services take over a specific job you don't want to take care of. They enhance
- // your test setup with almost no effort. Unlike plugins, they don't add new
- // commands. Instead, they hook themselves up into the test process.
- services: [],
-
- // Framework you want to run your specs with.
- // The following are supported: Mocha, Jasmine, and Cucumber
- // see also: https://webdriver.io/docs/frameworks.html
- //
- // Make sure you have the wdio adapter package for the specific framework installed
- // before running any tests.
- framework: 'mocha',
- //
- // The number of times to retry the entire specfile when it fails as a whole
- // specFileRetries: 1,
- //
- // Whether or not retried specfiles should be retried immediately or deferred to the end of the queue
- // specFileRetriesDeferred: false,
- //
- // Test reporter for stdout.
- // The only one supported by default is 'dot'
- // see also: https://webdriver.io/docs/dot-reporter.html
- reporters: ['spec'],
-
- //
- // Options to be passed to Mocha.
- // See the full list at http://mochajs.org/
- mochaOpts: {
- // as of wdio 6.12.1, it automatically registers ts-node, registering it again would cause conflict
- // require: ['ts-node/register'],
- ui: 'bdd',
- timeout: 60000,
- },
- //
- // =====
- // Hooks
- // =====
- // WebdriverIO provides several hooks you can use to interfere with the test process in order to enhance
- // it and to build services around it. You can either apply a single function or an array of
- // methods to it. If one of them returns with a promise, WebdriverIO will wait until that promise got
- // resolved to continue.
- /**
- * Gets executed once before all workers get launched.
- * @param {Object} config wdio configuration object
- * @param {Array.