Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proxyless: make the 'experimental' option regular #7583

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/cli/argument-parser/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ const REMOTE_ALIAS_RE = /^remote(?::(\d*))?$/;
const DESCRIPTION = dedent(`

To select a browser, specify an alias ("ie", "chrome", etc.) or the path to the browser executable. You can select more than one browser.
Use the "all" alias to run tests against all available browsers.

Use the "all" alias to run tests against all available browsers.
Use the "remote" alias to run tests on remote devices, like smartphones or tablets. Specify the number of remote browsers after the semicolon ("remote:3").
If you use a browser provider plugin, specify both the name of the plugin and the name of the browser. Separate the two with a semicolon ("saucelabs:chrome@51").

Expand Down Expand Up @@ -167,7 +167,7 @@ export default class CLIArgumentParser {
.option('--test-meta <key=value[,key2=value2,...]>', 'filter tests by metadata')
.option('--fixture-meta <key=value[,key2=value2,...]>', 'filter fixtures by metadata')
.option('--debug-on-fail', 'pause tests on failure')
.option('--experimental-proxyless', 'enable proxyless mode: https://testcafe.io/documentation/404237/guides/experimental-capabilities/proxyless-mode')
.option('--proxyless', 'enable proxyless mode')
.option('--app-init-delay <ms>', 'specify your application`s initialization time')
.option('--selector-timeout <ms>', 'specify the maximum Selector resolution time')
.option('--assertion-timeout <ms>', 'specify the maximum Assertion resolution time')
Expand Down
2 changes: 0 additions & 2 deletions src/cli/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ async function runTests (argParser) {
cache,
disableHttp2,
v8Flags,
experimentalProxyless,
disableCrossDomain,
experimentalEsm,
} = opts;
Expand All @@ -104,7 +103,6 @@ async function runTests (argParser) {
configFile,
disableHttp2,
v8Flags,
experimentalProxyless,
disableCrossDomain,
experimentalEsm,
});
Expand Down
2 changes: 1 addition & 1 deletion src/configuration/option-names.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ enum OptionNames {
debugLogger = 'debugLogger',
disableMultipleWindows = 'disableMultipleWindows',
disableHttp2 = 'disableHttp2',
experimentalProxyless = 'experimentalProxyless',
proxyless = 'proxyless',
experimentalDebug = 'experimentalDebug',
compilerOptions = 'compilerOptions',
pageRequestTimeout = 'pageRequestTimeout',
Expand Down
2 changes: 1 addition & 1 deletion src/configuration/run-option-names.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ export default [
OPTION_NAMES.pageRequestTimeout,
OPTION_NAMES.ajaxRequestTimeout,
OPTION_NAMES.retryTestPages,
OPTION_NAMES.experimentalProxyless,
OPTION_NAMES.proxyless,
OPTION_NAMES.baseUrl,
];
10 changes: 5 additions & 5 deletions src/configuration/testcafe-configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const OPTION_INIT_FLAG_NAMES = [
OPTION_NAMES.retryTestPages,
OPTION_NAMES.cache,
OPTION_NAMES.disableHttp2,
OPTION_NAMES.experimentalProxyless,
OPTION_NAMES.proxyless,
OPTION_NAMES.disableCrossDomain,
];

Expand Down Expand Up @@ -113,7 +113,7 @@ export default class TestCafeConfiguration extends Configuration {

await this.asyncMergeOptions(options);

const proxyless = this.getOption(OPTION_NAMES.experimentalProxyless);
const proxyless = this.getOption(OPTION_NAMES.proxyless);

if (proxyless)
this._ensureOptionWithValue(OPTION_NAMES.hostname, LOCALHOST_NAMES.LOCALHOST, OptionSource.Input);
Expand Down Expand Up @@ -168,14 +168,14 @@ export default class TestCafeConfiguration extends Configuration {
cache: this.getOption(OPTION_NAMES.cache),
disableHttp2: this.getOption(OPTION_NAMES.disableHttp2),
disableCrossDomain: this.getOption(OPTION_NAMES.disableCrossDomain),
proxyless: this.getOption(OPTION_NAMES.experimentalProxyless),
proxyless: this.getOption(OPTION_NAMES.proxyless),
};
}

public get browserConnectionGatewayOptions (): BrowserConnectionGatewayOptions {
return {
retryTestPages: this.getOption(OPTION_NAMES.retryTestPages),
proxyless: this.getOption(OPTION_NAMES.experimentalProxyless),
proxyless: this.getOption(OPTION_NAMES.proxyless),
};
}

Expand Down Expand Up @@ -277,7 +277,7 @@ export default class TestCafeConfiguration extends Configuration {
this._ensureOptionWithValue(OPTION_NAMES.developmentMode, DEFAULT_DEVELOPMENT_MODE, OptionSource.Configuration);
this._ensureOptionWithValue(OPTION_NAMES.retryTestPages, DEFAULT_RETRY_TEST_PAGES, OptionSource.Configuration);
this._ensureOptionWithValue(OPTION_NAMES.disableHttp2, DEFAULT_DISABLE_HTTP2, OptionSource.Configuration);
this._ensureOptionWithValue(OPTION_NAMES.experimentalProxyless, DEFAULT_PROXYLESS, OptionSource.Configuration);
this._ensureOptionWithValue(OPTION_NAMES.proxyless, DEFAULT_PROXYLESS, OptionSource.Configuration);
this._ensureOptionWithValue(OPTION_NAMES.disableCrossDomain, DEFAULT_DISABLE_CROSS_DOMAIN, OptionSource.Configuration);

this._ensureScreenshotOptions();
Expand Down
2 changes: 1 addition & 1 deletion src/runner/bootstrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ export default class Bootstrapper {
if (remotes && remotes.length % this.concurrency)
throw new GeneralError(RUNTIME_ERRORS.cannotDivideRemotesCountByConcurrency);

this.proxyless = this.configuration.getOption(OPTION_NAMES.experimentalProxyless);
this.proxyless = this.configuration.getOption(OPTION_NAMES.proxyless);

await this._setupProxy();

Expand Down
2 changes: 1 addition & 1 deletion src/runner/task/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default class Task extends AsyncEventEmitter {
this._pendingBrowserJobs = this._createBrowserJobs(proxy, this.opts);
this.testStructure = this._prepareTestStructure(tests);

this.registerClientScriptRouting(!!this.opts.experimentalProxyless);
this.registerClientScriptRouting(!!this.opts.proxyless);

if (this.opts.videoPath) {
const { videoPath, videoOptions, videoEncodingOptions } = this.opts;
Expand Down
2 changes: 1 addition & 1 deletion src/test-run/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ export default class TestRun extends AsyncEventEmitter {
}

public isProxyless (): boolean {
return !!this.opts.experimentalProxyless;
return !!this.opts.proxyless;
}

private _getRequestHookEventProvider (): RequestHookEventProvider {
Expand Down
2 changes: 1 addition & 1 deletion test/functional/fixtures/api/es-next/global-hooks/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const runTestsLocal = (testName) => {
.filter(test => {
return testName ? test === testName : true;
})
.run({ experimentalProxyless: config.proxyless })
.run({ proxyless: config.proxyless })
.then(failedCount => {
const taskReport = JSON.parse(stream.data);
const testReport = taskReport.fixtures.length === 1 ?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ createTestCafe()
return testName === 'Should log error on browser disconnect';
})
.reporter(shouldAttachReporter ? reporter : [])
.run({ experimentalProxyless: config.proxyless });
.run({ proxyless: config.proxyless });
})
.catch(function () {
return testcafe.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function run (pathToTest, filter, initializeConnection = initializeConnectionLow
.filter(testName => testName === filter)
.reporter(reporter)
.browsers(connection)
.run({ experimentalProxyless: config.proxyless });
.run({ proxyless: config.proxyless });
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if (config.useLocalBrowsers && config.hasBrowser('chrome')) {
.filter(fixtureName => fixtureName === 'Check presence of touch event handlers')
.reporter('minimal', createNullStream())
.browsers(browserAlias)
.run({ experimentalProxyless: config.proxyless });
.run({ proxyless: config.proxyless });

expect(failedCount).eql(0);
}
Expand Down Expand Up @@ -50,7 +50,7 @@ if (config.useLocalBrowsers && config.hasBrowser('chrome')) {
.src(path.join(__dirname, './testcafe-fixtures/index-test.js'))
.reporter(reporter)
.browsers('chrome:headless:emulation:device=iphone X --no-sandbox')
.run({ experimentalProxyless: config.proxyless });
.run({ proxyless: config.proxyless });

expect(prettyUserAgents.length).eql(1);
expect(prettyUserAgents[0]).endsWith('(Emulating iPhone X)');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if (config.useLocalBrowsers && !config.useHeadlessBrowsers && !config.hasBrowser
.src(path.join(__dirname, './testcafe-fixtures/index-test.js'))
.reporter('minimal', createNullStream())
.browsers('chrome:userProfile', 'firefox:userProfile')
.run({ experimentalProxyless: config.proxyless })
.run({ proxyless: config.proxyless })
.then(failedCount => {
expect(failedCount).eql(0);
});
Expand All @@ -30,7 +30,7 @@ if (config.useLocalBrowsers && !config.useHeadlessBrowsers && !config.hasBrowser
.src(path.join(__dirname, './testcafe-fixtures/index-test.js'))
.reporter('minimal', createNullStream())
.browsers(`chrome --user-data-dir=${chromeProfile.name}`, `firefox -profile ${firefoxProfile.name}`)
.run({ experimentalProxyless: config.proxyless });
.run({ proxyless: config.proxyless });
})
.then(failedCount => {
expect(failedCount).eql(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ if (config.useLocalBrowsers && !config.hasBrowser('ie')) {
end: noop,
})
.browsers(browsers)
.run({ experimentalProxyless: config.proxyless });
.run({ proxyless: config.proxyless });
}

before(function () {
Expand Down
2 changes: 1 addition & 1 deletion test/functional/fixtures/concurrency/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ if (config.useLocalBrowsers) {
})
.browsers(browsers)
.concurrency(concurrency)
.run({ experimentalProxyless: config.proxyless });
.run({ proxyless: config.proxyless });
}

function createConnections (count) {
Expand Down
18 changes: 9 additions & 9 deletions test/functional/fixtures/live/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ if (config.useLocalBrowsers) {
}, 1000);
});

return runner.run({ experimentalProxyless: config.proxyless });
return runner.run({ proxyless: config.proxyless });
})
.then(() => {
expect(helper.counter).eql(config.browsers.length * helper.testCount * runCount);
Expand All @@ -117,8 +117,8 @@ if (config.useLocalBrowsers) {
});

return runner.run({
quarantineMode: true,
experimentalProxyless: config.proxyless,
quarantineMode: true,
proxyless: config.proxyless,
});
})
.then(() => {
Expand All @@ -145,7 +145,7 @@ if (config.useLocalBrowsers) {
}, 1000);
});

return runner.run({ experimentalProxyless: config.proxyless });
return runner.run({ proxyless: config.proxyless });
})
.then(() => {
return cafe.close();
Expand Down Expand Up @@ -174,7 +174,7 @@ if (config.useLocalBrowsers) {
return runner
.browsers(config.browsers.map(browserInfo => browserInfo.browserName))
.src(path.join(__dirname, '/testcafe-fixtures/test-2.js'))
.run({ experimentalProxyless: config.proxyless })
.run({ proxyless: config.proxyless })
.then(() => {
return cafe.close();
})
Expand All @@ -185,7 +185,7 @@ if (config.useLocalBrowsers) {
}, 10000);

return runner
.run({ experimentalProxyless: config.proxyless });
.run({ proxyless: config.proxyless });
});

return promise;
Expand Down Expand Up @@ -234,7 +234,7 @@ if (config.useLocalBrowsers) {
});

return runner
.run({ experimentalProxyless: config.proxyless })
.run({ proxyless: config.proxyless })
.then(() => {
return cafe.close();
});
Expand All @@ -252,7 +252,7 @@ if (config.useLocalBrowsers) {
}, 1000);
});

