Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
re-enable max-len
  • Loading branch information
jmthibault79 committed Jan 24, 2022
commit 133e9364137bd2f63c82c1b08286fd4e80cfd669
10 changes: 9 additions & 1 deletion ui/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,18 @@ module.exports = {

'prettier/prettier': 'warn',

'max-len': [
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These 2 are compatible and non-redundant to Prettier

'warn',
{
code: 140,
ignorePattern: '^import |^export\\{(.*?)\\}',
ignoreComments: true,
},
],

// temp disable others. re-enable if desired after determining that they don't conflict with prettier.

// 'eol-last': 'warn',
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

redundant

// 'max-len': ['warn', {code: 140, ignorePattern: '^import |^export\\{(.*?)\\}', ignoreComments: true}],
// 'no-trailing-spaces': 'warn',
// 'quotes': ['warn', 'single'],
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

redundant

// // 'brace-style': ['warn', '1tbs'],
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

redundant

Expand Down
163 changes: 87 additions & 76 deletions ui/src/app/pages/analysis/runtime-panel.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -557,85 +557,96 @@ describe('RuntimePanel', () => {
expect(runtimeApiStub.runtime.gceConfig).toBeFalsy();
});

it('should set runtime preset values in customize panel instead of getRuntime values if configurationType is GeneralAnalysis', async () => {
// skip this test after enabling pd
if (enablePd) {
return;
it(
'should set runtime preset values in customize panel instead of getRuntime values ' +
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

line was too long

'if configurationType is GeneralAnalysis',
async () => {
// skip this test after enabling pd
if (enablePd) {
return;
}
const runtime = {
...runtimeApiStub.runtime,
status: RuntimeStatus.Deleted,
configurationType: RuntimeConfigurationType.GeneralAnalysis,
gceConfig: {
...defaultGceConfig(),
machineType: 'n1-standard-16',
diskSize: 1000,
},
dataprocConfig: null,
};
runtimeApiStub.runtime = runtime;
runtimeStoreStub.runtime = runtime;

const wrapper = await component();
await mustClickButton(wrapper, 'Customize');

expect(getMainCpu(wrapper)).toEqual(
findMachineByName(
runtimePresets.generalAnalysis.runtimeTemplate.gceConfig.machineType
).cpu
);
expect(getMainRam(wrapper)).toEqual(
findMachineByName(
runtimePresets.generalAnalysis.runtimeTemplate.gceConfig.machineType
).memory
);
expect(getMainDiskSize(wrapper)).toEqual(
runtimePresets.generalAnalysis.runtimeTemplate.gceConfig.diskSize
);
}
const runtime = {
...runtimeApiStub.runtime,
status: RuntimeStatus.Deleted,
configurationType: RuntimeConfigurationType.GeneralAnalysis,
gceConfig: {
...defaultGceConfig(),
machineType: 'n1-standard-16',
diskSize: 1000,
},
dataprocConfig: null,
};
runtimeApiStub.runtime = runtime;
runtimeStoreStub.runtime = runtime;

const wrapper = await component();
await mustClickButton(wrapper, 'Customize');

expect(getMainCpu(wrapper)).toEqual(
findMachineByName(
runtimePresets.generalAnalysis.runtimeTemplate.gceConfig.machineType
).cpu
);
expect(getMainRam(wrapper)).toEqual(
findMachineByName(
runtimePresets.generalAnalysis.runtimeTemplate.gceConfig.machineType
).memory
);
expect(getMainDiskSize(wrapper)).toEqual(
runtimePresets.generalAnalysis.runtimeTemplate.gceConfig.diskSize
);
});

it('should set runtime preset values in customize panel instead of getRuntime values if configurationType is HailGenomicsAnalysis', async () => {
const runtime = {
...runtimeApiStub.runtime,
status: RuntimeStatus.Deleted,
configurationType: RuntimeConfigurationType.HailGenomicAnalysis,
gceConfig: null,
dataprocConfig: {
...defaultDataprocConfig(),
masterMachineType: 'n1-standard-16',
masterDiskSize: 999,
workerDiskSize: 444,
numberOfWorkers: 5,
},
};
runtimeApiStub.runtime = runtime;
runtimeStoreStub.runtime = runtime;

const wrapper = await component();
await mustClickButton(wrapper, 'Customize');

expect(getMainCpu(wrapper)).toEqual(
findMachineByName(
);

it(
'should set runtime preset values in customize panel instead of getRuntime values ' +
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

line was too long

'if configurationType is HailGenomicsAnalysis',
async () => {
const runtime = {
...runtimeApiStub.runtime,
status: RuntimeStatus.Deleted,
configurationType: RuntimeConfigurationType.HailGenomicAnalysis,
gceConfig: null,
dataprocConfig: {
...defaultDataprocConfig(),
masterMachineType: 'n1-standard-16',
masterDiskSize: 999,
workerDiskSize: 444,
numberOfWorkers: 5,
},
};
runtimeApiStub.runtime = runtime;
runtimeStoreStub.runtime = runtime;

const wrapper = await component();
await mustClickButton(wrapper, 'Customize');

expect(getMainCpu(wrapper)).toEqual(
findMachineByName(
runtimePresets.hailAnalysis.runtimeTemplate.dataprocConfig
.masterMachineType
).cpu
);
expect(getMainRam(wrapper)).toEqual(
findMachineByName(
runtimePresets.hailAnalysis.runtimeTemplate.dataprocConfig
.masterMachineType
).memory
);
expect(getMainDiskSize(wrapper)).toEqual(
runtimePresets.hailAnalysis.runtimeTemplate.dataprocConfig
.masterMachineType
).cpu
);
expect(getMainRam(wrapper)).toEqual(
findMachineByName(
.masterDiskSize
);
expect(getWorkerDiskSize(wrapper)).toEqual(
runtimePresets.hailAnalysis.runtimeTemplate.dataprocConfig
.masterMachineType
).memory
);
expect(getMainDiskSize(wrapper)).toEqual(
runtimePresets.hailAnalysis.runtimeTemplate.dataprocConfig.masterDiskSize
);
expect(getWorkerDiskSize(wrapper)).toEqual(
runtimePresets.hailAnalysis.runtimeTemplate.dataprocConfig.workerDiskSize
);
expect(getNumWorkers(wrapper)).toEqual(
runtimePresets.hailAnalysis.runtimeTemplate.dataprocConfig.numberOfWorkers
);
});
.workerDiskSize
);
expect(getNumWorkers(wrapper)).toEqual(
runtimePresets.hailAnalysis.runtimeTemplate.dataprocConfig
.numberOfWorkers
);
}
);

it('should allow configuration via dataproc preset from modified form', async () => {
runtimeApiStub.runtime = null;
Expand Down
4 changes: 3 additions & 1 deletion ui/src/app/pages/workspace/workspace-edit.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,9 @@ describe('WorkspaceEdit', () => {
CdrVersionsStubVariables.DEFAULT_WORKSPACE_CDR_VERSION_ID
);

const expectedUpgradeMessage = `${CdrVersionsStubVariables.ALT_WORKSPACE_CDR_VERSION} to ${CdrVersionsStubVariables.DEFAULT_WORKSPACE_CDR_VERSION}.`;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

line too long

const { ALT_WORKSPACE_CDR_VERSION, DEFAULT_WORKSPACE_CDR_VERSION } =
CdrVersionsStubVariables;
const expectedUpgradeMessage = `${ALT_WORKSPACE_CDR_VERSION} to ${DEFAULT_WORKSPACE_CDR_VERSION}.`;
const cdrUpgradeMessage = wrapper
.find('[data-test-id="cdr-version-upgrade"]')
.first()
Expand Down
4 changes: 3 additions & 1 deletion ui/src/app/utils/resources.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ describe('resources.tsx', () => {
});

it('should return resource URLs', () => {
const WORKSPACE_URL_PREFIX = `/workspaces/${WorkspaceStubVariables.DEFAULT_WORKSPACE_NS}/${WorkspaceStubVariables.DEFAULT_WORKSPACE_ID}`;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

line too long

const { DEFAULT_WORKSPACE_NS, DEFAULT_WORKSPACE_ID } =
WorkspaceStubVariables;
const WORKSPACE_URL_PREFIX = `/workspaces/${DEFAULT_WORKSPACE_NS}/${DEFAULT_WORKSPACE_ID}`;
const EXPECTED_COHORT_URL = `${WORKSPACE_URL_PREFIX}/data/cohorts/build?cohortId=${COHORT_ID}`;
const EXPECTED_COHORT_REVIEW_URL = `${WORKSPACE_URL_PREFIX}/data/cohorts/${COHORT_REVIEW_COHORT_ID}/review`;
const EXPECTED_CONCEPT_SET_URL = `${WORKSPACE_URL_PREFIX}/data/concepts/sets/${CONCEPT_SET_ID}`;
Expand Down