mirror of
https://github.com/mattermost/mattermost-mobile.git
synced 2026-11-09 04:30:14 +00:00
test(e2e): stabilize Detox and Maestro suites and harden CI - Re-enable stabilized cases and document remaining iOS skips. - Improve selectors, navigation recovery, state assertions, and retry limits. - Harden API retries, fixture setup, and server configuration cleanup. - Increase Detox shards to 24 and improve reporting, artifact uploads, and timeout handling. - Add testIDs and unit-test fixes; revert unproven app behavior changes.
34 lines
1.2 KiB
TypeScript
34 lines
1.2 KiB
TypeScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import {createServerLock} from '@support/server_lock';
|
|
|
|
import type {AcquireLockOptions} from '@support/classification_lock_core';
|
|
|
|
const classificationLock = createServerLock('classification');
|
|
|
|
export const createClassificationLockOwner = (): string => {
|
|
return classificationLock.createOwner();
|
|
};
|
|
|
|
export const acquireClassificationLock = async (
|
|
baseUrl: string,
|
|
owner: string,
|
|
options: AcquireLockOptions = {},
|
|
): Promise<void> => {
|
|
return classificationLock.acquire(baseUrl, owner, options);
|
|
};
|
|
|
|
export const releaseClassificationLock = async (baseUrl: string, owner: string): Promise<void> => {
|
|
return classificationLock.release(baseUrl, owner);
|
|
};
|
|
|
|
/**
|
|
* Throw unless `owner` still holds the classification lock. Cheap (one admin-preference
|
|
* read): call it before config mutations and in beforeEach so a stolen lock fails the test
|
|
* immediately with the stealer's identity instead of as downstream banner timeouts.
|
|
*/
|
|
export const assertClassificationLockOwnership = async (baseUrl: string, owner: string): Promise<void> => {
|
|
return classificationLock.assertOwnership(baseUrl, owner);
|
|
};
|