diff --git a/testrunner/config/default.yaml b/testrunner/config/default.yaml index 1afb7ee..7cd60ee 100644 --- a/testrunner/config/default.yaml +++ b/testrunner/config/default.yaml @@ -20,13 +20,13 @@ location: # containers, you need to set --s3.endpoint to something else than 127.0.0.1. # On Mac you can use --s3.endpoint http://host.docker.internal:9000 and on Linux # you can use your actual IP. - useDocker: true + useDocker: false - name: "Emulated Mobile" type: "emulatedMobile" browsers: ["chrome"] connectivity: ["native", "3g", "4g", "cable"] - useDocker: true + useDocker: false # Here's an example of setting up a Android phone #- name: "Android" @@ -64,10 +64,12 @@ executable: "sitespeed.io" # If you run sitespeed.io using Docker this is the container that is used. # If you use the latest, make sure to docker pull the container once a day # to get the latest version -# extraparameters will be passed omn to Docker, between docker run and the container name +# extraparameters will be passed on to Docker, between docker run and the container name +# baselineDddir is the directory that is mappedd where baseline data is stored docker: container: "sitespeedio/sitespeed.io:latest" extraparameters: "--cap-add=NET_ADMIN" + #baselinedir: "$(pwd)" # The number of jobs to keep in the queue # Depending on how many jobs you run and how much memory diff --git a/testrunner/src/testrunners/docker-testrunner.js b/testrunner/src/testrunners/docker-testrunner.js index efd393f..db34eea 100644 --- a/testrunner/src/testrunners/docker-testrunner.js +++ b/testrunner/src/testrunners/docker-testrunner.js @@ -58,7 +58,9 @@ export default async function runJob(job) { configFileName, resultFileName, (job.data.extras && job.data.extras.includes('--webpagereplay')) || - job.data.config.webpagereplay + job.data.config.webpagereplay, + (job.data.extras && job.data.extras.includes('--compare.')) || + job.data.config.compare ); if (job.data.scripting) { @@ -156,7 +158,8 @@ function setupDockerParameters( workingDirectory, configFileName, resultFileName, - usingWebPageReplay + usingWebPageReplay, + usingBaseline ) { const baseParameters = [ 'run', @@ -177,6 +180,12 @@ function setupDockerParameters( if (usingWebPageReplay) { baseParameters.splice(1, 0, '-e', 'REPLAY=true', '-e', 'LATENCY=100'); } + + if (usingBaseline) { + const baselineDirectory = nconf.get('docker:baselinedir') || '"$(pwd)"'; + baseParameters.splice(1, 0, '-v', `${baselineDirectory}:/baseline`); + } + return baseParameters; } diff --git a/testrunner/src/validateconfig.js b/testrunner/src/validateconfig.js index a787787..121af6d 100644 --- a/testrunner/src/validateconfig.js +++ b/testrunner/src/validateconfig.js @@ -54,7 +54,8 @@ const loggingSchema = Joi.object({ // Docker schema const dockerSchema = Joi.object({ container: Joi.string().optional(), - extraparameters: Joi.string().allow(null).optional() + extraparameters: Joi.string().allow(null).optional(), + baselinedir: Joi.string().allow(null).optional() }); // Complete config schema