export default AllureReader; declare class AllureReader { constructor(opts?: {}); requestParams: { apiKey: any; url: any; title: string; env: string; group_title: string; batchMode: "manual"; }; runId: any; opts: {}; withPackage: any; store: {}; pipesPromise: Promise; _tests: any[]; stats: {}; suites: {}; uploader: S3Uploader; version: any; set tests(value: any[]); get tests(): any[]; createRun(): Promise; pipes: any; parse(resultsPattern: any): {}; parseContainerFiles(containerFiles: any): void; processAllureResult(result: any, resultsDir: any): { rid: any; title: any; status: any; suite_title: any; file: string; run_time: number; steps: any; message: any; stack: any; meta: {}; links: { label: string; }[]; artifacts: any[]; create: boolean; overwrite: boolean; }; mapStatus(status: any): any; /** * Map an Allure step status to the Testomat.io Step status enum * (`passed | failed | none | custom`, see testomat-api-definition.yml). * * Allure marks a step `broken` when it threw an unexpected error — that is a * failure for reporting purposes, matching how `mapStatus` treats tests. * `skipped` and anything unknown/absent become `none` (the neutral value), * since the step enum has no `skipped`. * * @param {string} status - Allure step status * @returns {'passed'|'failed'|'none'} Testomat.io step status */ mapStepStatus(status: string): "passed" | "failed" | "none"; extractSuiteTitle(result: any): any; stripNamespace(suiteName: any): any; extractFile(result: any): string; getFileExtension(result: any): any; extractMeta(result: any): {}; extractLinks(result: any): { label: string; }[]; /** * Extract all Testomat.io test ids from Allure links so reported results match * existing cases instead of creating duplicates. * * A test may carry several `@TmsLink`s (e.g. `@TmsLinks(@TmsLink("…"), @TmsLink("…"))`), * each producing a link with `type: "tms"`. Some exporters omit the type but still point * the link URL at a Testomat.io test page; both are accepted. The link `name` is used as * the id (falling back to the id segment of a Testomat.io URL). Ids are normalized and * de-duplicated, preserving order so the first one stays the primary `test_id`. * * @param {object} result - Parsed Allure result JSON * @returns {string[]} Normalized test ids (possibly empty) */ extractTmsIds(result: object): string[]; /** * The primary Testomat.io test id (the first `@TmsLink`), or null when there is none. * * @param {object} result - Parsed Allure result JSON * @returns {string|null} */ extractTestId(result: object): string | null; /** * Attach additional linked test cases to a reported test as `{ test: id }` link entries * (the same shape `linkTest()` uses), so a single result updates every case it is linked * to — not just the primary `test_id`. Existing links are preserved; duplicates skipped. * * @param {object} test - converted test * @param {string[]} ids - additional test ids to link */ addLinkedTestIds(test: object, ids: string[]): void; /** * Normalize a value into a Testomat.io test id. * * Testomat.io test ids are exactly **8 word characters**. The value may arrive bare * (`1a2b3c4d`), or carrying the `T` / `@T` markers Testomat uses in code and titles * (`T1a2b3c4d`, `@T1a2b3c4d`). The markers are removed only when doing so still leaves * a valid 8-char id, so a real id that happens to start with `T` is preserved. * * Anything that does not resolve to a valid 8-char id — a numeric Allure TestOps id * like `12345`, a JIRA key, a 6-digit TMS number — is rejected (returns null) so we * never send an unmatchable id that would create duplicates. * * @param {string|number|null|undefined} value * @returns {string|null} The bare 8-char id, or null when the value is not a valid id */ normalizeTestId(value: string | number | null | undefined): string | null; /** * Recover a Testomat.io test id from the `@TmsLink("…")` annotation in test source. * * Allure does not emit link annotations for skipped (`@Ignore` / `@Disabled`) tests, * so their results carry no `tms` link and `extractTestId` returns null — which makes * the server create a duplicate case. The id still lives in the source, on the test * method, so we read it from there as a fallback. * * The lookup is method-scoped: we locate the test method declaration by name, collect * its annotation/comment block (the lines directly above it, up to the previous code * construct) and read every `@TmsLink` from it — so an unrelated method's annotation can * never be picked up. Both `@TmsLink("…")` and the container forms * `@TmsLinks(@TmsLink("…"), @TmsLink("…"))` (single- or multi-line) are supported. * * @param {string} contents - full source file * @param {object} test - converted test (uses `title`) * @returns {string[]} normalized 8-char ids in source order (possibly empty) */ extractTmsIdsFromSource(contents: string, test: object): string[]; /** * The primary `@TmsLink` id for a test method in source, or null. Convenience wrapper * around {@link extractTmsIdsFromSource}. * * @param {string} contents - full source file * @param {object} test - converted test (uses `title`) * @returns {string|null} */ extractTmsIdFromSource(contents: string, test: object): string | null; convertSteps(steps: any, depth?: number): any; /** * Check whether any step in the given (already converted) subtree already * carries an `error`. Used to keep the failure message on the deepest failed * step only, instead of repeating it on every ancestor in the failure chain. * * @param {Array|undefined} steps - converted child steps * @returns {boolean} */ subtreeHasError(steps: Array | undefined): boolean; /** * Build the `error` payload for a failed step from its Allure `statusDetails`. * * Allure stores the failure message and stack trace (which includes the failing * source line) in `statusDetails` on the step itself. We only surface it for * failed/broken steps — passing or skipped steps carry no error. Returns null * when there is no usable failure information so the field is omitted entirely. * * @param {object} step - Allure step * @returns {{message: string, stack: string}|null} */ extractStepError(step: object): { message: string; stack: string; } | null; calculateRunTime(item: any): number; convertParameters(parameters: any): {}; combineRetryAttempts(attempts: any): any; calculateStats(): {}; fetchSourceCode(): void; getLanguage(): any; /** * Link tests to their Testomat.io cases by reading `@TmsLink` from source for tests that * carry no `{ test: … }` link yet. This rescues skipped (`@Ignore` / `@Disabled`) tests, * whose Allure results drop the `@TmsLink` link and would otherwise create duplicate * cases. Every `@TmsLink` on the method is linked (consistent with executed tests); the * `test_id` is left untouched — links and test_id are separate concerns. * * Opt-in: only runs when `--java-tests` (a source root) is provided. The source files are * indexed once by basename; for each not-yet-linked test we read the candidate file(s) * matching its `testFile` / class name and parse the method's `@TmsLink`(s). */ recoverTmsLinksFromSource(): void; /** * Fallback: when a test has no `test_id`, adopt the first linked case (`@TmsLink`) as its * `test_id` so it matches an existing case instead of creating a method-named duplicate. * * Runs after `fetchSourceCode`, so a native Testomat.io id parsed from source always wins. * The id stays in `links` as well — every linked case is still updated; this only gives the * test a primary identity to match on. */ applyPrimaryTestIdFromLinks(): void; /** * Build (and cache) a basename -> [absolute paths] index of source files under `root`. * Walks synchronously, skipping common build/dependency directories. * * @param {string} root * @returns {Map} */ indexSourceFiles(root: string): Map; _sourceIndex: Map; /** * Candidate source file paths for a test, looked up in the basename index. * Uses the `testFile` meta label (e.g. `Foo.kt`) and the class name from `file`, * trying both `.kt` and `.java` extensions. Ambiguity (same basename in several * dirs) is harmless: only the file that actually declares the method will match. * * @param {object} t * @param {Map} index * @returns {string[]} */ sourceCandidatesForTest(t: object, index: Map): string[]; uploadArtifacts(): Promise; uploadData(): Promise; } import { S3Uploader } from './uploader.js';