Skip to content

Commit 33bb925

Browse files
committed
Test changes for non-converter tasks running on empty image
1 parent 0e05c82 commit 33bb925

File tree

8 files changed

+32
-16
lines changed

8 files changed

+32
-16
lines changed

src/lib/components/v2/tasks/AddSingleTask.svelte

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,11 @@
9696
9797
const typesValid = typesEditor?.validate();
9898
99-
if (Object.keys($validationErrors).length > 0 || !typesValid || !taskGroupSelector?.validate()) {
99+
if (
100+
Object.keys($validationErrors).length > 0 ||
101+
!typesValid ||
102+
!taskGroupSelector?.validate()
103+
) {
100104
return;
101105
}
102106
@@ -115,11 +119,19 @@
115119
docs_link
116120
};
117121
118-
if (argsSchemaNonParallel && (taskType === 'non_parallel' || taskType === 'compound')) {
122+
if (
123+
argsSchemaNonParallel &&
124+
(taskType === 'non_parallel' ||
125+
taskType === 'compound' ||
126+
taskType === 'converter_non_parallel')
127+
) {
119128
bodyData.args_schema_non_parallel = argsSchemaNonParallel;
120129
}
121130
122-
if (argsSchemaParallel && (taskType === 'parallel' || taskType === 'compound')) {
131+
if (
132+
argsSchemaParallel &&
133+
(taskType === 'parallel' || taskType === 'compound' || taskType === 'converter_compound')
134+
) {
123135
bodyData.args_schema_parallel = argsSchemaParallel;
124136
}
125137

src/routes/healthcheck/+page.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@
116116
headers,
117117
body: normalizePayload({
118118
name: '__TEST_ECHO_TASK__',
119+
type: 'converter_non_parallel',
119120
command_non_parallel: 'echo',
120121
version: '9.9.9',
121122
input_types: {},

tests/v2/accounting.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ test('Display accounting page', async ({ page, workflow }) => {
1515
await test.step('Go to workflow page and add generic_task', async () => {
1616
await page.goto(workflow.url);
1717
await waitPageLoading(page);
18-
await workflow.addTask('generic_task');
18+
await workflow.addTask('generic_task_converter');
1919
});
2020

2121
await test.step('Start the job', async () => {

tests/v2/admin_jobs.spec.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ test('Execute a job and show it on the job tables [v2]', async ({ page, request
1010
let taskName;
1111
await test.step('Create test tasks', async () => {
1212
taskName = await createFakeTask(page, {
13-
type: 'non_parallel'
13+
type: 'converter_non_parallel'
1414
});
1515
});
1616

@@ -22,16 +22,15 @@ test('Execute a job and show it on the job tables [v2]', async ({ page, request
2222
let jobId1;
2323
await test.step('Create first job and wait its failure', async () => {
2424
const job = await createJob(page, request, async function (workflow) {
25-
await workflow.addTask('generic_task');
26-
await workflow.selectTask('generic_task');
25+
await workflow.addTask('generic_task_converter');
26+
await workflow.selectTask('generic_task_converter');
2727
await page.getByRole('switch').check();
2828
await page.getByRole('button', { name: 'Save changes' }).click();
2929
await page.getByText('Arguments changes saved successfully').waitFor();
3030
});
3131
workflow1 = job.workflow;
3232
dataset1 = job.dataset;
3333
jobId1 = job.jobId;
34-
await waitTaskSubmitted(page);
3534
await waitTaskFailure(page);
3635
await workflow1.deleteProject();
3736
});

tests/v2/task_utils.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@ export async function createFakeTask(page, task) {
2626
await page.getByRole('combobox', { name: 'Task type' }).selectOption('Parallel');
2727
} else if (task.type === 'compound') {
2828
await page.getByRole('combobox', { name: 'Task type' }).selectOption('Compound');
29+
} else if (task.type === 'converter_non_parallel') {
30+
await page.getByRole('combobox', { name: 'Task type' }).selectOption('Converter Non Parallel');
2931
}
3032

3133
await page.getByRole('textbox', { name: 'Task name' }).fill(taskName);
3234

3335
const command = path.join(__dirname, '..', 'data', 'fake-task.sh');
34-
if (task.type === 'non_parallel' || task.type === 'compound') {
36+
if (task.type === 'non_parallel' || task.type === 'compound' || task.type === 'converter_non_parallel') {
3537
await page
3638
.getByRole('textbox', { name: 'Command non parallel' })
3739
.fill(task.command_non_parallel || command);

tests/v2/tasks_filtering.spec.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { expect, test } from './workflow_fixture.js';
22
import { selectSlimSelect, waitPageLoading } from '../utils.js';
33

4+
const NUM_MOCK_TASKS = 19
5+
46
test('Tasks filtering', async ({ page, workflow }) => {
57
await page.waitForURL(workflow.url);
68
await waitPageLoading(page);
@@ -31,7 +33,7 @@ async function testFiltering(page) {
3133
const rows = page.getByRole('row');
3234

3335
await selectSlimSelect(page, packageFilter, 'fractal-tasks-mock');
34-
await expect(rows).toHaveCount(18);
36+
await expect(rows).toHaveCount(NUM_MOCK_TASKS);
3537
await selectSlimSelect(page, modalityFilter, 'HCS');
3638
await expect(rows).toHaveCount(8);
3739
await selectSlimSelect(page, categoryFilter, 'Conversion');
@@ -40,14 +42,14 @@ async function testFiltering(page) {
4042

4143
await deselect(modalityFilter);
4244
await deselect(categoryFilter);
43-
await expect(rows).toHaveCount(18);
45+
await expect(rows).toHaveCount(NUM_MOCK_TASKS);
4446

4547
await selectSlimSelect(page, tagFilter, 'Deep Learning');
4648
await expect(rows).toHaveCount(3);
4749
await expect(page.getByRole('row', { name: 'cellpose_segmentation' })).toBeVisible();
4850

4951
await deselect(tagFilter);
50-
await expect(rows).toHaveCount(18);
52+
await expect(rows).toHaveCount(NUM_MOCK_TASKS);
5153

5254
await search(page, 'mip', 'MIP_compound'); // search by task_name
5355
await search(page, 'deep', 'cellpose_segmentation'); // search by tag
@@ -74,5 +76,5 @@ async function search(page, query, expectedTaskName) {
7476
await expect(page.getByRole('row')).toHaveCount(3);
7577
await expect(page.getByRole('row', { name: expectedTaskName })).toBeVisible();
7678
await page.getByPlaceholder('Search...').fill('');
77-
await expect(page.getByRole('row')).toHaveCount(18);
79+
await expect(page.getByRole('row')).toHaveCount(NUM_MOCK_TASKS);
7880
}

tests/v2/workflow_task_run_no_schema.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ test('Workflow task runs on task without arguments', async ({ page, workflow })
2121

2222
await test.step('Create test tasks', async () => {
2323
taskName = await createFakeTask(page, {
24-
type: 'non_parallel',
24+
type: 'converter_non_parallel',
2525
version: '0.0.1',
2626
command_non_parallel: 'echo'
2727
});

tests/v2/workflow_task_run_schema_version_changes.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ test('Workflow task runs display different versions of arguments schema', async
2424

2525
await test.step('Create test tasks', async () => {
2626
taskName = await createFakeTask(page, {
27-
type: 'non_parallel',
27+
type: 'converter_non_parallel',
2828
version: '0.0.1',
2929
command_non_parallel: 'echo',
3030
args_schema_non_parallel: {
@@ -36,7 +36,7 @@ test('Workflow task runs display different versions of arguments schema', async
3636
});
3737
await createFakeTask(page, {
3838
name: taskName,
39-
type: 'non_parallel',
39+
type: 'converter_non_parallel',
4040
version: '0.0.2',
4141
command_non_parallel: 'echo',
4242
args_schema_non_parallel: {

0 commit comments

Comments
 (0)