Skip to content

Commit e1bcaed

Browse files
run collab tests in enforced liveCollab = true flag env
1 parent 8295a12 commit e1bcaed

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

frontend/javascripts/test/sagas/proofreading/proofreading_mesh_interaction.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,17 @@ import type { MinCutTargetEdge } from "admin/rest_api";
3232
import _ from "lodash";
3333
import { delay } from "typed-redux-saga";
3434
import { updateUserSettingAction } from "viewer/model/actions/settings_actions";
35+
import { WkDevFlags } from "viewer/api/wk_dev";
3536

3637
describe("Proofreading (with mesh actions)", () => {
38+
const initialLiveCollab = WkDevFlags.liveCollab;
3739
beforeEach<WebknossosTestContext>(async (context) => {
40+
WkDevFlags.liveCollab = true;
3841
await setupWebknossosForTesting(context, "hybrid");
3942
});
4043

4144
afterEach<WebknossosTestContext>(async (context) => {
45+
WkDevFlags.liveCollab = initialLiveCollab;
4246
context.tearDownPullQueues();
4347
// Saving after each test and checking that the root saga didn't crash,
4448
expect(hasRootSagaCrashed()).toBe(false);

frontend/javascripts/test/sagas/proofreading/proofreading_multi_user.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,17 @@ import {
2424
mockInitialBucketAndAgglomerateData,
2525
} from "./proofreading_test_utils";
2626
import { setOthersMayEditForAnnotationAction } from "viewer/model/actions/annotation_actions";
27+
import { WkDevFlags } from "viewer/api/wk_dev";
2728

2829
describe("Proofreading (Multi User)", () => {
30+
const initialLiveCollab = WkDevFlags.liveCollab;
2931
beforeEach<WebknossosTestContext>(async (context) => {
32+
WkDevFlags.liveCollab = true;
3033
await setupWebknossosForTesting(context, "hybrid");
3134
});
3235

3336
afterEach<WebknossosTestContext>(async (context) => {
37+
WkDevFlags.liveCollab = initialLiveCollab;
3438
context.tearDownPullQueues();
3539
// Saving after each test and checking that the root saga didn't crash,
3640
expect(hasRootSagaCrashed()).toBe(false);

frontend/javascripts/test/sagas/proofreading/proofreading_poll_only.spec.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,18 @@ import {
1818
} from "./proofreading_test_utils";
1919
import { AnnotationTool } from "viewer/model/accessors/tool_accessor";
2020
import { setOthersMayEditForAnnotationAction } from "viewer/model/actions/annotation_actions";
21+
import { WkDevFlags } from "viewer/api/wk_dev";
2122

2223
describe("Proofreading (Poll only)", () => {
24+
const initialLiveCollab = WkDevFlags.liveCollab;
2325
beforeEach<WebknossosTestContext>(async (context) => {
26+
WkDevFlags.liveCollab = true;
2427
await setupWebknossosForTesting(context, "hybrid");
2528
//Store.dispatch(setIsUpdatingAnnotationCurrentlyAllowedAction(false));
2629
});
2730

2831
afterEach<WebknossosTestContext>(async (context) => {
32+
WkDevFlags.liveCollab = initialLiveCollab;
2933
context.tearDownPullQueues();
3034
expect(hasRootSagaCrashed()).toBe(false);
3135
});
@@ -430,3 +434,5 @@ describe("Proofreading (Poll only)", () => {
430434
await task.toPromise();
431435
}, 8000);
432436
});
437+
438+
// TODOM: Test where OthersMayEdit = true is not needed

frontend/javascripts/test/sagas/proofreading/proofreading_skeleton_interaction.spec.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import { deleteEdgeAction, mergeTreesAction } from "viewer/model/actions/skeleto
2727
import { minCutAgglomerateAction } from "viewer/model/actions/proofread_actions";
2828
import type { MinCutTargetEdge } from "admin/rest_api";
2929
import _ from "lodash";
30+
import { WkDevFlags } from "viewer/api/wk_dev";
3031

3132
function* performMergeTreesProofreading(
3233
context: WebknossosTestContext,
@@ -235,13 +236,15 @@ const mockEdgesForAgglomerateMinCut = (
235236
},
236237
);
237238

238-
// TODOM: wait for agglomerate skeleton being properly loaded and then continue to do a proofreading action with it.
239239
describe("Proofreading (With Agglomerate Skeleton interactions)", () => {
240+
const initialLiveCollab = WkDevFlags.liveCollab;
240241
beforeEach<WebknossosTestContext>(async (context) => {
242+
WkDevFlags.liveCollab = true;
241243
await setupWebknossosForTesting(context, "hybrid");
242244
});
243245

244246
afterEach<WebknossosTestContext>(async (context) => {
247+
WkDevFlags.liveCollab = initialLiveCollab;
245248
context.tearDownPullQueues();
246249
// Saving after each test and checking that the root saga didn't crash,
247250
expect(hasRootSagaCrashed()).toBe(false);
@@ -764,6 +767,5 @@ describe("Proofreading (With Agglomerate Skeleton interactions)", () => {
764767

765768
// TODOM: Write test for backend manipulating same agglomerate skeleton - should this be synched? check with others
766769

767-
// TODOM: write tests for partitionedMinCut -> new test file
768770
// TODOM: Write a test that pulling update fro the backend does not yield diff tracing changes that would be pushed to the backend in a live collab scenario!
769771
// TODOM: Write test without injected version and test via spy or so that no rebasing was tried and thus only the update actions were sent to the server!

0 commit comments

Comments
 (0)