[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [Git][tpo/applications/tor-browser-bundle-testsuite][main] 2 commits: Bug 40110: Add suite to run mochitests



Title: GitLab

brizental pushed to branch main at The Tor Project / Applications / tor-browser-bundle-testsuite

Commits:

  • fa0bac4b
    by Beatriz Rizental at 2026-11-26T18:02:46-03:00
    Bug 40110: Add suite to run mochitests
    
  • 8159429d
    by Beatriz Rizental at 2026-11-26T18:19:11-03:00
    Bug 40120: Add suite filter to job inputs
    

7 changed files:

Changes:

  • .gitlab-ci.yml
    ... ... @@ -4,6 +4,7 @@ spec:
    4 4
     ---
    
    5 5
     stages:
    
    6 6
       - test-xpcshell
    
    7
    +  - test-mochitest
    
    7 8
       - test-marionette
    
    8 9
     
    
    9 10
     default:
    
    ... ... @@ -19,6 +20,7 @@ include:
    19 20
         inputs:
    
    20 21
           mozharness_url: $[[ inputs.mozharness_url ]]
    
    21 22
           tags: $[[ inputs.tags ]]
    
    23
    +      suites: $[[ inputs.suites ]]
    
    22 24
           android_x86_64_installer_url: $[[ inputs.android_x86_64_installer_url ]]
    
    23 25
           android_x86_64_package_name: $[[ inputs.android_x86_64_package_name ]]
    
    24 26
           android_x86_64_artifacts_url: $[[ inputs.android_x86_64_artifacts_url ]]
    
    ... ... @@ -33,4 +35,5 @@ include:
    33 35
           windows_x86_64_artifacts_url: $[[ inputs.windows_x86_64_artifacts_url ]]
    
    34 36
           windows_x86_64_sha256sums_url: $[[ inputs.windows_x86_64_sha256sums_url ]]
    
    35 37
       - local: '.gitlab/test_xpcshell.yml'
    
    38
    +  - local: '.gitlab/test_mochitest.yml'
    
    36 39
       - local: '.gitlab/test_marionette.yml'

  • .gitlab/README.md
    ... ... @@ -88,7 +88,8 @@ The pipeline accepts the following inputs:
    88 88
     - `android_x86_64_artifacts_url`: URL to the Android test artifacts, including `target.test_packages.json`.
    
    89 89
     - `android_x86_64_sha256sums_url`: URL to the Android `sha256sums.txt` file. Optional. When provided, the job checks this URL is reachable before running the full test suite.
    
    90 90
     - `android_x86_64_package_name`: Android package name to test.
    
    91
    -- `tag`: Tag used to filter tests. Defaults to `""`.
    
    91
    +- `tags`: Space-separated `--tag` flags used to filter tests. Defaults to `""`.
    
    92
    +- `suites`: Space- or comma-separated list of test suites to run, e.g. `"xpcshell mochitest-plain"`. Accepted names are `xpcshell`, `mochitest-plain`, `mochitest-browser`, `mochitest` (runs both `mochitest-plain` and `mochitest-browser`) and `marionette`. Defaults to `""`, which runs all suites.
    
    92 93
     
    
    93 94
     All inputs default to the empty string. The platform-specific inputs are optional when triggering the pipeline as a whole, but the installer URL, artifacts URL, and (for Android) package name must be provided together for that platform's job to run.
    
    94 95
     
    
    ... ... @@ -106,4 +107,6 @@ That means the set of jobs in the pipeline depends on the inputs you provide:
    106 107
     - If you provide the Windows installer and artifacts inputs, the Windows Marionette job is included.
    
    107 108
     - If you provide the Android installer URL, artifacts URL, and package name, the Android Marionette job is included.
    
    108 109
     
    
    110
    +On top of that, if `suites` is not empty, only jobs whose suite is listed in it are included. Each test job declares its suite through the `SUITE_PATTERN` variable, which the shared `.suites_filter` rule in [`_base.yml`](./_base.yml) matches against `suites`. The mochitest matrix jobs are the exception: GitLab puts every matrix variable in the job name, so they match on `MOCHITEST_SUITE` through `.mochitest_suites_filter` in [`test_mochitest.yml`](./test_mochitest.yml) instead.
    
    111
    +
    
    109 112
     If a platform-specific input is missing or left as an empty string, that platform's job is skipped entirely rather than starting and failing later. In other words, one triggered pipeline can run one platform, several platforms, or all platforms, depending on which input set you send.

  • .gitlab/_base.yml
    ... ... @@ -5,6 +5,16 @@ spec:
    5 5
     variables:
    
    6 6
       MOZHARNESS_URL: "$[[ inputs.mozharness_url ]]"
    
    7 7
       TAGS: "$[[ inputs.tags ]]"
    
    8
    +  SUITES: "$[[ inputs.suites ]]"
    
    9
    +
    
    10
    +# Skips a job when the `suites` input is set and does not list the job's suite.
    
    11
    +# Every test job must define `SUITE_PATTERN`, a regex matching its suite name
    
    12
    +# as an entry of the space- or comma-separated `suites` list, or (for matrix
    
    13
    +# jobs, see test_mochitest.yml) provide equivalent rules of its own.
    
    14
    +.suites_filter:
    
    15
    +  rules:
    
    16
    +    - if: $SUITES != "" && $SUITE_PATTERN && $SUITES !~ $SUITE_PATTERN
    
    17
    +      when: never
    
    8 18
     
    
    9 19
     .common:
    
    10 20
       allow_failure: true
    
    ... ... @@ -25,6 +35,7 @@ variables:
    25 35
         - debian-trixie-x86_64
    
    26 36
     
    
    27 37
       rules:
    
    38
    +    - !reference [.suites_filter, rules]
    
    28 39
         - if: $CI_PIPELINE_SOURCE == "trigger" && "$[[ inputs.mozharness_url ]]" != "" && "$[[ inputs.debian_x86_64_installer_url ]]" != "" && "$[[ inputs.debian_x86_64_artifacts_url ]]" != ""
    
    29 40
           when: on_success
    
    30 41
         - when: never
    
    ... ... @@ -51,6 +62,7 @@ variables:
    51 62
         - macos-sonoma-x86_64
    
    52 63
     
    
    53 64
       rules:
    
    65
    +    - !reference [.suites_filter, rules]
    
    54 66
         - if: $CI_PIPELINE_SOURCE == "trigger" && "$[[ inputs.mozharness_url ]]" != "" && "$[[ inputs.macos_x86_64_installer_url ]]" != "" && "$[[ inputs.macos_x86_64_artifacts_url ]]" != ""
    
    55 67
           when: on_success
    
    56 68
         - when: never
    
    ... ... @@ -71,6 +83,7 @@ variables:
    71 83
         - windows-11-x86_64
    
    72 84
     
    
    73 85
       rules:
    
    86
    +    - !reference [.suites_filter, rules]
    
    74 87
         - if: $CI_PIPELINE_SOURCE == "trigger" && "$[[ inputs.mozharness_url ]]" != "" && "$[[ inputs.windows_x86_64_installer_url ]]" != "" && "$[[ inputs.windows_x86_64_artifacts_url ]]" != ""
    
    75 88
           when: on_success
    
    76 89
         - when: never
    
    ... ... @@ -88,6 +101,7 @@ variables:
    88 101
       extends: .debian-x86_64
    
    89 102
     
    
    90 103
       rules:
    
    104
    +    - !reference [.suites_filter, rules]
    
    91 105
         - if: '$CI_PIPELINE_SOURCE == "trigger" && "$[[ inputs.mozharness_url ]]" != "" && "$[[ inputs.android_x86_64_installer_url ]]" != "" && "$[[ inputs.android_x86_64_artifacts_url ]]" != "" && "$[[ inputs.android_x86_64_package_name ]]" != ""'
    
    92 106
           when: on_success
    
    93 107
         - when: never
    

  • .gitlab/_inputs.yml
    ... ... @@ -7,6 +7,10 @@ inputs:
    7 7
         type: string
    
    8 8
         default: ""
    
    9 9
         description: "Space-separated --tag flags (e.g. '--tag foo --tag bar'). Will run all tests if not provided"
    
    10
    +  suites:
    
    11
    +    type: string
    
    12
    +    default: ""
    
    13
    +    description: "Space- or comma-separated list of test suites to run (xpcshell, mochitest, mochitest-plain, mochitest-browser, marionette; mochitest runs both mochitest suites). Will run all suites if not provided"
    
    10 14
     
    
    11 15
       android_x86_64_installer_url:
    
    12 16
         type: string
    

  • .gitlab/test_marionette.yml
    ... ... @@ -14,6 +14,8 @@
    14 14
     debian-x86_64_marionette:
    
    15 15
       extends: [.debian-x86_64, .marionette-variants]
    
    16 16
       stage: test-marionette
    
    17
    +  variables:
    
    18
    +    SUITE_PATTERN: '/(^|[ ,])marionette([ ,]|$)/'
    
    17 19
       script:
    
    18 20
         - >
    
    19 21
           python3 "$(pwd)/mozharness/scripts/marionette.py"
    
    ... ... @@ -27,6 +29,8 @@ debian-x86_64_marionette:
    27 29
     macos-x86_64_marionette:
    
    28 30
       extends: [.macos-x86_64, .marionette-variants]
    
    29 31
       stage: test-marionette
    
    32
    +  variables:
    
    33
    +    SUITE_PATTERN: '/(^|[ ,])marionette([ ,]|$)/'
    
    30 34
       script:
    
    31 35
         - >
    
    32 36
           python3 "$(pwd)/mozharness/scripts/marionette.py"
    
    ... ... @@ -40,6 +44,8 @@ macos-x86_64_marionette:
    40 44
     windows-x86_64_marionette:
    
    41 45
       extends: [.windows-x86_64, .marionette-variants]
    
    42 46
       stage: test-marionette
    
    47
    +  variables:
    
    48
    +    SUITE_PATTERN: '/(^|[ ,])marionette([ ,]|$)/'
    
    43 49
       script:
    
    44 50
         - >
    
    45 51
           python3 "$(pwd)/mozharness/scripts/marionette.py"
    
    ... ... @@ -53,6 +59,8 @@ windows-x86_64_marionette:
    53 59
     android-x86_64_marionette:
    
    54 60
       extends: [.android-x86_64, .marionette-variants]
    
    55 61
       stage: test-marionette
    
    62
    +  variables:
    
    63
    +    SUITE_PATTERN: '/(^|[ ,])marionette([ ,]|$)/'
    
    56 64
       script:
    
    57 65
         - >
    
    58 66
           python3 "$(pwd)/mozharness/scripts/android_emulator_unittest.py"
    

  • .gitlab/test_mochitest.yml
    1
    +.mochitest:
    
    2
    +  stage: test-mochitest
    
    3
    +  parallel:
    
    4
    +    matrix:
    
    5
    +      - MOCHITEST_SUITE:
    
    6
    +          - mochitest-plain
    
    7
    +          - mochitest-browser-chrome
    
    8
    +      # We have no chrome tests to run currently. These tests are slowly
    
    9
    +      # being deprecated by Mozilla, and new ones should not be added.
    
    10
    +      # See: https://firefox-source-docs.mozilla.org/testing/chrome-tests/index.html#disclaimer
    
    11
    +      # Add `mochitest-chrome` to the list above and a matching rule to
    
    12
    +      # `.mochitest_suites_filter` below to enable them.
    
    13
    +
    
    14
    +# The suite filter is keyed on `MOCHITEST_SUITE` rather than set through a
    
    15
    +# per-entry `SUITE_PATTERN`, because GitLab adds every matrix variable to the job
    
    16
    +# name. Matrix jobs must list these rules ahead of their platform rules.
    
    17
    +.mochitest_suites_filter:
    
    18
    +  rules:
    
    19
    +    - if: $SUITES != "" && $MOCHITEST_SUITE == "mochitest-plain" && $SUITES !~ /(^|[ ,])mochitest(-plain)?([ ,]|$)/
    
    20
    +      when: never
    
    21
    +    - if: $SUITES != "" && $MOCHITEST_SUITE == "mochitest-browser-chrome" && $SUITES !~ /(^|[ ,])mochitest(-browser)?([ ,]|$)/
    
    22
    +      when: never
    
    23
    +
    
    24
    +debian-x86_64_mochitest:
    
    25
    +  extends:
    
    26
    +    - .debian-x86_64
    
    27
    +    - .mochitest
    
    28
    +  rules:
    
    29
    +    - !reference [.mochitest_suites_filter, rules]
    
    30
    +    - !reference [.debian-x86_64, rules]
    
    31
    +  script:
    
    32
    +    - >
    
    33
    +      python3 "$(pwd)/mozharness/scripts/desktop_unittest.py"
    
    34
    +      --config-file "$(pwd)/mozharness/configs/unittests/linux_unittest.py"
    
    35
    +      --mochitest-suite "$MOCHITEST_SUITE"
    
    36
    +      --installer-url "$INSTALLER_URL"
    
    37
    +      --test-packages-url "$ARTIFACTS_URL/target.test_packages.json"
    
    38
    +      --headless
    
    39
    +      $TAGS
    
    40
    +
    
    41
    +macos-x86_64_mochitest:
    
    42
    +  extends:
    
    43
    +    - .macos-x86_64
    
    44
    +    - .mochitest
    
    45
    +  rules:
    
    46
    +    - !reference [.mochitest_suites_filter, rules]
    
    47
    +    - !reference [.macos-x86_64, rules]
    
    48
    +  script:
    
    49
    +    - >
    
    50
    +      python3 "$(pwd)/mozharness/scripts/desktop_unittest.py"
    
    51
    +      --config-file "$(pwd)/mozharness/configs/unittests/mac_unittest.py"
    
    52
    +      --mochitest-suite "$MOCHITEST_SUITE"
    
    53
    +      --installer-url "$INSTALLER_URL"
    
    54
    +      --test-packages-url "$ARTIFACTS_URL/target.test_packages.json"
    
    55
    +      --headless
    
    56
    +      $TAGS
    
    57
    +
    
    58
    +windows-x86_64_mochitest:
    
    59
    +  extends:
    
    60
    +    - .windows-x86_64
    
    61
    +    - .mochitest
    
    62
    +  rules:
    
    63
    +    - !reference [.mochitest_suites_filter, rules]
    
    64
    +    - !reference [.windows-x86_64, rules]
    
    65
    +  script:
    
    66
    +    - >
    
    67
    +      python3 "$(pwd)/mozharness/scripts/desktop_unittest.py"
    
    68
    +      --config-file "$(pwd)/mozharness/configs/unittests/win_unittest.py"
    
    69
    +      --mochitest-suite "$MOCHITEST_SUITE"
    
    70
    +      --installer-url "$INSTALLER_URL"
    
    71
    +      --test-packages-url "$ARTIFACTS_URL/target.test_packages.json"
    
    72
    +      --pip-index
    
    73
    +      --headless
    
    74
    +      ($env:TAGS -split ' ')
    
    75
    +
    
    76
    +# Note: Only mochitest-plain is supported on android.
    
    77
    +android-x86_64_mochitest:
    
    78
    +  extends: .android-x86_64
    
    79
    +  stage: test-mochitest
    
    80
    +  variables:
    
    81
    +    SUITE_PATTERN: '/(^|[ ,])mochitest(-plain)?([ ,]|$)/'
    
    82
    +  script:
    
    83
    +    - >
    
    84
    +      python3 "$(pwd)/mozharness/scripts/android_emulator_unittest.py"
    
    85
    +      --config-file "$(pwd)/mozharness/configs/android/android_common.py"
    
    86
    +      --config-file "$(pwd)/mozharness/configs/android/android14-x86_64.py"
    
    87
    +      --test-suite=mochitest-plain
    
    88
    +      --installer-url "$INSTALLER_URL"
    
    89
    +      --test-packages-url "$ARTIFACTS_URL/target.test_packages.json"
    
    90
    +      $TAGS

  • .gitlab/test_xpcshell.yml
    1 1
     debian-x86_64_xpcshell:
    
    2 2
       extends: .debian-x86_64
    
    3 3
       stage: test-xpcshell
    
    4
    +  variables:
    
    5
    +    SUITE_PATTERN: '/(^|[ ,])xpcshell([ ,]|$)/'
    
    4 6
       script:
    
    5 7
         - >
    
    6 8
           python3 "$(pwd)/mozharness/scripts/desktop_unittest.py"
    
    ... ... @@ -13,6 +15,8 @@ debian-x86_64_xpcshell:
    13 15
     macos-x86_64_xpcshell:
    
    14 16
       extends: .macos-x86_64
    
    15 17
       stage: test-xpcshell
    
    18
    +  variables:
    
    19
    +    SUITE_PATTERN: '/(^|[ ,])xpcshell([ ,]|$)/'
    
    16 20
       script:
    
    17 21
         - >
    
    18 22
           python3 "$(pwd)/mozharness/scripts/desktop_unittest.py"
    
    ... ... @@ -25,6 +29,8 @@ macos-x86_64_xpcshell:
    25 29
     windows-x86_64_xpcshell:
    
    26 30
       extends: .windows-x86_64
    
    27 31
       stage: test-xpcshell
    
    32
    +  variables:
    
    33
    +    SUITE_PATTERN: '/(^|[ ,])xpcshell([ ,]|$)/'
    
    28 34
       script:
    
    29 35
         - >
    
    30 36
           python3 "$(pwd)/mozharness/scripts/desktop_unittest.py"
    
    ... ... @@ -38,6 +44,8 @@ windows-x86_64_xpcshell:
    38 44
     android-x86_64_xpcshell:
    
    39 45
       extends: .android-x86_64
    
    40 46
       stage: test-xpcshell
    
    47
    +  variables:
    
    48
    +    SUITE_PATTERN: '/(^|[ ,])xpcshell([ ,]|$)/'
    
    41 49
       script:
    
    42 50
         - >
    
    43 51
           python3 "$(pwd)/mozharness/scripts/android_emulator_unittest.py"
    

  • _______________________________________________
    tor-commits mailing list -- tor-commits@xxxxxxxxxxxxxxxxxxxx
    To unsubscribe send an email to tor-commits-leave@xxxxxxxxxxxxxxxxxxxx