import { AbstractReporter } from './abstract-reporter'; import { Attachment, TestResultType } from '../models'; import { LoggerInterface } from '../utils/logger'; import { IClient } from '../client/interface'; /** * @class TestOpsReporter * @extends AbstractReporter */ export declare class TestOpsReporter extends AbstractReporter { private api; private withState; private projectCode; private showPublicReportLink?; private readonly baseUrl; private readonly batchSize; private runId; /** First result that has not been confirmed as accepted by Qase. */ private firstIndex; /** * First result that no sender has taken responsibility for yet. Kept apart from * `firstIndex` so a batch is claimed before the request and only marked sent after the * response: a concurrent `sendResults()` cannot ship the same batch twice, and a batch * that failed is released back for the next attempt instead of being skipped. */ private claimedIndex; private isTestRunReady; private mutex; /** * @param {LoggerInterface} logger * @param {IClient} api * @param {boolean} withState * @param {string} projectCode * @param {string | undefined} baseUrl * @param {number | undefined} batchSize */ constructor(logger: LoggerInterface, api: IClient, withState: boolean, projectCode: string, baseUrl?: string, batchSize?: number, runId?: number, showPublicReportLink?: boolean | undefined); /** * @returns {Promise} */ startTestRun(): Promise; /** * @param {TestResultType} result * @returns {Promise} */ addTestResult(result: TestResultType): Promise; /** * @returns {Promise} */ private checkOrCreateTestRun; /** * @returns {Promise} * @param testResults * @private */ private publishResults; /** * @returns {Promise} */ publish(): Promise; /** * @returns {Promise} */ sendResults(): Promise; /** * Sends `results[from, to)`, claiming the range up front so no other sender picks it up and * releasing the claim if the upload fails, so the next `sendResults()` retries it. * * @param {number} from * @param {number} to * @returns {Promise} * @private */ private publishClaimed; /** * The message must stay inside a single tagged template: a tagged template binds tighter than * `+`, so splitting it hands chalk an unbalanced `{red ...` and makes the logging call throw, * replacing the upload failure it was meant to report. * * @param {number} count * @param {unknown} error * @private */ private reportUnrecoverableBatch; /** * Results accumulated but never confirmed as accepted by Qase. * * @returns {number} * @private */ private unsentResultsCount; /** * @param {Attachment} attachment * @returns {Promise} */ uploadAttachment(attachment: Attachment): Promise; /** * @returns {Promise} */ complete(): Promise; /** * @param {number | null} id * @param {string} title * @return string * @private */ private prepareFailedTestLink; /** * Show link to failed test * @param {number | null} id * @param {string} title * @private */ private showLink; }