Repository navigation
Add tests for the Google Cloud Tasks links - #72846
Merged
Merged
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
|
`CloudTasksQueueLink` and `CloudTasksLink` had no unit tests, so they were suppressed by the `OVERLOOKED_TESTS` allowlist. `CloudTasksQueueLink` is attached to eleven operators in `google.cloud.operators.tasks` and its `extract_parts()` helper parses the queue resource name that every one of those links is built from, but none of that ran under test.
xlsongc
force-pushed
the
add-tests-google-cloud-tasks-links
branch
from
September 9, 2026 21:14
b0ef1db to
55a12f3
Compare
shahar1
approved these changes
Sep 24, 2026
shahar1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the added tests!
Wlecome to Apache Airflow :)
|
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
google.cloud.links.cloud_taskshad no unit tests and was suppressed by theOVERLOOKED_TESTSallowlist inairflow-core/tests/unit/always/test_project_structure.py.CloudTasksQueueLinkis attached to eleven operators ingoogle.cloud.operators.tasks,and its
extract_parts()helper parses theprojects/<project>/locations/<location>/queues/<queue>resource name that every one ofthose links is built from — none of which was exercised by a test.
This adds
providers/google/tests/unit/google/cloud/links/test_cloud_tasks.pyand removesthe allowlist entry. The tests follow the existing shape of the link tests in that
directory (
test_cloud_run.py,test_dataplex.py).Covered:
name/key/format_str) forCloudTasksQueueLinkandCloudTasksLinkCloudTasksQueueLink.extract_parts()— full resource name,None, and empty stringCloudTasksQueueLink.persist()with and without aqueue_name, asserting what is pushed to XComget_link()end to end for both links, asserting the rendered console URLNo production code is changed.
One thing I noticed but deliberately left alone:
extract_parts()guards against a falsyqueue_namebut indexesparts[1],parts[3],parts[5]unconditionally otherwise, so aname that is not a full queue resource path raises
IndexError. In practice the value comesstraight from the Cloud Tasks API, so I did not want to bake current behaviour into a test or
change it in a test-only PR. Happy to follow up separately if maintainers think it is worth
hardening.
Verified locally:
related: #35442
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code following the guidelines
🤖 Generated with Claude Code