Skip to content

Test webapp local training in parallel - #1218

Open
ale18V wants to merge 10 commits into
mainfrom
1196-webapp-training-tests-ale
Open

ale18V wants to merge 10 commits into
mainfrom
1196-webapp-training-tests-ale

Conversation

@ale18V

@ale18V ale18V commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

What & why

This PR adds dedicated browser end-to-end coverage for local training and runs the new specs independently in CI. Titanic uses the full bundled CSV and its default task configuration. LUS COVID selects all bundled images and uses the real model, preprocessing, batch size, and validation setup, with a CI-specific five-epoch workload so the test remains bounded.

Technical plan

The general E2E job excludes the dedicated local-training specs, while a matrix runs the Titanic and LUS scenarios independently. Each scenario mocks only task/model retrieval, selects local files through the UI, completes training, and saves the resulting model.

Deviations from plan

The issue calls for coverage of each data type; this PR does not include Wikitext because a parallel GPT-2 browser workload is too resource-intensive. The default 50-epoch LUS task exceeded five minutes on the GitHub Electron runner, so CI uses five complete epochs over the full bundled image dataset.

Todo

Add representative text-training coverage when a practical browser workload is established.

@ale18V
ale18V marked this pull request as draft September 18, 2026 15:54
@ale18V
ale18V force-pushed the 1196-webapp-training-tests-ale branch from 302f156 to 67b00eb Compare September 23, 2026 21:42
Comment thread webapp/src/components/training/TrainerDashboard.vue Outdated
@ale18V
ale18V marked this pull request as ready for review September 24, 2026 12:32
@ale18V
ale18V requested a review from JulienVig September 24, 2026 12:32
Comment thread webapp/cypress/fixtures/local_training/wikitext.txt Outdated
@ale18V
ale18V added this pull request to stack #1235 September 24, 2026 13:05
@ale18V
ale18V force-pushed the 1196-webapp-training-tests-ale branch from 8875ceb to 04c5fda Compare September 24, 2026 15:58

@JulienVig JulienVig left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for your work! Looks overall good to me, I left a few minor comments that you can address before merging

Comment on lines +39 to +54
cy.contains("button", "next").click();
cy.contains("button", "locally").click();
cy.contains("button", "Start training").click();
cy.contains("Training successfully completed", {
timeout: trainingTimeout,
}).should("be.visible");
cy.contains("h6", "epochs")
.next()
.should("have.text", `${epochs} / ${epochs}`);
cy.contains("button", "Start training").should("be.visible");
cy.contains("button", "next").click();
cy.contains("button", "save model").click();
cy.contains(`The trained ${title} model has been saved.`, {
timeout: 30_000,
}).should("be.visible");
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can you also check that no error toaster are being shown as in training.cy.ts? They can sometimes be displayed even when the training proceeds without crashing

cy.get(".v-toast__item--error", { timeout: 1_000 }).should("not.exist");

I've seen them occur after clicking start training, at the end of training or after clicking save model.

Comment thread .github/workflows/_test.yml Outdated
Comment on lines +90 to +91
wait-on: http://localhost:1351
browser: electron

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
wait-on: http://localhost:1351
browser: electron

Electron is already the default isn't it?

Cypress already waits for the webapp to boot, no need to manually wait for it

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This test is a duplicate of the one in training.cy.ts, I like the folder structure you made in this PR so can you move tests out of training.cy.ts into titanic.cy.ts and lus_covid.ts and delete duplicate ones?


cy.contains("button", "test model").click();
cy.url().should("include", "/evaluate");
cy.contains("Titanic Prediction");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

"Titanic Prediction" is found in the success toaster but this is already tested in trainLocallyAndSave

Image
Suggested change
cy.contains("Titanic Prediction");
cy.contains("Model Testing");

infos.props("rounds").last()?.epochs.last()?.training.accuracy,
).toBeGreaterThan(0);

await vi.waitFor(() => expect(infos.props("isTraining")).toBe(false));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
await vi.waitFor(() => expect(infos.props("isTraining")).toBe(false));
await vi.waitFor(() => expect(infos.props("isTraining")).toBe(false), { timeout: 5_000 });

The default 1s timeout is maybe a bit tight

it("completes local LUS COVID training and saves the model", () => {
setupServerWith(
withTrainingConfig(defaultTasks.lusCovid, {
epochs: 4,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Use a variable for the epoch numer to keep it consistent with the argument of trainLocallyAndSave

.first()
.selectFile("../datasets/titanic_train.csv");

trainLocallyAndSave("Titanic Prediction", 10);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

For the epoch number you can directly use the default task epoch parameter

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants