Skip to content

Commit

Permalink
[reporting] Move chromium user data to path.data (#112198)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbudz authored Sep 15, 2021
1 parent ccf4410 commit 6435a81
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

import apm from 'elastic-apm-node';
import { i18n } from '@kbn/i18n';
import { getDataPath } from '@kbn/utils';
import del from 'del';
import fs from 'fs';
import os from 'os';
import path from 'path';
import puppeteer from 'puppeteer';
import * as Rx from 'rxjs';
Expand Down Expand Up @@ -59,7 +59,7 @@ export class HeadlessChromiumDriverFactory {
logger.warning(`Enabling the Chromium sandbox provides an additional layer of protection.`);
}

this.userDataDir = fs.mkdtempSync(path.join(os.tmpdir(), 'chromium-'));
this.userDataDir = fs.mkdtempSync(path.join(getDataPath(), 'chromium-'));
this.getChromiumArgs = (viewport: ViewportConfig) =>
args({
userDataDir: this.userDataDir,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ import { spawn } from 'child_process';
import del from 'del';
import { mkdtempSync } from 'fs';
import { uniq } from 'lodash';
import os, { tmpdir } from 'os';
import os from 'os';
import { join } from 'path';
import { createInterface } from 'readline';
import { getDataPath } from '@kbn/utils';
import { fromEvent, merge, of, timer } from 'rxjs';
import { catchError, map, reduce, takeUntil, tap } from 'rxjs/operators';
import { ReportingCore } from '../../../';
Expand Down Expand Up @@ -61,7 +62,7 @@ export const browserStartLogs = (
const config = core.getConfig();
const proxy = config.get('capture', 'browser', 'chromium', 'proxy');
const disableSandbox = config.get('capture', 'browser', 'chromium', 'disableSandbox');
const userDataDir = mkdtempSync(join(tmpdir(), 'chromium-'));
const userDataDir = mkdtempSync(join(getDataPath(), 'chromium-'));

const platform = process.platform;
const architecture = os.arch();
Expand Down

0 comments on commit 6435a81

Please sign in to comment.