await runner.run({ experimentalProxyless: config.proxyless });
await runner.run({ proxyless: config.proxyless });

return cafe.close();
});
Expand Down Expand Up @@ -288,7 +288,7 @@ if (config.useLocalBrowsers) {
expect(inTestProcessName).eql(ProcessTitle.service);
}, 1000);

return runner.run({ experimentalProxyless: config.proxyless });
return runner.run({ proxyless: config.proxyless });
})
.then(() => {
if (fs.existsSync(markerFile))
Expand Down
10 changes: 5 additions & 5 deletions test/functional/fixtures/proxyless/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const config = require('../../config.js');

let testCafe = null;

async function runTest ({ browsers, test, experimentalProxyless }) {
async function runTest ({ browsers, test, proxyless }) {
const runner = testCafe.createRunner();
const source = path.join(__dirname, './testcafe-fixtures/index.js');

Expand All @@ -14,7 +14,7 @@ async function runTest ({ browsers, test, experimentalProxyless }) {
.filter(testName => {
return testName ? test === testName : true;
})
.run({ experimentalProxyless });
.run({ proxyless });

if (failedCount)
throw new Error('Error has occurred.');
Expand All @@ -39,14 +39,14 @@ if (thereAreAllRequiredBrowsers) {
return runTest({ browsers: 'chrome', test: 'Disabled' });
});

it('Enabled with the "experimentalProxyless" option', function () {
return runTest({ browsers: 'chrome', test: 'Enabled', experimentalProxyless: true });
it('Enabled with the "proxyless" option', function () {
return runTest({ browsers: 'chrome', test: 'Enabled', proxyless: true });
});

it('Should throw error on running with unsupported browser', function () {
let errorIsRaised = false;

return runTest({ browsers: ['chrome', 'firefox'], test: 'Disabled', experimentalProxyless: true })
return runTest({ browsers: ['chrome', 'firefox'], test: 'Disabled', proxyless: true })
.catch(err => {
errorIsRaised = true;

Expand Down
2 changes: 1 addition & 1 deletion test/functional/fixtures/regression/gh-3049/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if (isLocalChrome) {
return testCafe.createRunner()
.browsers(`chrome${headless} --window-size=1,1`)
.src(path.join(__dirname, './testcafe-fixtures/index.js'))
.run({ experimentalProxyless: config.proxyless });
.run({ proxyless: config.proxyless });
})
.then(failed => {
failedCount = failed;
Expand Down
2 changes: 1 addition & 1 deletion test/functional/fixtures/regression/gh-3456/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (config.useLocalBrowsers) {
.src(fixturePath)
.browsers(browsers)
.screenshots(SCREENSHOTS_PATH)
.run({ experimentalProxyless: config.proxyless });
.run({ proxyless: config.proxyless });
})
.then(failedCount => {
expect(failedCount).eql(0);
Expand Down
2 changes: 1 addition & 1 deletion test/functional/fixtures/regression/gh-3929/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (config.useLocalBrowsers && !config.useHeadlessBrowsers) {
return testCafe.createRunner()
.browsers(`chrome`)
.src(path.join(__dirname, './testcafe-fixtures/index.js'))
.run({ experimentalProxyless: config.proxyless });
.run({ proxyless: config.proxyless });
})
.then(failed => {
failedCount = failed;
Expand Down
2 changes: 1 addition & 1 deletion test/functional/fixtures/regression/gh-4675/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if (config.useLocalBrowsers && !config.useHeadlessBrowsers) {
.browsers(`chrome`)
.src(path.join(__dirname, './testcafe-fixtures/index.js'))
.reporter([customReporter('custom1'), customReporter('custom2')])
.run({ experimentalProxyless: config.proxyless });
.run({ proxyless: config.proxyless });
})
.catch(err => {
error = err;
Expand Down
2 changes: 1 addition & 1 deletion test/functional/fixtures/regression/gh-4787/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ if (config.useLocalBrowsers && !config.useHeadlessBrowsers) {
.src(path.join(__dirname, './testcafe-fixtures/index.js'))
.browsers(['chrome', 'firefox'])
.reporter(reporter)
.run({ experimentalProxyless: config.proxyless });
.run({ proxyless: config.proxyless });
})
.then(() => {
return cafe.close();
Expand Down
2 changes: 1 addition & 1 deletion test/functional/fixtures/regression/gh-5239/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ async function run ({ src, browsers, retryTestPages, reporter }) {
if (reporter)
runner.reporter(reporter);

await runner.run({ experimentalProxyless: config.proxyless });
await runner.run({ proxyless: config.proxyless });

await testcafe.close();
}
Expand Down
2 changes: 1 addition & 1 deletion test/functional/fixtures/regression/gh-5549/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if (config.useLocalBrowsers) {
.createRunner()
.browsers('chrome:headless')
.src(path.join(__dirname, './testcafe-fixtures/index.js'))
.run({ experimentalProxyless: config.proxyless });
.run({ proxyless: config.proxyless });
})
.then(failed => {
failedCount = failed;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ async function run ({ src, browser }) {
await testcafe.createRunner()
.src(path.join(__dirname, src))
.browsers(browser)
.run({ experimentalProxyless: config.proxyless });
.run({ proxyless: config.proxyless });

await testcafe.close();
}
Expand Down
2 changes: 1 addition & 1 deletion test/functional/fixtures/runner/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function run (browsers, testFile) {
.createRunner()
.src(path.join(__dirname, testFile))
.browsers(browsers)
.run({ experimentalProxyless: config.proxyless });
.run({ proxyless: config.proxyless });
}

describe('Runner', () => {
Expand Down
Loading