Skip to content

Commit 9298ec5

Browse files
committed
fix: resolve three Integration Tests and Scheduled Chores CI failures
- Move capture_orgid_using_task fixture from test_integration_infrastructure.py to conftest.py so pytest 8.x discovers it when --org is passed (previously the fixture was silently skipped during collection, causing "fixture not found" errors on test_cli_specified_org, test_org_shape, and test_org_shape_reuse) - Replace `uv run cci robot install_playwright` in robot_ui job with explicit `uv pip install robotframework-browser && uv run python -m Browser.entry init` because uv-managed envs do not install pip by default, causing the pip-based install inside the cci command to fail - Fix update_api_versions Scheduled Chores job: use `git switch -C` (reset if branch exists) and `git push --force-with-lease` to handle the case where a prior run already created the update branch; also check for an existing PR before creating a new one to avoid duplicate-PR errors
1 parent 8cd4e58 commit 9298ec5

4 files changed

Lines changed: 41 additions & 25 deletions

File tree

.github/workflows/chores.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,20 @@ jobs:
4848
run: |
4949
git config user.name github-actions[bot]
5050
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
51-
git switch -c "update-sfdc-api-v$VERSION"
51+
git switch -C "update-sfdc-api-v$VERSION"
5252
git add cumulusci/cumulusci.yml
5353
git commit -m "Automated update to sfdc API version $VERSION"
54-
git push origin "update-sfdc-api-v$VERSION"
55-
- env:
54+
git push --force-with-lease origin "update-sfdc-api-v$VERSION"
55+
- name: Create or update PR
56+
env:
5657
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5758
run: |
58-
gh pr create --fill --label 'auto-pr'
59+
existing_pr=$(gh pr list --head "update-sfdc-api-v$VERSION" --json number -q '.[0].number')
60+
if [ -n "$existing_pr" ]; then
61+
echo "PR #$existing_pr already exists for update-sfdc-api-v$VERSION"
62+
else
63+
gh pr create --fill --label 'auto-pr'
64+
fi
5965
test_sfdx_release_candidate:
6066
uses: ./.github/workflows/release_test_sfdx.yml
6167
with:

.github/workflows/slow_integration_tests.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ jobs:
9191
wget -qO- https://developer.salesforce.com/media/salesforce-cli/sf/channels/stable/sf-linux-x64.tar.xz | tar xJ -C sfdx --strip-components 1
9292
echo $(realpath sfdx/bin) >> $GITHUB_PATH
9393
- name: Initialize Browser/Playwright
94-
run: uv run cci robot install_playwright
94+
run: |
95+
uv pip install robotframework-browser
96+
uv run python -m Browser.entry init
9597
- name: Authenticate Dev Hub
9698
run: |
9799
sf plugins --core

cumulusci/conftest.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,3 +179,31 @@ def task_context(org_config, project_config):
179179
return TaskContext(
180180
org_config=org_config, project_config=project_config, logger=getLogger()
181181
)
182+
183+
184+
@pytest.fixture()
185+
def capture_orgid_using_task(create_task, tmp_path):
186+
"""Returns a callable that captures the org ID by running a SOQL query task.
187+
188+
Moved from test_integration_infrastructure.py to ensure pytest 8.x
189+
discovers this fixture when tests run with --org.
190+
"""
191+
192+
def _capture_orgid_using_task():
193+
from cumulusci.tasks.salesforce import SOQLQuery
194+
195+
csv_output = Path(tmp_path) / "foo.csv"
196+
t = create_task(
197+
SOQLQuery,
198+
{
199+
"query": "select Id from Organization",
200+
"object": "Organization",
201+
"result_file": csv_output,
202+
},
203+
)
204+
t()
205+
assert csv_output.exists()
206+
org_id = csv_output.read_text().split("\n")[1].split(",")[0]
207+
return org_id.strip('"')
208+
209+
return _capture_orgid_using_task

cumulusci/tests/test_integration_infrastructure.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,6 @@
1313
)
1414

1515

16-
@pytest.fixture()
17-
def capture_orgid_using_task(create_task: callable, tmp_path: str) -> str:
18-
def _capture_orgid_using_task():
19-
csv_output = Path(tmp_path) / "foo.csv"
20-
t = create_task(
21-
SOQLQuery,
22-
{
23-
"query": "select Id from Organization",
24-
"object": "Organization",
25-
"result_file": csv_output,
26-
},
27-
)
28-
t()
29-
assert csv_output.exists()
30-
org_id = csv_output.read_text().split("\n")[1].split(",")[0]
31-
return org_id.strip('"')
32-
33-
return _capture_orgid_using_task
34-
35-
3616
class TestIntegrationInfrastructure:
3717
"Test our two plugins for doing integration testing"
3818

0 commit comments

Comments
 (0)