Skip to content

Commit

Permalink
Run automatic linting
Browse files Browse the repository at this point in the history
  • Loading branch information
vrigal committed Jul 3, 2024
1 parent 6a43811 commit 24bd385
Show file tree
Hide file tree
Showing 57 changed files with 345 additions and 649 deletions.
8 changes: 2 additions & 6 deletions tests/ui/job-view/Filtering_test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -468,12 +468,8 @@ describe('Filtering', () => {
});

test('Filters | Reset should get back to original set of jobs', async () => {
const {
getAllByText,
findAllByText,
findByText,
queryAllByText,
} = render(testApp());
const { getAllByText, findAllByText, findByText, queryAllByText } =
render(testApp());
const symbolToRemove = 'yaml';

await findAllByText('B');
Expand Down
3 changes: 1 addition & 2 deletions tests/ui/job-view/Push_test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ describe('Transformations', () => {
expected: 'devtools/client/framework/browser-toolbox/test/browser.ini',
},
{
path:
'devtools/client/framework/browser-toolbox/test/browser_browser_toolbox.js',
path: 'devtools/client/framework/browser-toolbox/test/browser_browser_toolbox.js',
expected:
'devtools/client/framework/browser-toolbox/test/browser_browser_toolbox.js',
},
Expand Down
8 changes: 2 additions & 6 deletions tests/ui/job-view/details/PinBoard_test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,8 @@ describe('DetailsPanel', () => {
});

test('classify and unclassify all jobs', async () => {
const {
getByPlaceholderText,
getByText,
getByTitle,
queryAllByTitle,
} = render(testDetailsPanel());
const { getByPlaceholderText, getByText, getByTitle, queryAllByTitle } =
render(testDetailsPanel());

store.dispatch(pinJobs(jobList.data));
store.dispatch(setSelectedJob(jobList.data[1], true));
Expand Down
42 changes: 12 additions & 30 deletions tests/ui/perfherder/alerts-view/alerts_test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -467,11 +467,8 @@ test("'Take' button hides when clicking on 'Unassigned' badge", async () => {
alertSummary.assignee_email = '[email protected]';
alertSummary.assignee_username = 'mozilla-ldap/[email protected]';

const {
getByText,
queryByText,
queryByPlaceholderText,
} = alertsViewControls();
const { getByText, queryByText, queryByPlaceholderText } =
alertsViewControls();

const unassignedBadge = await waitFor(() => getByText('Unassigned'));

Expand Down Expand Up @@ -659,11 +656,8 @@ const assertAlertsAreInOrder = async (alertsInOrder, alertTableRows) => {
};

test(`table data can be sorted in descending order by 'Test'`, async () => {
const {
getAllByLabelText,
getByTestId,
getAllByTitle,
} = alertsViewControls();
const { getAllByLabelText, getByTestId, getAllByTitle } =
alertsViewControls();

let alertTableRows = await waitFor(() =>
getAllByLabelText('Alert table row'),
Expand Down Expand Up @@ -698,11 +692,8 @@ test(`table data can be sorted in descending order by 'Test'`, async () => {
});

test(`table data can be sorted in ascending order by 'Platform'`, async () => {
const {
getByTestId,
getAllByLabelText,
getAllByTitle,
} = alertsViewControls();
const { getByTestId, getAllByLabelText, getAllByTitle } =
alertsViewControls();

let alertTableRows = await waitFor(() =>
getAllByLabelText('Alert table row'),
Expand Down Expand Up @@ -744,11 +735,8 @@ test(`table data cannot be sorted by 'Tags & Options'`, async () => {
});

test(`table data can be sorted in ascending order by 'Confidence'`, async () => {
const {
getAllByLabelText,
getByTestId,
getAllByTitle,
} = alertsViewControls();
const { getAllByLabelText, getByTestId, getAllByTitle } =
alertsViewControls();

let alertTableRows = await waitFor(() =>
getAllByLabelText('Alert table row'),
Expand Down Expand Up @@ -780,11 +768,8 @@ test(`table data can be sorted in ascending order by 'Confidence'`, async () =>
});

test(`table data can be sorted in ascending order by 'Magnitude of Change'`, async () => {
const {
getAllByLabelText,
getByTestId,
getAllByTitle,
} = alertsViewControls();
const { getAllByLabelText, getByTestId, getAllByTitle } =
alertsViewControls();

let alertTableRows = await waitFor(() =>
getAllByLabelText('Alert table row'),
Expand Down Expand Up @@ -817,11 +802,8 @@ test(`table data can be sorted in ascending order by 'Magnitude of Change'`, asy
});

test('Data can be sorted only by one column', async () => {
const {
getAllByLabelText,
getByTestId,
getAllByTitle,
} = alertsViewControls();
const { getAllByLabelText, getByTestId, getAllByTitle } =
alertsViewControls();

let alertTableRows = await waitFor(() =>
getAllByLabelText('Alert table row'),
Expand Down
12 changes: 4 additions & 8 deletions tests/ui/perfherder/compare-view/compare_table_test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,8 @@ test('filters that are not enabled are removed from URL params', async () => {
});

test('page parameter updates with value 2 when clicking on the second page', async () => {
const { getByText, findAllByLabelText } = compareTableControls(
compareResults,
);
const { getByText, findAllByLabelText } =
compareTableControls(compareResults);

const result1 = await waitFor(() =>
getByText(compareTablesControlsResults[0].name),
Expand Down Expand Up @@ -374,11 +373,8 @@ test('page parameter updates with value 2 when clicking on the second page', asy
});

test('text input filter results should differ when filter button(s) are selected', async () => {
const {
getByText,
getByPlaceholderText,
queryByText,
} = compareTableControls();
const { getByText, getByPlaceholderText, queryByText } =
compareTableControls();

const result1 = await waitFor(() => getByText(result[0].name));
const result2 = await waitFor(() => getByText(result[1].name));
Expand Down
16 changes: 4 additions & 12 deletions tests/ui/perfherder/graphs-view/graphs_view_test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -278,12 +278,8 @@ test('Using select query param displays tooltip for correct datapoint with repli
});

test('InputFilter from TestDataModal can filter by application name', async () => {
const {
getByText,
getByTestId,
getByPlaceholderText,
getByTitle,
} = graphsViewControls();
const { getByText, getByTestId, getByPlaceholderText, getByTitle } =
graphsViewControls();

const { name, application, projectName, platform } = seriesData[0];
const fullTestName = projectName.concat(
Expand Down Expand Up @@ -313,12 +309,8 @@ test('InputFilter from TestDataModal can filter by application name', async () =

test('Changing the platform dropdown while filtered by text in the Test Data Modal displays expected tests', async () => {
mockShowModal.mockClear();
const {
getByText,
getByPlaceholderText,
getByTitle,
getByTestId,
} = graphsViewControls();
const { getByText, getByPlaceholderText, getByTitle, getByTestId } =
graphsViewControls();

fireEvent.click(getByText('Add test data'));

Expand Down
102 changes: 12 additions & 90 deletions tests/ui/perfherder/replicates_graph_test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,8 @@ const mockedReplicateData = {
lowerIsBetter: true,
name: SUBTEST_NAME,
replicates: [
500,
345,
366,
358,
355,
365,
354,
354,
363,
360,
389,
357,
273,
376,
350,
381,
373,
356,
351,
348,
271,
354,
351,
360,
385,
500, 345, 366, 358, 355, 365, 354, 354, 363, 360, 389, 357, 273,
376, 350, 381, 373, 356, 351, 348, 271, 354, 351, 360, 385,
],
shouldAlert: false,
unit: 'ms',
Expand All @@ -58,31 +35,8 @@ const mockedReplicateData = {
lowerIsBetter: true,
name: 'tablemutation.html',
replicates: [
89,
88,
90,
83,
87,
87,
88,
86,
85,
84,
85,
88,
102,
83,
100,
86,
100,
80,
87,
88,
82,
85,
84,
83,
86,
89, 88, 90, 83, 87, 87, 88, 86, 85, 84, 85, 88, 102, 83, 100, 86,
100, 80, 87, 88, 82, 85, 84, 83, 86,
],
shouldAlert: false,
unit: 'ms',
Expand All @@ -98,26 +52,8 @@ const mockedReplicateData = {
{
name: 'ts_paint',
replicates: [
844,
832,
842,
825,
849,
816,
857,
841,
849,
840,
846,
872,
864,
837,
830,
843,
841,
854,
841,
858,
844, 832, 842, 825, 849, 816, 857, 841, 849, 840, 846, 872, 864,
837, 830, 843, 841, 854, 841, 858,
],
value: 842,
},
Expand All @@ -134,26 +70,12 @@ const mockedReplicateData = {
lowerIsBetter: true,
name: '',
replicates: [
552.9000000000001,
561.6599999999999,
558.1199999999999,
565.0799999999999,
554.94,
599.9399999999998,
600.9200000000001,
559.22,
552.0600000000002,
559.4000000000001,
603.0999999999999,
586.4199999999998,
587.3200000000002,
606.3800000000001,
587.1000000000001,
592.9200000000001,
542.9199999999998,
553.98,
556.4200000000001,
576.0999999999999,
552.9000000000001, 561.6599999999999, 558.1199999999999,
565.0799999999999, 554.94, 599.9399999999998, 600.9200000000001,
559.22, 552.0600000000002, 559.4000000000001, 603.0999999999999,
586.4199999999998, 587.3200000000002, 606.3800000000001,
587.1000000000001, 592.9200000000001, 542.9199999999998, 553.98,
556.4200000000001, 576.0999999999999,
],
shouldAlert: false,
unit: 'ms',
Expand Down
3 changes: 1 addition & 2 deletions tests/ui/push-health/details/DetailsPanel_test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ describe('DetailsPanel', () => {
},
line_number: 18841,
},
line:
'22:42:53 INFO - TEST-UNEXPECTED-FAIL | devtools/client/debugger/test/mochitest/browser_dbg-sourcemaps.js | Uncaught exception - at chrome://mochitests/content/browser/devtools/client/debugger/test/mochitest/helpers.js:358 - TypeError: can\'t access property "wrapClass", lineInfo is null',
line: '22:42:53 INFO - TEST-UNEXPECTED-FAIL | devtools/client/debugger/test/mochitest/browser_dbg-sourcemaps.js | Uncaught exception - at chrome://mochitests/content/browser/devtools/client/debugger/test/mochitest/helpers.js:358 - TypeError: can\'t access property "wrapClass", lineInfo is null',
line_number: 18841,
},
],
Expand Down
3 changes: 2 additions & 1 deletion ui/helpers/job.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@ export const getTaskRunStr = (job) => `${job.task_id}.${job.retry_id}`;

// This matches as taskId, optionally followed by `.` or`-` and a runId.
// We support `-` for backwards compatability with the original format used.
const taskRunPattern = /^([A-Za-z0-9_-]{8}[Q-T][A-Za-z0-9_-][CGKOSWaeimquy26-][A-Za-z0-9_-]{10}[AQgw])(?:[-.]([0-9]+))?$/;
const taskRunPattern =
/^([A-Za-z0-9_-]{8}[Q-T][A-Za-z0-9_-][CGKOSWaeimquy26-][A-Za-z0-9_-]{10}[AQgw])(?:[-.]([0-9]+))?$/;

export const getTaskRun = function getTaskRun(taskRunStr) {
const match = taskRunPattern.exec(taskRunStr);
Expand Down
1 change: 0 additions & 1 deletion ui/helpers/performance.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// This file may export additional functions.
/* eslint-disable import/prefer-default-export */

import TaskclusterModel from '../models/taskcluster';

Expand Down
2 changes: 1 addition & 1 deletion ui/helpers/revision.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const getRevisionTitle = function getRevisionTitle(revisions) {
* Strip out unwanted things like additional lines, trychooser
* syntax, request flags, mq cruft, whitespace, and punctuation
*/
// eslint-disable-next-line prefer-destructuring

title = title.split('\n')[0];
title = title.replace(/\btry: .*/, '');
title = title.replace(/\b(r|sr|f|a)=.*/, '');
Expand Down
1 change: 0 additions & 1 deletion ui/helpers/sort.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable-next-line import/prefer-default-export
export const sortAlphaNum = (a, b) => {
// Implement a better alphanumeric sort so that mochitest-10
// is sorted after mochitest 9, not mochitest-1
Expand Down
1 change: 0 additions & 1 deletion ui/helpers/taskcluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ const taskcluster = (() => {
userCredentials[_rootUrl] &&
moment(userCredentials[_rootUrl].expires).isAfter(moment())
) {
// eslint-disable-next-line no-promise-executor-return
return resolve(userCredentials[_rootUrl]);
}

Expand Down
2 changes: 0 additions & 2 deletions ui/helpers/utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable no-bitwise */

export const hashFunction = (someString) => {
// Borrowed from https://github.com/darkskyapp/string-hash
let hash = 5381;
Expand Down
17 changes: 4 additions & 13 deletions ui/infra-compare/InfraCompareTableView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,8 @@ export default class InfraCompareTableView extends React.Component {

getInfraData = async () => {
const { getQueryParams, getDisplayResults } = this.props;
const {
originalProject,
originalRevision,
newProject,
newRevision,
} = this.props.validated;
const { originalProject, originalRevision, newProject, newRevision } =
this.props.validated;
const { timeRange, failureMessages } = this.state;

this.setState({ loading: true });
Expand Down Expand Up @@ -143,13 +139,8 @@ export default class InfraCompareTableView extends React.Component {
pageTitle,
} = this.props.validated;
const { jobsNotDisplayed } = this.props;
const {
compareResults,
loading,
failureMessages,
timeRange,
tabTitle,
} = this.state;
const { compareResults, loading, failureMessages, timeRange, tabTitle } =
this.state;
const compareDropdowns = [];
const params = {
originalProject,
Expand Down
Loading

0 comments on commit 24bd385

Please sign in to comment.