diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 8b27fe6038..9eeb1b5986 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -31,4 +31,6 @@ jobs: - name: Test WebPageReplay with Chrome run: docker run --cap-add=NET_ADMIN --rm -v "$(pwd)":/sitespeed.io -e REPLAY=true -e LATENCY=100 sitespeedio/sitespeed.io https://www.sitespeed.io -n 3 -b chrome - name: Test WebPageReplay with Firefox - run: docker run --cap-add=NET_ADMIN --rm -v "$(pwd)":/sitespeed.io --network=host -e REPLAY=true -e LATENCY=100 sitespeedio/sitespeed.io https://www.sitespeed.io -n 3 -b firefox --browsertime.firefox.acceptInsecureCerts true \ No newline at end of file + run: docker run --cap-add=NET_ADMIN --rm -v "$(pwd)":/sitespeed.io --network=host -e REPLAY=true -e LATENCY=100 sitespeedio/sitespeed.io https://www.sitespeed.io -n 3 -b firefox --browsertime.firefox.acceptInsecureCerts true + - name: Run Chrome test with config + run: docker run --rm -v "$(pwd)":/sitespeed.io --network=host sitespeedio/sitespeed.io http://127.0.0.1:3001 -b chrome --config test/exampleConfig.json diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 76d8972ce8..5005970287 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -67,4 +67,6 @@ jobs: - name: Run test with Influx 1.8 run: bin/sitespeed.js http://127.0.0.1:3001/simple/ -n 1 --influxdb.host 127.0.0.1 --xvfb --logToFile - name: Run test with Influx 2.6.1 - run: bin/sitespeed.js http://127.0.0.1:3001/simple/ -n 1 --influxdb.host 127.0.0.1 --influxdb.port 8087 --influxdb.version 2 --influxdb.organisation sitespeed --influxdb.token sitespeed --xvfb \ No newline at end of file + run: bin/sitespeed.js http://127.0.0.1:3001/simple/ -n 1 --influxdb.host 127.0.0.1 --influxdb.port 8087 --influxdb.version 2 --influxdb.organisation sitespeed --influxdb.token sitespeed --xvfb + - name: Run Chrome test with config + run: node bin/sitespeed.js --config test/exampleConfig.json http://127.0.0.1:3001/simple/ --xvfb \ No newline at end of file diff --git a/.github/workflows/safari.yml b/.github/workflows/safari.yml index ea5cb41a4d..e799fd417d 100644 --- a/.github/workflows/safari.yml +++ b/.github/workflows/safari.yml @@ -25,3 +25,5 @@ jobs: run: (serve test/data/html/ -l 3001&) - name: Run test run: bin/sitespeed.js -b safari http://127.0.0.1:3001/ + - name: Run Safari test with config + run: node bin/sitespeed.js -b safari --config test/exampleConfig.json http://127.0.0.1:3001/ diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 2c76fe1dbd..fcf992a5f7 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -29,4 +29,7 @@ jobs: - name: Run Edge test with scripting run: node bin/sitespeed.js -b edge --multi test/prepostscripts/multiWindows.cjs -n 1 shell: cmd + - name: Run Edge test with config + run: node bin/sitespeed.js -b edge --config test/exampleConfig.json https://www.sitespeed.io/ + shell: cmd \ No newline at end of file diff --git a/lib/cli/cli.js b/lib/cli/cli.js index 5c3f400799..655856e296 100644 --- a/lib/cli/cli.js +++ b/lib/cli/cli.js @@ -2064,9 +2064,7 @@ export async function parseCommandLine() { if (argv.config) { const config = JSON.parse( - await readFileSync( - new URL(resolve(process.cwd(), argv.config), import.meta.url) - ) + await readFileSync(resolve(process.cwd(), argv.config)) ); explicitOptions = merge(explicitOptions, config); } diff --git a/test/exampleConfig.json b/test/exampleConfig.json new file mode 100644 index 0000000000..ba0fb8b73c --- /dev/null +++ b/test/exampleConfig.json @@ -0,0 +1,5 @@ +{ + "browsertime": { + "iterations" : 1 + } +} \ No newline at end of file