boklm pushed to branch main at The Tor Project / Applications / tor-browser-bundle-testsuite Commits: 763ab6a8 by Beatriz Rizental at 2026-06-10T17:43:50-03:00 Bug 40113: Pass test tag as an argument for test jobs - - - - - 7 changed files: - .gitlab-ci.yml - .gitlab/README.md - .gitlab/_base.yml - .gitlab/_inputs.yml - .gitlab/test_marionette.yml - config/tb-build-06.torproject.org - tools/trigger-test-pipeline.py Changes: ===================================== .gitlab-ci.yml ===================================== @@ -17,6 +17,7 @@ include: - local: '.gitlab/_base.yml' inputs: mozharness_url: $[[ inputs.mozharness_url ]] + tag: $[[ inputs.tag ]] android_x86_64_installer_url: $[[ inputs.android_x86_64_installer_url ]] android_x86_64_package_name: $[[ inputs.android_x86_64_package_name ]] android_x86_64_artifacts_url: $[[ inputs.android_x86_64_artifacts_url ]] ===================================== .gitlab/README.md ===================================== @@ -88,6 +88,7 @@ The pipeline accepts the following inputs: - `android_x86_64_artifacts_url`: URL to the Android test artifacts, including `target.test_packages.json`. - `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. - `android_x86_64_package_name`: Android package name to test. +- `tag`: Tag used to filter tests. Defaults to `""`. 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. ===================================== .gitlab/_base.yml ===================================== @@ -4,6 +4,7 @@ spec: --- variables: MOZHARNESS_URL: "$[[ inputs.mozharness_url ]]" + TAG: "$[[ inputs.tag ]]" .common: before_script: ===================================== .gitlab/_inputs.yml ===================================== @@ -3,6 +3,10 @@ inputs: type: string default: "" description: "Location of the mozharness.zip archive" + tag: + type: string + default: "" + description: "Tag used to filter tests" android_x86_64_installer_url: type: string ===================================== .gitlab/test_marionette.yml ===================================== @@ -6,7 +6,7 @@ --config-file "$(pwd)/mozharness/configs/marionette/prod_config.py" --installer-url "$INSTALLER_URL" --test-packages-url "$ARTIFACTS_URL/target.test_packages.json" - --tag tor + --tag "$TAG" --headless debian-x86_64_marionette: @@ -36,4 +36,4 @@ android-x86_64_marionette: --installer-url "$INSTALLER_URL" --test-packages-url "$ARTIFACTS_URL/target.test_packages.json" --package-name "$PACKAGE_NAME" - --tag tor + --tag "$TAG" ===================================== config/tb-build-06.torproject.org ===================================== @@ -36,11 +36,13 @@ my $test_post = sub { return unless $test->{results} && $test->{results}{success}; return unless $test->{publish_dir}; + my $tag = $test->{name} =~ /^torbrowser/ ? 'tor' : 'mullvad-browser'; my ($stdout, $stderr, $success) = capture_exec( 'python3', "$FindBin::Bin/tools/trigger-test-pipeline.py", '--step-name', $test->{name}, '--publish-url', $publish_url, '--publish-dir', $test->{publish_dir}, + '--tag', $tag, ); write_file( "$tbbinfos->{'results-dir'}/$test->{name}.trigger-test-pipeline.stderr.txt", ===================================== tools/trigger-test-pipeline.py ===================================== @@ -58,6 +58,11 @@ def parse_args() -> argparse.Namespace: required=True, help="Subdirectory within the publish URL where build artifacts are located.", ) + parser.add_argument( + "--tag", + required=False, + help="Tag used to filter tests.", + ) parser.add_argument( "--dry-run", action="store_true", @@ -66,7 +71,7 @@ def parse_args() -> argparse.Namespace: return parser.parse_args() -def build_inputs(step_name: str, publish_url: str, publish_dir: str) -> dict[str, str] | None: +def build_inputs(step_name: str, publish_url: str, publish_dir: str, tag: str) -> dict[str, str] | None: # Add the architecture as padding, to address the macos case which doesn't # have architecture in the step name since it is a universal build. browser, channel, platform, architecture = (step_name.split("-") + ["x86_64"])[:4] @@ -111,6 +116,9 @@ def build_inputs(step_name: str, publish_url: str, publish_dir: str) -> dict[str if platform == "android": inputs[f"{input_prefix}_package_name"] = f"org.torproject.{browser}_{channel}" + if tag: + inputs["tag"] = tag + return inputs @@ -149,7 +157,7 @@ def main() -> int: with open(token_file) as f: trigger_token = f.read().strip() - inputs = build_inputs(args.step_name, args.publish_url, args.publish_dir) + inputs = build_inputs(args.step_name, args.publish_url, args.publish_dir, args.tag) if inputs is None: logger.info(f"No CI inputs for step {args.step_name!r}, skipping.") return 0 View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-bundle-testsuite/... -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-bundle-testsuite/... You're receiving this email because of your account on gitlab.torproject.org. Manage all notifications: https://gitlab.torproject.org/-/profile/notifications | Help: https://gitlab.torproject.org/help
participants (1)
-
boklm (@boklm)