Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Marionette notes

Testing

tldr:

> mt test_path.py --setpref marionette.actors.enabled=true -vv --gecko-log -

Fission and useActors

To enable code paths guarded by MarionettePrefs.useActors pass --setpref marionette.actors.enabled=true when running a test.

We are not running with marionette.actors.enabled on CI yet, so we have to check this locally.

Enable logs

By default all logs are hidden. Pass -vv --gecko-log - to enable logging. logger.info/warn/trace/... statements in the code should now show up in the logs.

For webplatform tests, you need to pass --webdriver-arg=-vv.

Workaround missing commands

The executeScript command is not working yet with actors, but a lot of tests rely on it. They use it to gather "expected" values (example https://searchfox.org/mozilla-central/rev/30e70f2fe80c97bfbfcd975e68538cefd7f58b2a/testing/marionette/harness/marionette_harness/tests/unit/test_chrome_element_css.py#15)

For such tests, simply comment out the execute_script call and find the expected value "manually". Eg. run the test without marionette.actors.enabled, check the value, and then hardcode it in the test (or be creative).

Try

No shared preset for now, but you can set

marionette:
    query:
        - '''awsy ''ship ''base'
        - '''firefox-ui ''debug'
        - '''marionette !gpu ''debug !headless'
        - '''platform ''reftest ''debug'
        - '''platform !reftest ''-5 ''debug'
        - '''wdspec ''debug'
        - '''xpcshell ''debug !qr !spi'
    selector: fuzzy

in ~/.mozbuild/try_presets.yml.

And then ./mach try --preset marionette.

Run wpt reftests using Marionette

./mach wpt testing/web-platform/tests/css/CSS2/colors/color-001.xht --test-types reftest  --setpref marionette.log.level=Trace 
./mach wpt testing/web-platform/tests/css/css-text/writing-system/ --test-types reftest --setpref marionette.log.level=Trace --repeat 10

View WPT tests differences

For local tests you can run with --debug-test for try pushes there's a button on treeherder in the bottom panel

Use debugger with marionette harness unit tests

Pass --app-arg=--jsdebugger & --app-arg=--wait-for-jsdebugger (--app-arg will forward arguments to the APP, here firefox).

mt testing/marionette/harness/marionette_harness/tests/unit/test_reftest.py --setpref marionette.actors.enabled=true -vv --gecko-log - --app-arg=--jsdebugger --app-arg=--wait-for-jsdebugger

Add logs to WPT tests on try

Add - --setpref=marionette.log.level=trace in taskcluster/ci/test/web-platform.yml at https://searchfox.org/mozilla-central/rev/71621bfa47a371f2b1ccfd33c704913124afb933/taskcluster/ci/test/web-platform.yml#89

Wait in python tests

import time

time.sleep(1)

Build and copy geckodriver

Build:

% cd testing/geckodriver
% cargo build

Copy:

% cp target/debug/geckodriver objdir.noindex/dist/Nightly.app/Contents/MacOS/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment