Closed Bug 1902032 Opened 1 year ago Closed 7 months ago

Ensure applicable tabbrowser tests also run with vertical -tabs enabled

Categories

(Firefox :: Sidebar, task)

task

Tracking

()

RESOLVED FIXED
135 Branch
Tracking Status
firefox135 --- fixed

People

(Reporter: sclements, Assigned: sfoster)

References

(Depends on 1 open bug, Blocks 16 open bugs)

Details

(Whiteboard: [fidefe-sidebar])

Attachments

(1 file)

I think we can refactor some tests to run with both verticalTabs pref on and the default (off) rather than trying to writing all new tests for this existing functionality - this would be more around interations like mute/sound playing, etc.

Looks like we can create an alternative toml file with the tests we want to run with the sidebar.verticalTabs=true and then register that in the manifest like so: https://searchfox.org/mozilla-central/rev/4582d908c17fbf7924f5699609fe4a12c28ddc4a/dom/cache/moz.build#89-92. So we can start with important ones and gradually work through others that require refactoring.

Summary: Modify existing tabbrowser tests to account for vertical tabs → Set up new toml file to run tabbrowser tests for vertical tabs
Assignee: nobody → sclements
Status: NEW → ASSIGNED
Assignee: sclements → sfoster
Blocks: 1932786
Blocks: 1932787
Blocks: 1932790
Blocks: 1932964
Blocks: 1932997
Blocks: 1933002
Blocks: 1933597
Blocks: 1933601

Can you give the attached WIP patch a look over :aryx and :jmaher? When vertical tabs is enabled, we move the tabstrip to the sidebar and its not a given that all the things we expect to work with a horizontal tabstrip necessarily work in the vertical configuration. We have some test coverage for vertical tabs in browser/components/sidebar, but there's a trove of detailed tests, gotchas and expectations in the browser/components/tabbrowser/test/browser/tabs suite - which has been built up over the years. At a high level, we want those tests to pass in both configurations, but there are some expected differences and a lot of those tests a really about <xul:tab> and <xul:browser> not so much tabstrip or tabbed browser behavior.

So my approach here is to create a new manifest with dupe-manifest = true in the tabs directory, set the pref sidebar.verticalTabs = true and selectively include a subset of those tests to run with this configuration. This gives us apples to apples results, and also lets us skip tests that are currently failing with the pref enabled and file bugs and incrementally re-enable them. And it lets me not have to refactor or copy/paste ~100 test files, with all the risk of bitrot and maintenance headache that implies.

However, this also needs to fit into your workflow as sheriffs and not create more problems than it solves. Is it sufficiently clear when a test fails, which manifest and associated pref values it failed under? And will it be clear enough to everyone involved how and why it failed, how to reproduce the failure etc.?

Flags: needinfo?(jmaher)
Flags: needinfo?(aryx.bugmail)

An identic test name cannot be identified as running with a different configuration if it runs within the same task type, e.g. mochitest browser-chrome, shown as M(bc) in Treeherder.

The recommend way to satisfy the needs:

  • Add tag = "vertical-tabs" to each test manifest or below the test in the manifest (example)
  • Add a boolean test suite property which represents if vertical tabs are enabled or not , similar to these. It will be used to disable tests only in vertical tabs configuration.
    • Add a test variant which will run the tagged tests with the variables set which enable vertical tabs, similar to these. Suggestion for suffix: vt

Further information:

  • By default, CI failures will be classified for both horizontal and vertical tabs into one bug.
  • There are scripts available to have burndown charts for the disabled tests.
Flags: needinfo?(aryx.bugmail)

there are other examples of duplicated tests with preferences, and we support this in our CI- but when something goes wrong, we usually skip the problem with a large hammer. It is also confusing 2 years later when a new engineer is debugging a test failure and then realizes they spent hours looking at the wrong runtime mode.

I am a big advocate for test-variants as Aryx mentioned ^. This allows reuse of the same test, but then we have a key so we can do:
skip-if = os ... and vertical_tabs or skip-if = os ... and not vertical_tabs

One quirk with variants is that they survive for 6 months, and then need to be renewed. Typically variants were designed for new features coming into the browser that take longer to implement, rollout, etc.; There are some variants with expires: never, after a few rounds of this we know if we need to support both default and variant long term (no future plans for development because both modes have value) and at this point we switch to a expires: never

Flags: needinfo?(jmaher)

(In reply to Joel Maher ( :jmaher ) (UTC -8) from comment #5)

I am a big advocate for test-variants as Aryx mentioned ^. This allows reuse of the same test, but then we have a key so we can do:
skip-if = os ... and vertical_tabs or skip-if = os ... and not vertical_tabs

Ok, I'm sold on this approach and I think I understand broadly what the variant does/can do. I think really want to be able to explicitly opt-in tests (or maybe test suites). So I see examples in there for how to ensure the variant only runs for say "mochitest-browser-chrome" == task["try-name"] but it makes little sense to run most of our bc tests in this configuration so rather than adding skip-if to every browser-chrome test, I'd like to restrict to the specific files I'm currently identifying in the browser-verticalTabs.toml (and potentially others down the road) Can I add a tag to a test in the existing browser.toml and have the when clause from my variant definition only return true when the test has that tag? Is that what the MOZHARNESS_TEST_TAG does. E.g?

    merge:
        worker:
            env:
                MOZHARNESS_TEST_TAG: ["vertical-tabs-applicable"]

(I did try this quickly, but I'm either doing it wrong or it doesnt do what I think it should)

One quirk with variants is that they survive for 6 months, and then need to be renewed.

That should be fine. We can review in 6 months and see if this approach is still providing value.

Flags: needinfo?(jmaher)
Summary: Set up new toml file to run tabbrowser tests for vertical tabs → Ensure applicable tabbrowser tests also run with vertical -tabs enabled

yes, using tags is a great way to filter this down. you can see that in media-engine, and there are tags in a few manifests.

Looking forward to seeing these go live soon!

Flags: needinfo?(jmaher)
Attachment #9438702 - Attachment description: WIP: Bug 1902032 - Add new manifest to run select tabbrowser tests with sidebar.verticalTabs enabled. → WIP: Bug 1902032 - Add test variant to run select tabbrowser tests with sidebar.verticalTabs enabled.
Blocks: 1935233
Blocks: 1935247
Attachment #9438702 - Attachment description: WIP: Bug 1902032 - Add test variant to run select tabbrowser tests with sidebar.verticalTabs enabled. → Bug 1902032 - Add test variant to run select tabbrowser tests with sidebar.verticalTabs enabled. r?#tabbrowser-reviewers!,#sidebar-reviewers,jmaher
Blocks: 1935548
Blocks: 1936168
Blocks: 1936170
Blocks: 1936686
Blocks: 1936688
Pushed by sfoster@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b07b6247a0fd Add test variant to run select tabbrowser tests with sidebar.verticalTabs enabled. r=jmaher,sidebar-reviewers,tabbrowser-reviewers,taskgraph-reviewers,ahal,nsharpley

Backed out for causing python failure on test_new_config.py

Backout link

Push with failures

Failure log

Flags: needinfo?(sfoster)

Thanks for the backout. Looks like the filter function in test_new_config needs an update to expect the new variant tasks.

Flags: needinfo?(sfoster)
Pushed by sfoster@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/bca9e1e0626a Add test variant to run select tabbrowser tests with sidebar.verticalTabs enabled. r=jmaher,sidebar-reviewers,tabbrowser-reviewers,taskgraph-reviewers,ahal,nsharpley

Backed out for causing bc jobs to not run any tests.

Flags: needinfo?(sfoster)
Flags: needinfo?(sfoster)
Pushed by sfoster@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ae226b670402 Add test variant to run select tabbrowser tests with sidebar.verticalTabs enabled. r=jmaher,sidebar-reviewers,tabbrowser-reviewers,taskgraph-reviewers,ahal,nsharpley
Flags: needinfo?(sfoster)
Pushed by sfoster@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f7abae721bae Add test variant to run select tabbrowser tests with sidebar.verticalTabs enabled. r=jmaher,sidebar-reviewers,tabbrowser-reviewers,taskgraph-reviewers,ahal,nsharpley
Status: ASSIGNED → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → 135 Branch

Clearing need-info. Thank you for your patience getting this landed.

Flags: needinfo?(sfoster)
Regressions: 1938525
See Also: → 1957920
Depends on: 1976110
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: