Skip to content

Commit

Permalink
Pass remote opts
Browse files Browse the repository at this point in the history
  • Loading branch information
jscasca committed Jun 19, 2024
1 parent 52d40f8 commit 3e4c8e8
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,23 +72,26 @@ const bedrockHeadless = (tests, browser, auto) => {
}
};

const bedrockBrowser = (tests, browserName, osName, bucket, buckets, chunk, auto) => {
const bedrockBrowser = (tests, browserName, osName, bucket, buckets, chunk, remote, auto, opts) => {
const name = opts.name ? opts.name : `${browserName}-${osName}`;
if (tests.length === 0) {
return {};
} else {
return {
browser: {
...bedrockDefaults,
overallTimeout: 1200000,
name: `${browserName}-${osName}`,
overallTimeout: 3600000,
name: name,
browser: browserName,
testfiles: testFolders(tests, auto),
bucket: bucket,
buckets: buckets,
chunk: chunk,
remote: remote,

// we have a few tests that don't play nicely when combined together in the monorepo
retries: 3
retries: 3,
...opts
}
};
}
Expand Down Expand Up @@ -138,6 +141,18 @@ module.exports = function (grunt) {
const activeBrowser = grunt.option('bedrock-browser') || 'chrome-headless';
const headlessBrowser = activeBrowser.endsWith("-headless") ? activeBrowser : 'chrome-headless';
const activeOs = grunt.option('bedrock-os') || 'tests';

const remote = grunt.option('remote');

const bedrockOpts = (grunt, availableOpts) => {
return availableOpts.reduce((opts, opt) => {
const current = grunt.option(opt);
if (current) opts[opt] = current;
return opts;
}, {});
};

const opts = bedrockOpts(grunt, ['name', 'username', 'accesskey', 'sishDomain', 'devicefarmArn', 'devicefarmRegion', 'platformName', 'browserVersion']);
const gruntConfig = {
shell: {
tsc: { command: 'yarn -s tsc' },
Expand All @@ -147,11 +162,11 @@ module.exports = function (grunt) {
},
'bedrock-auto': {
...bedrockHeadless(headlessTests, headlessBrowser, true),
...bedrockBrowser(browserTests, activeBrowser, activeOs, bucket, buckets, chunk, true)
...bedrockBrowser(browserTests, activeBrowser, activeOs, bucket, buckets, chunk, remote, true, opts)
},
'bedrock-manual': {
...bedrockHeadless(headlessTests, headlessBrowser, false),
...bedrockBrowser(browserTests, activeBrowser, activeOs, bucket, buckets, chunk, false)
...bedrockBrowser(browserTests, activeBrowser, activeOs, bucket, buckets, chunk, remote, false, opts)
}
};

Expand Down Expand Up @@ -206,4 +221,4 @@ Top-level grunt has been replaced by 'yarn build', and the output has moved from
config: 'package.json',
pattern: ['@ephox/bedrock-server', 'grunt-shell']
});
};
};

0 comments on commit 3e4c8e8

Please sign in to comment.