Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,4 @@ queue_rules:
- check-success=@github-actions/openrepotools-delivery
merge_conditions:
- check-success=@github-actions/openrepotools-batch-heavy
- check-success=@sonarqubecloud/SonarCloud Code Analysis
23 changes: 21 additions & 2 deletions tests/test_ci_p07_p09.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from conftest import REPO, NEEDS_UPSTREAM
from test_ci_delivery import commit, delivery, git
from test_ci_v13_delivery import write
from test_ci_pilot_queue import reader
from test_ci_pilot_queue import matches, reader


@pytest.fixture
Expand Down Expand Up @@ -95,7 +95,10 @@ def test_ci_p07_p09_exact_queue_and_inventory(pair, reader):
assert queue["batch_size"] == 2 and queue["batch_max_failure_resolution_attempts"] == 0
assert queue["max_checks_retries"] == 0 and queue["merge_method"] == "merge"
conditions = queue["queue_conditions"]
assert queue["merge_conditions"] == ["check-success=@github-actions/openrepotools-batch-heavy"]
assert queue["merge_conditions"] == [
"check-success=@github-actions/openrepotools-batch-heavy",
"check-success=@sonarqubecloud/SonarCloud Code Analysis",
]
assert {"base=main", "-draft", "-closed", "-from-fork",
"check-success=@github-actions/openrepotools-pr-fast",
"check-success=@github-actions/openrepotools-delivery"} <= {
Expand All @@ -116,6 +119,22 @@ def test_ci_p07_p09_exact_queue_and_inventory(pair, reader):
"tests/sql_register_landed/T999"))


@NEEDS_UPSTREAM
@pytest.mark.parametrize(("checks", "accepted"), [
({"check-success": ["@github-actions/openrepotools-batch-heavy"]}, False),
({"check-success": ["@github-actions/openrepotools-batch-heavy"],
"check-neutral": ["@sonarqubecloud/SonarCloud Code Analysis"]}, False),
({"check-success": ["@github-actions/openrepotools-batch-heavy",
"@other-app/SonarCloud Code Analysis"]}, False),
({"check-success": ["@sonarqubecloud/SonarCloud Code Analysis"]}, False),
({"check-success": ["@github-actions/openrepotools-batch-heavy",
"@sonarqubecloud/SonarCloud Code Analysis"]}, True),
])
def test_ci_p07_p09_candidate_merge_requires_existing_sonar_gate(reader, checks, accepted):
queue = reader(REPO / ".mergify.yml")["queue_rules"][-1]
assert all(matches(condition, checks) for condition in queue["merge_conditions"]) is accepted


def test_ci_p07_p09_exact_source_rejects_drift(exact, pair):
root, anchor, main, members, prs = exact
assert pair.configuration(root, anchor) is None
Expand Down
Loading