grafana / k6x

Run k6 with extensions
GNU Affero General Public License v3.0
13 stars 3 forks source link

Docker image does not support running browser tests #25

Open pablochacin opened 12 months ago

pablochacin commented 12 months ago

Brief summary

When running a test script that imports the browser experimental extension the test fails because the browser binary is not present in the image. As the browser is an experimental feature already integrated into k6, this should be supported by default.

k6 version

0.46

xk6-dashboard version

v0.4.0

OS

Linux

Docker version and image (if applicable)

No response

Steps to reproduce the problem

Create this test script localy as browser.js

import { browser } from 'k6/experimental/browser';

export const options = {
  scenarios: {
    ui: {
      executor: 'shared-iterations',
      options: {
        browser: {
          type: 'chromium',
        },
      },
    },
  },
}

export default async function () {
  const page = browser.newPage();

  try {
    await page.goto('https://test.k6.io/');
  } finally {
    page.close();
  }
}

Launch k6x image with the following command:

docker run -it  --mount type=bind,src=$PWD/browser.js,dst=/home/k6x/browser.js  szkiba/k6x:v0.4.0 run browser.js

Expected behaviour

The test runs successfully

Actual behaviour

Error message

ERRO[0001] error building browser on IterStart: launching browser: exec: no command at file:///home/k6x/browser.js:16:15(0)